summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2004-01-29 08:08:07 +0000
committerEgbert Eich <eich@suse.de>2004-01-29 08:08:07 +0000
commit036e955dfcc31d3b6c081f84e4f0b85969ccdd12 (patch)
tree6f72daca2e517d094c6e5638d30b306ab9c2a960
parentf81d7ef72c9b4f13e33efa812bed9446657ed003 (diff)
Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004xf86-4_3_99_903_specialxf86-012804-2330
-rw-r--r--man/XtConvertAndStore.man4
-rw-r--r--man/XtCreateApplicationContext.man4
-rw-r--r--man/XtSetLanguageProc.man4
-rw-r--r--src/Alloc.c10
-rw-r--r--src/Initialize.c62
-rw-r--r--src/Vendor.c23
6 files changed, 93 insertions, 14 deletions
diff --git a/man/XtConvertAndStore.man b/man/XtConvertAndStore.man
index 6683934..d624bb5 100644
--- a/man/XtConvertAndStore.man
+++ b/man/XtConvertAndStore.man
@@ -25,7 +25,7 @@
.\" dealing in this Software without prior written authorization from the
.\" X Consortium.
.\"
-.\" $XFree86: xc/doc/man/Xt/XtConvSt.man,v 1.4 2003/04/28 22:18:18 herrb Exp $
+.\" $XFree86: xc/doc/man/Xt/XtConvSt.man,v 1.5 2004/01/03 16:30:59 herrb Exp $
.\"
.ds tk X Toolkit
.ds xT X Toolkit Intrinsics \- C Language Interface
@@ -134,7 +134,7 @@ XtConvertAndStore, XtCallConverter \- invoke resource converters
Boolean XtConvertAndStore(Widget \fIwidget\fP, String \fIfrom_type\fP,
XrmValuePtr \fIfrom\fP, String \fIto_type\fP, XrmValuePtr \fIto_in_out\fP);
.HP
-void XtCallConverter(Display* \fIdpy\fP, XtConverter \fIconverter\fP,
+Boolean XtCallConverter(Display* \fIdpy\fP, XtConverter \fIconverter\fP,
XrmValuePtr \fIargs\fP, Cardinal \fInum_args\fP, XrmValuePtr \fIfrom\fP,
XrmValuePtr \fIto_in_out\fP, XtCacheRef* \fIcache_ref_return\fP);
.SH ARGUMENTS
diff --git a/man/XtCreateApplicationContext.man b/man/XtCreateApplicationContext.man
index abbb730..975fc49 100644
--- a/man/XtCreateApplicationContext.man
+++ b/man/XtCreateApplicationContext.man
@@ -26,7 +26,7 @@
.\" other dealings in this Software without prior written authorization
.\" from the X Consortium.
.\"
-.\" $XFree86: xc/doc/man/Xt/XtCreACon.man,v 1.3 2003/04/28 22:18:18 herrb Exp $
+.\" $XFree86: xc/doc/man/Xt/XtCreACon.man,v 1.4 2004/01/12 21:43:19 herrb Exp $
.\"
.ds tk X Toolkit
.ds xT X Toolkit Intrinsics \- C Language Interface
@@ -134,7 +134,7 @@ XtCreateApplicationContext, XtDestroyApplicationContext, XtWidgetToApplicationCo
.HP
XtAppContext XtCreateApplicationContext(void);
.HP
-void XtDestroyApplicationContext(XtAppContext \fIapp_context\fP,
+void XtDestroyApplicationContext(XtAppContext \fIapp_context\fP);
.HP
XtAppContext XtWidgetToApplicationContext(Widget \fIw\fP);
.HP
diff --git a/man/XtSetLanguageProc.man b/man/XtSetLanguageProc.man
index b39e5d7..86c4830 100644
--- a/man/XtSetLanguageProc.man
+++ b/man/XtSetLanguageProc.man
@@ -26,7 +26,7 @@
.\" other dealings in this Software without prior written authorization
.\" from the X Consortium.
.\"
-.\" $XFree86: xc/doc/man/Xt/XtSetLangP.man,v 1.4 2003/05/29 21:48:05 herrb Exp $
+.\" $XFree86: xc/doc/man/Xt/XtSetLangP.man,v 1.5 2004/01/12 21:43:19 herrb Exp $
.\"
.ds tk X Toolkit
.ds xT X Toolkit Intrinsics \- C Language Interface
@@ -159,7 +159,7 @@ returns the previously registered language procedure. If a language
procedure has not yet been registered, the return value is unspecified
but if this return value is used in a subsequent call to
.ZN XtSetLanguageProc ,
-it will because the default language procedure to be registered.
+it will cause the default language procedure to be registered.
.LP
The default language procedure does the following:
.IP \(bu 5
diff --git a/src/Alloc.c b/src/Alloc.c
index 80fadfb..939d216 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -58,7 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/Xt/Alloc.c,v 1.9 2001/12/14 19:56:07 dawes Exp $ */
+/* $XFree86: xc/lib/Xt/Alloc.c,v 1.10 2003/12/30 01:45:07 tsi Exp $ */
/*
* X Toolkit Memory Allocation Routines
@@ -117,7 +117,7 @@ char *XtMalloc(size)
{
char *ptr;
-#if defined (MALLOC_0_RETURNS_NULL) && defined(XTMALLOC_BC)
+#if defined(MALLOC_0_RETURNS_NULL) && defined(XTMALLOC_BC)
/* preserve this (broken) behavior until everyone fixes their apps */
if (!size) size = 1;
#endif
@@ -132,12 +132,12 @@ char *XtRealloc(ptr, size)
unsigned size;
{
if (ptr == NULL) {
-#if MALLOC_0_RETURNS_NULL
+#ifdef MALLOC_0_RETURNS_NULL
if (!size) size = 1;
#endif
return(XtMalloc(size));
} else if ((ptr = Xrealloc(ptr, size)) == NULL
-#if MALLOC_0_RETURNS_NULL
+#ifdef MALLOC_0_RETURNS_NULL
&& size
#endif
)
@@ -151,7 +151,7 @@ char *XtCalloc(num, size)
{
char *ptr;
-#if defined (MALLOC_0_RETURNS_NULL) && defined(XTMALLOC_BC)
+#if defined(MALLOC_0_RETURNS_NULL) && defined(XTMALLOC_BC)
/* preserve this (broken) behavior until everyone fixes their apps */
if (!size) num = size = 1;
#endif
diff --git a/src/Initialize.c b/src/Initialize.c
index c79ddc2..e590666 100644
--- a/src/Initialize.c
+++ b/src/Initialize.c
@@ -32,7 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/Xt/Initialize.c,v 3.21 2003/04/21 16:34:27 herrb Exp $ */
+/* $XFree86: xc/lib/Xt/Initialize.c,v 3.22 2003/12/22 21:10:25 dickey Exp $ */
/*
@@ -184,6 +184,66 @@ void _XtInherit()
#define _XtInherit __XtInherit
#endif
+
+#if defined(__CYGWIN__)
+/*
+ * The Symbol _XtInherit is used in two different manners.
+ * First it could be used as a generic function and second
+ * as an absolute address reference, which will be used to
+ * check the initialisation process of several other libraries.
+ * Because of this the symbol must be accessable by all
+ * client dll's and applications. In unix environments
+ * this is no problem, because the used shared libraries
+ * format (elf) supports this immediatly. Under Windows
+ * this isn't true, because a functions address in a dll
+ * is different from the same function in another dll or
+ * applications, because the used Portable Executable
+ * File adds a code stub to each client to provide the
+ * exported symbol name. This stub uses an indirect
+ * pointer to get the original symbol address, which is
+ * then jumped to, like in this example:
+ *
+ * --- client --- --- dll ----
+ * ...
+ * call foo
+ *
+ * foo: jmp (*_imp_foo) ----> foo: ....
+ * nop
+ * nop
+ *
+ * _imp_foo: .long <index of foo in dll export table, is
+ * set to the real address by the runtime linker>
+ *
+ * Now it is clear why the clients symbol foo isn't the same
+ * as in the dll and we can think about how to deal which
+ * this two above mentioned requirements, to export this
+ * symbol to all clients and to allow calling this symbol
+ * as a function. The solution I've used exports the
+ * symbol _XtInherit as data symbol, because global data
+ * symbols are exported to all clients. But how to deal
+ * with the second requirement, that this symbol should
+ * be used as function. The Trick is to build a little
+ * code stub in the data section in the exact manner as
+ * above explained. This is done with the assembler code
+ * below.
+ *
+ * Ralf Habacker
+ *
+ * References:
+ * msdn http://msdn.microsoft.com/msdnmag/issues/02/02/PE/PE.asp
+ * cygwin-xfree: http://www.cygwin.com/ml/cygwin-xfree/2003-10/msg00000.html
+ */
+
+asm (".data\n\
+ .globl __XtInherit \n\
+ __XtInherit: jmp *_y \n\
+ _y: .long ___XtInherit \n\
+ .text \n");
+
+#define _XtInherit __XtInherit
+#endif
+
+
void _XtInherit()
{
XtErrorMsg("invalidProcedure","inheritanceProc",XtCXtToolkitError,
diff --git a/src/Vendor.c b/src/Vendor.c
index 3b282dc..b2f0b0d 100644
--- a/src/Vendor.c
+++ b/src/Vendor.c
@@ -46,7 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/Xt/Vendor.c,v 1.7 2002/05/31 18:45:46 dawes Exp $ */
+/* $XFree86: xc/lib/Xt/Vendor.c,v 1.8 2003/12/22 21:10:25 dickey Exp $ */
/* Make sure all wm properties can make it out of the resource manager */
@@ -64,9 +64,11 @@ SOFTWARE.
*
***************************************************************************/
-#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) {
@@ -82,6 +84,23 @@ unsigned long _DLL_InitTerm(unsigned long mod,unsigned long flag)
}
#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 = {
{
/* superclass */ (WidgetClass) &wmShellClassRec,