Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys: Fixes for MinGW support #346

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/sys/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#define dll_import
#endif

#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__MINGW32__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same might be relevant on line 94 for the definitions of dll_export and dll_import. But it's not part of the patch we're using in production for Godot (https://github.com/godotengine/godot/blob/master/thirdparty/embree/patches/godot-changes-misc.patch), so for this PR I chose to play it safe and only include what we tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was needed to fix a crash issue when compiling Embree with MinGW-GCC, which we experienced upstream: godotengine/godot#45097

#if !defined(__noinline)
#define __noinline __declspec(noinline)
#endif
Expand Down
2 changes: 1 addition & 1 deletion common/sys/sysinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace embree
#if defined(__X86_ASM__)
__noinline int64_t get_xcr0()
{
#if defined (__WIN32__)
#if defined (__WIN32__) && !defined (__MINGW32__)
int64_t xcr0 = 0; // int64_t is workaround for compiler bug under VS2013, Win32
xcr0 = _xgetbv(0);
return xcr0;
Expand Down
2 changes: 1 addition & 1 deletion include/embree3/rtcore_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ typedef int ssize_t;
#endif
#endif

#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
# define RTC_ALIGN(...) __declspec(align(__VA_ARGS__))
#else
# define RTC_ALIGN(...) __attribute__((aligned(__VA_ARGS__)))
Expand Down