attempt to fix a compiler warning with fwrite return value being not used
This commit is contained in:
parent
92da79025d
commit
a7a9a5cb8f
2 changed files with 12 additions and 2 deletions
|
@ -19,7 +19,10 @@ The old flowers on grassland terrain (Ggf) has been removed in favour of ^Efm, i
|
|||
Maps containing the old terrain will no longer load.
|
||||
[/section]
|
||||
|
||||
[section="Another Change"]
|
||||
[section="Lua updated to 5.2"]
|
||||
Lua interpreter was updated to 5.2
|
||||
Some of the changes are not compatible, but still work due to the compatibility mode. The compatibility mode would be disabled after several minor releases, so it's best to rework the code according to http://www.lua.org/manual/5.2/manual.html#8
|
||||
Some of the changes in interpreter are not compatible but don't have a compatibility mode.
|
||||
[/section]
|
||||
|
||||
[section="Another Change"]
|
||||
|
|
|
@ -218,7 +218,14 @@
|
|||
*/
|
||||
#if defined(LUA_LIB) || defined(lua_c)
|
||||
#include <stdio.h>
|
||||
#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
|
||||
inline void fwrite_wrapper(const void * ptr, size_t size, size_t count, FILE * stream ) {
|
||||
size_t i = fwrite(ptr, size, count, stream);
|
||||
if (i != count * size) {
|
||||
puts("error in fwrite by lua, unexpected amount of bytes written");
|
||||
}
|
||||
}
|
||||
|
||||
#define luai_writestring(s,l) fwrite_wrapper((s), sizeof(char), (l), stdout)
|
||||
#define luai_writeline() (luai_writestring("\n", 1), fflush(stdout))
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue