godot-changes-misc.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. diff --git a/thirdparty/embree/common/sys/intrinsics.h b/thirdparty/embree/common/sys/intrinsics.h
  2. index 79729c87ab..ed8dd7d40a 100644
  3. --- a/thirdparty/embree/common/sys/intrinsics.h
  4. +++ b/thirdparty/embree/common/sys/intrinsics.h
  5. @@ -34,8 +34,14 @@
  6. #endif
  7. #if defined(__WIN32__)
  8. -# define NOMINMAX
  9. -# include <windows.h>
  10. +// -- GODOT start --
  11. +#if !defined(NOMINMAX)
  12. +// -- GODOT end --
  13. +#define NOMINMAX
  14. +// -- GODOT start --
  15. +#endif
  16. +#include "windows.h"
  17. +// -- GODOT end --
  18. #endif
  19. /* normally defined in pmmintrin.h, but we always need this */
  20. diff --git a/thirdparty/embree/common/sys/platform.h b/thirdparty/embree/common/sys/platform.h
  21. index 3fc5e99b8d..697e07bb86 100644
  22. --- a/thirdparty/embree/common/sys/platform.h
  23. +++ b/thirdparty/embree/common/sys/platform.h
  24. @@ -99,7 +99,9 @@
  25. #define dll_import
  26. #endif
  27. -#ifdef __WIN32__
  28. +// -- GODOT start --
  29. +#if defined(__WIN32__) && !defined(__MINGW32__)
  30. +// -- GODOT end --
  31. #if !defined(__noinline)
  32. #define __noinline __declspec(noinline)
  33. #endif
  34. @@ -149,6 +151,9 @@
  35. #define DELETED = delete
  36. #endif
  37. +// -- GODOT start --
  38. +#if !defined(likely)
  39. +// -- GODOT end --
  40. #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
  41. #define likely(expr) (expr)
  42. #define unlikely(expr) (expr)
  43. @@ -156,6 +161,9 @@
  44. #define likely(expr) __builtin_expect((bool)(expr),true )
  45. #define unlikely(expr) __builtin_expect((bool)(expr),false)
  46. #endif
  47. +// -- GODOT start --
  48. +#endif
  49. +// -- GODOT end --
  50. ////////////////////////////////////////////////////////////////////////////////
  51. /// Error handling and debugging
  52. diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp
  53. index ba97dc227b..f1a59e511e 100644
  54. --- a/thirdparty/embree/common/sys/sysinfo.cpp
  55. +++ b/thirdparty/embree/common/sys/sysinfo.cpp
  56. @@ -248,7 +248,9 @@ namespace embree
  57. #if defined(__X86_ASM__)
  58. __noinline int64_t get_xcr0()
  59. {
  60. -#if defined (__WIN32__)
  61. +// -- GODOT start --
  62. +#if defined (__WIN32__) && !defined (__MINGW32__)
  63. +// -- GODOT end --
  64. int64_t xcr0 = 0; // int64_t is workaround for compiler bug under VS2013, Win32
  65. xcr0 = _xgetbv(0);
  66. return xcr0;
  67. diff --git a/thirdparty/embree/include/embree3/rtcore_common.h b/thirdparty/embree/include/embree3/rtcore_common.h
  68. index 9c14b28745..4857e1e05e 100644
  69. --- a/thirdparty/embree/include/embree3/rtcore_common.h
  70. +++ b/thirdparty/embree/include/embree3/rtcore_common.h
  71. @@ -19,7 +19,9 @@ typedef int ssize_t;
  72. #endif
  73. #endif
  74. -#ifdef _WIN32
  75. +// -- GODOT start --
  76. +#if defined(_WIN32) && defined(_MSC_VER)
  77. +// -- GODOT end --
  78. # define RTC_ALIGN(...) __declspec(align(__VA_ARGS__))
  79. #else
  80. # define RTC_ALIGN(...) __attribute__((aligned(__VA_ARGS__)))
  81. diff --git a/thirdparty/embree/common/tasking/taskschedulertbb.h b/thirdparty/embree/common/tasking/taskschedulertbb.h
  82. index 3fd15816e9..35bd49849f 100644
  83. --- a/thirdparty/embree/common/tasking/taskschedulertbb.h
  84. +++ b/thirdparty/embree/common/tasking/taskschedulertbb.h
  85. @@ -12,7 +12,13 @@
  86. #include "../sys/ref.h"
  87. #if defined(__WIN32__)
  88. +// -- GODOT start --
  89. +#if !defined(NOMINMAX)
  90. +// -- GODOT end --
  91. # define NOMINMAX
  92. +// -- GODOT start --
  93. +#endif
  94. +// -- GODOT end --
  95. #endif
  96. // We need to define these to avoid implicit linkage against