Fix build errors on Linux
This commit is contained in:
parent
357cd6f43b
commit
44312b9653
@ -34,7 +34,8 @@ size_t AMXAPI aux_ProgramSize(char *filename)
|
||||
|
||||
if ((fp=fopen(filename,"rb")) == NULL)
|
||||
return 0;
|
||||
(void)fread(&hdr, sizeof hdr, 1, fp);
|
||||
if (fread(&hdr, sizeof hdr, 1, fp) < 1)
|
||||
return 0;
|
||||
fclose(fp);
|
||||
|
||||
amx_Align16(&hdr.magic);
|
||||
@ -51,7 +52,8 @@ int AMXAPI aux_LoadProgram(AMX *amx, char *filename, void *memblock)
|
||||
/* open the file, read and check the header */
|
||||
if ((fp = fopen(filename, "rb")) == NULL)
|
||||
return AMX_ERR_NOTFOUND;
|
||||
(void)fread(&hdr, sizeof hdr, 1, fp);
|
||||
if (fread(&hdr, sizeof hdr, 1, fp) < 1)
|
||||
return AMX_ERR_INIT;
|
||||
amx_Align16(&hdr.magic);
|
||||
amx_Align32((uint32_t *)&hdr.size);
|
||||
amx_Align32((uint32_t *)&hdr.stp);
|
||||
@ -73,7 +75,8 @@ int AMXAPI aux_LoadProgram(AMX *amx, char *filename, void *memblock)
|
||||
|
||||
/* read in the file */
|
||||
rewind(fp);
|
||||
(void)fread(memblock, 1, (size_t)hdr.size, fp);
|
||||
if (fread(memblock, 1, (size_t)hdr.size, fp) < (size_t)hdr.size)
|
||||
return AMX_ERR_INIT;
|
||||
fclose(fp);
|
||||
|
||||
/* initialize the abstract machine */
|
||||
|
@ -174,8 +174,8 @@ set(PAWNRUNS_SRCS
|
||||
../amx/amxcore.c
|
||||
)
|
||||
if(UNIX)
|
||||
set(PAWNRUN_SRCS
|
||||
${PAWNRUN_SRCS}
|
||||
set(PAWNRUNS_SRCS
|
||||
${PAWNRUNS_SRCS}
|
||||
../linux/getch.c
|
||||
../linux/getch.h
|
||||
../linux/binreloc.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user