Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.9 KiB

  1. /*
  2. ** File: common.hxx
  3. **
  4. ** (C) 1989 Microsoft Corp.
  5. */
  6. /*****************************************************************************/
  7. /** Microsoft LAN Manager **/
  8. /** Copyright(c) Microsoft Corp., 1987-1990 **/
  9. /*****************************************************************************/
  10. /*****************************************************************************
  11. File : rpctypes.hxx
  12. Title : rpc type node defintions
  13. Description : Common header file for MIDL compiler
  14. History :
  15. ??-Aug-1990 ??? Created
  16. 20-Sep-1990 NateO Safeguards against double inclusion
  17. *****************************************************************************/
  18. #ifndef __COMMON_HXX__
  19. #define __COMMON_HXX__
  20. #include "nulldefs.h"
  21. extern "C" {
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <ctype.h>
  25. #include "midldebug.h"
  26. };
  27. typedef unsigned short USHORT;
  28. typedef int BOOL;
  29. typedef __int64 LONGLONG;
  30. #if _MSC_VER < 1100
  31. #define true (1)
  32. #define false (0)
  33. #endif
  34. #ifndef FALSE
  35. #define FALSE 0
  36. #endif
  37. #ifndef TRUE
  38. #define TRUE 1
  39. #endif
  40. #define RET_VAL "_ret_value"
  41. class BufferManager;
  42. extern void * AllocateNew( size_t size );
  43. extern void AllocateDelete( void * p );
  44. extern void * AllocateOnceNew( size_t size );
  45. extern void AllocateOnceDelete( void * p );
  46. inline void * operator new( size_t size )
  47. {
  48. return AllocateNew( size );
  49. }
  50. inline void operator delete( void * p )
  51. {
  52. AllocateDelete( p );
  53. }
  54. extern char * MIDLStrDup(char * p);
  55. extern void UseBackEndHeap();
  56. extern void DestroyBackEndHeap();
  57. #define IN
  58. #define OUT
  59. #define OPTIONAL
  60. //////////////////////////////////////////////////////////////////////////////
  61. // optimisation options
  62. //////////////////////////////////////////////////////////////////////////////
  63. //
  64. // These are the switches to be set corresponding to the optimisations
  65. // options specified by the user. If no optimisations are specified,
  66. // then the compiler optimises for speed.
  67. //
  68. //
  69. typedef unsigned short OPTIM_OPTION;
  70. #define OPTIMIZE_NONE 0x0000
  71. #define OPTIMIZE_SIZE 0x0001
  72. #define OPTIMIZE_INTERPRETER 0x0002
  73. #define OPTIMIZE_NO_REF_CHECK 0x0004
  74. #define OPTIMIZE_NO_BOUNDS_CHECK 0x0008
  75. #define OPTIMIZE_NO_CTXT_CHECK 0x0010
  76. #define OPTIMIZE_NO_GEN_HDL_CHECK 0x0011
  77. #define OPTIMIZE_THUNKED_INTERPRET 0x0020
  78. #define OPTIMIZE_NON_NT35 0x0040
  79. #define OPTIMIZE_STUBLESS_CLIENT 0x0040 // same as non-nt35
  80. #define OPTIMIZE_NON_NT351 0x0080
  81. #define OPTIMIZE_INTERPRETER_V2 0x0080 // same as non-nt351
  82. #define OPTIMIZE_INTERPRETER_IX 0x0100 // cmd only: the best Oi* possible
  83. #define OPTIMIZE_ALL_I0_FLAGS 0x0002
  84. #define OPTIMIZE_ALL_I1_FLAGS 0x0042
  85. #define OPTIMIZE_ALL_I2_FLAGS 0x00c2
  86. #define OPTIMIZE_ANY_INTERPRETER 0x01c2
  87. #define DEFAULT_OPTIM_OPTIONS ( \
  88. OPTIMIZE_SIZE \
  89. )
  90. //
  91. // These are internal optimization level values
  92. //
  93. typedef enum _opt_level_enum
  94. {
  95. OPT_LEVEL_OS,
  96. OPT_LEVEL_OI,
  97. OPT_LEVEL_OIC,
  98. OPT_LEVEL_OICF,
  99. } OPT_LEVEL_ENUM;
  100. typedef enum _syntax_enum
  101. {
  102. SYNTAX_DCE = 1,
  103. SYNTAX_NDR64,
  104. SYNTAX_BOTH
  105. } SYNTAX_ENUM;
  106. #define HPP_TYPE_NAME_PREFIX ( "P" )
  107. // RKK64: TBD
  108. // With full support for 64b expressions, we would need -i64toa etc.
  109. #define MIDL_SPAWNLP _spawnlp
  110. #define MIDL_FGETCHAR _fgetchar
  111. #define MIDL_FILENO _fileno
  112. #define MIDL_ITOA _itoa
  113. #define MIDL_LTOA _ltoa
  114. #define MIDL_UNLINK _unlink
  115. //
  116. // forward declarations.
  117. //
  118. class node_skl;
  119. class node_base_attr;
  120. #define SIZE_2GB 0x80000000
  121. #if defined(MIDL_ENABLE_ASSERTS)
  122. int DisplayAssertMsg(char *pFileName, int , char *pExpr );
  123. #define MIDL_ASSERT( expr ) \
  124. ( ( expr ) ? 1 : DisplayAssertMsg( __FILE__ , __LINE__, #expr ) )
  125. #else
  126. #define MIDL_ASSERT( expr )
  127. #endif
  128. #endif // __COMMON_HXX__