Changeset 1346


Ignore:
Timestamp:
08/27/25 18:14:08 (34 hours ago)
Author:
Maciej Komosinski
Message:

Added compatibility with MinGW compiler

Location:
cpp/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd_math.h

    r1329 r1346  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2025  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    66#define _NONSTD_MATH_H_
    77
    8 
    9 #ifdef _MSC_VER
     8#if defined _MSC_VER || defined __MINGW32__
    109 #define _USE_MATH_DEFINES //after this is defined, the next #include <math.h> or <cmath> will define M_PI etc.
    1110 #include <math.h> //in vc2008, <cmath> worked here, but no longer in vc2010 because "something" (some other .h from stl?) earlier includes <cmath> without _USE_MATH_DEFINES, and <cmath> includes <math.h> (just once because it has "include guards" like any other .h)
     
    8382#endif
    8483
    85 #if defined LINUX || defined TIZEN || defined __ANDROID__
     84#if defined LINUX || defined __MINGW32__ || defined TIZEN || defined __ANDROID__
    8685#include <fenv.h>
    8786#endif
     
    9089{
    9190//handling floating point exceptions
    92 #if defined LINUX || defined TIZEN || defined __ANDROID__
     91#if defined LINUX || defined __MINGW32__ || defined TIZEN || defined __ANDROID__
    9392        //fenv.h values
    9493        static constexpr unsigned int FPEX_DIV0 = FE_DIVBYZERO;
  • cpp/common/nonstd_span.h

    r1340 r1346  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 2019-2024  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 2019-2025  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    88#include <string>
    99#include <vector>
     10#include <cstdint> // uint8_t
    1011
    1112// Remove this and use std::span when available (c++20)
Note: See TracChangeset for help on using the changeset viewer.