home *** CD-ROM | disk | FTP | other *** search
/ MORE WinGames / WINGAMES.iso / hyperoid / winext.h < prev   
C/C++ Source or Header  |  1991-11-02  |  3KB  |  110 lines

  1. #if !defined(WINEXT_H)
  2. #define WINEXT_H
  3.  
  4. #if defined(__cplusplus)
  5. extern "C" {
  6. #endif // __cplusplus
  7.  
  8. //
  9. // WINEXT.H - additional windows definitions
  10. //
  11. // Version 1.0  03/21/89  Copyright (C) 1989,90,91 Lantern Coroporation.
  12. // Author: Edward Hutchins
  13. // Status: Freeware
  14. // Revisions:
  15. // 06/06/90 modified HUGE to LARGE to preserve compatibility with math.h
  16. //          also nested windows.h include to prevent modifications on the
  17. //          actual source file - Ed.
  18. // 10/01/90 added CONST and CONSTP,NP,LP,HP and a few comments - Ed.
  19. // 08/28/91 added EXPORT and SEGMENT - Ed.
  20. // 10/28/91 added DLLEXP - Ed.
  21. // 11/02/91 posted on Compuserve - Ed.
  22. //
  23.  
  24. //
  25. // include WINDOWS.H, if needed
  26. //
  27.  
  28. #if !defined(WINDOWS_H)
  29.     #if defined(NULL)
  30.         #undef NULL
  31.     #endif
  32.     #include <windows.h>
  33.     #if !defined(NULL)
  34.         #define NULL 0
  35.     #endif
  36.     #define WINDOWS_H
  37. #endif // WINDOWS_H
  38.  
  39. //
  40. // extra data types and defines
  41. //
  42.  
  43. #define LARGE huge
  44. #define CDECL cdecl
  45. #define CONST const
  46. #define HNULL (0)
  47. #define LPNULL (0L)
  48.  
  49. typedef char        CHAR;
  50. typedef int         INT;
  51. typedef float       FLOAT;
  52. typedef double      DOUBLE;
  53. typedef long double LDOUBLE;
  54.  
  55. // extend the string type
  56. typedef CHAR LARGE  *HPSTR;
  57.  
  58. // useful macros for typedefing pointers to objects //
  59. #define npointerdef(o) typedef o NEAR * NP ## o
  60. #define lpointerdef(o) typedef o FAR * LP ## o
  61. #define hpointerdef(o) typedef o LARGE * HP ## o
  62. #define pointerdef(o) npointerdef(o); lpointerdef(o); hpointerdef(o)
  63.  
  64. // define the different kinds of pointers to things //
  65. pointerdef( BOOL );
  66. npointerdef( BYTE ); hptrdef( BYTE );
  67. pointerdef( CHAR );
  68. npointerdef( INT ); hpointerdef( INT );
  69. npointerdef( WORD ); hpointerdef( WORD );
  70. npointerdef( LONG ); hpointerdef( LONG );
  71. npointerdef( DWORD ); hpointerdef( DWORD );
  72. pointerdef( FLOAT );
  73. pointerdef( DOUBLE );
  74. pointerdef( LDOUBLE );
  75. npointerdef( HANDLE ); hpointerdef( HANDLE );
  76. npointerdef( VOID ); hpointerdef( VOID );
  77.  
  78. // these are here for compatibility - use NPVOID etc...
  79. typedef VOID NEAR *NPMEM;
  80. typedef VOID FAR *LPMEM;
  81.  
  82. // window proc function pointer
  83. typedef LONG (FAR PASCAL *WNDPROC)( HWND, unsigned, WORD, LONG );
  84.  
  85. //
  86. // scope protocol definitions
  87. //
  88.  
  89. #define GLOBAL      // GLOBAL
  90. #define LOCAL       static
  91. #define IMPORT      extern
  92. #define FROM(where) // FROM where
  93. #define PROTO       // PROTOTYPE
  94.  
  95. #define EXPORT _export
  96. #define SEGMENT _segment
  97.  
  98. #if defined(__cplusplus)
  99. }
  100. #endif // __cplusplus
  101.  
  102. // c++ class export type
  103. #if defined(__DLL__)
  104. #define DLLEXP EXPORT
  105. #else
  106. #define DLLEXP LARGE
  107. #endif
  108.  
  109. #endif // WINEXT_H
  110.