diff --git a/include/securec.h b/include/securec.h index d933056006898b113f93d80a85a56f69bb88db20..b1dea967d8f5a6a14010ebf706fa5082fb229b4f 100644 --- a/include/securec.h +++ b/include/securec.h @@ -85,10 +85,18 @@ typedef int errno_t; /* If you need export the function of this library in Win32 dll, use __declspec(dllexport) */ #ifndef SECUREC_API #if defined(SECUREC_DLL_EXPORT) +#if defined(_MSC_VER) #define SECUREC_API __declspec(dllexport) +#else /* build for linux */ +#define SECUREC_API __attribute__((visibility("default"))) +#endif /* end of _MSC_VER and SECUREC_DLL_EXPORT */ #elif defined(SECUREC_DLL_IMPORT) +#if defined(_MSC_VER) #define SECUREC_API __declspec(dllimport) #else +#define SECUREC_API +#endif /* end of _MSC_VER and SECUREC_DLL_IMPORT */ +#else /* * Standardized function declaration. If a security function is declared in the your code, * it may cause a compilation alarm,Please delete the security function you declared. diff --git a/src/securecutil.c b/src/securecutil.c index 7518eb300b2eca40609e7865f5d002413d80ba65..0053a72cfab51526702fecc78d1cbe4616e68abb 100644 --- a/src/securecutil.c +++ b/src/securecutil.c @@ -44,8 +44,8 @@ int mbtowc(wchar_t *pwc, const char *s, size_t n) /* The V100R001C01 version num is 0x5 (High 8 bits) */ #define SECUREC_C_VERSION 0x500U -#define SECUREC_SPC_VERSION 0xbU -#define SECUREC_VERSION_STR "V100R001C01SPC011B003" +#define SECUREC_SPC_VERSION 0x10U +#define SECUREC_VERSION_STR "1.1.16" /* * Get version string and version number. diff --git a/src/secureprintoutput.h b/src/secureprintoutput.h index a00b10dfffab275febb926b5ce130815e9212869..dc483f58c10905cb94205b1a9bd6a3dccfb3b279 100644 --- a/src/secureprintoutput.h +++ b/src/secureprintoutput.h @@ -23,22 +23,29 @@ #define SECUREC_HANDLE_WFORMAT 1 #endif -#if SECUREC_HANDLE_WFORMAT && defined(__GNUC__) && ((__GNUC__ >= 5) || \ - (defined(__GNUC_MINOR__) && (__GNUC__ == 4 && __GNUC_MINOR__ > 7))) #if defined(__clang__) +#if SECUREC_HANDLE_WFORMAT && defined(__GNUC__) && ((__GNUC__ >= 5) || \ + (defined(__GNUC_MINOR__) && (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))) #define SECUREC_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") +#define SECUREC_END_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic pop") #else +#define SECUREC_MASK_WFORMAT_WARNING +#define SECUREC_END_MASK_WFORMAT_WARNING +#endif +#else +#if SECUREC_HANDLE_WFORMAT && defined(__GNUC__) && ((__GNUC__ >= 5 ) || \ + (defined(__GNUC_MINOR__) && (__GNUC__ == 4 && __GNUC_MINOR__ > 7))) #define SECUREC_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \ _Pragma("GCC diagnostic ignored \"-Wmissing-format-attribute\"") \ _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=format\"") -#endif #define SECUREC_END_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic pop") #else #define SECUREC_MASK_WFORMAT_WARNING #define SECUREC_END_MASK_WFORMAT_WARNING #endif +#endif #define SECUREC_MASK_VSPRINTF_WARNING SECUREC_MASK_WFORMAT_WARNING \ SECUREC_MASK_MSVC_CRT_WARNING