This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Xt - Needs same DllMain fix for exporting vendorShellWidgetClass?


Xt's Vendor.c has a fix for OS/2 that exports and initializes vendorShellWidgetClass on startup. It seems that this might be needed for us since we need the fix for Xaw, Xaw3d, and LessTif.

Would someone please look at the attached patch and comment? I have build tested it and gave it a quick runtime test, but I am not certain about whether or not it is needed.

Harold
Index: Vendor.c
===================================================================
RCS file: /cvs/xc/lib/Xt/Vendor.c,v
retrieving revision 1.7
diff -u -r1.7 Vendor.c
--- Vendor.c	31 May 2002 18:45:46 -0000	1.7
+++ Vendor.c	18 Nov 2003 00:52:23 -0000
@@ -64,9 +64,11 @@
  *
  ***************************************************************************/
 
-#ifdef __UNIXOS2__
+#if defined(__UNIXOS2__) || defined(__CYGWIN__)
 /* to fix the EditRes problem because of wrong linker semantics */
 extern WidgetClass vendorShellWidgetClass;
+
+#if defined(__UNIXOS2__)
 unsigned long _DLL_InitTerm(unsigned long mod,unsigned long flag)
 {
         switch (flag) {
@@ -80,6 +82,23 @@
                 return 0;
         }
 }
+#endif
+
+#if defined(__CYGWIN__)
+int __stdcall
+DllMain(unsigned long mod_handle, unsigned long flag, void *routine)
+{
+  switch (flag)
+    {
+    case 1: /* DLL_PROCESS_ATTACH - process attach */
+      vendorShellWidgetClass = (WidgetClass)(&vendorShellClassRec);
+      break;
+    case 0: /* DLL_PROCESS_DETACH - process detach */
+      break;
+    }
+  return 1;
+}
+#endif
 #endif
 
 externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]