1 /* 2 * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #ifdef _WIN64 25 #define EXPORT __declspec(dllexport) 26 #else 27 #define EXPORT 28 #endif 29 30 #define macro_byte (char) 1 31 #define macro_short (short) 1 32 #define macro_int 1 33 #define macro_long 1LL 34 #define macro_float 1.0F 35 #define macro_double 1.0 36 #define macro_address_NULL (void*) 0 37 #define macro_address_123 (void*) 123 38 #define macro_string "abc" 39 #define macro_string_noident "123.asdf" 40 41 EXPORT char func_byte(void); 42 EXPORT short func_short(void); 43 EXPORT int func_int(void); 44 EXPORT long long func_long(void); 45 EXPORT float func_float(void); 46 EXPORT double func_double(void); 47 48 EXPORT extern char global_byte; 49 EXPORT extern short global_short; 50 EXPORT extern int global_int; 51 EXPORT extern long long global_long; 52 EXPORT extern float global_float; 53 EXPORT extern double global_double; 54 55 typedef void(*CB)(int); 56 EXPORT void func_cb(CB cb); 57 58 struct Foo { 59 char c; 60 short s; 61 int i; 62 long long ll; 63 float f; 64 double d; 65 }; 66 67 typedef struct { 68 int a; 69 int b; 70 } Bar; 71 72 enum Enum { 73 enum_0, 74 enum_1, 75 enum_2, 76 }; 77 78 enum { 79 enum_anon_0, 80 enum_anon_1, 81 enum_anon_2, 82 };