aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/common/global.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
commit3565aad630864ecdbe53fdaa501ea708555b3c7c (patch)
treec743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /SQLiteStudio3/coreSQLiteStudio/common/global.h
parent1fdc150116cad39aae5c5da407c3312b47a59e3a (diff)
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/common/global.h')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/common/global.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/common/global.h b/SQLiteStudio3/coreSQLiteStudio/common/global.h
index e09391a..c056abb 100644
--- a/SQLiteStudio3/coreSQLiteStudio/common/global.h
+++ b/SQLiteStudio3/coreSQLiteStudio/common/global.h
@@ -39,9 +39,7 @@
var = nullptr; \
}
-#define parser_safe_delete(var) \
- if (var) \
- delete var
+#define parser_safe_delete(var) delete var
#define static_char static constexpr const char
@@ -74,4 +72,19 @@
#define STRINGIFY(s) _STRINGIFY(s)
#define _STRINGIFY(s) #s
+#define __SQLS_INIT_RESOURCE(proj, name) Q_INIT_RESOURCE(proj ## _ ## name)
+#define __SQLS_CLEANUP_RESOURCE(proj, name) Q_CLEANUP_RESOURCE(proj ## _ ## name)
+#define _SQLS_INIT_RESOURCE(pname, name) __SQLS_INIT_RESOURCE(pname, name)
+#define _SQLS_CLEANUP_RESOURCE(pname, name) __SQLS_CLEANUP_RESOURCE(pname, name)
+
+// These are replacements for Qt's macros to cover customized resource naming,
+// which is used to avoid duplication of qmake_qmake_qm_files resource initialization function across different shared libraries.
+#ifdef PROJECT_MODULE_NAME
+# define SQLS_INIT_RESOURCE(name) _SQLS_INIT_RESOURCE(PROJECT_MODULE_NAME, name)
+# define SQLS_CLEANUP_RESOURCE(name) _SQLS_CLEANUP_RESOURCE(PROJECT_MODULE_NAME, name)
+#else
+# define SQLS_INIT_RESOURCE(name)
+# define SQLS_CLEANUP_RESOURCE(name)
+#endif
+
#endif // GLOBAL_H