Leaked source code of windows server 2003
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.

137 lines
4.1 KiB

  1. // This is a part of the Active Template Library.
  2. // Copyright (C) 1996-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Active Template Library Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Active Template Library product.
  10. #ifndef __ATLDEF_H__
  11. #define __ATLDEF_H__
  12. #ifndef __cplusplus
  13. #error ATL requires C++ compilation (use a .cpp suffix)
  14. #endif
  15. #ifdef UNDER_CE
  16. #error ATL not currently supported for CE
  17. #endif
  18. #ifdef _UNICODE
  19. #ifndef UNICODE
  20. #define UNICODE // UNICODE is used by Windows headers
  21. #endif
  22. #endif
  23. #ifdef UNICODE
  24. #ifndef _UNICODE
  25. #define _UNICODE // _UNICODE is used by C-runtime/MFC headers
  26. #endif
  27. #endif
  28. #ifdef _DEBUG
  29. #ifndef DEBUG
  30. #define DEBUG
  31. #endif
  32. #endif
  33. #ifndef ATLASSERT
  34. #define ATLASSERT(expr) _ASSERTE(expr)
  35. #endif
  36. ///////////////////////////////////////////////////////////////////////////////
  37. // __declspec(novtable) is used on a class declaration to prevent the vtable
  38. // pointer from being initialized in the constructor and destructor for the
  39. // class. This has many benefits because the linker can now eliminate the
  40. // vtable and all the functions pointed to by the vtable. Also, the actual
  41. // constructor and destructor code are now smaller.
  42. ///////////////////////////////////////////////////////////////////////////////
  43. // This should only be used on a class that is not directly createable but is
  44. // rather only used as a base class. Additionally, the constructor and
  45. // destructor (if provided by the user) should not call anything that may cause
  46. // a virtual function call to occur back on the object.
  47. ///////////////////////////////////////////////////////////////////////////////
  48. // By default, the wizards will generate new ATL object classes with this
  49. // attribute (through the ATL_NO_VTABLE macro). This is normally safe as long
  50. // the restriction mentioned above is followed. It is always safe to remove
  51. // this macro from your class, so if in doubt, remove it.
  52. ///////////////////////////////////////////////////////////////////////////////
  53. #ifdef _ATL_DISABLE_NO_VTABLE
  54. #define ATL_NO_VTABLE
  55. #else
  56. #define ATL_NO_VTABLE __declspec(novtable)
  57. #endif
  58. #ifdef _ATL_DEBUG_REFCOUNT
  59. #ifndef _ATL_DEBUG_INTERFACES
  60. #define _ATL_DEBUG_INTERFACES
  61. #endif
  62. #endif
  63. #ifdef _ATL_DEBUG_INTERFACES
  64. #ifndef _ATL_DEBUG
  65. #define _ATL_DEBUG
  66. #endif // _ATL_DEBUG
  67. #endif // _ATL_DEBUG_INTERFACES
  68. #ifndef _ATL_HEAPFLAGS
  69. #ifdef _MALLOC_ZEROINIT
  70. #define _ATL_HEAPFLAGS HEAP_ZERO_MEMORY
  71. #else
  72. #define _ATL_HEAPFLAGS 0
  73. #endif
  74. #endif
  75. #ifndef _ATL_PACKING
  76. #define _ATL_PACKING 8
  77. #endif
  78. #if defined(_ATL_DLL)
  79. #define ATLAPI extern "C" HRESULT __declspec(dllimport) __stdcall
  80. #define ATLAPI_(x) extern "C" __declspec(dllimport) x __stdcall
  81. #define ATLINLINE
  82. #elif defined(_ATL_DLL_IMPL)
  83. #define ATLAPI extern "C" HRESULT __declspec(dllexport) __stdcall
  84. #define ATLAPI_(x) extern "C" __declspec(dllexport) x __stdcall
  85. #define ATLINLINE
  86. #else
  87. #define ATLAPI HRESULT __stdcall
  88. #define ATLAPI_(x) x __stdcall
  89. #define ATLINLINE inline
  90. #endif
  91. #if defined (_CPPUNWIND) & (defined(_ATL_EXCEPTIONS) | defined(_AFX))
  92. #define ATLTRY(x) try{x;} catch(...) {}
  93. #else
  94. #define ATLTRY(x) x;
  95. #endif
  96. #define offsetofclass(base, derived) ((DWORD_PTR)(static_cast<base*>((derived*)_ATL_PACKING))-_ATL_PACKING)
  97. /////////////////////////////////////////////////////////////////////////////
  98. // Master version numbers
  99. #define _ATL 1 // Active Template Library
  100. #ifdef _WIN64
  101. #define _ATL_VER 0x0301 // Active Template Library version 3.0
  102. #else
  103. #define _ATL_VER 0x0300 // Active Template Library version 3.0
  104. #endif
  105. /////////////////////////////////////////////////////////////////////////////
  106. // Threading
  107. #ifndef _ATL_SINGLE_THREADED
  108. #ifndef _ATL_APARTMENT_THREADED
  109. #ifndef _ATL_FREE_THREADED
  110. #define _ATL_FREE_THREADED
  111. #endif
  112. #endif
  113. #endif
  114. #endif // __ATLDEF_H__
  115. /////////////////////////////////////////////////////////////////////////////