_tbb_windef.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. Copyright 2005-2013 Intel Corporation. All Rights Reserved.
  3. This file is part of Threading Building Blocks.
  4. Threading Building Blocks is free software; you can redistribute it
  5. and/or modify it under the terms of the GNU General Public License
  6. version 2 as published by the Free Software Foundation.
  7. Threading Building Blocks is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  9. of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with Threading Building Blocks; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. As a special exception, you may use this file as part of a free software
  15. library without restriction. Specifically, if other files instantiate
  16. templates or use macros or inline functions from this file, or you compile
  17. this file and link it with other files to produce an executable, this
  18. file does not by itself cause the resulting executable to be covered by
  19. the GNU General Public License. This exception does not however
  20. invalidate any other reasons why the executable file might be covered by
  21. the GNU General Public License.
  22. */
  23. #ifndef __TBB_tbb_windef_H
  24. #error Do not #include this internal file directly; use public TBB headers instead.
  25. #endif /* __TBB_tbb_windef_H */
  26. // Check that the target Windows version has all API calls requried for TBB.
  27. // Do not increase the version in condition beyond 0x0500 without prior discussion!
  28. #if defined(_WIN32_WINNT) && _WIN32_WINNT<0x0501
  29. #error TBB is unable to run on old Windows versions; _WIN32_WINNT must be 0x0501 or greater.
  30. #endif
  31. #if !defined(_MT)
  32. #error TBB requires linkage with multithreaded C/C++ runtime library. \
  33. Choose multithreaded DLL runtime in project settings, or use /MD[d] compiler switch.
  34. #endif
  35. // Workaround for the problem with MVSC headers failing to define namespace std
  36. namespace std {
  37. using ::size_t; using ::ptrdiff_t;
  38. }
  39. #define __TBB_STRING_AUX(x) #x
  40. #define __TBB_STRING(x) __TBB_STRING_AUX(x)
  41. // Default setting of TBB_USE_DEBUG
  42. #ifdef TBB_USE_DEBUG
  43. # if TBB_USE_DEBUG
  44. # if !defined(_DEBUG)
  45. # pragma message(__FILE__ "(" __TBB_STRING(__LINE__) ") : Warning: Recommend using /MDd if compiling with TBB_USE_DEBUG!=0")
  46. # endif
  47. # else
  48. # if defined(_DEBUG)
  49. # pragma message(__FILE__ "(" __TBB_STRING(__LINE__) ") : Warning: Recommend using /MD if compiling with TBB_USE_DEBUG==0")
  50. # endif
  51. # endif
  52. #endif
  53. #if (__TBB_BUILD || __TBBMALLOC_BUILD) && !defined(__TBB_NO_IMPLICIT_LINKAGE)
  54. #define __TBB_NO_IMPLICIT_LINKAGE 1
  55. #endif
  56. #if _MSC_VER
  57. #if !__TBB_NO_IMPLICIT_LINKAGE
  58. #ifdef __TBB_LIB_NAME
  59. #pragma comment(lib, __TBB_STRING(__TBB_LIB_NAME))
  60. #else
  61. #ifdef _DEBUG
  62. #pragma comment(lib, "tbb_debug.lib")
  63. #else
  64. #pragma comment(lib, "tbb.lib")
  65. #endif
  66. #endif
  67. #endif
  68. #endif