_tbb_windef.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. Copyright (c) 2005-2020 Intel Corporation
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #ifndef __TBB_tbb_windef_H
  14. #error Do not #include this internal file directly; use public TBB headers instead.
  15. #endif /* __TBB_tbb_windef_H */
  16. // Check that the target Windows version has all API calls required for TBB.
  17. // Do not increase the version in condition beyond 0x0500 without prior discussion!
  18. #if defined(_WIN32_WINNT) && _WIN32_WINNT<0x0501
  19. #error TBB is unable to run on old Windows versions; _WIN32_WINNT must be 0x0501 or greater.
  20. #endif
  21. #if !defined(_MT)
  22. #error TBB requires linkage with multithreaded C/C++ runtime library. \
  23. Choose multithreaded DLL runtime in project settings, or use /MD[d] compiler switch.
  24. #endif
  25. // Workaround for the problem with MVSC headers failing to define namespace std
  26. namespace std {
  27. using ::size_t; using ::ptrdiff_t;
  28. }
  29. #define __TBB_STRING_AUX(x) #x
  30. #define __TBB_STRING(x) __TBB_STRING_AUX(x)
  31. // Default setting of TBB_USE_DEBUG
  32. #ifdef TBB_USE_DEBUG
  33. # if TBB_USE_DEBUG
  34. # if !defined(_DEBUG)
  35. # pragma message(__FILE__ "(" __TBB_STRING(__LINE__) ") : Warning: Recommend using /MDd if compiling with TBB_USE_DEBUG!=0")
  36. # endif
  37. # else
  38. # if defined(_DEBUG)
  39. # pragma message(__FILE__ "(" __TBB_STRING(__LINE__) ") : Warning: Recommend using /MD if compiling with TBB_USE_DEBUG==0")
  40. # endif
  41. # endif
  42. #endif
  43. #if (__TBB_BUILD || __TBBMALLOC_BUILD || __TBBBIND_BUILD) && !defined(__TBB_NO_IMPLICIT_LINKAGE)
  44. #define __TBB_NO_IMPLICIT_LINKAGE 1
  45. #endif
  46. #if _MSC_VER
  47. #if !__TBB_NO_IMPLICIT_LINKAGE
  48. #ifdef __TBB_LIB_NAME
  49. #pragma comment(lib, __TBB_STRING(__TBB_LIB_NAME))
  50. #else
  51. #ifdef _DEBUG
  52. #pragma comment(lib, "tbb_debug.lib")
  53. #else
  54. #pragma comment(lib, "tbb.lib")
  55. #endif
  56. #endif
  57. #endif
  58. #endif