summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-12-04 14:05:15 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-12-04 15:45:07 +0100
commita5130f2b3d9c4967ea1bb28a34d3ca627aff82f7 (patch)
tree7d47f27138e94cea75819456a9e271e9e190a70d /connectivity
parent06bd9ca29686a220e4615474bd9ddf232397d1c8 (diff)
Use SAL_STRINGIFY
Change-Id: I0a82d32b93369461c2edaff5524bfdd0d1752359 Reviewed-on: https://gerrit.libreoffice.org/84408 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/postgresql/pq_databasemetadata.cxx23
1 files changed, 10 insertions, 13 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index 4002d2fc866a..2f704c4e5fb1 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -72,7 +72,7 @@
#include "pq_tools.hxx"
#include <rtl/ustrbuf.hxx>
-
+#include <sal/macros.h>
#include <com/sun/star/sdbc/TransactionIsolation.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbc/XPreparedStatement.hpp>
@@ -97,13 +97,10 @@ using com::sun::star::uno::UNO_QUERY_THROW;
namespace pq_sdbc_driver
{
-#define QUOTEME(X) #X
-#define STRINGIFY(X) QUOTEME(X)
-
// These are pre-processor versions of KeyRule.idl declarations
// These are inherited from JDBC, and thus won't change anytime soon.
// Having them as pre-processor definitions allows to include them
-// into compile-time strings (through STRINGIFY), which can be passed to ASCII_STR.
+// into compile-time strings (through SAL_STRINGIFY), which can be passed to ASCII_STR.
// That is without resorting to horrendous hacks in template meta-programming.
#define KEYRULE_CASCADE 0
#define KEYRULE_RESTRICT 1
@@ -1811,11 +1808,11 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys(
}
// Copied / adapted / simplified from JDBC driver
-#define SQL_CASE_KEYRULE " WHEN 'c' THEN " STRINGIFY(KEYRULE_CASCADE) \
- " WHEN 'n' THEN " STRINGIFY(KEYRULE_SET_NULL) \
- " WHEN 'd' THEN " STRINGIFY(KEYRULE_SET_DEFAULT) \
- " WHEN 'r' THEN " STRINGIFY(KEYRULE_RESTRICT) \
- " WHEN 'a' THEN " STRINGIFY(KEYRULE_NO_ACTION) \
+#define SQL_CASE_KEYRULE " WHEN 'c' THEN " SAL_STRINGIFY(KEYRULE_CASCADE) \
+ " WHEN 'n' THEN " SAL_STRINGIFY(KEYRULE_SET_NULL) \
+ " WHEN 'd' THEN " SAL_STRINGIFY(KEYRULE_SET_DEFAULT) \
+ " WHEN 'r' THEN " SAL_STRINGIFY(KEYRULE_RESTRICT) \
+ " WHEN 'a' THEN " SAL_STRINGIFY(KEYRULE_NO_ACTION) \
" ELSE NULL "
#define SQL_GET_REFERENCES \
@@ -1831,9 +1828,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys(
" END AS DELETE_RULE, " \
" con.conname AS FK_NAME, pkic.relname AS PK_NAME, " \
" CASE " \
- " WHEN con.condeferrable AND con.condeferred THEN " STRINGIFY(DEFERRABILITY_INITIALLY_DEFERRED) \
- " WHEN con.condeferrable THEN " STRINGIFY(DEFERRABILITY_INITIALLY_IMMEDIATE) \
- " ELSE " STRINGIFY(DEFERRABILITY_NONE) \
+ " WHEN con.condeferrable AND con.condeferred THEN " SAL_STRINGIFY(DEFERRABILITY_INITIALLY_DEFERRED) \
+ " WHEN con.condeferrable THEN " SAL_STRINGIFY(DEFERRABILITY_INITIALLY_IMMEDIATE) \
+ " ELSE " SAL_STRINGIFY(DEFERRABILITY_NONE) \
" END AS DEFERRABILITY " \
"FROM " \
" pg_catalog.pg_namespace pkn, pg_catalog.pg_class pkc, pg_catalog.pg_attribute pka, " \