📄 global.h
字号:
#endif #elif defined(__GNUC__) /* gcc compiler on Mac OS X */ #ifndef MAC_POWERPC #define MAC_POWERPC #endif #elif !defined(THINK_C) #error Unknown Mac development environment #endif #define PLATFORM_NAME "Macintosh" #define BIG_ENDIAN_ORDER #define THREADS #define SEMAPHORES #define SEMSPIN #define ODS_NEEDED TRUE #define COMPILER_INT_SIZE 4 #if defined(MAC_POWERPC) && defined(XLC_C) /* All other compilers use "-align mac68k" (2 byte alignment) */ #define REQUIRED_ALIGNMENT 1 /* PowerPC supports odd-byte addressing if truly required */ #define COMPILER_DWORD_ALIGNMENT 4 /* Compiler will pad DWORDs to DWORD boundary if possible */ #define COMPILER_NUMBER_ALIGNMENT 4 #else #define REQUIRED_ALIGNMENT 1 /* 68020 or later CPUs only (not 68000) */ #define COMPILER_DWORD_ALIGNMENT 2 /* Compiler will pad DWORDs to WORD boundary, because any further alignment is unnecessary */ #define COMPILER_NUMBER_ALIGNMENT 2 #endif #define VIM_USE_MAC /* Tdanalzye is a rudimentary parser, that is failing to correctly parse this long #if #elif statements. * It is re-processing the UNIX section after it has already processed the OS400 section and incorrectly * using a COMPILER_NUMBER_ALIGNMENT of 4. So for now, add a redundant !OS400, until tdanalzye is fixed. */#elif defined(UNIX) && !defined(OS400) #ifndef W32 #define W32 /* Compile for Windows 32 API - its emulated */ #endif #ifndef W #define W /* Compile for Windows 16 API - its emulated */ #endif #if !defined(MIRAGE) && !defined(INTERNOTES) #define MIRAGE #endif #define PLATFORM_NAME "UNIX" #if defined(AIX) #define XLC_C #elif defined(SUN) || defined(SOLARIS) #define SUN_C #elif defined(HPUX) #define HP_C #elif defined(OS390) #define OS390_C #elif defined(UNIXWARE) #define UW_C #elif defined(__osf__) #if !defined(OSF) #define OSF #endif #define DEC_C #elif defined(LINUX) #define GCC #endif #if (defined(ODT) || defined(SOLX86) || defined(UNIXWARE) || defined(OSF) || defined(LINUX)) && !defined(ZLINUX) #define LITTLE_ENDIAN_ORDER #else #define BIG_ENDIAN_ORDER #endif #define PREEMPTIVE #define SEMAPHORES #define SEMALLOC /* All UNIX type platforms except Solaris,HPUX, and AIX are 32 bit handle platforms */ /* This needs to be here so that it is also included in the SDK */ #if !(defined(SOLARIS) || defined(HPUX) || defined(SOLX86) || defined(AIX)) #ifndef HANDLE_IS_32BITS #define HANDLE_IS_32BITS #endif #endif #if (defined(SOLARIS) || defined(AIX) || defined (HPUX) || defined(OS390) || defined(LINUX)) && !defined(DISABLE_THREADS) #define THREADS #endif /* ODS needed, even for ODT (on x86 machines), because X includes don't support having the compiler set for tight packing (-Zp1), that is, they assume padding. With padding enabled, we must use ODS even when theoretically unncessary. Perhaps the X headers can be kludged to explicitly pad so that this is unnecessary. */ #if defined(ODT_LATER) #define COMPILER_INT_SIZE 4 #define REQUIRED_ALIGNMENT 1 #define COMPILER_DWORD_ALIGNMENT 2 #define COMPILER_NUMBER_ALIGNMENT 2 #else #define ODS_NEEDED TRUE #define COMPILER_INT_SIZE 4 #if defined(OSF) #define REQUIRED_ALIGNMENT 8 #else #define REQUIRED_ALIGNMENT 4 #endif #define COMPILER_DWORD_ALIGNMENT 4 #if defined(SOLARIS) || defined(HPUX) || defined(OS390) || defined(ZLINUX) #define COMPILER_NUMBER_ALIGNMENT 8 #else #define COMPILER_NUMBER_ALIGNMENT 4 #endif #endif #define VIM_USE_UNIX#elif defined(NLM) #ifdef __WATCOMC__ #define WATCOM_C #endif #ifdef _MSC_VER #define MSC #endif #define PLATFORM_NAME "NetWare" #define LITTLE_ENDIAN_ORDER #define SEMAPHORES #define SEMALLOC #define THREADS #define SINGLE_INSTANCE_DLL_DS #define ODS_NEEDED FALSE #define COMPILER_INT_SIZE 4 #define REQUIRED_ALIGNMENT 1 #define COMPILER_DWORD_ALIGNMENT 1 #define COMPILER_NUMBER_ALIGNMENT 1 #define NOGUI #define ENABLE_TRANSACTIONS #define VIM_USE_NLM#else #error Must specify type of OS ("DOS", "OS2", etc) on C command line!#endif#if (defined(SOLARIS) || defined(AIX)) && defined(Enable_New_SpinLocks) #define USE_COND_SLEEP_ON_SPINLOCK 1#endif/* Nullify the certain compiler keywords if not supported by compiler */#if !defined(MSC) || defined(NT) || defined(MAC) #if !defined(MAC) /* On Mac, "pascal" (lowercase) is a reserved word */ #ifdef pascal #undef pascal #endif #if defined(_MSC_VER) && _MSC_VER >= 800 #define pascal __stdcall #else #define pascal #endif #endif /* !defined(MAC) */ #if defined(MAC) #define PASCAL #endif #ifndef PASCAL #define PASCAL #endif #ifdef cdecl #undef cdecl #endif #define cdecl #if !defined(MWERKS_C) /* In MWERKS_C, "far" is a reserved word, and cannot appear in an #ifdef expression */ #ifdef far #undef far #endif #endif #define far #ifndef FAR #define FAR #endif #ifdef near #undef near #endif #define near #ifndef NEAR #define NEAR #endif #ifdef huge #undef huge #endif #define huge#endif /* !defined(MSC) || defined(NT) || defined(MAC) *//* Nullify C keywords that are not supported by some compilers */#if defined(GCC)#if !defined(LINUX) /* These two are already handled with latest GCC headers on LINUX */ #define volatile #define signed #define const#endif#elif defined(HP_C) && defined(__cplusplus) #define signed#elif defined(SUN_C) && defined(__cplusplus) #define signed#endif/* Remove certain definitions if the Netware header files have defined them previously, potentially in conflict with OUR definitions */#ifdef NLM #undef BYTE #undef WORD #undef LONG#endif/* Handle loading of os2def.h up-front, since everyone needs it. */#ifdef OS2 #ifndef APIENTRY #include "os2def.h" #include "bsedos.h" #endif#endif/* Same goes for NT include files */#ifdef NT #ifndef _WINDEF_ #ifndef RC_INVOKED /* Save packing around inclusion of Microsoft headers, just to protect ourselves against their failure to restore packing if they change it. This may not be needed anymore... */ #pragma pack(push, WinIncludes) /* Set packing to be 4, to temporarily workaround a bug in wincon.h where Microsoft incorrectly assumes natural packing instead of setting it explicitly. */ #pragma pack() #endif #undef PASCAL #undef FAR #undef NEAR /* Windows.h defines WINVER, but we seldom include windows.h when using other windows headers. */ #ifndef WINVER #define WINVER 0x0500 #endif /* Determine the processor type as required by the following Windows includes */ #if !defined(_PPC_) && !defined(_ALPHA_) && !defined(_MIPS_) && !defined(_X86_) && defined(_M_IX86) #define _X86_ #endif #if !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MRX000) #define _MIPS_ #endif #if !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_ALPHA) #define _ALPHA_ #endif #if !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_PPC) #define _PPC_ #endif #include <stdarg.h> #define NOMINMAX #include <windef.h> #undef NOMINMAX #include <winbase.h> #include <WinVer.h> #ifndef RC_INVOKED #pragma pack(pop, WinIncludes) #endif #endif#endif#if defined(MAC)#if defined(MAC_OSX) #include <Carbon/Carbon.h>#else #include <MacTypes.h> /* Needed for basic "Handle", "Point", "Rect" typedefs */ #include <MacMemory.h> /* Needed for BlockMove() define */#endif#endif/* Determine what has been included BEFORE this module */#if defined(_INC_WINDOWS) /* WIN16 */ || defined(_WINDEF_) /* WIN32 */ #define WINDOWS_INCLUDED#endif#ifdef SEVERITY_NOERROR #define OS2DEF_INCLUDED#endif/* Define datatypes which are also defined by other include files */#ifndef FAR #define FAR far#endif#ifndef NEAR #define NEAR near#endif#ifndef PASCAL #define PASCAL pascal#endif#if !defined(OS2DEF_INCLUDED) && !defined(WINDOWS_INCLUDED) #define VOID void typedef unsigned char BYTE; #if defined(LONGIS64BIT) typedef int LONG; #else typedef long LONG; #endif #if defined(UNIX) typedef int BOOL; #elif defined(OS2_2x) typedef unsigned long BOOL; #elif defined(OS2_1x) typedef unsigned short BOOL; #elif defined(DOSW16) typedef int BOOL; #else typedef short BOOL; #endif #define LOBYTE(w) ((BYTE)w) #define HIBYTE(w) (((WORD)w >> 8) & 0xff)#endif#ifndef OS2DEF_INCLUDED #ifndef _WINDEF_ /* USHORT, ULONG and UCHAR are already defined in windef.h */ typedef unsigned short int USHORT; #if defined(LONGIS64BIT) typedef unsigned int ULONG; #else typedef unsigned long ULONG; #endif typedef unsigned char UCHAR; #endif /* _WINDEF_ */ #ifndef WINDOWS_INCLUDED /* This is also defined in windows.h */ typedef unsigned int UINT; #endif#endif/* Define datatype which is used to represent a "resource file" */#ifndef HMODULE#if !defined(OS2) /* OS2 already defines this */ #define HMODULE HANDLE#endif#endif#if !defined(WINDOWS_INCLUDED)/* These symbols/typedefs ARE COPIED from WINDOWS.H, and are the ONLY symbols that should be defined in this section! (This is a help for modules that can't afford to include windows.h and want to use a few of these helpful definitions. */ typedef unsigned short WORD; /* WORD = unsigned 16 bit integer */ #if defined(LONGIS64BIT) typedef unsigned int DWORD; /* DWORD = unsigned 32 bit integer */ #else typedef unsigned long DWORD; #endif/* Windows defines a HANDLE as unsigned int, but the Mac needs it to be unsigned short. In C, both are equivalent, but C++ is pickier */#if defined(DOSW16) typedef unsigned int HANDLE; /* really a short, but compiler is picky */#elif defined(HANDLE_IS_32BITS) typedef unsigned int HANDLE; /* 32-bit HANDLEs */#else typedef unsigned short HANDLE;#endif #define LOWORD(l) ((WORD)(DWORD)(l)) #define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xffff))#else /* if WINDOWS_INCLUDED */ /* TEMPORARY: Fix a bug in the standard Windows LOWORD macro (see also a copy of it above), which produces a C compiler warning regarding loss of segment portion of a pointer. */ #undef LOWORD #define LOWORD(l) ((WORD)(DWORD)(l))#endif/* Define our Notes-specific global data types */#define FLAG unsigned /* FLAG = 1-bit boolean value */ /* (Unsized, use ONLY in bitfields!) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -