front_idill/extern/fajran-npTuioClient/npapi/jni_md.h
changeset 30 45c889eae324
parent 29 fcf435874395
child 31 2c7fc855eba8
equal deleted inserted replaced
29:fcf435874395 30:45c889eae324
     1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
       
     2  *
       
     3  * ***** BEGIN LICENSE BLOCK *****
       
     4  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       
     5  *
       
     6  * The contents of this file are subject to the Mozilla Public License Version
       
     7  * 1.1 (the "License"); you may not use this file except in compliance with
       
     8  * the License. You may obtain a copy of the License at
       
     9  * http://www.mozilla.org/MPL/
       
    10  *
       
    11  * Software distributed under the License is distributed on an "AS IS" basis,
       
    12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       
    13  * for the specific language governing rights and limitations under the
       
    14  * License.
       
    15  *
       
    16  * The Original Code is mozilla.org code.
       
    17  *
       
    18  * The Initial Developer of the Original Code is
       
    19  * Netscape Communications Corporation.
       
    20  * Portions created by the Initial Developer are Copyright (C) 1998
       
    21  * the Initial Developer. All Rights Reserved.
       
    22  *
       
    23  * Contributor(s):
       
    24  *
       
    25  * Alternatively, the contents of this file may be used under the terms of
       
    26  * either the GNU General Public License Version 2 or later (the "GPL"), or
       
    27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       
    28  * in which case the provisions of the GPL or the LGPL are applicable instead
       
    29  * of those above. If you wish to allow use of your version of this file only
       
    30  * under the terms of either the GPL or the LGPL, and not to allow others to
       
    31  * use your version of this file under the terms of the MPL, indicate your
       
    32  * decision by deleting the provisions above and replace them with the notice
       
    33  * and other provisions required by the GPL or the LGPL. If you do not delete
       
    34  * the provisions above, a recipient may use your version of this file under
       
    35  * the terms of any one of the MPL, the GPL or the LGPL.
       
    36  *
       
    37  * ***** END LICENSE BLOCK *****
       
    38  *
       
    39  *
       
    40  * This Original Code has been modified by IBM Corporation.
       
    41  * Modifications made by IBM described herein are
       
    42  * Copyright (c) International Business Machines
       
    43  * Corporation, 2000
       
    44  *
       
    45  * Modifications to Mozilla code or documentation
       
    46  * identified per MPL Section 3.3
       
    47  *
       
    48  * Date         Modified by     Description of modification
       
    49  * 03/27/2000   IBM Corp.       Set JNICALL to Optlink for
       
    50  *                               use in OS2
       
    51  */
       
    52 
       
    53 /*******************************************************************************
       
    54  * Netscape version of jni_md.h -- depends on jri_md.h
       
    55  ******************************************************************************/
       
    56 
       
    57 #ifndef JNI_MD_H
       
    58 #define JNI_MD_H
       
    59 
       
    60 #include "prtypes.h" /* needed for _declspec */
       
    61 
       
    62 /*******************************************************************************
       
    63  * WHAT'S UP WITH THIS FILE?
       
    64  * 
       
    65  * This is where we define the mystical JNI_PUBLIC_API macro that works on all
       
    66  * platforms. If you're running with Visual C++, Symantec C, or Borland's 
       
    67  * development environment on the PC, you're all set. Or if you're on the Mac
       
    68  * with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't
       
    69  * matter.
       
    70 
       
    71  * Changes by sailesh on 9/26 
       
    72 
       
    73  * There are two symbols used in the declaration of the JNI functions
       
    74  * and native code that uses the JNI:
       
    75  * JNICALL - specifies the calling convention 
       
    76  * JNIEXPORT - specifies export status of the function 
       
    77  * 
       
    78  * The syntax to specify calling conventions is different in Win16 and
       
    79  * Win32 - the brains at Micro$oft at work here. JavaSoft in their
       
    80  * infinite wisdom cares for no platform other than Win32, and so they
       
    81  * just define these two symbols as:
       
    82 
       
    83  #define JNIEXPORT __declspec(dllexport)
       
    84  #define JNICALL __stdcall
       
    85 
       
    86  * We deal with this, in the way JRI defines the JRI_PUBLIC_API, by
       
    87  * defining a macro called JNI_PUBLIC_API. Any of our developers who
       
    88  * wish to use code for Win16 and Win32, _must_ use JNI_PUBLIC_API to
       
    89  * be able to export functions properly.
       
    90 
       
    91  * Since we must also maintain compatibility with JavaSoft, we
       
    92  * continue to define the symbol JNIEXPORT. However, use of this
       
    93  * internally is deprecated, since it will cause a mess on Win16.
       
    94 
       
    95  * We _do not_ need a new symbol called JNICALL. Instead we
       
    96  * redefine JNICALL in the same way JRI_CALLBACK was defined.
       
    97 
       
    98  ******************************************************************************/
       
    99 
       
   100 /* DLL Entry modifiers... */
       
   101 /* Win32 */
       
   102 #if defined(XP_WIN) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32)
       
   103 #	include <windows.h>
       
   104 #	if defined(_MSC_VER) || defined(__GNUC__)
       
   105 #		if defined(WIN32) || defined(_WIN32)
       
   106 #			define JNI_PUBLIC_API(ResultType)	_declspec(dllexport) ResultType __stdcall
       
   107 #			define JNI_PUBLIC_VAR(VarType)		VarType
       
   108 #			define JNI_NATIVE_STUB(ResultType)	_declspec(dllexport) ResultType
       
   109 #			define JNICALL                          __stdcall
       
   110 #		else /* !_WIN32 */
       
   111 #		    if defined(_WINDLL)
       
   112 #			define JNI_PUBLIC_API(ResultType)	ResultType __cdecl __export __loadds 
       
   113 #			define JNI_PUBLIC_VAR(VarType)		VarType
       
   114 #			define JNI_NATIVE_STUB(ResultType)	ResultType __cdecl __loadds
       
   115 #			define JNICALL			        __loadds
       
   116 #		    else /* !WINDLL */
       
   117 #			define JNI_PUBLIC_API(ResultType)	ResultType __cdecl __export
       
   118 #			define JNI_PUBLIC_VAR(VarType)		VarType
       
   119 #			define JNI_NATIVE_STUB(ResultType)	ResultType __cdecl __export
       
   120 #			define JNICALL			        __export
       
   121 #                   endif /* !WINDLL */
       
   122 #		endif /* !_WIN32 */
       
   123 #	elif defined(__BORLANDC__)
       
   124 #		if defined(WIN32) || defined(_WIN32)
       
   125 #			define JNI_PUBLIC_API(ResultType)	__export ResultType
       
   126 #			define JNI_PUBLIC_VAR(VarType)		VarType
       
   127 #			define JNI_NATIVE_STUB(ResultType)	 __export ResultType
       
   128 #			define JNICALL
       
   129 #		else /* !_WIN32 */
       
   130 #			define JNI_PUBLIC_API(ResultType)	ResultType _cdecl _export _loadds 
       
   131 #			define JNI_PUBLIC_VAR(VarType)		VarType
       
   132 #			define JNI_NATIVE_STUB(ResultType)	ResultType _cdecl _loadds
       
   133 #			define JNICALL			_loadds
       
   134 #		endif
       
   135 #	else
       
   136 #		error Unsupported PC development environment.	
       
   137 #	endif
       
   138 #	ifndef IS_LITTLE_ENDIAN
       
   139 #		define IS_LITTLE_ENDIAN
       
   140 #	endif
       
   141 	/*  This is the stuff inherited from JavaSoft .. */
       
   142 #	define JNIEXPORT __declspec(dllexport)
       
   143 #	define JNIIMPORT __declspec(dllimport)
       
   144 
       
   145 /* OS/2 */
       
   146 #elif defined(XP_OS2)
       
   147 #	ifdef XP_OS2_VACPP
       
   148 #		define JNI_PUBLIC_API(ResultType)	ResultType _System
       
   149 #		define JNI_PUBLIC_VAR(VarType)		VarType
       
   150 #		define JNICALL				_Optlink
       
   151 #		define JNIEXPORT
       
   152 #		define JNIIMPORT
       
   153 #	elif defined(__declspec)
       
   154 #		define JNI_PUBLIC_API(ResultType)	__declspec(dllexport) ResultType
       
   155 #		define JNI_PUBLIC_VAR(VarType)		VarType
       
   156 #		define JNI_NATIVE_STUB(ResultType)	__declspec(dllexport) ResultType
       
   157 #		define JNICALL
       
   158 #		define JNIEXPORT
       
   159 #		define JNIIMPORT
       
   160 #	else
       
   161 #		define JNI_PUBLIC_API(ResultType)	ResultType
       
   162 #		define JNI_PUBLIC_VAR(VarType)		VarType
       
   163 #		define JNICALL
       
   164 #		define JNIEXPORT
       
   165 #		define JNIIMPORT
       
   166 #	endif
       
   167 #	ifndef IS_LITTLE_ENDIAN
       
   168 #		define IS_LITTLE_ENDIAN
       
   169 #	endif
       
   170 
       
   171 /* Mac */
       
   172 #elif macintosh || Macintosh || THINK_C
       
   173 #	if defined(__MWERKS__)				/* Metrowerks */
       
   174 #		if !__option(enumsalwaysint)
       
   175 #			error You need to define 'Enums Always Int' for your project.
       
   176 #		endif
       
   177 #		if defined(TARGET_CPU_68K) && !TARGET_RT_MAC_CFM 
       
   178 #			if !__option(fourbyteints) 
       
   179 #				error You need to define 'Struct Alignment: 68k' for your project.
       
   180 #			endif
       
   181 #		endif /* !GENERATINGCFM */
       
   182 #		define JNI_PUBLIC_API(ResultType)	__declspec(export) ResultType 
       
   183 #		define JNI_PUBLIC_VAR(VarType)		JNI_PUBLIC_API(VarType)
       
   184 #		define JNI_NATIVE_STUB(ResultType)	JNI_PUBLIC_API(ResultType)
       
   185 #	elif defined(__SC__)				/* Symantec */
       
   186 #		error What are the Symantec defines? (warren@netscape.com)
       
   187 #	elif macintosh && applec			/* MPW */
       
   188 #		error Please upgrade to the latest MPW compiler (SC).
       
   189 #	else
       
   190 #		error Unsupported Mac development environment.
       
   191 #	endif
       
   192 #	define JNICALL
       
   193 	/*  This is the stuff inherited from JavaSoft .. */
       
   194 #	define JNIEXPORT
       
   195 #	define JNIIMPORT
       
   196 
       
   197 /* Unix or else */
       
   198 #else
       
   199 #	define JNI_PUBLIC_API(ResultType)		ResultType
       
   200 #       define JNI_PUBLIC_VAR(VarType)                  VarType
       
   201 #       define JNI_NATIVE_STUB(ResultType)              ResultType
       
   202 #	define JNICALL
       
   203 	/*  This is the stuff inherited from JavaSoft .. */
       
   204 #	define JNIEXPORT
       
   205 #	define JNIIMPORT
       
   206 #endif
       
   207 
       
   208 #ifndef FAR		/* for non-Win16 */
       
   209 #define FAR
       
   210 #endif
       
   211 
       
   212 /* Get the rest of the stuff from jri_md.h */
       
   213 #include "jri_md.h"
       
   214 
       
   215 #endif /* JNI_MD_H */