gnustep / libs-gui

The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification). *** Larger patches require copyright assignment to FSF. please file bugs here. ***
http://www.gnustep.org
GNU General Public License v3.0
279 stars 103 forks source link

Avoid accessing instance variables in inline functions when compiling with msvc #205

Closed qmfrederik closed 1 year ago

qmfrederik commented 1 year ago

DPSOperators.h exports various inline functions which access the methods variable of the NSGraphicsContext class. This will result in accessing instance variables across module boundaries if these functions are used in external libraries.

Accessing instance variables across module boundaries is not supported when building on Windows using the Visual Studio toolchain.

This patch adds a methods function on NSGraphicsContext which returns the variable, and reworks the inline functions to use the methods function instead of directly accessing the variable.

Re-submit of !177

fredkiefer commented 1 year ago

As this was reviewed in detail in the last pull request I just trust you that this are the same changes. Hopefully we have more luck this time.