namespace.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright [2021] JD.com, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef __DTC_VERSIONED_NAMESPACE_H
  17. #define __DTC_VERSIONED_NAMESPACE_H
  18. #include "version.h"
  19. #if DTC_HAS_VERSIONED_NAMESPACE && DTC_HAS_VERSIONED_NAMESPACE == 1
  20. #ifndef DTC_VERSIONED_NAMESPACE
  21. #define MAKE_DTC_VERSIONED_NAMESPACE_IMPL(MAJOR, MINOR, BETA) \
  22. DTC_##MAJOR##_##MINOR##_##BETA
  23. #define MAKE_DTC_VERSIONED_NAMESPACE(MAJOR, MINOR, BETA) \
  24. MAKE_DTC_VERSIONED_NAMESPACE_IMPL(MAJOR, MINOR, BETA)
  25. #define DTC_VERSIONED_NAMESPACE \
  26. MAKE_DTC_VERSIONED_NAMESPACE(DTC_MAJOR_VERSION, DTC_MINOR_VERSION, \
  27. DTC_BETA_VERSION)
  28. #endif //end DTC_VERSIONED_NAMESPACE
  29. #define DTC_BEGIN_NAMESPACE \
  30. namespace DTC_VERSIONED_NAMESPACE \
  31. {
  32. #define DTC_END_NAMESPACE }
  33. #define DTC_USING_NAMESPACE using namespace DTC_VERSIONED_NAMESPACE;
  34. #else
  35. #define DTC_BEGIN_NAMESPACE
  36. #define DTC_END_NAMESPACE
  37. #define DTC_USING_NAMESPACE
  38. #endif //end DTC_HAS_VERSIONED_NAMESPACE
  39. #endif