• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision63 (tree)
Time2018-02-07 07:59:14
Authorquiret

Log Message

- GCC compatibility fixes

Change Summary

Incremental Difference

--- mta/sdk/CScriptArgReader.h (revision 62)
+++ mta/sdk/CScriptArgReader.h (revision 63)
@@ -2,7 +2,7 @@
22 *
33 * PROJECT: Multi Theft Auto v1.2
44 * LICENSE: See LICENSE in the top level directory
5-* FILE: CScriptArgReader.h
5+* FILE: CScriptArgReader.h
66 * PURPOSE: Unified Lua script argumentation
77 *
88 * Multi Theft Auto is available from http://www.multitheftauto.com/
@@ -24,7 +24,7 @@
2424 case LUACLASS_SYSENTITY: return "sysentity";
2525 case LUACLASS_TEXTURE: return "game-texture";
2626 case LUACLASS_GUIELEMENT: return "gui-element";
27- case LUACLASS_MARKER: return "marker";
27+ case LUACLASS_MARKER: return "marker";
2828 case LUACLASS_OBJECT: return "object";
2929 case LUACLASS_PATHNODE: return "pathnode";
3030 case LUACLASS_PED: return "ped";
@@ -223,7 +223,7 @@
223223 {
224224 if ( defaultValue )
225225 {
226- outValue = defaultValue;
226+ outValue = defaultValue;
227227 return false;
228228 }
229229 }
@@ -294,13 +294,15 @@
294294 {
295295 if ( lua_type( m_luaVM, m_iIndex ) != LUA_TCLASS )
296296 goto fail;
297+
298+ {
299+ ILuaClass& j = *lua_refclass( m_luaVM, m_iIndex );
297300
298- ILuaClass& j = *lua_refclass( m_luaVM, m_iIndex );
301+ if ( j.IsDestroyed() || !j.GetTransmit( transmit, (void*&)outValue ) )
302+ goto fail;
299303
300- if ( j.IsDestroyed() || !j.GetTransmit( transmit, (void*&)outValue ) )
301- goto fail;
302-
303- m_iIndex++;
304+ m_iIndex++;
305+ }
304306 return true;
305307
306308 fail:
@@ -316,14 +318,16 @@
316318 {
317319 if ( lua_type( m_luaVM, m_iIndex ) != LUA_TCLASS )
318320 goto pass;
321+
322+ {
323+ ILuaClass& j = *lua_refclass( m_luaVM, m_iIndex );
319324
320- ILuaClass& j = *lua_refclass( m_luaVM, m_iIndex );
325+ if ( j.IsDestroyed() || !j.GetTransmit( transmit, (void*&)outValue ) )
326+ goto pass;
321327
322- if ( j.IsDestroyed() || !j.GetTransmit( transmit, (void*&)outValue ) )
323- goto pass;
324-
325- m_iIndex++;
326- return;
328+ m_iIndex++;
329+ return;
330+ }
327331 pass:
328332 outValue = def;
329333 m_iIndex++;
@@ -335,14 +339,16 @@
335339 {
336340 if ( lua_type( m_luaVM, m_iIndex ) != LUA_TCLASS )
337341 goto pass;
342+
343+ {
344+ ILuaClass& j = *lua_refclass( m_luaVM, m_iIndex );
338345
339- ILuaClass& j = *lua_refclass( m_luaVM, m_iIndex );
346+ if ( j.IsDestroyed() || !j.GetTransmit( transmit, (void*&)outValue ) )
347+ goto pass;
340348
341- if ( j.IsDestroyed() || !j.GetTransmit( transmit, (void*&)outValue ) )
342- goto pass;
343-
344- m_iIndex++;
345- return;
349+ m_iIndex++;
350+ return;
351+ }
346352 pass:
347353 outValue = NULL;
348354 m_iIndex++;
@@ -386,7 +392,8 @@
386392 outValue = (unsigned char)color;
387393 return true;
388394 }
389-
395+
396+#if 0
390397 //
391398 // Read next userdata, using default if needed
392399 //
@@ -448,8 +455,8 @@
448455 }
449456 return false;
450457 }
458+#endif //0
451459
452-
453460 //
454461 // Read a function, but don't do it yet due to Lua stack issues
455462 //
--- mta/sdk/SharedUtil.File.hpp (revision 62)
+++ mta/sdk/SharedUtil.File.hpp (revision 63)
@@ -9,77 +9,8 @@
99 *
1010 *****************************************************************************/
1111
12-#ifdef WIN32
13-#include "shellapi.h"
14-#include "shlobj.h"
15-#else
16-#include <dirent.h>
17-#endif
18-
1912 #include <CFileSystemInterface.h>
2013
21-#ifdef _WIN32
22-#ifdef MTA_CLIENT
23-
24-filePath SharedUtil::GetSystemLocalAppDataPath()
25-{
26- char szResult[MAX_PATH] = "";
27- SHGetFolderPathA( NULL, CSIDL_LOCAL_APPDATA, NULL, 0, szResult );
28- return filePath( szResult );
29-}
30-
31-filePath SharedUtil::GetSystemCommonAppDataPath()
32-{
33- char szResult[MAX_PATH] = "";
34- SHGetFolderPathA( NULL, CSIDL_COMMON_APPDATA, NULL, 0, szResult );
35- return filePath( szResult );
36-}
37-
38-filePath SharedUtil::GetSystemTempPath()
39-{
40- char szResult[4030] = "";
41- GetTempPath( 4000, szResult );
42- return filePath( szResult );
43-}
44-
45-filePath SharedUtil::GetMTADataPath()
46-{
47- filePath path = GetSystemCommonAppDataPath();
48- path += "/MTA San Andreas All/";
49- path += GetMajorVersionString();
50- path += "/";
51- return path;
52-}
53-
54-filePath SharedUtil::GetMTATempPath()
55-{
56- filePath path = GetSystemTempPath();
57- path += "MTA";
58- path += GetMajorVersionString();
59- path += "/";
60- return path;
61-}
62-#endif
63-#endif
64-
65-#ifdef _WIN32
66-
67-filePath SharedUtil::GetCurrentDirectory()
68-{
69- char szCurDir[1024] = "";
70- ::GetCurrentDirectoryA( sizeof(szCurDir), szCurDir );
71- return filePath( szCurDir );
72-}
73-
74-filePath SharedUtil::GetWindowsDirectory()
75-{
76- char szWinDir[MAX_PATH] = "";
77- ::GetWindowsDirectoryA( szWinDir, sizeof(szWinDir) );
78- return filePath( szWinDir );
79-}
80-
81-#endif
82-
8314 void SharedUtil::ExtractFilename ( const SString& in, SString* strPath, SString* strFilename )
8415 {
8516 if ( !in.Split ( PATH_SEPERATOR, strPath, strFilename, -1 ) )
@@ -121,6 +52,10 @@
12152 }
12253
12354 #ifdef _WIN32
55+#define WIN32_LEAN_AND_MEAN
56+#define NOMINMAX
57+#include <windows.h>
58+
12459 filePath SharedUtil::MakeUniquePath( const filePath& path )
12560 {
12661 unsigned int n = 0;
--- mta/sdk/SharedUtil.Misc.hpp (revision 62)
+++ mta/sdk/SharedUtil.Misc.hpp (revision 63)
@@ -708,8 +708,12 @@
708708 //
709709 // Cross platform critical section
710710 //
711-#ifdef WIN32
711+#ifdef _WIN32
712712
713+#define WIN32_LEAN_AND_MEAN
714+#define NOMINMAX
715+#include <Windows.h>
716+
713717 SharedUtil::CCriticalSection::CCriticalSection ( void )
714718 {
715719 m_pCriticalSection = new CRITICAL_SECTION;
Show on old repository browser