scitech.h

来自「适合KS8695X」· C头文件 代码 · 共 713 行 · 第 1/2 页

H
713
字号
/****************************************************************************
*
*                   SciTech Multi-platform Graphics Library
*
*  ========================================================================
*
*    The contents of this file are subject to the SciTech MGL Public
*    License Version 1.0 (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.scitechsoft.com/mgl-license.txt
*
*    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.
*
*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
*
*    The Initial Developer of the Original Code is SciTech Software, Inc.
*    All Rights Reserved.
*
*  ========================================================================
*
* Language:     ANSI C
* Environment:  any
*
* Description:  General header file for operating system portable code.
*
****************************************************************************/

#ifndef __SCITECH_H
#define __SCITECH_H

/* We have the following defines to identify the compilation environment:
 *
 *  __16BIT__       Compiling for 16 bit code (any environment)
 *  __32BIT__       Compiling for 32 bit code (any environment)
 *  __MSDOS__       Compiling for MS-DOS (includes __WINDOWS16__, __WIN386__)
 *  __REALDOS__     Compiling for MS-DOS (excludes __WINDOWS16__)
 *  __MSDOS16__     Compiling for 16 bit MS-DOS
 *  __MSDOS32__     Compiling for 32 bit MS-DOS
 *  __WINDOWS__     Compiling for Windows
 *  __WINDOWS16__   Compiling for 16 bit Windows (__MSDOS__ also defined)
 *  __WINDOWS32__   Compiling for 32 bit Windows
 *  __WIN32_VXD__   Compiling for a 32-bit C based VxD
 *  __NT_DRIVER__   Compiling for a 32-bit C based NT device driver
 *  __OS2__         Compiling for OS/2
 *  __OS2_16__      Compiling for 16 bit OS/2
 *  __OS2_32__      Compiling for 32 bit OS/2
 *  __UNIX__        Compiling for Unix
 *  __QNX__         Compiling for the QNX realtime OS (Unix compatible)
 *  __LINUX__       Compiling for the Linux OS (Unix compatible)
 *  __FREEBSD__     Compiling for the FreeBSD OS (Unix compatible)
 *  __BEOS__        Compiling for the BeOS (Unix compatible)
 *  __SMX32__       Compiling for the SMX 32-bit Real Time OS
 *  __ENEA_OSE__    Compiling for the OSE embedded OS
 *  __RTTARGET__    Compiling for the RTTarget 32-bit embedded OS
 *  __MACOS__       Compiling for the MacOS platform (PowerPC)
 *  __DRIVER__      Compiling for a 32-bit binary compatible driver
 *  __CONSOLE__     Compiling for a fullscreen OS console mode
 *  __SNAP__        Compiling as a Snap executeable or dynamic library
 *
 *  __INTEL__       Compiling for Intel CPU's
 *  __ALPHA__       Compiling for DEC Alpha CPU's
 *  __MIPS__        Compiling for MIPS CPU's
 *  __PPC__         Compiling for PowerPC CPU's
 *  __MC68K__       Compiling for Motorola 680x0
 *
 *  __BIG_ENDIAN__  Compiling for a big endian processor
 *
 */

#ifdef  __SC__
#if     __INTSIZE == 4
#define __SC386__
#endif
#endif

/* Determine some things that are compiler specific */

#ifdef  __GNUC__
#ifdef  __cplusplus
/* G++ currently fucks this up! */
#define __cdecl
#define __stdcall
#else
#undef  __cdecl
#undef  __stdcall
#define __cdecl     __attribute__ ((cdecl))
#define __stdcall   __attribute__ ((stdcall))
#endif
#define __FLAT__            /* GCC is always 32 bit flat model          */
#define __HAS_BOOL__        /* Latest GNU C++ has ibool type            */
#define __HAS_LONG_LONG__   /* GNU C supports long long type            */
#include <stdio.h>          /* Bring in for definition of NULL          */
#endif

#ifdef  __BORLANDC__
#if (__BORLANDC__ >= 0x500) || defined(CLASSLIB_DEFS_H)
#define __HAS_BOOL__        /* Borland C++ 5.0 defines ibool type       */
#endif
#if (__BORLANDC__ >= 0x502) && !defined(VTOOLSD) && !defined(__SMX32__)
#define __HAS_INT64__       /* Borland C++ 5.02 supports __int64 type   */
#endif
#endif

#if defined(_MSC_VER) && !defined(__SC__) && !defined(VTOOLSD) && !defined(__SMX32__)
#define __HAS_INT64__       /* Visual C++ supports __int64 type         */
#endif

#if defined(__WATCOMC__) && (__WATCOMC__ >= 1100) && !defined(VTOOLSD) && !defined(__SMX32__)
#define __HAS_INT64__       /* Watcom C++ 11.0 supports __int64 type    */
#endif

/*---------------------------------------------------------------------------
 * Determine the compile time environment. This must be done for each
 * supported platform so that we can determine at compile time the target
 * environment, hopefully without requiring #define's from the user.
 *-------------------------------------------------------------------------*/

/* 32-bit binary compatible driver. Compiled as Win32, but as OS neutral */
#ifdef  __DRIVER__
#ifndef __32BIT__
#define __32BIT__
#endif
#undef  __WINDOWS__
#undef  _WIN32
#undef  __WIN32__
#undef  __NT__

/* 32-bit Snap exe or dll. Compiled as Win32, but as OS neutral */
#elif   defined(__SNAP__)
#ifndef __32BIT__
#define __32BIT__
#endif
#undef  __WINDOWS__
#undef  _WIN32
#undef  __WIN32__
#undef  __NT__

