summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-09-12 01:03:26 +0200
committerHaru <haru@dotalux.com>2016-10-02 17:26:07 +0200
commitd235a0ef5897aa0a145a79a4d41eed7257c246b7 (patch)
tree2d06ce7befdfda6a3fdd387d0aa14912332dbbdf
parent0933e9bb5b3842252ced04a3c523511ade68d743 (diff)
downloadhercules-d235a0ef5897aa0a145a79a4d41eed7257c246b7.tar.gz
hercules-d235a0ef5897aa0a145a79a4d41eed7257c246b7.tar.bz2
hercules-d235a0ef5897aa0a145a79a4d41eed7257c246b7.tar.xz
hercules-d235a0ef5897aa0a145a79a4d41eed7257c246b7.zip
Changed _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") to target GCC 4.6 instead of 4.5
- The support on GCC 4.5 is incomplete, and in order to build Hercules, GCC >= 4.6 is recommended Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/common/cbasetypes.h12
-rw-r--r--src/common/sql.c6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 33d617b13..98c3552c4 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -291,12 +291,12 @@ typedef uintptr_t uintptr;
#define GCC_VERSION 0
#endif
-// Pragma macro only enabled on gcc >= 4.5 or clang - borrowed from Mana Plus
-#if defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
-#define PRAGMA_GCC45(str) _Pragma(#str)
-#else // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
-#define PRAGMA_GCC45(str)
-#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
+// Pragma macro only enabled on gcc >= 4.6 or clang - borrowed from Mana Plus
+#if defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
+#define PRAGMA_GCC46(str) _Pragma(#str)
+#else // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
+#define PRAGMA_GCC46(str)
+#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
// fallthrough attribute only enabled on gcc >= 7.0
#if defined(__GNUC__) && (GCC_VERSION >= 70000)
diff --git a/src/common/sql.c b/src/common/sql.c
index 7e3e2e46f..8da105872 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -664,8 +664,8 @@ int SqlStmt_BindParam(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_
if (idx >= self->max_params)
return SQL_SUCCESS; // out of range - ignore
-PRAGMA_GCC45(GCC diagnostic push)
-PRAGMA_GCC45(GCC diagnostic ignored "-Wcast-qual")
+PRAGMA_GCC46(GCC diagnostic push)
+PRAGMA_GCC46(GCC diagnostic ignored "-Wcast-qual")
/*
* MySQL uses the same struct with a non-const buffer for both
* parameters (input) and columns (output).
@@ -673,7 +673,7 @@ PRAGMA_GCC45(GCC diagnostic ignored "-Wcast-qual")
* dropping a const qualifier here.
*/
return Sql_P_BindSqlDataType(self->params+idx, buffer_type, (void *)buffer, buffer_len, NULL, NULL);
-PRAGMA_GCC45(GCC diagnostic pop)
+PRAGMA_GCC46(GCC diagnostic pop)
}
/// Executes the prepared statement.