Add MaxString<__uint128_t>
authorTim Hanson <thanson@fb.com>
Thu, 3 Oct 2013 20:17:10 +0000 (13:17 -0700)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:45:52 +0000 (18:45 -0700)
Summary: For GCC 3.6+, define a template specialization for MaxString<__uint128_t>.

@override-unit-failures

Test Plan: Unit tests

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D995290

folly/Conv.cpp

index 6dfede7ce6487d020974d56ed530ee0cc57662ea..4796e87ad19f464bddc617f34cca9e1509e7caaf 100644 (file)
@@ -46,6 +46,12 @@ static_assert(sizeof(unsigned long long) >= 8,
               "Wrong value for MaxString<unsigned long long>::value"
               ", please update.");
 
               "Wrong value for MaxString<unsigned long long>::value"
               ", please update.");
 
+/* Test for GCC >= 3.6.0 */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ >= 6))
+template <> const char *const MaxString<__uint128_t>::value =
+  "340282366920938463463374607431768211455";
+#endif
+
 inline bool bool_str_cmp(const char** b, size_t len, const char* value) {
   // Can't use strncasecmp, since we want to ensure that the full value matches
   const char* p = *b;
 inline bool bool_str_cmp(const char** b, size_t len, const char* value) {
   // Can't use strncasecmp, since we want to ensure that the full value matches
   const char* p = *b;