From ea9bc3e4587fe823dc182c4b99e04c70e6b27df8 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Tue, 27 Jul 2021 12:15:11 +0300 Subject: wopl_file.h: Organize the stdint necessary defines --- src/wopl/wopl_file.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/wopl/wopl_file.h') diff --git a/src/wopl/wopl_file.h b/src/wopl/wopl_file.h index c0e49f2..5666ce7 100644 --- a/src/wopl/wopl_file.h +++ b/src/wopl/wopl_file.h @@ -32,16 +32,27 @@ extern "C" { #endif -#if !defined(__STDC_VERSION__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901L)) \ - || defined(__STRICT_ANSI__) || !defined(__cplusplus) -/* Solaris defines the integer types regardless of what C/C++ standard is actually available, so avoid defining them at all by ourselves. */ -#ifndef __sun +/* Solaris defines the integer types regardless of what C/C++ standard is actually available, + * so avoid defining them at all by ourselves. */ +#if !defined(WOPL_STDINT_TYPEDEFS_NOT_NEEDED) && defined(__sun) +# define WOPL_STDINT_TYPEDEFS_NOT_NEEDED +#endif + +#if !defined(WOPL_STDINT_TYPEDEFS_NEEDED) && !defined(WOPL_STDINT_TYPEDEFS_NOT_NEEDED) +# if !defined(__STDC_VERSION__) || \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901L)) || \ + defined(__STRICT_ANSI__) || \ + !defined(__cplusplus) +# define WOPL_STDINT_TYPEDEFS_NEEDED +# endif +#endif + +#ifdef WOPL_STDINT_TYPEDEFS_NEEDED typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int int16_t; typedef unsigned short int uint16_t; #endif -#endif /* Global OPL flags */ typedef enum WOPLFileFlags -- cgit v1.2.3