Compiler: Fix linux compilation and close file handle on success in pc_opensrc.
This commit is contained in:
parent
e46785a434
commit
f30c7a63b1
@ -56,6 +56,10 @@
|
|||||||
}
|
}
|
||||||
#endif /* PAWNC_DLL */
|
#endif /* PAWNC_DLL */
|
||||||
|
|
||||||
|
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* pc_printf()
|
/* pc_printf()
|
||||||
* Called for general purpose "console" output. This function prints general
|
* Called for general purpose "console" output. This function prints general
|
||||||
@ -175,6 +179,7 @@ void *pc_opensrc(char *filename)
|
|||||||
|
|
||||||
src->pos = src->buffer;
|
src->pos = src->buffer;
|
||||||
src->end = src->buffer + length;
|
src->end = src->buffer + length;
|
||||||
|
fclose(fp);
|
||||||
return src;
|
return src;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user