mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
wc_port.h: for linuxkm, move definitions of XSNPRINTF and XATOI macros outside the defined(BUILDING_WOLFSSL) gate, to prevent inclusion of stdio.h and stdlib.h from types.h when building application code.
This commit is contained in:
@ -579,20 +579,6 @@
|
||||
extern void fipsEntry(void);
|
||||
#endif
|
||||
|
||||
/* needed to suppress inclusion of stdio.h in wolfssl/wolfcrypt/types.h */
|
||||
#define XSNPRINTF snprintf
|
||||
|
||||
/* the rigmarole around kstrtoll() here is to accommodate its warn-unused-result attribute. */
|
||||
#define XATOI(s) ({ \
|
||||
long long _xatoi_res = 0; \
|
||||
int _xatoi_ret = kstrtoll(s, 10, &_xatoi_res); \
|
||||
if (_xatoi_ret != 0) { \
|
||||
_xatoi_res = 0; \
|
||||
} \
|
||||
(int)_xatoi_res; \
|
||||
})
|
||||
|
||||
|
||||
/* suppress false-positive "writing 1 byte into a region of size 0" warnings
|
||||
* building old kernels with new gcc:
|
||||
*/
|
||||
@ -602,6 +588,20 @@
|
||||
|
||||
#endif /* BUILDING_WOLFSSL */
|
||||
|
||||
/* needed to suppress inclusion of stdio.h in wolfssl/wolfcrypt/types.h */
|
||||
#define XSNPRINTF snprintf
|
||||
|
||||
/* the rigmarole around kstrtoll() here is to accommodate its warn-unused-result attribute. */
|
||||
/* also needed to suppress inclusion of stdlib.h in wolfssl/wolfcrypt/types.h */
|
||||
#define XATOI(s) ({ \
|
||||
long long _xatoi_res = 0; \
|
||||
int _xatoi_ret = kstrtoll(s, 10, &_xatoi_res); \
|
||||
if (_xatoi_ret != 0) { \
|
||||
_xatoi_res = 0; \
|
||||
} \
|
||||
(int)_xatoi_res; \
|
||||
})
|
||||
|
||||
#endif /* WOLFSSL_LINUXKM */
|
||||
|
||||
/* THREADING/MUTEX SECTION */
|
||||
|
Reference in New Issue
Block a user