Bump version to 49:0
[folly.git] / folly / Checksum.cpp
index 3882a6e8c13f28951aaa7b728ecc3c30410ace59..a7afa352b8a789eac91c23725b9983032f89c67e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,15 @@ namespace folly {
 
 namespace detail {
 
-#if FOLLY_X64 && defined(__GNUC__) && defined(__GNUC_MINOR__) && \
-    (((__GNUC__ * 100) + __GNUC_MINOR__) >= 407)
+#ifndef __has_builtin
+  /* nolint */
+  #define __has_builtin(x) 0
+#endif
+
+#if (__has_builtin(__builtin_ia32_crc32qi) && \
+     __has_builtin(__builtin_ia32_crc32di)) || \
+    (FOLLY_X64 && defined(__GNUC__) && defined(__GNUC_MINOR__) && \
+     (((__GNUC__ * 100) + __GNUC_MINOR__) >= 407))
 
 // Fast SIMD implementation of CRC-32C for x86 with SSE 4.2
 uint32_t crc32c_hw(const uint8_t *data, size_t nbytes,