#380 C9x integer types

v4.2.0
closed
APIs (29)
none
5
2014-04-15
2009-09-29
No

Hi all,

The header file rexxapitypes.h defines C9X Standard integer types unconditionally. Unfortunately we are using a third party library that defines these types too.
As a result the build of our project fails due to definition conflicts! (error C2371: 'int8_t' : redefinition; different basic types )
We brings to your awareness that these types are already present under some platforms (e.g Linux) in the header inttypes.h, for windows there is an open project by the name of msinttypes (http://code.google.com/p/msinttypes/) to add the support of this standard to Visual Studio.
The key point is that we should at the very minimum test to see if the header file inttypes.h is available (or/and the integer types are already defined.)
As a solution we suggest the below changes to the rexxapitypes.h file:

ifdef NATIVE_INTYPES

/ If the plattform and compiler supports the
* C9X 'proposed' standard for interger types,
* use the provided inttypes.h
* otherwise use our own defintions of the same types
/

include <inttypes.h>

else

// portable ANSI types
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef char int8_t;
typedef unsigned char uint8_t;
typedef signed int64 int64_t;
typedef unsigned
int64 uint64_t;

endif //NATIVE_INTYPES

Regards,

Laurent CREPEL.

Discussion

  • Rick McGuire

    Rick McGuire - 2009-09-29

    Changing this to an enhancement request.

     
  • Rick McGuire

    Rick McGuire - 2011-02-03

    This is an excellent suggestion.

    Committed revision 6693

     
  • Rick McGuire

    Rick McGuire - 2014-04-15
    • status: pending --> closed
    • Pending work items: --> none
     

Anonymous
Anonymous

Cancel  Add attachments