summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-07-12 19:43:58 -0400
committerNeil Moore <neil@s-z.org>2014-07-12 20:56:08 -0400
commitac4b98f7f12b67270b0aa685eb4ca1484c20cc8b (patch)
tree936a248c07d795199f40e2e5d79ba50023901c8b
parent758800ef84f60adf6848dbecd55ec8ba8d8dbc6a (diff)
downloadcrawl-ref-ac4b98f7f12b67270b0aa685eb4ca1484c20cc8b.tar.gz
crawl-ref-ac4b98f7f12b67270b0aa685eb4ca1484c20cc8b.zip
Avoid conflict with libraries' HAVE_*
-rw-r--r--crawl-ref/source/libutil.cc2
-rw-r--r--crawl-ref/source/libutil.h2
-rw-r--r--crawl-ref/source/syscalls.cc4
-rw-r--r--crawl-ref/source/syscalls.h2
-rwxr-xr-xcrawl-ref/source/util/configure17
5 files changed, 16 insertions, 11 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 50fc9739a1..9896ccade3 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -1070,7 +1070,7 @@ void cscroll(int n, GotoRegion region)
mouse_mode mouse_control::ms_current_mode = MOUSE_MODE_NORMAL;
-#ifndef HAVE_STRLCPY
+#ifndef CRAWL_HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t n)
{
if (!n)
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index 667f6d40cc..22c9daa888 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -74,7 +74,7 @@ static inline ucs_t toalower(ucs_t c)
int numcmp(const char *a, const char *b, int limit = 0);
bool numcmpstr(string a, string b);
-#ifdef HAVE_STRLCPY
+#ifdef CRAWL_HAVE_STRLCPY
#include <cstring>
#else
size_t strlcpy(char *dst, const char *src, size_t n);
diff --git a/crawl-ref/source/syscalls.cc b/crawl-ref/source/syscalls.cc
index 7ae3831217..c9d9b02c02 100644
--- a/crawl-ref/source/syscalls.cc
+++ b/crawl-ref/source/syscalls.cc
@@ -117,7 +117,7 @@ void alarm(unsigned int seconds)
}
# endif
-# ifndef HAVE_FDATASYNC
+# ifndef CRAWL_HAVE_FDATASYNC
// implementation by Richard W.M. Jones
// He claims this is the equivalent to fsync(), reading the MSDN doesn't seem
// to show that vital metadata is indeed flushed, others report that at least
@@ -180,7 +180,7 @@ int mkstemp(char *dummy)
#else
// non-Windows
-# ifndef HAVE_FDATASYNC
+# ifndef CRAWL_HAVE_FDATASYNC
// At least MacOS X 10.6 has it (as required by Posix) but present only
// as a symbol in the libraries without a proper header.
int fdatasync(int fd)
diff --git a/crawl-ref/source/syscalls.h b/crawl-ref/source/syscalls.h
index 0262e18467..8bbb832ae9 100644
--- a/crawl-ref/source/syscalls.h
+++ b/crawl-ref/source/syscalls.h
@@ -22,7 +22,7 @@ int mkstemp(char *dummy);
# endif
#endif
-#ifndef HAVE_FDATASYNC
+#ifndef CRAWL_HAVE_FDATASYNC
int fdatasync(int fd);
#endif
diff --git a/crawl-ref/source/util/configure b/crawl-ref/source/util/configure
index c720630cbc..bb66104055 100755
--- a/crawl-ref/source/util/configure
+++ b/crawl-ref/source/util/configure
@@ -1,8 +1,7 @@
#!/bin/sh
CXX="$1"
-if [ -z "$CXX" ]
- then
+if [ -z "$CXX" ]; then
echo >&2 "CXX not specified"
exit 1
fi
@@ -17,8 +16,11 @@ int main()
}
END
-$CXX "$@" -c conftest.cc >/dev/null 2>/dev/null &&
- FDATASYNC="#define HAVE_FDATASYNC" || FDATASYNC="#undef HAVE_FDATASYNC"
+if $CXX "$@" -c conftest.cc >/dev/null 2>/dev/null; then
+ FDATASYNC="#define CRAWL_HAVE_FDATASYNC"
+else
+ FDATASYNC="#undef CRAWL_HAVE_FDATASYNC"
+fi
rm -f conftest.cc conftest.o
cat <<END >conftest.cc
@@ -32,8 +34,11 @@ int main()
}
END
-$CXX "$@" -c conftest.cc >/dev/null 2>/dev/null &&
- STRLCPY="#define HAVE_STRLCPY" || STRLCPY="#undef HAVE_STRLCPY"
+if $CXX "$@" -c conftest.cc >/dev/null 2>/dev/null; then
+ STRLCPY="#define CRAWL_HAVE_STRLCPY"
+else
+ STRLCPY="#undef CRAWL_HAVE_STRLCPY"
+fi
rm -f conftest.cc conftest.o
cat <<END >config.h