Updated Branches:
  refs/heads/master f16128255 -> 05f37f191

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.


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/05f37f19
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/05f37f19
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/05f37f19

Branch: refs/heads/master
Commit: 05f37f1917bfa89d5862e4e45896bc6e28d8fa51
Parents: f161282
Author: jfarrell <[email protected]>
Authored: Mon Jan 6 22:51:22 2014 -0500
Committer: jfarrell <[email protected]>
Committed: Mon Jan 6 22:51:22 2014 -0500

----------------------------------------------------------------------
 lib/rb/ext/strlcpy.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/05f37f19/lib/rb/ext/strlcpy.h
----------------------------------------------------------------------
diff --git a/lib/rb/ext/strlcpy.h b/lib/rb/ext/strlcpy.h
index c6f508f..f6fe0fe 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
 

Reply via email to