/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*
*/
#ifndef SHARE_VM_LIBADT_PORT_HPP
#define SHARE_VM_LIBADT_PORT_HPP
// Typedefs for portable compiling
#if defined(__GNUC__)
//INTERFACE
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
// Access to the C++ class virtual function pointer
// Put the class in the macro
typedef void *VPTR;
// G++ puts it at the end of the base class
#elif defined(__TURBOC__)
#include <mem.h>
#include <string.h>
extern "C" int stricmp(const char *, const char *);
inline int min( int a, int b) { return a < b ? a : b; }
inline int max( int a, int b) { return a > b ? a : b; }
//strcasecmp moved to globalDefinitions_visCPP.hpp
//inline int strcasecmp(const char *s1, const char *s2) { return stricmp(s1,s2); }
inline long abs( long x ) { return x < 0 ? -x : x; }
// Access to the C++ class virtual function pointer
// Put the class in the macro
// BorlandC puts it up front
#define INTERFACE
#define IMPLEMENTATION
#define signed
#include <strings.h>
#include <stdlib.h>
inline long min( long a, long b) { return a < b ? a : b; }
inline long max( long a, long b) { return a > b ? a : b; }
inline int min( int a, int b) { return a < b ? a : b; }
inline int max( int a, int b) { return a > b ? a : b; }
inline long abs( long x ) { return x < 0 ? -x : x; }
// Motorola's mcc
#define INTERFACE
#define IMPLEMENTATION
#include <stdlib.h>
#include <memory.h>
inline int min( int a, int b) { return a < b ? a : b; }
inline int max( int a, int b) { return a > b ? a : b; }
// IBM's xlC compiler
#define INTERFACE
#define IMPLEMENTATION
#include <stdlib.h>
#include <memory.h>
inline int min( int a, int b) { return a < b ? a : b; }
inline int max( int a, int b) { return a > b ? a : b; }
// Microsoft Visual C++
//#define INTERFACE
#define IMPLEMENTATION
#include <stdlib.h>
//strcasecmp moved to globalDefinitions_visCPP.hpp
//inline int strcasecmp(const char *s1, const char *s2) { return stricmp(s1,s2); }
#elif defined(SPARC_WORKS)
#define INTERFACE
#define IMPLEMENTATION
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#define INTERFACE
#define IMPLEMENTATION
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
// This case is for the Tandem Business Unit of Compaq Computer Corporation.
// The Tandem case must precede the AT&T case,
// because the Tandem c89 compiler also defines __cplusplus.
#include "port_tandem.hpp"
#elif defined(__cplusplus)
// AT&Ts cfront
#define INTERFACE
#define IMPLEMENTATION
#include <unistd.h>
#define signed
// #include <bstring.h>
inline int min( int a, int b) { return a < b ? a : b; }
inline int max( int a, int b) { return a > b ? a : b; }
#else // All other machines
#define signed
inline int min( int a, int b) { return a < b ? a : b; }
inline int max( int a, int b) { return a > b ? a : b; }
#endif
//-----------------------------------------------------------------------------
// Safer memory allocations
#ifdef SAFE_MEMORY
#endif
//-----------------------------------------------------------------------------
// And now, the bit-size-specified integer sizes
typedef signed char int8;
typedef unsigned char uint8;
typedef unsigned char byte;
// All uses of *int16 changed to 32-bit to speed up compiler on Intel
//typedef signed short int16; // Exactly 16bits signed
//typedef unsigned short uint16; // Exactly 16bits unsigned
//const unsigned int min_uint16 = 0x0000; // smallest uint16
//const unsigned int max_uint16 = 0xFFFF; // largest uint16
/*typedef int int; */ // When you need a fast >=16bit value
// Bit-sized floating point and long thingies
#ifndef __TANDEM
// Do not define these for Tandem, because they conflict with typedefs in softieee.h.
#endif // __TANDEM
//-----------------------------------------------------------------------------
// Nice constants
//-----------------------------------------------------------------------------
#endif // SHARE_VM_LIBADT_PORT_HPP