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.

101 lines
3.0 KiB

  1. //
  2. // DECLSPEC.H: Define the DLL_BASED and DLL_CLASS manifests for
  3. // DLL export/import decoration
  4. //
  5. // BUGBUG: Temporarily DISABLED until __declspec works better
  6. //
  7. // If a fixed header files is needed, define _DECLSPEC_WORKS_ and this
  8. // header file will work correctly.
  9. //
  10. #if !defined(_DECLSPEC_WORKS_)
  11. #if !defined(_DECLSPEC_H_)
  12. #define _DECLSPEC_H_
  13. // Create benign definitions for __declspec macros.
  14. #define DLL_TEMPLATE
  15. #define DLL_CLASS class
  16. #define DLL_BASED
  17. #endif
  18. #endif
  19. #if !defined(_DECLSPEC_H_)
  20. #define _DECLSPEC_H_
  21. //
  22. // DECLSPEC.H: Define the DLL_BASED and DLL_CLASS manifests for
  23. // DLL export/import decoration
  24. //
  25. // This file is based upon the following macro definitions:
  26. //
  27. // _CFRONT_PASS_ defined in MAKEFILE.DEF for CFRONT preprocessing;
  28. //
  29. // _cplusplus defined for all C++ compilation;
  30. //
  31. // NETUI_DLL defined in $(UI)\COMMON\SRC\DLLRULES.MK, which is
  32. // included by all components which live in NETUI DLLs.
  33. //
  34. // DLL_BASED_DEFEAT optional manifest that suppresses __declspec;
  35. //
  36. // This file generates two definitions:
  37. //
  38. // DLL_BASED which indicates that the external function, data item
  39. // or class lives in a NETUI DLL; expands to nothing,
  40. // "_declspec(dllimport)", or "_declspec(dllexport)"
  41. // depending upon the manifest above.
  42. //
  43. // DLL_CLASS which expands to "class", "class _declspec(dllimport)",
  44. // or "class _declspec(dllexport)" depending on the
  45. // manifests above.
  46. //
  47. // DLL_TEMPLATE expands to nothing outside of the DLLs; expands to
  48. // DLL_BASED inside the DLLs. In other words, the standard
  49. // template is local to the defining link scope. To
  50. // declare a template as "dllimport", another set of
  51. // macros exists which allows direct specification of the
  52. // desired decoration.
  53. //
  54. #if defined(_CFRONT_PASS_)
  55. #define DLL_BASED_DEFEAT
  56. #endif
  57. // Define DLL_BASED for all compiles
  58. #if defined(DLL_BASED_DEFEAT)
  59. // If CFront, no decoration allowed
  60. #define DLL_BASED
  61. #else
  62. #if defined(NETUI_DLL)
  63. // If C8 and inside DLL, export stuff
  64. #define DLL_BASED __declspec(dllexport)
  65. #else
  66. // If C8 and inside DLL, import stuff
  67. #define DLL_BASED __declspec(dllimport)
  68. #endif
  69. #endif
  70. // If C++, define the DLL_CLASS and DLL_TEMPLATE macros
  71. #if defined(__cplusplus)
  72. #if defined(DLL_BASED_DEFEAT)
  73. // If CFRONT, no decoration allowed
  74. #define DLL_CLASS class
  75. #define DLL_TEMPLATE
  76. #else
  77. #define DLL_CLASS class DLL_BASED
  78. #if defined(NETUI_DLL)
  79. // Templates expanded in the DLL are exported
  80. #define DLL_TEMPLATE DLL_BASED
  81. #else
  82. #define DLL_TEMPLATE
  83. #endif
  84. #endif
  85. #endif
  86. #endif // !_DECLSPEC_H_