-
Notifications
You must be signed in to change notification settings - Fork 329
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
Fix compiling with OSL 1.11.8 #2900
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,14 @@ | |
#include "boost/python/detail/wrap_python.hpp" // has to be first, to avoid redefinition warnings | ||
#include "boost/python.hpp" | ||
|
||
// wrap_python.hpp undefines _DEBUG and then redefines it without assigning it value of 1 | ||
// In OSL 1.11.8 osl/platform.h header uses the syntax "#if _DEBUG" which assumes | ||
// that _DEBUG is not an empty macro, otherwise the header can't be compiled | ||
#ifdef _DEBUG | ||
#undef _DEBUG | ||
#define _DEBUG 1 | ||
#endif | ||
Comment on lines
+45
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So there is a conflit between boost and OSL ? Why putting this here exactly ? There isn't any OSL include bellow those lines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I added this here directly after "wrap_python.hpp" to fix the macro definition. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. We have some headers in appleseed wich goal is to include another header and then fix some things, like you are doing here. This ensure that the fix will be avilable everywhere we need @dictoon Can you confirm this ? Do you have an example in mind ? |
||
|
||
#if defined _MSC_VER | ||
__pragma(warning(pop)) | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSL 1.11.7 and 1.11.8 changed how
stdosl.h
is looked up: INSTALL_PREFIX/share/OSL/shaders takes precedence over ../shaders (where INSTALL_PREFIX is the compile time path of the installation).However, if
stdosl.h
found in the includes it takes the highest precedence.These changes were introduced in AcademySoftwareFoundation/OpenShadingLanguage#956 and the relevant change can be seen here:
https://github.com/imageworks/OpenShadingLanguage/blob/8ff28a0e062c714b74244cc89fd55461421c5a97/src/liboslcomp/oslcomp.cpp#L334-L341