public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Xt - Needs same DllMain fix for exporting vendorShellWidgetClass?
@ 2003-11-18  0:58 Harold L Hunt II
  0 siblings, 0 replies; only message in thread
From: Harold L Hunt II @ 2003-11-18  0:58 UTC (permalink / raw)
  To: cygx

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

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

[-- Attachment #2: xc-lib-Xt-Vendor.c.diff --]
[-- Type: text/plain, Size: 1192 bytes --]

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 = {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-18  0:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-18  0:58 Xt - Needs same DllMain fix for exporting vendorShellWidgetClass? Harold L Hunt II

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).