added makefile define DEPRECATED to show warnings about deprecated code / added ATTR_DEPRECATED / flag some stuff in diexec.h as deprecated (nw)

This commit is contained in:
Oliver Stöneberg 2013-08-22 09:40:15 +00:00
parent fb1e10310d
commit eb91a212ac
4 changed files with 18 additions and 2 deletions

View File

@ -250,6 +250,9 @@ BUILD_MIDILIB = 1
# uncomment next line to generate verbose build information
# VERBOSE = 1
# uncomment next line to generate deprecation warnings during compilation
# DEPRECATED = 1
# specify the sanitizer to use or leave empty to use none
# SANITIZE =
@ -488,6 +491,12 @@ ifdef VERBOSE
CCOMFLAGS += -v
endif
# only show deprecation warnings when enabled
ifndef DEPRECATED
CCOMFLAGS += \
-Wno-deprecated-declarations
endif
# add profiling information for the compiler
ifdef PROFILE
CCOMFLAGS += -pg

View File

@ -143,7 +143,7 @@ typedef device_delegate<void (device_t &)> device_interrupt_delegate;
// IRQ callback to be called by executing devices when an IRQ is actually taken
typedef device_delegate<int (device_t &, int)> device_irq_acknowledge_delegate;
typedef int (*device_irq_acknowledge_callback)(device_t *device, int irqnum); // legacy
ATTR_DEPRECATED typedef int (*device_irq_acknowledge_callback)(device_t *device, int irqnum);
@ -190,7 +190,7 @@ public:
void set_input_line_vector(int linenum, int vector) { m_input[linenum].set_vector(vector); }
void set_input_line_and_vector(int linenum, int state, int vector) { m_input[linenum].set_state_synced(state, vector); }
int input_state(int linenum) { return m_input[linenum].m_curstate; }
void set_irq_acknowledge_callback(device_irq_acknowledge_callback callback); // legacy
ATTR_DEPRECATED void set_irq_acknowledge_callback(device_irq_acknowledge_callback callback);
void set_irq_acknowledge_callback(device_irq_acknowledge_delegate callback);
// suspend/resume

View File

@ -67,6 +67,7 @@
#define ATTR_CONST __attribute__((const))
#define ATTR_FORCE_INLINE __attribute__((always_inline))
#define ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
#define ATTR_DEPRECATED __attribute__((deprecated))
/* not supported in GCC prior to 4.4.x */
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)
#define ATTR_HOT __attribute__((hot))
@ -88,6 +89,7 @@
#define ATTR_CONST
#define ATTR_FORCE_INLINE
#define ATTR_NONNULL(...)
#define ATTR_DEPRECATED __declspec(deprecated)
#define ATTR_HOT
#define ATTR_COLD
#define UNEXPECTED(exp) (exp)

View File

@ -180,6 +180,11 @@ CCOMFLAGS += /wd4005
# disable behavior change: 'member1' called instead of 'member2' warning
CCOMFLAGS += /wd4350
# only show deprecation warnings when enabled
ifndef DEPRECATED
CCOMFLAGS += /wd4996
endif
# explicitly set the entry point for UNICODE builds
LDFLAGS += /ENTRY:wmainCRTStartup