Browse Source

Deprecates support for old compilers (#5051)

Fixes #4646

Switches AppVeyor build worker image to Visual Studio 2015.
Fixed a bug with serv.bat, since crashes would result in a negative number sometimes, the crash would not be detected and would not be reported.

Thanks to @aleos89
Lemongrass3110 5 years ago
parent
commit
8efd61f9b2
4 changed files with 24 additions and 7 deletions
  1. 3 5
      appveyor.yml
  2. 12 0
      src/common/core.cpp
  3. 7 0
      src/config/core.hpp
  4. 2 2
      tools/serv.bat

+ 3 - 5
appveyor.yml

@@ -1,4 +1,4 @@
-image: Visual Studio 2013
+image: Visual Studio 2015
 # This is the default location, but we put it here for safety reasons, since we use it in our test script
 # This is the default location, but we put it here for safety reasons, since we use it in our test script
 clone_folder: c:\projects\rathena
 clone_folder: c:\projects\rathena
 # We do not need the git history for our integration tests
 # We do not need the git history for our integration tests
@@ -8,10 +8,8 @@ pull_requests:
   do_not_increment_build_number: true
   do_not_increment_build_number: true
 environment:
 environment:
   matrix:
   matrix:
-  - VisualStudioVersion: 14.0
-    Defines: "\"BUILDBOT\""
-  - VisualStudioVersion: 14.0
-    Defines: "\"BUILDBOT;PRERE\""
+  - Defines: "\"BUILDBOT\""
+  - Defines: "\"BUILDBOT;PRERE\""
 platform:
 platform:
   - Win32
   - Win32
   - x64
   - x64

+ 12 - 0
src/common/core.cpp

@@ -3,6 +3,8 @@
 
 
 #include "core.hpp"
 #include "core.hpp"
 
 
+#include "../config/core.hpp"
+
 #ifndef MINICORE
 #ifndef MINICORE
 #include "ers.hpp"
 #include "ers.hpp"
 #include "socket.hpp"
 #include "socket.hpp"
@@ -24,6 +26,16 @@
 #include "showmsg.hpp"
 #include "showmsg.hpp"
 #include "strlib.hpp"
 #include "strlib.hpp"
 
 
+#ifndef DEPRECATED_COMPILER_SUPPORT
+	#if defined( _MSC_VER ) && _MSC_VER < 1900
+		#error "Visual Studio versions older than Visual Studio 2015 are not officially supported anymore"
+	#elif defined( __clang__ ) && __clang_major__ < 4 && !( __clang_major__ == 3 && __clang_minor__ >= 7 )
+		#error "clang versions older than clang 3.7 are not officially supported anymore"
+	#elif !defined( __clang__ ) && defined( __GNUC__ ) && __GNUC__ < 5
+		#error "GCC versions older than GCC 5 are not officially supported anymore"
+	#endif
+#endif
+
 /// Called when a terminate signal is received.
 /// Called when a terminate signal is received.
 void (*shutdown_callback)(void) = NULL;
 void (*shutdown_callback)(void) = NULL;
 
 

+ 7 - 0
src/config/core.hpp

@@ -74,6 +74,13 @@
 // overflows, which is approximately every ~49 days.
 // overflows, which is approximately every ~49 days.
 //#define DEPRECATED_WINDOWS_SUPPORT
 //#define DEPRECATED_WINDOWS_SUPPORT
 
 
+// Uncomment to enable compilation for unsupported compilers
+// Note:
+// Compilation might work on these compilers, but they might not fully follow newer C++ rules and
+// cause unexpected behavior.
+// Do NOT create any issues or ask for help with these compilers.
+//#define DEPRECATED_COMPILER_SUPPORT
+
 /**
 /**
  * No settings past this point
  * No settings past this point
  **/
  **/

+ 2 - 2
tools/serv.bat

@@ -36,10 +36,10 @@ PING -n 15 127.0.0.1 > NUL
 :START_RA
 :START_RA
 %1
 %1
 ECHO.
 ECHO.
-REM Return value > 1 is exception&~0xC0000000
-IF ERRORLEVEL 2 GOTO CRASHED
 REM Return value 1 is EXIT_FAILURE
 REM Return value 1 is EXIT_FAILURE
 IF ERRORLEVEL 1 GOTO EXIT1
 IF ERRORLEVEL 1 GOTO EXIT1
+REM Return value is not 0 the process has crashed
+IF NOT ERRORLEVEL 0 GOTO CRASHED
 REM Return value 0 is EXIT_SUCCESS
 REM Return value 0 is EXIT_SUCCESS
 ECHO %2 has shutdown successfully.
 ECHO %2 has shutdown successfully.
 GOTO RESTART_NT
 GOTO RESTART_NT