summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-03-19 06:15:14 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-03-19 06:15:14 +0000
commit58d832602b06c8d4587562160714531443fd54e4 (patch)
tree8d9ec0dbb0ac9aea339d7476353a258a1e93aee9
parent5caef9210c376d563b9fa8b47a81f68b0afc6f3a (diff)
Having decided to look at the MAME source again, I have a fairly minor patch:
* Fix build of ldplayer on OS X. Since the CUSTOM sound module no longer exists, I arbitrarily changed it to WAVE, as ar gets upset if it has no input files. I also removed the -all_load flag for ldplayer from the main makefile as it upsets the linker on OS X. * Fix build for PPC64 Linux. (This slightly messes up static branch prediction hints on OS X and AIX, but OS X for PPC64 is dead, and no- one builds MAME for AIX, and it will still build, anyway.) * Paramaterise the arguments to check for NULL in the ATTR_NONNULL macro rather than just checking the first argument. This requires compiler support for C99 variadic macros (MSVC2005 and GCC4 have this AFAIK). Vas
-rw-r--r--makefile5
-rw-r--r--src/emu/eigccppc.h14
-rw-r--r--src/emu/eigccx86.h12
-rw-r--r--src/emu/machine/6850acia.h8
-rw-r--r--src/emu/memory.h42
-rw-r--r--src/emu/sound/dac.h8
-rw-r--r--src/ldplayer/ldplayer.mak2
-rw-r--r--src/osd/osdcomm.h4
8 files changed, 45 insertions, 50 deletions
diff --git a/makefile b/makefile
index 2777a0e3983..4827e37e89e 100644
--- a/makefile
+++ b/makefile
@@ -402,11 +402,6 @@ ifdef MAP
LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map
endif
-# any reason why this doesn't work for all cases?
-ifeq ($(TARGETOS),macosx)
-LDFLAGSEMULATOR += -Xlinker -all_load
-endif
-
#-------------------------------------------------
diff --git a/src/emu/eigccppc.h b/src/emu/eigccppc.h
index 4290a6af7a3..31814a23e72 100644
--- a/src/emu/eigccppc.h
+++ b/src/emu/eigccppc.h
@@ -299,7 +299,7 @@ _count_leading_ones(UINT32 value)
-------------------------------------------------*/
#define compare_exchange32 _compare_exchange32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
{
register INT32 result;
@@ -333,7 +333,7 @@ _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
#if defined(__ppc64__) || defined(__PPC64__)
#define compare_exchange64 _compare_exchange64
-INLINE INT64 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
{
register INT64 result;
@@ -343,7 +343,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
" cmpd %[compare], %[result] \n"
" bne 2f \n"
" stdcx. %[exchange], 0, %[ptr] \n"
- " bne-- 1b \n"
+ " bne- 1b \n"
"2: "
: [dummy] "+m" (*ptr) /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
, [result] "=&r" (result)
@@ -365,7 +365,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
-------------------------------------------------*/
#define atomic_exchange32 _atomic_exchange32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
{
register INT32 result;
@@ -393,7 +393,7 @@ _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
-------------------------------------------------*/
#define atomic_add32 _atomic_add32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_add32(INT32 volatile *ptr, INT32 delta)
{
register INT32 result;
@@ -422,7 +422,7 @@ _atomic_add32(INT32 volatile *ptr, INT32 delta)
-------------------------------------------------*/
#define atomic_increment32 _atomic_increment32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_increment32(INT32 volatile *ptr)
{
register INT32 result;
@@ -450,7 +450,7 @@ _atomic_increment32(INT32 volatile *ptr)
-------------------------------------------------*/
#define atomic_decrement32 _atomic_decrement32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_decrement32(INT32 volatile *ptr)
{
register INT32 result;
diff --git a/src/emu/eigccx86.h b/src/emu/eigccx86.h
index a84a16f2202..4be2f3ee474 100644
--- a/src/emu/eigccx86.h
+++ b/src/emu/eigccx86.h
@@ -504,7 +504,7 @@ _count_leading_ones(UINT32 value)
-------------------------------------------------*/
#define compare_exchange32 _compare_exchange32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
{
register INT32 result;
@@ -531,7 +531,7 @@ _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
#ifdef __x86_64__
#define compare_exchange64 _compare_exchange64
-INLINE INT64 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
{
register INT64 result;
@@ -557,7 +557,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
-------------------------------------------------*/
#define atomic_exchange32 _atomic_exchange32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
{
register INT32 result;
@@ -580,7 +580,7 @@ _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
-------------------------------------------------*/
#define atomic_add32 _atomic_add32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_add32(INT32 volatile *ptr, INT32 delta)
{
register INT32 result = delta;
@@ -604,7 +604,7 @@ _atomic_add32(INT32 volatile *ptr, INT32 delta)
-------------------------------------------------*/
#define atomic_increment32 _atomic_increment32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_increment32(INT32 volatile *ptr)
{
register INT32 result = 1;
@@ -628,7 +628,7 @@ _atomic_increment32(INT32 volatile *ptr)
-------------------------------------------------*/
#define atomic_decrement32 _atomic_decrement32
-INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
+INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
_atomic_decrement32(INT32 volatile *ptr)
{
register INT32 result = -1;
diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h
index 022d0f09ef0..091708f7345 100644
--- a/src/emu/machine/6850acia.h
+++ b/src/emu/machine/6850acia.h
@@ -63,11 +63,11 @@ struct _acia6850_interface
DEVICE_GET_INFO( acia6850 );
-void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL;
-void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL;
+void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL(1);
+void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL(1);
-void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL;
-void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL;
+void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL(1);
+void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL(1);
WRITE8_DEVICE_HANDLER( acia6850_ctrl_w );
READ8_DEVICE_HANDLER( acia6850_stat_r );
diff --git a/src/emu/memory.h b/src/emu/memory.h
index b55d647ed39..94e6e1a6a44 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -853,75 +853,75 @@ void address_map_free(address_map *map);
/* ----- direct access control ----- */
/* registers an address range as having a decrypted data pointer */
-void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) ATTR_NONNULL;
+void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) ATTR_NONNULL(1, 4);
/* register a handler for opcode base changes on a given CPU */
-direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function) ATTR_NONNULL;
+direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function) ATTR_NONNULL(1);
/* called by CPU cores to update the opcode base for the given address */
-int memory_set_direct_region(const address_space *space, offs_t *byteaddress) ATTR_NONNULL;
+int memory_set_direct_region(const address_space *space, offs_t *byteaddress) ATTR_NONNULL(1, 2);
/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a bank */
-void *memory_get_read_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL;
+void *memory_get_read_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL(1);
/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a writeable bank */
-void *memory_get_write_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL;
+void *memory_get_write_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL(1);
/* ----- memory banking ----- */
/* configure the addresses for a bank */
-void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL;
+void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
/* configure the decrypted addresses for a bank */
-void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL;
+void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
/* select one pre-configured entry to be the new bank base */
-void memory_set_bank(running_machine *machine, int banknum, int entrynum) ATTR_NONNULL;
+void memory_set_bank(running_machine *machine, int banknum, int entrynum) ATTR_NONNULL(1);
/* return the currently selected bank */
-int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL;
+int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL(1);
/* set the absolute address of a bank base */
-void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL;
+void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL(1, 3);
/* ----- dynamic address space mapping ----- */
/* install a new memory handler into the given address space, returning a pointer to the memory backing it, if present */
-void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
/* same as above but explicitly for 8-bit handlers */
-UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
/* same as above but explicitly for 16-bit handlers */
-UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
/* same as above but explicitly for 32-bit handlers */
-UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
/* same as above but explicitly for 64-bit handlers */
-UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
/* install a new device memory handler into the given address space, returning a pointer to the memory backing it, if present */
-void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
/* same as above but explicitly for 8-bit handlers */
-UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
/* same as above but explicitly for 16-bit handlers */
-UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
/* same as above but explicitly for 32-bit handlers */
-UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
/* same as above but explicitly for 64-bit handlers */
-UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
+UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
/* install a new input port handler into the given address space */
-void memory_install_read_port_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *tag) ATTR_NONNULL;
+void memory_install_read_port_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *tag) ATTR_NONNULL(1, 6);
diff --git a/src/emu/sound/dac.h b/src/emu/sound/dac.h
index 0beb199e174..a5f46decdc5 100644
--- a/src/emu/sound/dac.h
+++ b/src/emu/sound/dac.h
@@ -3,10 +3,10 @@
#ifndef __DAC_H__
#define __DAC_H__
-void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL;
-void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL;
-void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL;
-void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL;
+void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1);
+void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1);
+void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1);
+void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1);
WRITE8_DEVICE_HANDLER( dac_w );
WRITE8_DEVICE_HANDLER( dac_signed_w );
diff --git a/src/ldplayer/ldplayer.mak b/src/ldplayer/ldplayer.mak
index 2c67ba4c6dd..713a05f0463 100644
--- a/src/ldplayer/ldplayer.mak
+++ b/src/ldplayer/ldplayer.mak
@@ -34,7 +34,7 @@ CPUS += Z80
# specify required sound cores
#-------------------------------------------------
-SOUNDS += CUSTOM
+SOUNDS += WAVE
#-------------------------------------------------
diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h
index f446a4d6ffc..82566a73f2d 100644
--- a/src/osd/osdcomm.h
+++ b/src/osd/osdcomm.h
@@ -49,7 +49,7 @@
#define ATTR_PURE __attribute__((pure))
#define ATTR_CONST __attribute__((const))
#define ATTR_FORCE_INLINE __attribute__((always_inline))
-#define ATTR_NONNULL __attribute__((nonnull(1)))
+#define ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
#define UNEXPECTED(exp) __builtin_expect((exp), 0)
#define RESTRICT __restrict__
#define SETJMP_GNUC_PROTECT() (void)__builtin_return_address(1)
@@ -64,7 +64,7 @@
#define ATTR_PURE
#define ATTR_CONST
#define ATTR_FORCE_INLINE
-#define ATTR_NONNULL
+#define ATTR_NONNULL(...)
#define UNEXPECTED(exp) (exp)
#define RESTRICT
#define SETJMP_GNUC_PROTECT() do {} while (0)