THRIFT-2219: Thrift gem fails to build on OS X Mavericks
authorjfarrell <jfarrell@apache.org>
Tue, 7 Jan 2014 03:51:22 +0000 (22:51 -0500)
committerjfarrell <jfarrell@apache.org>
Tue, 7 Jan 2014 03:51:22 +0000 (22:51 -0500)
Client: ruby
Patch: Jake Farrell

Adds builtin check to strlcpy.h header for ruby lib.

lib/rb/ext/strlcpy.h

index c6f508f..f6fe0fe 100644 (file)
  * 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