Bug 77749 - PRAGMA_EXPORT_SUPPORTED defined incorrectly on OS X
Summary: PRAGMA_EXPORT_SUPPORTED defined incorrectly on OS X
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-21 22:38 UTC by thakis
Modified: 2014-04-28 23:20 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch (1.66 KB, patch)
2014-04-22 16:44 UTC, thakis
Details | Splinter Review
patch (1.66 KB, patch)
2014-04-24 20:22 UTC, thakis
Details | Splinter Review

Description thakis 2014-04-21 22:38:00 UTC
gl.h and osmesa.h define PRAGMA_EXPORT_SUPPORTED and then use "pragma export on", "pragma export off" if that is defined.

#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)	
#  define PRAGMA_EXPORT_SUPPORTED		1	
#endif

On my mac, this ends up being true somehow (I suppose something ends up defining __QUICKDRAW__), and then clang warns

../../third_party/mesa/src/include/GL/gl.h:124:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma export on
        ^

It looks like this is only used for old platforms, so I'd suggest just removing the whole "pragma export" stuff.
Comment 1 thakis 2014-04-21 22:48:50 UTC
Yup, Quickdraw.h defines __QUICKDRAW__. The header gets pulled in like this (with the 10.8 sdk):

..... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h
...... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h
....... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h
Comment 2 thakis 2014-04-21 22:57:28 UTC
(Clarification: gl.h defines PRAGMA_EXPORT_SUPPORTED; osmesa.h uses "pragma export" directly if __QUICKDRAW__ is defined)
Comment 3 thakis 2014-04-22 16:44:28 UTC
Created attachment 97758 [details] [review]
patch

Here's how a patch to remove this might look. I removed "pragma import" too -- while this doesn't cause warnings, it looks like this was used only on very old versions on OS X.
Comment 4 Brian Paul 2014-04-23 14:52:09 UTC
The patch looks OK to me.  I'm always happy to get rid of old system-specific crud.

But I can't apply the patch here to test it:

$ patch -p0 < ~/mesaport.diff 
patching file include/GL/gl.h
patch: **** malformed patch at line 16: @@ -92,10 +87,6 @@

Do I need a special option for patch?
Comment 5 thakis 2014-04-24 20:22:22 UTC
Created attachment 97921 [details] [review]
patch

Oh sorry. I had manually edited the patch as it was relative to our slightly forked mesa -- always a bad idea :-)

Here's the same patch relative to an earlier revision of ours, which should hopefully apply cleanly (or at least enable patch to read it.)

(Thanks for the quick turnaround!)
Comment 6 Brian Paul 2014-04-28 22:02:48 UTC
The new patch still doesn't apply to master.  But I've posted a patch with the same intention to the mailing list for review.
Comment 7 Brian Paul 2014-04-28 23:18:44 UTC
Fixed in commit 50034c017125b9538cd1e88b7344574da5bf3c9a
Comment 8 thakis 2014-04-28 23:20:07 UTC
Thank you!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.