From 97e2c8fc3d3aecc21709a6a4719aed26a5ecc34d Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 29 Sep 2015 17:58:37 -0400 Subject: [PATCH] Try to fix the Android build. --- source/text.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/text.cpp b/source/text.cpp index ccec5249..f826ad13 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -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;