From patchwork Tue Aug 7 17:36:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev,RFC,2/4] asn-config: use definitions from stdint X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 32 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <20180807173657.7572-3-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Tue, 7 Aug 2018 13:36:55 -0400 From: Aaron Conole List-Id: eSNACC Development discussion 4-byte integral types are defined in the standard to exist in stdint.h, so there is no need to use a strange ifdef construct. Signed-off-by: Aaron Conole --- cxx-lib/inc/asn-config.h | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/cxx-lib/inc/asn-config.h b/cxx-lib/inc/asn-config.h index 6e5045f..979bc50 100644 --- a/cxx-lib/inc/asn-config.h +++ b/cxx-lib/inc/asn-config.h @@ -132,6 +132,7 @@ #ifndef _asn_config_h_ #define _asn_config_h_ +#include #ifndef WIN32 #include /* for wchar_t on UNIX */ #endif @@ -166,24 +167,9 @@ #define USE_EXP_BUF 1 // used not only by AsnInt (asn-int.h), but by AsnNameDesc (meta.h) as well: -#if SIZEOF_INT == 4 -# define I int -#else -# if SIZEOF_LONG == 4 -# define I long -# elif SIZEOF_SHORT == 4 -# define I short -# else -# define I int -# endif -#endif -#ifdef I - typedef I AsnIntType; - typedef unsigned I AsnUIntType; -# undef I -#else -# error "can't find integer type which is 4 bytes in size" -#endif + +typedef int32_t AsnIntType; +typedef uint32_t AsnUIntType; /* used to test if optionals are present */ #define NOT_NULL( ptr) ((ptr) != NULL)