vcpkg/ports/libxt/globals.patch
Alexander Neumann 6f7ffeb18f
[many ports] Add X windows part 11/N (#27441)
* [libice] replace macros with typedefs

* [libx11] fix dl linkage on linux and cleanup the cmake wrapper.

* [libxxf86vm] add port

* [libxtst] add port

* [libxt] add port

* [libxmu] add port

* [libxaw] add port

* bump port version

* v db

* fix libxpm and maybe cross libxt

* malloc returns null for cross builds

* fix typo

* fix stuff

* v db

* fix stuff ?

* WIP commit

* libxt cross fix

* add todo

* fix libxaw

* xcb add some fixes.

* fix todos

* fix arm ?

* fix path

* bump some versions

* shorten comment

* format manifest

* v db

* fix stuff

* ci baseline

* v db

* adjust libx11 wrapper again

* v db

* add license

* remove doubled entry from v db

* v db

* libxmu remove global variable.

* correctly split unistd.patch and apply it

* disable thread safe init in libx11 on windows

* v db

* libx11 append options correctly.

* v db

* still not correct.

* v db
2022-11-11 17:32:25 -08:00

97 lines
2.4 KiB
Diff

diff --git a/util/StrDefs.ct b/util/StrDefs.ct
index b597b2051..b682255ad 100644
--- a/util/StrDefs.ct
+++ b/util/StrDefs.ct
@@ -46,6 +46,8 @@ SOFTWARE.
******************************************************************/
#define Const const
+#include "StringDefs.h"
+#include "Shell.h"
<<<STRING_TABLE_GOES_HERE>>>
diff --git a/util/StrDefs.ht b/util/StrDefs.ht
index 2ce20562f..ceab2610f 100644
--- a/util/StrDefs.ht
+++ b/util/StrDefs.ht
@@ -52,6 +52,18 @@ SOFTWARE.
#define _XtStringDefs_h_Const const
#endif
+#ifndef XT_EXTERN_API
+# if defined(_MSC_VER) && defined(XT_DLL_EXPORTS)
+# ifdef XT_BUILD
+# define XT_EXTERN_API extern __declspec(dllexport)
+# else
+# define XT_EXTERN_API extern __declspec(dllimport)
+# endif
+# else
+# define XT_EXTERN_API extern
+# endif
+#endif
+
<<<STRING_TABLE_GOES_HERE>>>
#ifndef XTSTRINGDEFINES
diff --git a/util/string.list b/util/string.list
index 49ba7476e..753c592b3 100644
--- a/util/string.list
+++ b/util/string.list
@@ -6,7 +6,7 @@
#prefix Xt
#feature XTSTRINGDEFINES
-#externref extern
+#externref XT_EXTERN_API
#externdef
! note that the trailing space is required in the #externdef line.
#ctmpl util/StrDefs.ct
diff --git a/util/Shell.ht b/util/Shell.ht
index 500e0fd75..ac8fc2a2e 100644
--- a/util/Shell.ht
+++ b/util/Shell.ht
@@ -64,6 +64,18 @@ SOFTWARE.
#define _XtShell_h_Const const
#endif
+#ifndef XT_EXTERN_API
+# if defined(_MSC_VER) && defined(XT_DLL_EXPORTS)
+# ifdef XT_BUILD
+# define XT_EXTERN_API extern __declspec(dllexport)
+# else
+# define XT_EXTERN_API extern __declspec(dllimport)
+# endif
+# else
+# define XT_EXTERN_API extern
+# endif
+#endif
+
<<<STRING_TABLE_GOES_HERE>>>
#ifndef XTSTRINGDEFINES
diff --git a/include/X11/Intrinsic.h b/include/X11/Intrinsic.h
index 559697aa0..d11eb0955 100644
--- a/include/X11/Intrinsic.h
+++ b/include/X11/Intrinsic.h
@@ -106,7 +106,18 @@ typedef char *String;
#define externalref globalref
#define externaldef(psect) globaldef {"psect"} noshare
#else
-#define externalref extern
+#ifndef XT_EXTERN_API
+# if defined(_MSC_VER) && defined(XT_DLL_EXPORTS)
+# ifdef XT_BUILD
+# define XT_EXTERN_API extern __declspec(dllexport)
+# else
+# define XT_EXTERN_API extern __declspec(dllimport)
+# endif
+# else
+# define XT_EXTERN_API extern
+# endif
+#endif
+#define externalref XT_EXTERN_API
#define externaldef(psect)
#endif /* VMS */