1998-08-01 00:19:50 +04:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
1998-03-28 05:44:41 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1998-03-28 05:44:41 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1998-03-28 05:44:41 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1998-03-28 05:44:41 +03:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2000-04-06 08:21:51 +04:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* This Original Code has been modified by IBM Corporation.
|
|
|
|
* Modifications made by IBM described herein are
|
|
|
|
* Copyright (c) International Business Machines
|
|
|
|
* Corporation, 2000
|
|
|
|
*
|
|
|
|
* Modifications to Mozilla code or documentation
|
|
|
|
* identified per MPL Section 3.3
|
|
|
|
*
|
|
|
|
* Date Modified by Description of modification
|
|
|
|
* 03/27/2000 IBM Corp. Set JNICALL to Optlink for
|
|
|
|
* use in OS2
|
1998-03-28 05:44:41 +03:00
|
|
|
*/
|
1998-08-01 00:19:50 +04:00
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Netscape version of jni_md.h -- depends on jri_md.h
|
|
|
|
******************************************************************************/
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
#ifndef JNI_MD_H
|
|
|
|
#define JNI_MD_H
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
/*******************************************************************************
|
|
|
|
* WHAT'S UP WITH THIS FILE?
|
|
|
|
*
|
|
|
|
* This is where we define the mystical JNI_PUBLIC_API macro that works on all
|
|
|
|
* platforms. If you're running with Visual C++, Symantec C, or Borland's
|
|
|
|
* development environment on the PC, you're all set. Or if you're on the Mac
|
|
|
|
* with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't
|
|
|
|
* matter.
|
|
|
|
|
|
|
|
* Changes by sailesh on 9/26
|
|
|
|
|
|
|
|
* There are two symbols used in the declaration of the JNI functions
|
|
|
|
* and native code that uses the JNI:
|
|
|
|
* JNICALL - specifies the calling convention
|
|
|
|
* JNIEXPORT - specifies export status of the function
|
|
|
|
*
|
|
|
|
* The syntax to specify calling conventions is different in Win16 and
|
|
|
|
* Win32 - the brains at Micro$oft at work here. JavaSoft in their
|
|
|
|
* infinite wisdom cares for no platform other than Win32, and so they
|
|
|
|
* just define these two symbols as:
|
|
|
|
|
|
|
|
#define JNIEXPORT __declspec(dllexport)
|
|
|
|
#define JNICALL __stdcall
|
|
|
|
|
|
|
|
* We deal with this, in the way JRI defines the JRI_PUBLIC_API, by
|
|
|
|
* defining a macro called JNI_PUBLIC_API. Any of our developers who
|
|
|
|
* wish to use code for Win16 and Win32, _must_ use JNI_PUBLIC_API to
|
|
|
|
* be able to export functions properly.
|
|
|
|
|
|
|
|
* Since we must also maintain compatibility with JavaSoft, we
|
|
|
|
* continue to define the symbol JNIEXPORT. However, use of this
|
|
|
|
* internally is deprecated, since it will cause a mess on Win16.
|
|
|
|
|
|
|
|
* We _do not_ need a new symbol called JNICALL. Instead we
|
|
|
|
* redefine JNICALL in the same way JRI_CALLBACK was defined.
|
|
|
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/* DLL Entry modifiers... */
|
2000-03-15 18:15:29 +03:00
|
|
|
#if defined(XP_OS2)
|
|
|
|
# ifdef XP_OS2_VACPP
|
2000-05-30 18:43:56 +04:00
|
|
|
# define JNI_PUBLIC_API(ResultType) ResultType _System
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNICALL _Optlink
|
2000-04-06 08:21:51 +04:00
|
|
|
# define JNIEXPORT
|
|
|
|
# else
|
2000-05-30 18:43:56 +04:00
|
|
|
# define JNI_PUBLIC_API(ResultType) ResultType
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
2000-03-15 18:15:29 +03:00
|
|
|
# define JNICALL
|
|
|
|
# define JNIEXPORT
|
|
|
|
# endif
|
1998-08-01 00:19:50 +04:00
|
|
|
/* PC */
|
2000-03-15 18:15:29 +03:00
|
|
|
#elif defined(XP_PC) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32)
|
1998-08-01 00:19:50 +04:00
|
|
|
# include <windows.h>
|
|
|
|
# if defined(_MSC_VER)
|
|
|
|
# if defined(WIN32) || defined(_WIN32)
|
|
|
|
# define JNI_PUBLIC_API(ResultType) _declspec(dllexport) ResultType __stdcall
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) _declspec(dllexport) ResultType
|
|
|
|
# define JNICALL __stdcall
|
|
|
|
# else /* !_WIN32 */
|
|
|
|
# if defined(_WINDLL)
|
|
|
|
# define JNI_PUBLIC_API(ResultType) ResultType __cdecl __export __loadds
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) ResultType __cdecl __loadds
|
|
|
|
# define JNICALL __loadds
|
|
|
|
# else /* !WINDLL */
|
|
|
|
# define JNI_PUBLIC_API(ResultType) ResultType __cdecl __export
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) ResultType __cdecl __export
|
|
|
|
# define JNICALL __export
|
|
|
|
# endif /* !WINDLL */
|
|
|
|
# endif /* !_WIN32 */
|
|
|
|
# elif defined(__BORLANDC__)
|
|
|
|
# if defined(WIN32) || defined(_WIN32)
|
|
|
|
# define JNI_PUBLIC_API(ResultType) __export ResultType
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) __export ResultType
|
|
|
|
# define JNICALL
|
|
|
|
# else /* !_WIN32 */
|
|
|
|
# define JNI_PUBLIC_API(ResultType) ResultType _cdecl _export _loadds
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) ResultType _cdecl _loadds
|
|
|
|
# define JNICALL _loadds
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# error Unsupported PC development environment.
|
|
|
|
# endif
|
|
|
|
# ifndef IS_LITTLE_ENDIAN
|
|
|
|
# define IS_LITTLE_ENDIAN
|
|
|
|
# endif
|
|
|
|
/* This is the stuff inherited from JavaSoft .. */
|
|
|
|
# define JNIEXPORT __declspec(dllexport)
|
|
|
|
|
|
|
|
|
|
|
|
/* Mac */
|
|
|
|
#elif macintosh || Macintosh || THINK_C
|
|
|
|
# if defined(__MWERKS__) /* Metrowerks */
|
|
|
|
# if !__option(enumsalwaysint)
|
|
|
|
# error You need to define 'Enums Always Int' for your project.
|
|
|
|
# endif
|
2000-06-21 03:10:06 +04:00
|
|
|
# if defined(TARGET_CPU_68K) && !TARGET_RT_MAC_CFM
|
1998-08-01 00:19:50 +04:00
|
|
|
# if !__option(fourbyteints)
|
|
|
|
# error You need to define 'Struct Alignment: 68k' for your project.
|
|
|
|
# endif
|
|
|
|
# endif /* !GENERATINGCFM */
|
|
|
|
# define JNI_PUBLIC_API(ResultType) __declspec(export) ResultType
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) JNI_PUBLIC_API(VarType)
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) JNI_PUBLIC_API(ResultType)
|
|
|
|
# elif defined(__SC__) /* Symantec */
|
|
|
|
# error What are the Symantec defines? (warren@netscape.com)
|
|
|
|
# elif macintosh && applec /* MPW */
|
|
|
|
# error Please upgrade to the latest MPW compiler (SC).
|
|
|
|
# else
|
|
|
|
# error Unsupported Mac development environment.
|
|
|
|
# endif
|
|
|
|
# define JNICALL
|
|
|
|
/* This is the stuff inherited from JavaSoft .. */
|
|
|
|
# define JNIEXPORT
|
|
|
|
|
|
|
|
/* Unix or else */
|
|
|
|
#else
|
|
|
|
# define JNI_PUBLIC_API(ResultType) ResultType
|
|
|
|
# define JNI_PUBLIC_VAR(VarType) VarType
|
|
|
|
# define JNI_NATIVE_STUB(ResultType) ResultType
|
|
|
|
# define JNICALL
|
|
|
|
/* This is the stuff inherited from JavaSoft .. */
|
|
|
|
# define JNIEXPORT
|
|
|
|
#endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#ifndef FAR /* for non-Win16 */
|
|
|
|
#define FAR
|
|
|
|
#endif
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
/* Get the rest of the stuff from jri_md.h */
|
|
|
|
#include "jri_md.h"
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
#endif /* JNI_MD_H */
|