Fix msvc build.
This commit is contained in:
+2
-2
@@ -5,9 +5,9 @@ os: Visual Studio 2015
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
# - { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 } # missing strtoull()
|
- { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 }
|
||||||
### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # AppVeyor: x64 compiler is not installed
|
### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # AppVeyor: x64 compiler is not installed
|
||||||
# - { C: msvc-11.0-x86, CL_VERSION: 17.00, VS_VERSION: 2012 } # missing strtoull()
|
- { C: msvc-11.0-x86, CL_VERSION: 17.00, VS_VERSION: 2012 }
|
||||||
### - { C: msvc-11.0-x64, CL_VERSION: 17.00, VS_VERSION: 2012 } # AppVeyor: x64 compiler is not installed
|
### - { C: msvc-11.0-x64, CL_VERSION: 17.00, VS_VERSION: 2012 } # AppVeyor: x64 compiler is not installed
|
||||||
- { C: msvc-12.0-x86, CL_VERSION: 18.00, VS_VERSION: 2013 }
|
- { C: msvc-12.0-x86, CL_VERSION: 18.00, VS_VERSION: 2013 }
|
||||||
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
|
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
|
||||||
|
|||||||
+9
-4
@@ -307,13 +307,18 @@ void ElfLinker::preprocessRelocations(char *start, char *end)
|
|||||||
char sign = *p;
|
char sign = *p;
|
||||||
*p = 0; // terminate the symbol name
|
*p = 0; // terminate the symbol name
|
||||||
p += 3;
|
p += 3;
|
||||||
|
|
||||||
assert(strlen(p) == 8 || strlen(p) == 16);
|
assert(strlen(p) == 8 || strlen(p) == 16);
|
||||||
|
#if (ACC_CC_MSC && (_MSC_VER < 1800))
|
||||||
|
unsigned a = 0, b = 0;
|
||||||
|
if (sscanf(p, "%08x%08x", &a, &b) == 2)
|
||||||
|
add = ((upx_uint64_t)a << 32) | b;
|
||||||
|
else
|
||||||
|
add = a;
|
||||||
|
#else
|
||||||
char *endptr = NULL;
|
char *endptr = NULL;
|
||||||
upx_uint64_t ull = strtoull(p, &endptr, 16);
|
add = strtoull(p, &endptr, 16);
|
||||||
add = (upx_uint64_t) ull;
|
|
||||||
assert(add == ull);
|
|
||||||
assert(endptr && *endptr == '\0');
|
assert(endptr && *endptr == '\0');
|
||||||
|
#endif
|
||||||
if (sign == '-')
|
if (sign == '-')
|
||||||
add = 0 - add;
|
add = 0 - add;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user