aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-08-02 00:19:16 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-08-02 00:19:16 +0300
commit9395426e07706546f31c7b0f4e79ca01be5b037d (patch)
tree0d057afe4638acd08bea221ad07c2c499f9e33aa /include
parent1e1300a6ff99a7e559b39bf1c67bb8497a169242 (diff)
downloadlibADLMIDI-9395426e07706546f31c7b0f4e79ca01be5b037d.tar.gz
libADLMIDI-9395426e07706546f31c7b0f4e79ca01be5b037d.tar.bz2
libADLMIDI-9395426e07706546f31c7b0f4e79ca01be5b037d.zip
Better deprecated calls warning
Diffstat (limited to 'include')
-rw-r--r--include/adlmidi.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/include/adlmidi.h b/include/adlmidi.h
index 35afe94..6ae184e 100644
--- a/include/adlmidi.h
+++ b/include/adlmidi.h
@@ -57,13 +57,29 @@ typedef short ADL_SInt16;
/* == Deprecated function markers == */
-#ifdef __GNUC__
-#define DEPRECATED(func) func __attribute__ ((deprecated))
-#elif defined(_MSC_VER)
-#define DEPRECATED(func) __declspec(deprecated) func
-#else
-#define DEPRECATED(func) func
-#endif
+#if defined(_MSC_VER) /* MSVC */
+# if _MSC_VER >= 1500 /* MSVC 2008 */
+ /*! Indicates that the following function is deprecated. */
+# define ADLMIDI_DEPRECATED(message) __declspec(deprecated(message))
+# endif
+#endif /* defined(_MSC_VER) */
+
+#ifdef __clang__
+# if __has_extension(attribute_deprecated_with_message)
+# define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
+# endif
+#elif defined __GNUC__ /* not clang (gcc comes later since clang emulates gcc) */
+# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+# define ADLMIDI_DEPRECATED(message) __attribute__((deprecated(message)))
+# elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+# define ADLMIDI_DEPRECATED(message) __attribute__((__deprecated__))
+# endif /* GNUC version */
+#endif /* __clang__ || __GNUC__ */
+
+#if !defined(ADLMIDI_DEPRECATED)
+# define ADLMIDI_DEPRECATED(message)
+#endif /* if !defined(ADLMIDI_DEPRECATED) */
+
#ifdef ADLMIDI_BUILD
# ifndef ADLMIDI_DECLSPEC
@@ -388,7 +404,8 @@ extern ADLMIDI_DECLSPEC void adl_setSoftPanEnabled(struct ADL_MIDIPlayer *device
*
* This function is deprecated. Suggested replacement: `adl_setVolumeRangeModel` with `ADLMIDI_VolumeModel_NativeOPL3` volume model value;
*/
-DEPRECATED(extern ADLMIDI_DECLSPEC void adl_setLogarithmicVolumes(struct ADL_MIDIPlayer *device, int logvol));
+ADLMIDI_DEPRECATED("Use `adl_setVolumeRangeModel(device, ADLMIDI_VolumeModel_NativeOPL3)` instead")
+extern ADLMIDI_DECLSPEC void adl_setLogarithmicVolumes(struct ADL_MIDIPlayer *device, int logvol);
/**
* @brief Set different volume range model
@@ -428,7 +445,8 @@ extern ADLMIDI_DECLSPEC int adl_openBankData(struct ADL_MIDIPlayer *device, cons
*
* @return A string that contains a notice to use `adl_chipEmulatorName` instead of this function.
*/
-DEPRECATED(extern ADLMIDI_DECLSPEC const char *adl_emulatorName());
+ADLMIDI_DEPRECATED("Use `adl_chipEmulatorName(device)` instead")
+extern ADLMIDI_DECLSPEC const char *adl_emulatorName();
/**
* @brief Returns chip emulator name string