Try to fix the Android build.
authorDejan Mircevski <deki@google.com>
Tue, 29 Sep 2015 21:58:37 +0000 (17:58 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
source/text.cpp

index ccec524..f826ad1 100644 (file)
@@ -162,12 +162,12 @@ spv_result_t encodeImmediate(libspirv::AssemblyContext* context,
   assert(*text == '!');
   const char* begin = text + 1;
   char* end = nullptr;
-  const uint64_t parseResult = std::strtoull(begin, &end, 0);
+  const uint64_t parseResult = strtoull(begin, &end, 0);
   size_t length = end - begin;
   if (length != strlen(begin)) {
     context->diagnostic() << "Invalid immediate integer '" << text << "'.";
     return SPV_ERROR_INVALID_TEXT;
-  } else if (length > 10 || parseResult > UINT32_MAX) {
+  } else if (length > 10 || (parseResult >> 32) != 0) {
     context->diagnostic() << "Immediate integer '" << text
                           << "' is over 32 bits.";
     return SPV_ERROR_INVALID_TEXT;