aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-30 17:54:32 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-02 06:59:44 +0000
commit2fe8708a47ea47ae709f7fc432e28caff6e649f0 (patch)
treee9b4f6b0b70d70ea1a32299d7488cb4801a4388d /sources
parent4a93787a78fac4a3cf0942247281e68bd86f47e9 (diff)
shiboken6 tests: Consolidate import/export macrcos
Following 430d02db24b95a56ae0acc6a9df6a0effe49da0d, base them on libminimal. Change-Id: I722a73e6f45344cbc91fb044bdf1f015bdff5ec2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/tests/libminimal/libminimalmacros.h28
-rw-r--r--sources/shiboken6/tests/libother/libothermacros.h23
-rw-r--r--sources/shiboken6/tests/libsample/libsamplemacros.h23
-rw-r--r--sources/shiboken6/tests/libsmart/libsmartmacros.h23
4 files changed, 46 insertions, 51 deletions
diff --git a/sources/shiboken6/tests/libminimal/libminimalmacros.h b/sources/shiboken6/tests/libminimal/libminimalmacros.h
index a9c417624..99ff667db 100644
--- a/sources/shiboken6/tests/libminimal/libminimalmacros.h
+++ b/sources/shiboken6/tests/libminimal/libminimalmacros.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of Qt for Python.
@@ -29,18 +29,22 @@
#ifndef LIBMINIMALMACROS_H
#define LIBMINIMALMACROS_H
-#if defined _WIN32 || defined __CYGWIN__
- #if LIBMINIMAL_BUILD
- #define LIBMINIMAL_API __declspec(dllexport)
- #else
- #define LIBMINIMAL_API __declspec(dllimport)
- #endif
+#if defined _WIN32
+# define LIBMINIMAL_EXPORT __declspec(dllexport)
+# ifdef _MSC_VER
+# define LIBMINIMAL_IMPORT __declspec(dllimport)
+# else
+# define LIBMINIMAL_IMPORT
+# endif
#else
-#if __GNUC__ >= 4
- #define LIBMINIMAL_API __attribute__ ((visibility("default")))
-#else
- #define LIBMINIMAL_API
-#endif
+# define LIBMINIMAL_EXPORT __attribute__ ((visibility("default")))
+# define LIBMINIMAL_IMPORT
#endif
+#ifdef LIBMINIMAL_BUILD
+# define LIBMINIMAL_API LIBMINIMAL_EXPORT
+#else
+# define LIBMINIMAL_API LIBMINIMAL_IMPORT
#endif
+
+#endif // LIBMINIMALMACROS_H
diff --git a/sources/shiboken6/tests/libother/libothermacros.h b/sources/shiboken6/tests/libother/libothermacros.h
index 757e9a304..e5207064f 100644
--- a/sources/shiboken6/tests/libother/libothermacros.h
+++ b/sources/shiboken6/tests/libother/libothermacros.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of Qt for Python.
@@ -29,18 +29,15 @@
#ifndef LIBOTHERMACROS_H
#define LIBOTHERMACROS_H
-#if defined _WIN32 || defined __CYGWIN__
- #if LIBOTHER_BUILD
- #define LIBOTHER_API __declspec(dllexport)
- #else
- #define LIBOTHER_API __declspec(dllimport)
- #endif
-#else
-#if __GNUC__ >= 4
- #define LIBOTHER_API __attribute__ ((visibility("default")))
+#include "../libminimal/libminimalmacros.h"
+
+#define LIBOTHER_EXPORT LIBMINIMAL_EXPORT
+#define LIBOTHER_IMPORT LIBMINIMAL_IMPORT
+
+#ifdef LIBOTHER_BUILD
+# define LIBOTHER_API LIBOTHER_EXPORT
#else
- #define LIBOTHER_API
-#endif
+# define LIBOTHER_API LIBOTHER_IMPORT
#endif
-#endif
+#endif // LIBOTHERMACROS_H
diff --git a/sources/shiboken6/tests/libsample/libsamplemacros.h b/sources/shiboken6/tests/libsample/libsamplemacros.h
index cda029ab7..e85b0fd5b 100644
--- a/sources/shiboken6/tests/libsample/libsamplemacros.h
+++ b/sources/shiboken6/tests/libsample/libsamplemacros.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of Qt for Python.
@@ -29,18 +29,15 @@
#ifndef LIBSAMPLEMACROS_H
#define LIBSAMPLEMACROS_H
-#if defined _WIN32 || defined __CYGWIN__
- #if LIBSAMPLE_BUILD
- #define LIBSAMPLE_API __declspec(dllexport)
- #else
- #define LIBSAMPLE_API __declspec(dllimport)
- #endif
-#else
-#if __GNUC__ >= 4
- #define LIBSAMPLE_API __attribute__ ((visibility("default")))
+#include "../libminimal/libminimalmacros.h"
+
+#define LIBSAMPLE_EXPORT LIBMINIMAL_EXPORT
+#define LIBSAMPLE_IMPORT LIBMINIMAL_IMPORT
+
+#ifdef LIBSAMPLE_BUILD
+# define LIBSAMPLE_API LIBSAMPLE_EXPORT
#else
- #define LIBSAMPLE_API
-#endif
+# define LIBSAMPLE_API LIBSAMPLE_IMPORT
#endif
-#endif
+#endif // LIBSAMPLEMACROS_H
diff --git a/sources/shiboken6/tests/libsmart/libsmartmacros.h b/sources/shiboken6/tests/libsmart/libsmartmacros.h
index d85e219bb..03edab049 100644
--- a/sources/shiboken6/tests/libsmart/libsmartmacros.h
+++ b/sources/shiboken6/tests/libsmart/libsmartmacros.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of Qt for Python.
@@ -29,18 +29,15 @@
#ifndef LIB_SMART_MACROS_H
#define LIB_SMART_MACROS_H
-#if defined _WIN32 || defined __CYGWIN__
- #if LIBSMART_BUILD
- #define LIB_SMART_API __declspec(dllexport)
- #else
- #define LIB_SMART_API __declspec(dllimport)
- #endif
-#else
-#if __GNUC__ >= 4
- #define LIB_SMART_API __attribute__ ((visibility("default")))
+#include "../libminimal/libminimalmacros.h"
+
+#define LIB_SMART_EXPORT LIBMINIMAL_EXPORT
+#define LIB_SMART_IMPORT LIBMINIMAL_IMPORT
+
+#ifdef LIBSMART_BUILD
+# define LIB_SMART_API LIB_SMART_EXPORT
#else
- #define LIB_SMART_API
-#endif
+# define LIB_SMART_API LIB_SMART_IMPORT
#endif
-#endif
+#endif // LIB_SMART_MACROS_H