summaryrefslogtreecommitdiff
path: root/lib/rb
diff options
context:
space:
mode:
authorjfarrell <jfarrell@apache.org>2014-01-06 22:51:22 -0500
committerjfarrell <jfarrell@apache.org>2014-01-06 22:51:22 -0500
commit05f37f1917bfa89d5862e4e45896bc6e28d8fa51 (patch)
treef71ac1ca13a44ad28fa96208ae223cecf8f8c7aa /lib/rb
parentf1612825584e219ff02f601da6691eae67e0878f (diff)
downloadthrift-05f37f1917bfa89d5862e4e45896bc6e28d8fa51.tar.gz
THRIFT-2219: Thrift gem fails to build on OS X Mavericks
Client: ruby Patch: Jake Farrell Adds builtin check to strlcpy.h header for ruby lib.
Diffstat (limited to 'lib/rb')
-rw-r--r--lib/rb/ext/strlcpy.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rb/ext/strlcpy.h b/lib/rb/ext/strlcpy.h
index c6f508f13..f6fe0fe6b 100644
--- a/lib/rb/ext/strlcpy.h
+++ b/lib/rb/ext/strlcpy.h
@@ -17,14 +17,18 @@
* under the License.
*/
-
#include <sys/types.h>
#include <string.h>
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#endif
+
#ifndef HAVE_STRLCPY
-size_t
-strlcpy (char *dst, const char *src, size_t dst_sz);
+size_t strlcpy (char *dst, const char *src, size_t dst_sz);
#else
+#if !__has_builtin(strlcpy)
extern size_t strlcpy(char *, const char *, size_t);
#endif
+#endif