Skip to content

Commit ab6bec3

Browse files
committed
fix older-GCC issue in [[deprecated]]
1 parent 36344de commit ab6bec3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

include/finufft_opts.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@ typedef struct finufft_opts{ // defaults see finufft.cpp:finufft_default_opts()
3535

3636
// Those of the above of the form spread_* indicate pass through to finufft_spread_opts
3737

38-
// Backwards-compatibility, with a warning in C (officially C23) or C++14...
39-
[[deprecated ("as of v2.1.0, nufft_opts is obsolete and renamed finufft_opts; please use this instead.")]] typedef finufft_opts nufft_opts;
38+
// define deprecated opts macro
39+
#if defined(__cplusplus) && (__cplusplus >= 201402L)
40+
#define DEPRECATED_OPTS [[deprecated ("as of v2.1.0, nufft_opts is obsolete and renamed finufft_opts; please use this instead.")]]
41+
#elif defined(_MSC_VER)
42+
#define DEPRECATED_OPTS __declspec(deprecated("as of v2.1.0, nufft_opts is obsolete and renamed finufft_opts; please use this instead."))
43+
#else
44+
#define DEPRECATED_OPTS __attribute__((deprecated("as of v2.1.0, nufft_opts is obsolete and renamed finufft_opts; please use this instead.")))
45+
#endif
46+
47+
// Backwards-compatibility
48+
DEPRECATED_OPTS typedef finufft_opts nufft_opts;
4049

4150
#endif // FINUFFT_OPTS_H

0 commit comments

Comments
 (0)