aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/common/global.h
diff options
context:
space:
mode:
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