Fix build errors on Linux
This commit is contained in:
parent
6e6f37b54a
commit
357cd6f43b
@ -34,7 +34,7 @@ size_t AMXAPI aux_ProgramSize(char *filename)
|
|||||||
|
|
||||||
if ((fp=fopen(filename,"rb")) == NULL)
|
if ((fp=fopen(filename,"rb")) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
fread(&hdr, sizeof hdr, 1, fp);
|
(void)fread(&hdr, sizeof hdr, 1, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
amx_Align16(&hdr.magic);
|
amx_Align16(&hdr.magic);
|
||||||
@ -51,7 +51,7 @@ int AMXAPI aux_LoadProgram(AMX *amx, char *filename, void *memblock)
|
|||||||
/* open the file, read and check the header */
|
/* open the file, read and check the header */
|
||||||
if ((fp = fopen(filename, "rb")) == NULL)
|
if ((fp = fopen(filename, "rb")) == NULL)
|
||||||
return AMX_ERR_NOTFOUND;
|
return AMX_ERR_NOTFOUND;
|
||||||
fread(&hdr, sizeof hdr, 1, fp);
|
(void)fread(&hdr, sizeof hdr, 1, fp);
|
||||||
amx_Align16(&hdr.magic);
|
amx_Align16(&hdr.magic);
|
||||||
amx_Align32((uint32_t *)&hdr.size);
|
amx_Align32((uint32_t *)&hdr.size);
|
||||||
amx_Align32((uint32_t *)&hdr.stp);
|
amx_Align32((uint32_t *)&hdr.stp);
|
||||||
@ -73,7 +73,7 @@ int AMXAPI aux_LoadProgram(AMX *amx, char *filename, void *memblock)
|
|||||||
|
|
||||||
/* read in the file */
|
/* read in the file */
|
||||||
rewind(fp);
|
rewind(fp);
|
||||||
fread(memblock, 1, (size_t)hdr.size, fp);
|
(void)fread(memblock, 1, (size_t)hdr.size, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
/* initialize the abstract machine */
|
/* initialize the abstract machine */
|
||||||
|
@ -171,8 +171,20 @@ set(PAWNRUNS_SRCS
|
|||||||
../amx/amxaux.c
|
../amx/amxaux.c
|
||||||
../amx/amxaux.h
|
../amx/amxaux.h
|
||||||
../amx/amxcons.c
|
../amx/amxcons.c
|
||||||
../amx/amxcore.c)
|
../amx/amxcore.c
|
||||||
|
)
|
||||||
|
if(UNIX)
|
||||||
|
set(PAWNRUN_SRCS
|
||||||
|
${PAWNRUN_SRCS}
|
||||||
|
../linux/getch.c
|
||||||
|
../linux/getch.h
|
||||||
|
../linux/binreloc.c
|
||||||
|
)
|
||||||
|
endif()
|
||||||
add_executable(pawnruns ${PAWNRUNS_SRCS})
|
add_executable(pawnruns ${PAWNRUNS_SRCS})
|
||||||
|
if(UNIX)
|
||||||
|
target_link_libraries(pawnruns dl)
|
||||||
|
endif()
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
# Generate a binary package with CPack
|
# Generate a binary package with CPack
|
||||||
|
Loading…
x
Reference in New Issue
Block a user