summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKO Myung-Hun <komh78@gmail.com>2025-11-27 15:19:55 +0900
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-11-28 13:28:20 +0200
commitdf4c35bab48395aa432c76482d3020a6c34f9619 (patch)
treec19b6e4aabb1d26b5c3d91cc93cf2f662e08ea54
parent4cddf9d439ad786cc4b9f70352daf0c00ec32646 (diff)
downloadmeson-df4c35bab48395aa432c76482d3020a6c34f9619.tar.gz
templates: Define a macro for pubic APIs on OS/2
-rw-r--r--mesonbuild/templates/cpptemplates.py6
-rw-r--r--mesonbuild/templates/ctemplates.py6
-rw-r--r--mesonbuild/templates/objcpptemplates.py6
-rw-r--r--mesonbuild/templates/objctemplates.py6
4 files changed, 24 insertions, 0 deletions
diff --git a/mesonbuild/templates/cpptemplates.py b/mesonbuild/templates/cpptemplates.py
index 1c742cfaa..77e61e417 100644
--- a/mesonbuild/templates/cpptemplates.py
+++ b/mesonbuild/templates/cpptemplates.py
@@ -55,6 +55,12 @@ lib_hpp_template = '''#pragma once
#else
#define {utoken}_PUBLIC __declspec(dllimport)
#endif
+#elif defined __OS2__
+ #ifdef BUILDING_{utoken}
+ #define {utoken}_PUBLIC __declspec(dllexport)
+ #else
+ #define {utoken}_PUBLIC
+ #endif
#else
#ifdef BUILDING_{utoken}
#define {utoken}_PUBLIC __attribute__ ((visibility ("default")))
diff --git a/mesonbuild/templates/ctemplates.py b/mesonbuild/templates/ctemplates.py
index c2db1e5e2..134e43b3f 100644
--- a/mesonbuild/templates/ctemplates.py
+++ b/mesonbuild/templates/ctemplates.py
@@ -18,6 +18,12 @@ lib_h_template = '''#pragma once
#else
#define {utoken}_PUBLIC __declspec(dllimport)
#endif
+#elif defined __OS2__
+ #ifdef BUILDING_{utoken}
+ #define {utoken}_PUBLIC __declspec(dllexport)
+ #else
+ #define {utoken}_PUBLIC
+ #endif
#else
#ifdef BUILDING_{utoken}
#define {utoken}_PUBLIC __attribute__ ((visibility ("default")))
diff --git a/mesonbuild/templates/objcpptemplates.py b/mesonbuild/templates/objcpptemplates.py
index 1fdfa06a4..1f4bef431 100644
--- a/mesonbuild/templates/objcpptemplates.py
+++ b/mesonbuild/templates/objcpptemplates.py
@@ -18,6 +18,12 @@ lib_h_template = '''#pragma once
#else
#define {utoken}_PUBLIC __declspec(dllimport)
#endif
+#elif defined __OS2__
+ #ifdef BUILDING_{utoken}
+ #define {utoken}_PUBLIC __declspec(dllexport)
+ #else
+ #define {utoken}_PUBLIC
+ #endif
#else
#ifdef BUILDING_{utoken}
#define {utoken}_PUBLIC __attribute__ ((visibility ("default")))
diff --git a/mesonbuild/templates/objctemplates.py b/mesonbuild/templates/objctemplates.py
index 5603bae3b..8708d78e3 100644
--- a/mesonbuild/templates/objctemplates.py
+++ b/mesonbuild/templates/objctemplates.py
@@ -18,6 +18,12 @@ lib_h_template = '''#pragma once
#else
#define {utoken}_PUBLIC __declspec(dllimport)
#endif
+#elif defined __OS2__
+ #ifdef BUILDING_{utoken}
+ #define {utoken}_PUBLIC __declspec(dllexport)
+ #else
+ #define {utoken}_PUBLIC
+ #endif
#else
#ifdef BUILDING_{utoken}
#define {utoken}_PUBLIC __attribute__ ((visibility ("default")))