mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-16 06:00:33 +01:00
engine: whereami: fix C89 in Android detection
This commit is contained in:
parent
067e9be37a
commit
c025606739
@ -295,6 +295,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
|||||||
&&buffer[length - 3] == 'a'
|
&&buffer[length - 3] == 'a'
|
||||||
&&buffer[length - 4] == '.')
|
&&buffer[length - 4] == '.')
|
||||||
{
|
{
|
||||||
|
char *begin, *p;
|
||||||
int fd = open(path, O_RDONLY);
|
int fd = open(path, O_RDONLY);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
@ -302,7 +303,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* begin = (char*)mmap(0, offset, PROT_READ, MAP_SHARED, fd, 0);
|
begin = (char*)mmap(0, offset, PROT_READ, MAP_SHARED, fd, 0);
|
||||||
if (begin == MAP_FAILED)
|
if (begin == MAP_FAILED)
|
||||||
{
|
{
|
||||||
close(fd);
|
close(fd);
|
||||||
@ -310,7 +311,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* p = begin + offset - 30; // minimum size of local file header
|
p = begin + offset - 30; // minimum size of local file header
|
||||||
while (p >= begin) // scan backwards
|
while (p >= begin) // scan backwards
|
||||||
{
|
{
|
||||||
if (*((uint32_t*)p) == 0x04034b50UL) // local file header signature found
|
if (*((uint32_t*)p) == 0x04034b50UL) // local file header signature found
|
||||||
|
Loading…
Reference in New Issue
Block a user