• R/O
  • SSH
  • HTTPS

green-candy: Commit


Commit MetaInfo

Revisión15 (tree)
Tiempo2022-06-07 00:43:29
Autorquiret

Log Message

- made the project compile for Linux

Cambiar Resumen

Diferencia incremental

--- blueMods/fileSystem/StdInc.h (revision 14)
+++ blueMods/fileSystem/StdInc.h (revision 15)
@@ -21,7 +21,9 @@
2121 #define MODULE_AUTHOR "The_GTA"
2222 #define MODULE_VERSION 2.0
2323
24+#ifdef _MSC_VER
2425 #pragma warning(disable: 4996)
26+#endif //_MSC_VER
2527
2628 #include "Common.h"
2729 #include <CFileSystem.h>
--- blueMods/fileSystem/luafile.cpp (revision 14)
+++ blueMods/fileSystem/luafile.cpp (revision 15)
@@ -14,6 +14,8 @@
1414 #include <StdInc.h>
1515 #include "luafile.Utils.hxx"
1616
17+#include <cstring>
18+
1719 static int luafile_read( lua_State *L )
1820 {
1921 CFile *file = fsLuaGetFile( L, 1 );
@@ -99,7 +101,7 @@
99101 numberType out_num;
100102
101103 bool success;
102-
104+
103105 LUAFILE_GUARDFSCALL_BEGIN
104106 success = file->ReadStruct( out_num );
105107 LUAFILE_GUARDFSCALL_END
@@ -160,7 +162,7 @@
160162 bool out_b;
161163
162164 bool successful;
163-
165+
164166 LUAFILE_GUARDFSCALL_BEGIN
165167 successful = file->ReadBool( out_b );
166168 LUAFILE_GUARDFSCALL_END
@@ -194,7 +196,7 @@
194196 numberType realNum = (numberType)number;
195197
196198 size_t numWrite;
197-
199+
198200 LUAFILE_GUARDFSCALL_BEGIN
199201 numWrite = file->WriteStruct( realNum );
200202 LUAFILE_GUARDFSCALL_END
@@ -269,7 +271,7 @@
269271 luaL_checktype( L, 2, LUA_TBOOLEAN );
270272
271273 size_t numWrite;
272-
274+
273275 LUAFILE_GUARDFSCALL_BEGIN
274276 numWrite = file->WriteBool(
275277 ( lua_toboolean( L, 2 ) != 0 )
--- blueMods/fileSystem/luafslib.cpp (revision 14)
+++ blueMods/fileSystem/luafslib.cpp (revision 15)
@@ -15,6 +15,8 @@
1515
1616 #include "luafile.Utils.hxx"
1717
18+#include <cstring>
19+
1820 extern CFileSystemInterface *pubFileSystem;
1921
2022 #ifndef FU_CLASS
@@ -469,7 +471,7 @@
469471 lua_pushlstring( L, "file", 4 );
470472 luafile_makemeta( L, -4 );
471473 lua_rawset( L, -3 );
472-
474+
473475 // Initialize the file-translator metatable.
474476 lua_pushlstring( L, "ftrans", 6 );
475477 luaftrans_makemeta( L, -4 );
@@ -506,7 +508,7 @@
506508 lua_pushvalue( L, -2 );
507509 luaL_openlib( L, nullptr, fsysLib, 1 );
508510 lua_pop( L, 1 );
509-
511+
510512 // Cache the root translator into the lib.
511513 lua_pushvalue( L, -1 );
512514 lua_pushcclosure( L, luafsys_init, 1 );
--- blueMods/fileSystem/ml_base.cpp (revision 14)
+++ blueMods/fileSystem/ml_base.cpp (revision 15)
@@ -18,11 +18,17 @@
1818
1919 #include "StdInc.h"
2020
21+#include <cstring>
22+
23+#ifndef __linux__
2124 #include <NativeExecutive/CExecutiveManager.h>
25+#endif //__linux__
2226
2327 ILuaModuleManager10 *pModuleManager = nullptr;
2428 CFileSystemInterface *pubFileSystem = nullptr;
29+#ifndef __linux__
2530 NativeExecutive::CExecutiveManager *natExecMan = nullptr;
31+#endif //__linux__
2632
2733 bool _global_doBufferAllRaw;
2834
@@ -30,11 +36,15 @@
3036 MTAEXPORT bool InitModule ( ILuaModuleManager10 *pManager, char *szModuleName, char *szAuthor, float *fVersion )
3137 {
3238 pModuleManager = pManager;
39+#ifndef __linux__
3340 natExecMan = NativeExecutive::CExecutiveManager::Create();
41+#endif //__linux__
3442 try
3543 {
3644 fs_construction_params fsparams;
45+#ifndef __linux__
3746 fsparams.nativeExecMan = natExecMan;
47+#endif //__linux__
3848 // TODO: anything left to configure for the Eir FileSystem module here?
3949
4050 pubFileSystem = CFileSystem::Create( fsparams );
@@ -46,7 +56,9 @@
4656 }
4757 catch( ... )
4858 {
59+#ifndef __linux__
4960 NativeExecutive::CExecutiveManager::Delete( natExecMan );
61+#endif //__linux__
5062 return false;
5163 }
5264
@@ -86,9 +98,11 @@
8698 {
8799 CFileSystem::Destroy( (CFileSystem*)pubFileSystem );
88100 }
101+#ifndef __linux__
89102 if ( natExecMan != nullptr )
90103 {
91104 NativeExecutive::CExecutiveManager::Delete( natExecMan );
92105 }
106+#endif //__linux__
93107 return true;
94108 }
Show on old repository browser