Fix Windows build, clean up included headers
authorSmallJoker <mk939@ymail.com>
Fri, 22 May 2015 16:26:18 +0000 (18:26 +0200)
committerest31 <MTest31@outlook.com>
Fri, 22 May 2015 18:37:59 +0000 (20:37 +0200)
Also fix a startup error caused by s_security.cpp

src/objdef.cpp
src/objdef.h
src/script/cpp_api/s_security.cpp

index 465bea44c530898f805d90a209cc00afe0d3b879..08d6844fc135487818ffc73f8a33bcba49e90b32 100644 (file)
@@ -17,11 +17,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#include <strings.h>
 #include "objdef.h"
 #include "util/numeric.h"
-#include "debug.h"
-#include "porting.h"
 #include "log.h"
 #include "gamedef.h"
 
index 9e0c0b001786e3d4d49172f641f0e1bec8a96c24..65e5c0176fe1ffb02c719488d155b92bbeddd70a 100644 (file)
@@ -20,9 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef OBJDEF_HEADER
 #define OBJDEF_HEADER
 
-#include <string>
-#include <vector>
-#include "irrlichttypes.h"
+#include "porting.h"
 
 class IGameDef;
 class INodeDefManager;
index abe5b3e97ffc85c7a4774b42bd4a1b3a73f30361..c46483e95450cf2b68c1ad31f3eefdecf802c3d5 100644 (file)
@@ -264,7 +264,7 @@ bool ScriptApiSecurity::safeLoadFile(lua_State *L, const char *path)
                fp = stdin;
                chunk_name = const_cast<char *>("=stdin");
        } else {
-               fp = fopen(path, "r");
+               fp = fopen(path, "rb");
                if (!fp) {
                        lua_pushfstring(L, "%s: %s", path, strerror(errno));
                        return false;