1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Win32 jni_md.h for cross-compiling.
*
* A JDK only ships the jni_md.h for the platform it runs on, so a Linux JDK
* gives us the Linux one — where `jint` is `int` and the calling convention is
* empty. Building a Windows DLL against that is a type mismatch waiting to
* happen, so this supplies the machine-dependent half itself and we point the
* include path here ahead of the JDK's own include/linux.
*
* The contents are fixed by the JNI spec plus the Windows ABI: on LLP64 `long`
* is 32-bit, which is why `jint` is `long` here and `int` on Linux.
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __declspec(dllexport)
#define JNIIMPORT __declspec(dllimport)
/*
* Empty, not __stdcall. x86-64 Windows has a single calling convention, and
* modern JDKs (this one included) define JNICALL as nothing — jni.h even
* redefines it unconditionally a few lines after including us, which produced a
* "JNICALL redefined" warning in every translation unit when this said
* __stdcall. Matching it keeps the build quiet and the declarations honest.
*/
#define JNICALL
typedef long jint;
typedef long long jlong;
typedef signed char jbyte;
#endif /* _JAVASOFT_JNI_MD_H_ */