1 /*
2 * Copyright (c) 2022 The Khronos Group Inc.
3 * Copyright (c) 2022 Valve Corporation
4 * Copyright (c) 2022 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and/or associated documentation files (the "Materials"), to
8 * deal in the Materials without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Materials, and to permit persons to whom the Materials are
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice(s) and this permission notice shall be included in
14 * all copies or substantial portions of the Materials.
15 *
16 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 *
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
23 * USE OR OTHER DEALINGS IN THE MATERIALS.
24 *
25 * Author: Charles Giessen <charles@lunarg.com>
26 */
27
28 #include "dynamic_library.h"
29
do_logic()30 FRAMEWORK_EXPORT char do_logic() {
31 #if defined(PRINT_OUTPUT_A)
32 return 'A';
33 #elif defined(PRINT_OUTPUT_B)
34 return 'B';
35 #elif defined(PRINT_OUTPUT_C)
36 return 'C';
37 #endif
38 }
39
init()40 FRAMEWORK_EXPORT void init() {
41 #if defined(PRINT_OUTPUT_A)
42 static LibraryWrapper b{};
43 static LibraryWrapper a{};
44 a = LibraryWrapper{"./libdynamic_library_a.dylib"};
45 b = LibraryWrapper{"./libdynamic_library_b.dylib"};
46 #endif
47 }