no need to include wchar.h in all cases

(cherry picked from commit a32d1afd1097ed1534004891d1322aa621473367)
This commit is contained in:
Steffen Jaeckel 2018-05-05 17:56:41 +02:00
parent 4c2bb90dec
commit 615b361673

View File

@ -667,16 +667,16 @@ int der_printable_value_decode(int v);
/* UTF-8 */ /* UTF-8 */
#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(__WCHAR_MAX__) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR) #if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(__WCHAR_MAX__) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR)
#include <wchar.h> #if defined(__WCHAR_MAX__)
#if defined(__WCHAR_MAX__) #define LTC_WCHAR_MAX __WCHAR_MAX__
#define LTC_WCHAR_MAX __WCHAR_MAX__ #else
#elif defined(WCHAR_MAX) #include <wchar.h>
#define LTC_WCHAR_MAX WCHAR_MAX #define LTC_WCHAR_MAX WCHAR_MAX
#endif #endif
/* please note that it might happen that LTC_WCHAR_MAX is undefined */ /* please note that it might happen that LTC_WCHAR_MAX is undefined */
#else #else
typedef ulong32 wchar_t; typedef ulong32 wchar_t;
#define LTC_WCHAR_MAX 0xFFFFFFFF #define LTC_WCHAR_MAX 0xFFFFFFFF
#endif #endif
int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, int der_encode_utf8_string(const wchar_t *in, unsigned long inlen,