From 79e885829617ffea8bbd9a0ce06d394c88b3b1ab Mon Sep 17 00:00:00 2001 From: Alexander Nicholi Date: Sun, 13 Dec 2020 00:00:14 -0500 Subject: [PATCH] fix deprecation #define in float, and fix #8 --- decl/include/uni/decl.h | 6 ++++-- decl/include/uni/types/float.h | 10 ++++++++-- decl/include/uni/types/options.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/decl/include/uni/decl.h b/decl/include/uni/decl.h index 81093b6..e61437f 100644 --- a/decl/include/uni/decl.h +++ b/decl/include/uni/decl.h @@ -14,7 +14,8 @@ #define UNI_C_API #endif -#ifndef UNI_NODEPREC +#if !defined( UNI_DEPRECATED ) +#if !defined( UNI_NODEPREC ) #if defined( __GNUC__ ) || defined( __clang__ ) #define UNI_DEPRECATED __attribute__( ( deprecated ) ) #elif defined( _MSC_VER ) @@ -26,7 +27,8 @@ #endif #else #define UNI_DEPRECATED -#endif +#endif /* !defined( UNI_NODEPREC ) */ +#endif /* !defined( UNI_DEPRECATED ) */ #define UNI_PACKED __attribute__( ( packed ) ) diff --git a/decl/include/uni/types/float.h b/decl/include/uni/types/float.h index 90d6017..a0de8ae 100644 --- a/decl/include/uni/types/float.h +++ b/decl/include/uni/types/float.h @@ -9,6 +9,8 @@ #define INC_API__UNI_TYPES_FLOAT_H /* XXX: Copied from ../decl.h, as we do not #include with dotdirs */ +#if !defined( UNI_DEPRECATED ) +#if !defined( UNI_NODEPREC ) #if defined( __GNUC__ ) || defined( __clang__ ) #define UNI_DEPRECATED __attribute__( ( deprecated ) ) #elif defined( _MSC_VER ) @@ -17,7 +19,11 @@ #pragma message( \ "WARNING: You need to implement UNI_DEPRECATED for this compiler" ) #define UNI_DEPRECATED -#endif +#endif /* defined( __GNUC__ ) || defined( __clang__ ) */ +#else +#define UNI_DEPRECATED +#endif /* !defined( UNI_NODEPREC ) */ +#endif /* defined( UNI_DEPRECATED ) */ /* VS Code complains that __fp16 is undefined... */ #if defined( __clang__ ) && !defined( __VSCODE_INTELLISENSE__ ) @@ -34,6 +40,6 @@ typedef float f16; typedef float f32; typedef double f64; typedef long double f80 UNI_DEPRECATED; -typedef long double fmax; +typedef long double fbig; #endif /* INC_API__UNI_TYPES_FLOAT_H */ diff --git a/decl/include/uni/types/options.h b/decl/include/uni/types/options.h index c5ec1a9..6e9e832 100644 --- a/decl/include/uni/types/options.h +++ b/decl/include/uni/types/options.h @@ -27,7 +27,7 @@ UNI_DECL_OPT( ptri ); UNI_DECL_OPT( f16 ); UNI_DECL_OPT( f32 ); UNI_DECL_OPT( f64 ); -UNI_DECL_OPT( fmax ); +UNI_DECL_OPT( fbig ); UNI_DECL_OPT_S( point2 ); UNI_DECL_OPT_S( point2l );