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.

43 lines
2.1 KiB

  1. /*
  2. * constdecl.hxx
  3. *
  4. *
  5. * Copyright (c) 1998 Microsoft Corporation
  6. *
  7. * PURPOSE: Defines the CONST_DECLARE family of macros depending on whether
  8. * DEFINE_CONST is declared.
  9. *
  10. * OWNER: vivekj
  11. */
  12. //--------------------------------------------------------------
  13. // A few useful macros that allows definition and declaration
  14. // of strings and guids from the same code, depending on
  15. // whether the macro DEFINE_CONST is declared.
  16. //--------------------------------------------------------------
  17. #undef CONST_SZ_NAME
  18. #undef CONST_SZ_DECLARE
  19. #undef CONST_SZ_DECLARE2
  20. #undef CONST_NODETYPE_DECLARE
  21. #undef SNAPININFO_DECLARE
  22. #undef CONST_NODETYPE_DECLARE2
  23. #ifdef DEFINE_CONST // definitions
  24. #define CONST_SZ_NAME(_a) _T("Name")
  25. #define CONST_SZ_DECLARE(_a, _b) const tstring _a = _T(_b);
  26. #define CONST_SZ_DECLARE2(_a, _b) const tstring _a = (_b);
  27. #define CONST_NODETYPE_DECLARE(_a, _b, _c, _d) extern CNodeType _a = CNodeType(_b, _c, _d);
  28. #define SNAPININFO_DECLARE(_a, _b, _c, _d, _e) extern CSnapinInfo _a = CSnapinInfo(_b, &_c, _d, _e);
  29. #else // declarations
  30. #define CONST_SZ_NAME(_a)
  31. #define CONST_SZ_DECLARE(_a, _b) extern const tstring _a;
  32. #define CONST_SZ_DECLARE2(_a, _b) extern const tstring _a;
  33. #define CONST_NODETYPE_DECLARE(_a, _b, _c, _d) extern CNodeType _a;
  34. #define SNAPININFO_DECLARE(_a, _b, _c, _d, _e) extern CSnapinInfo _a;
  35. #endif
  36. // defined in terms of the above macros.
  37. #define CONST_NODETYPE_DECLARE2(_a, _b) CONST_SZ_DECLARE2( szNodeType##_a, _T("{") _T(#_b) _T("-122F-4d2e-8994-8B90F51E4B00}") ) \
  38. DEFINE_GUID(clsidNodeType##_a, 0x##_b, 0x122f, 0x4d2e, 0x89, 0x94, 0x8b, 0x90, 0xf5, 0x1e, 0x4b, 0x0); \
  39. CONST_NODETYPE_DECLARE( nodetype##_a, &clsidNodeType##_a, szNodeType##_a, CONST_SZ_NAME(_a) );