/* 32-bit Windows VxD compile environment */
#elif   defined(__vtoolsd_h_) || defined(VTOOLSD)
#include <vtoolsc.h>
#define __WIN32_VXD__
#ifndef __32BIT__
#define __32BIT__
#endif
#define _MAX_PATH   256
#undef __WINDOWS32__

/* 32-bit Windows NT driver compile environment: TODO!! */
#elif   defined(__NT_DRIVER__)
#include "ntdriver.h"
#ifndef __32BIT__
#define __32BIT__
#endif
#define _MAX_PATH   256
#undef __WINDOWS32__

/* 32-bit SMX compile environment */
#elif   defined(__SMX32__)
#ifndef __MSDOS__
#define __MSDOS__
#endif
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __CONSOLE__
#define __CONSOLE__
#endif

/* 32-bit Enea OSE environment */
#elif   defined(__ENEA_OSE__)
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __CONSOLE__
#define __CONSOLE__
#endif

/* 32-bit RTTarget-32 environment */
#elif   defined(__RTTARGET__)
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __CONSOLE__
#define __CONSOLE__
#endif

/* 32-bit extended DOS compile environment */
#elif   defined(__MSDOS__) || defined(__MSDOS32__) || defined(__DOS__) || defined(__DPMI32__) || (defined(M_I86) && (!defined(__SC386__) && !defined(M_I386))) || defined(TNT)
#ifndef __MSDOS__
#define __MSDOS__
#endif
#if     defined(__MSDOS32__) || defined(__386__) || defined(__FLAT__) || defined(__NT__) || defined(__SC386__)
#ifndef __MSDOS32__
#define __MSDOS32__
#endif
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __REALDOS__
#define __REALDOS__
#endif
#ifndef __CONSOLE__
#define __CONSOLE__
#endif

/* 16-bit Windows compile environment */
#elif   (defined(_Windows) || defined(_WINDOWS)) && !defined(__DPMI16__)
#ifndef __16BIT__
#define __16BIT__
#endif
#ifndef __WINDOWS16__
#define __WINDOWS16__
#endif
#ifndef __WINDOWS__
#define __WINDOWS__
#endif
#ifndef __MSDOS__
#define __MSDOS__
#endif

/* 16-bit DOS compile environment */
#else
#ifndef __16BIT__
#define __16BIT__
#endif
#ifndef __MSDOS16__
#define __MSDOS16__
#endif
#ifndef __REALDOS__
#define __REALDOS__
#endif
#ifndef __CONSOLE__
#define __CONSOLE__
#endif
#endif

/* 32-bit Windows compile environment */
#elif   defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __WINDOWS32__
#define __WINDOWS32__
#endif
#ifndef _WIN32
#define _WIN32                  /* Microsoft Win32 SDK headers use _WIN32 */
#endif
#ifndef WIN32
#define WIN32                   /* OpenGL headers use WIN32 */
#endif
#ifndef __WINDOWS__
#define __WINDOWS__
#endif

/* 32-bit OS/2 VDD compile environment */
/* We're assuming (for now) that CL386 must be used */
#elif   defined(MSDOS) && defined(M_I386)
/* fixes necessary to compile with CL386 */
#define __cdecl  _cdecl
typedef unsigned int size_t;

#include <mvdm.h>

/* This should probably be somewhere else...                 */
/* Inline eligible functions (we have no CRT libs for CL386) */
#pragma intrinsic (strcpy, strcmp, strlen, strcat)
#pragma intrinsic (memcmp, memcpy, memset)

#define __OS2_VDD__
#ifndef __32BIT__
#define __32BIT__
#endif
#define CCHMAXPATH  256
#define _MAX_PATH   256
#ifndef __OS2__
#define __OS2__
#endif
#ifndef __OS2_32__
#define __OS2_32__
#endif

/* 16-bit OS/2 compile environment */
#elif   defined(__OS2_16__)
#ifndef __OS2__
#define __OS2__
#endif
#ifndef __16BIT__
#define __16BIT__
#endif
#ifndef __OS2_PM__
#ifndef __CONSOLE__
#define __CONSOLE__
#endif
#endif

/* 32-bit OS/2 compile environment */
#elif   defined(__OS2__) || defined(__OS2_32__)
#ifndef __OS2__
#define __OS2__
#endif
#ifndef __OS2_32__
#define __OS2_32__
#endif
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __OS2_PM__
#ifndef __CONSOLE__
#define __CONSOLE__
#endif
#endif

/* 32-bit QNX compile environment */
#elif   defined(__QNX__)
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __UNIX__
#define __UNIX__
#endif
#ifdef  __GNUC__
#define stricmp strcasecmp
#endif
#if !defined(__PHOTON__) && !defined(__X11__)
#ifndef __CONSOLE__
#define __CONSOLE__
#endif
#endif

/* 32-bit Linux compile environment */
#elif   defined(__LINUX__) || defined(linux)
#ifndef __LINUX__
#define __LINUX__
#endif
#ifndef __32BIT__
#define __32BIT__
#endif
#ifndef __UNIX__
#define __UNIX__
#endif
#ifdef  __GNUC__
#define stricmp strcasecmp
#endif
#ifndef __X11__
#ifndef __CONSOLE__
#define __CONSOLE__
#endif
#endif

/* 32-bit FreeBSD compile environment */
#elif   defined(__FREEBSD__)
#ifndef __FREEBSD__
#define __FREEBSD__
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?