From 65e604c40a065375575fb1355f36c59527188433 Mon Sep 17 00:00:00 2001 From: Divneil Rai Wadhawan Date: Thu, 26 Sep 2019 22:17:17 +0530 Subject: [PATCH] safestringlib: conditional inclusion of errno.h o While compiling for non-Linux based platforms where errno.h is not available, a new compile time flag is included. o Defining __LOCAL_ERRNO__ allows the safestring to compile without looking for errno.h Signed-off-by: Divneil Rai Wadhawan --- include/safe_lib_errno.h | 2 ++ include/safe_types.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/safe_lib_errno.h b/include/safe_lib_errno.h index 8f27111..b997099 100644 --- a/include/safe_lib_errno.h +++ b/include/safe_lib_errno.h @@ -36,7 +36,9 @@ #ifdef __KERNEL__ # include #else +#ifndef __LOCAL_ERRNO__ #include +#endif #endif /* __KERNEL__ */ /* diff --git a/include/safe_types.h b/include/safe_types.h index dba7474..a37d3f9 100644 --- a/include/safe_types.h +++ b/include/safe_types.h @@ -58,7 +58,9 @@ typedef int errno_t; #include #include +#ifndef __LOCAL_ERRNO__ #include +#endif typedef int errno_t;