diff options
author | Neil Moore <neil@s-z.org> | 2014-05-31 14:45:18 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-05-31 14:55:47 -0400 |
commit | 412fe291f11fef02f2e00c0323c4c9c616929459 (patch) | |
tree | 5ec315f78436d09203f93e504477ead4163e1b64 /crawl-ref/source/libutil.cc | |
parent | 48301db05228478240d016ade7e603fa2d9ca79c (diff) | |
download | crawl-ref-412fe291f11fef02f2e00c0323c4c9c616929459.tar.gz crawl-ref-412fe291f11fef02f2e00c0323c4c9c616929459.zip |
Don't redefine strlcpy if it already exists.
Check for strlcpy at compile time and define our version only if
necessary.
This should fix recurrent warnings on Macs (and probably other BSDs).
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r-- | crawl-ref/source/libutil.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 1b76dd4d09..50fc9739a1 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -1070,6 +1070,7 @@ void cscroll(int n, GotoRegion region) mouse_mode mouse_control::ms_current_mode = MOUSE_MODE_NORMAL; +#ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t n) { if (!n) @@ -1090,6 +1091,7 @@ size_t strlcpy(char *dst, const char *src, size_t n) return s - src - 1; } +#endif string unwrap_desc(string desc) { |