summaryrefslogtreecommitdiff
path: root/include/m_string.h
diff options
context:
space:
mode:
authorJoerg Bruehe <joerg.bruehe@oracle.com>2012-01-19 17:05:47 +0100
committerJoerg Bruehe <joerg.bruehe@oracle.com>2012-01-19 17:05:47 +0100
commit316a60af6db522a71879960f4f5fbdd215a8d262 (patch)
treea12b1f153b8c80567b7de7941f08c25d55efa728 /include/m_string.h
parent2bffb8b1de54e74fee8d0cc72d58b08129d6c442 (diff)
downloadmariadb-git-316a60af6db522a71879960f4f5fbdd215a8d262.tar.gz
Compile fix needed for AIX,
to work around the lack of a bzero() prototype. include/m_string.h: AIX does have bzero() in its system libraries, and the configure phase detects it, including the prototype (sets both HAVE_BZERO and HAVE_DECL_BZERO), but the declaration is missing when the source is compiled. Several attempts all failed. This patch takes the brute force approach to always map "bzero()" to "memset()" on AIX, like is done on platforms where "bzero()" is not found at all.
Diffstat (limited to 'include/m_string.h')
-rw-r--r--include/m_string.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/m_string.h b/include/m_string.h
index e1cf7651519..dc916792f60 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -60,7 +60,9 @@
# define bfill(A,B,C) memset((A),(C),(B))
#endif
-#if !defined(bzero) && (!defined(HAVE_BZERO) || !defined(HAVE_DECL_BZERO))
+#if !defined(bzero) && (!defined(HAVE_BZERO) || !HAVE_DECL_BZERO || defined(_AIX))
+/* See autoconf doku: "HAVE_DECL_symbol" will be defined after configure, to 0 or 1 */
+/* AIX has bzero() as a function, but the declaration prototype is strangely hidden */
# define bzero(A,B) memset((A),0,(B))
#endif