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

Support building on modern MSYS2 #13

Open
wants to merge 13 commits into
base: gnustep_testplant_branch
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Workaround for apparent clang bug calculating ivar offset into NSThre…
…ad object.
  • Loading branch information
rfm authored and qmfrederik committed Apr 30, 2024
commit 504f273b34905e025f86c1437a7ae1b1f0b97786
12 changes: 12 additions & 0 deletions Source/NSGraphicsContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
Boston, MA 02110-1301, USA.
*/

#if !defined(_NONFRAGILE_ABI)
#define EXPOSE_NSThread_IVARS
#endif

#import <Foundation/NSGeometry.h>
#import <Foundation/NSString.h>
Expand Down Expand Up @@ -97,7 +99,12 @@
*/
NSThread *th = GSCurrentThread();

# if defined(_NONFRAGILE_ABI)
return (NSGraphicsContext*)object_getIvar(th,
class_getInstanceVariable(object_getClass(th), "_gcontext"));
# else
return (NSGraphicsContext*) th->_gcontext;
# endif
#else
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];

Expand Down Expand Up @@ -166,7 +173,12 @@ + (void) setCurrentContext: (NSGraphicsContext *)context
*/
NSThread *th = GSCurrentThread();

# if defined(_NONFRAGILE_ABI)
object_setIvar(th,
class_getInstanceVariable(object_getClass(th), "_gcontext"), context);
# else
ASSIGN(th->_gcontext, context);
# endif
#else
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];

Expand Down
Loading