diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c86b510..538d741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,16 +85,16 @@ jobs: msys2 -c 'pacman --noconfirm -Suu' - name: debug build run: | - build_msys2.bat - shell: cmd + ./build_msys2.bat + shell: msys2 {0} env: CC: gcc CXX: g++ PATH: D:\a\_temp\msys\msys64\usr\bin;D:\a\_temp\msys\msys64\${{ matrix.msystem_lower }}\bin;D:\a\_temp\msys - name: release build run: | - build_msys2.bat --release - shell: cmd + ./build_msys2.bat --release + shell: msys2 {0} env: CC: gcc CXX: g++ diff --git a/build_msys2.bat b/build_msys2.bat index e1d53e1..fe38cde 100644 --- a/build_msys2.bat +++ b/build_msys2.bat @@ -28,6 +28,8 @@ if defined SOMETHING_RELEASE ( config_indexer assets/vars.conf >src/config_index.hpp %CXX% %CXXFLAGS% %PKGSCFLAGS% -o something.debug.exe src/something.cpp %PKGLIBS% -lopengl32 -static ) +dir *.exe +REM Returns Errorcode. Zero is Noerror. +EXIT /B %ERRORLEVEL% endlocal -dir *.exe diff --git a/src/something_main.cpp b/src/something_main.cpp index 8904d6a..214f579 100644 --- a/src/something_main.cpp +++ b/src/something_main.cpp @@ -6,13 +6,20 @@ const Seconds DELTA_TIME_SECS = 1.0f / static_cast(SCREEN_FPS); const Milliseconds DELTA_TIME_MS = static_cast(floorf(DELTA_TIME_SECS * 1000.0f)); -void MessageCallback(GLenum source, - GLenum type, - GLuint id, - GLenum severity, - GLsizei length, - const GLchar* message, - const void* userParam) +// inspired by https://github.com/Velho/ded/commit/44f9223d6ea7278243fa56c5a0c095bba0db4450 +#if defined(__MINGW32__) || defined(__MINGW64__) +#define CALLING_METHOD __stdcall +#else +#define CALLING_METHOD +#endif + +void CALLING_METHOD MessageCallback(GLenum source, + GLenum type, + GLuint id, + GLenum severity, + GLsizei length, + const GLchar* message, + const void* userParam) { (void) source; (void) id;