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 
25 #include <stdbool.h>
26 
27 #ifdef _WIN64
28 #define EXPORT __declspec(dllexport)
29 #else
30 #define EXPORT
31 #endif
32 
33 EXPORT void empty() {
34 }
35 
36 EXPORT bool identity_bool(bool x) {
37     return x;
38 }
39 
40 EXPORT char identity_char(char x) {
41     return x;
42 }
43 
44 EXPORT short identity_short(short x) {
45     return x;
46 }
47 
48 EXPORT int identity_int(int x) {
49     return x;
50 }
51 
52 EXPORT long long identity_long(long long x) {
53     return x;
54 }
55 
56 EXPORT float identity_float(float x) {
57     return x;
58 }
59 
60 EXPORT double identity_double(double x) {
61     return x;
62 }
63 
64 EXPORT int identity_va(int x, ...) {
65     return x;
66 }
67 
68 EXPORT int invoke_high_arity0(int x, double d, long long l, float f, char c, short s1, short s2) {
69     return x;
70 }
71 EXPORT double invoke_high_arity1(int x, double d, long long l, float f, char c, short s1, short s2) {
72     return d;
73 }
74 EXPORT long long invoke_high_arity2(int x, double d, long long l, float f, char c, short s1, short s2) {
75     return l;
76 }
77 EXPORT float invoke_high_arity3(int x, double d, long long l, float f, char c, short s1, short s2) {
78     return f;
79 }
80 EXPORT char invoke_high_arity4(int x, double d, long long l, float f, char c, short s1, short s2) {
81     return c;
82 }
83 EXPORT short invoke_high_arity5(int x, double d, long long l, float f, char c, short s1, short s2) {
84     return s1;
85 }
86 EXPORT short invoke_high_arity6(int x, double d, long long l, float f, char c, short s1, short s2) {
87     return s2;
88 }