summaryrefslogtreecommitdiff
path: root/demos/java/jni/gs_jni/include/jni.h
diff options
context:
space:
mode:
Diffstat (limited to 'demos/java/jni/gs_jni/include/jni.h')
-rw-r--r--demos/java/jni/gs_jni/include/jni.h84
1 files changed, 60 insertions, 24 deletions
diff --git a/demos/java/jni/gs_jni/include/jni.h b/demos/java/jni/gs_jni/include/jni.h
index 97b14d8a0..9ec44e38e 100644
--- a/demos/java/jni/gs_jni/include/jni.h
+++ b/demos/java/jni/gs_jni/include/jni.h
@@ -1,26 +1,26 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
- * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
*
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
*
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
*/
/*
@@ -39,14 +39,50 @@
#include <stdio.h>
#include <stdarg.h>
-/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
- and jlong */
+/* machine-dependent typedefs for jbyte, jint and jlong */
-#ifdef _WIN32
-#include "win32/jni_md.h"
-#else
-#include "jni_md.h"
-#endif
+#if defined(_WIN32)
+
+ // Win32 defines
+
+ #define JNIEXPORT __declspec(dllexport)
+ #define JNIIMPORT __declspec(dllimport)
+
+ #define JNICALL __stdcall
+
+ typedef signed char jbyte; // 8-bit signed integer
+ typedef long jint; // 32-bit signed integer
+ typedef __int64 jlong; // 64-bit signed integer
+
+#elif defined(__linux__) // #if defined(_WIN32)
+
+ // Linux defines
+
+ // Modifying OpenJDK jni_md.h to be in jni.h
+
+ #if !defined(__has_attribute)
+ #define __has_attribute(x) 0
+ #endif // #if !defined(__has_attribute)
+
+ #if (defined(__GNUC__) && ((__GNUC__) > 4)) || (__GNUC__ == 4) && (__GNU__MINOR__ > 2))) || __has_attribute(visibility)
+ #define JNIEXPORT __attribute__((visibility("default")))
+ #define JNIIMPORT __attribute__((visibility("default")))
+ #else // #if (defined(__GNUC__) && ((__GNUC__) > 4)) || (__GNUC__ == 4) && (__GNU__MINOR__ > 2))) || __has_attribute(visibility)
+ #define JNIEXPORT
+ #define JNIIMPORT
+ #endif // #if (defined(__GNUC__) && ((__GNUC__) > 4)) || (__GNUC__ == 4) && (__GNU__MINOR__ > 2))) || __has_attribute(visibility)
+
+ #define JNICALL
+
+ typedef signed char jbyte; // 8-bit signed integer
+ typedef int jint; // 32-bit signed integer
+ #if defined(_LP64)
+ typedef long jlong; // 64-bit signed integer
+ #else // #if defined(_LP64)
+ typedef long long jlong; // 64-bit signed integer
+ #endif // #if defined(_LP64)
+
+#endif // #elif defined(__linux__)
#ifdef __cplusplus
extern "C" {