Skip to content

Commit

Permalink
fix deprecation #define in float, and fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholatian committed Dec 13, 2020
1 parent 6d60aa5 commit 79e8858
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions decl/include/uni/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -26,7 +27,8 @@
#endif
#else
#define UNI_DEPRECATED
#endif
#endif /* !defined( UNI_NODEPREC ) */
#endif /* !defined( UNI_DEPRECATED ) */

#define UNI_PACKED __attribute__( ( packed ) )

Expand Down
10 changes: 8 additions & 2 deletions decl/include/uni/types/float.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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__ )
Expand All @@ -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 */
2 changes: 1 addition & 1 deletion decl/include/uni/types/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 79e8858

Please sign in to comment.