diff options
author | Mohamed Akram <mohd.akram@outlook.com> | 2024-05-23 01:03:14 +0400 |
---|---|---|
committer | Mohamed Akram <mohd.akram@outlook.com> | 2024-05-23 01:03:14 +0400 |
commit | b2365950e5314b0453dd7cf2a552aa30ec19c046 (patch) | |
tree | 2d11f6f5aa97165d76b2e41fc556faea7d62641d /src | |
parent | 37c08838fa16042c4eb5de505afabab33528d8d8 (diff) |
Improve linking on macOSmaster
This allows macOS to respect the linking order as on other platforms.
Diffstat (limited to 'src')
-rw-r--r-- | src/Vendor.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/Vendor.c b/src/Vendor.c index 08e7e41..4cd0b9b 100644 --- a/src/Vendor.c +++ b/src/Vendor.c @@ -112,22 +112,12 @@ void XawVendorShellExtResize(Widget); void XawVendorStructureNotifyHandler(Widget, XtPointer, XEvent*, Boolean*); -#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) +#if defined(__CYGWIN__) || defined(__MINGW32__) /* to fix the EditRes problem because of wrong linker semantics */ extern WidgetClass vendorShellWidgetClass; /* from Xt/Vendor.c */ extern VendorShellClassRec _XawVendorShellClassRec; void _XawFixupVendorShell(void); -#if defined(__APPLE__) -__attribute__((constructor)) -static void __VendorShellHack(void) -{ - vendorShellWidgetClass = (WidgetClass)(&_XawVendorShellClassRec); - _XawFixupVendorShell(); -} -#endif - -#if defined(__CYGWIN__) || defined(__MINGW32__) int __stdcall DllMain(unsigned long, unsigned long, void *); int __stdcall @@ -144,7 +134,6 @@ DllMain(unsigned long mod_handle, unsigned long flag, void *routine) } return 1; } -#endif #define vendorShellClassRec _XawVendorShellClassRec @@ -162,6 +151,9 @@ static CompositeClassExtensionRec vendorCompositeExt = { #endif #define SuperClass (&wmShellClassRec) +#if defined(__APPLE__) +__attribute__((weak)) +#endif externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = { { /* superclass */ (WidgetClass)SuperClass, @@ -223,10 +215,11 @@ externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = { } }; -#if !defined(__APPLE__) +#if defined(__APPLE__) +__attribute__((weak)) +#endif externaldef(vendorshellwidgetclass) WidgetClass vendorShellWidgetClass = (WidgetClass) (&vendorShellClassRec); -#endif #ifdef XAW_INTERNATIONALIZATION /*************************************************************************** @@ -470,7 +463,7 @@ XawVendorShellClassPartInit(WidgetClass class) } #endif -#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) +#if defined(__CYGWIN__) || defined(__MINGW32__) /* shared libraries on these platforms have the wrong semantics */ /* symbols do not get resolved external to the shared library */ void |