Git Product home page Git Product logo

Comments (5)

rparolin avatar rparolin commented on May 23, 2024

EABase was designed to include "inttypes.h" directly for you so there is no need to include inttypes after EABase.

from eastl.

 avatar commented on May 23, 2024

In practice it is a problem, because another software package I use includes inttypes.h in its public headers. So it is not something that I can work around that easily.

from eastl.

rparolin avatar rparolin commented on May 23, 2024

You can try defining 'EA_COMPILER_HAS_C99_FORMAT_MACROS' before EABase as it prevents the definition of the C99 format specifiers you cite are causing the problem. Other than that I don't have any other ideas as the C standard doesn't specify a method to prevent inttypes.h from defining them.

from eastl.

 avatar commented on May 23, 2024

The following changes fix the problem for me, and the test suite still passes. Is it something that could be included main line?

diff --git a/test/packages/EABase/include/Common/EABase/eabase.h b/test/packages/EABase/include/Common/EABase/eabase.h
index 4fd16e5..089e3bb 100644
--- a/test/packages/EABase/include/Common/EABase/eabase.h
+++ b/test/packages/EABase/include/Common/EABase/eabase.h
@@ -114,8 +114,8 @@
           #define __STDC_FORMAT_MACROS
        #endif
        // The GCC PSP compiler defines standard int types (e.g. uint32_t) but not PRId8, etc.
-       // MSVC doesn't include an inttypes.h header.
-       #if !defined(EA_COMPILER_MSVC)
+       // Old MSVC versions do not include an inttypes.h header.
+       #if !defined(EA_COMPILER_MSVC) || _MSC_VER >= 1900
                #include <inttypes.h> // PRId8, SCNd8, etc.
        #endif
        #if defined(_MSC_VER)
@@ -355,7 +355,7 @@
        typedef double              double_t;
 #endif

-#if defined(EA_COMPILER_HAS_INTTYPES) && !defined(EA_COMPILER_MSVC)
+#if defined(EA_COMPILER_HAS_INTTYPES) && (!defined(EA_COMPILER_MSVC) || _MSC_VER >= 1900)
        #define EA_COMPILER_HAS_C99_FORMAT_MACROS
 #endif

from eastl.

rparolin avatar rparolin commented on May 23, 2024

I did some googling but I couldn't find the anything about MS now including the inttypes.h file which is part of the C99 standard.

from eastl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.