diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index d40c25d27..e94668d75 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -652,7 +652,7 @@ cdi_cue_get_buffer(char *str, char **line, int up) done = 1; break; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/cdrom/cdrom_mitsumi.c b/src/cdrom/cdrom_mitsumi.c index 11ff14be2..6c015fa9d 100644 --- a/src/cdrom/cdrom_mitsumi.c +++ b/src/cdrom/cdrom_mitsumi.c @@ -324,7 +324,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) break; case 5: dev->readmsf = 0; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 4: diff --git a/src/chipset/ali1621.c b/src/chipset/ali1621.c index 4e19dc6cd..b927d3e34 100644 --- a/src/chipset/ali1621.c +++ b/src/chipset/ali1621.c @@ -28,6 +28,7 @@ #include <86box/io.h> #include <86box/mem.h> #include <86box/pci.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #include <86box/smram.h> #include <86box/spd.h> @@ -108,7 +109,7 @@ ali1621_smram_recalc(uint8_t val, ali1621_t *dev) switch (val & 0x30) { case 0x10: /* Open. */ access_normal = ACCESS_SMRAM_RX; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x30: /* Protect. */ @@ -123,7 +124,7 @@ ali1621_smram_recalc(uint8_t val, ali1621_t *dev) switch (val & 0x30) { case 0x10: /* Open. */ access_normal |= ACCESS_SMRAM_W; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x30: /* Protect. */ diff --git a/src/chipset/ali6117.c b/src/chipset/ali6117.c index c4b8b818a..78705ee26 100644 --- a/src/chipset/ali6117.c +++ b/src/chipset/ali6117.c @@ -33,6 +33,7 @@ #include <86box/hdc.h> #include <86box/hdc_ide.h> #include <86box/chipset.h> +#include <86box/plat_fallthrough.h> typedef struct ali6117_t { uint32_t local; @@ -233,7 +234,7 @@ ali6117_reg_write(uint16_t addr, uint8_t val, void *priv) case 0x12: val &= 0xf7; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/chipset/opti283.c b/src/chipset/opti283.c index 544302b28..865ec6ff5 100644 --- a/src/chipset/opti283.c +++ b/src/chipset/opti283.c @@ -29,6 +29,7 @@ #include <86box/io.h> #include <86box/device.h> #include <86box/mem.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #include <86box/chipset.h> @@ -228,7 +229,7 @@ opti283_write(uint16_t addr, uint8_t val, void *priv) case 0x14: reset_on_hlt = !!(val & 0x40); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x11: diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index ab109ef4b..04bcd5576 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -41,6 +41,7 @@ #include <86box/ddma.h> #include <86box/pci.h> #include <86box/pic.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #include <86box/port_92.h> #include <86box/hdc.h> @@ -1474,7 +1475,7 @@ pipc_write(int func, int addr, uint8_t val, void *priv) case 0xd2: if (dev->local == VIA_PIPC_686B) smbus_piix4_setclock(dev->smbus, (val & 0x04) ? 65536 : 16384); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index 60b4a2b3f..39398f996 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -29,6 +29,7 @@ #include <86box/io.h> #include <86box/pic.h> #include <86box/pit.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #include <86box/ppi.h> #include <86box/mem.h> @@ -463,7 +464,7 @@ kbc_at_poll_at(atkbc_t *dev) case STATE_KBC_AMI_OUT: if (dev->status & STAT_OFULL) break; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case STATE_MAIN_IBF: @@ -588,7 +589,7 @@ kbc_at_poll_ps2(atkbc_t *dev) case STATE_KBC_AMI_OUT: if (dev->status & STAT_OFULL) break; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case STATE_MAIN_IBF: diff --git a/src/device/kbc_at_dev.c b/src/device/kbc_at_dev.c index c37ddda9d..894b5f08a 100644 --- a/src/device/kbc_at_dev.c +++ b/src/device/kbc_at_dev.c @@ -38,6 +38,7 @@ #include <86box/snd_speaker.h> #include <86box/video.h> #include <86box/keyboard.h> +#include <86box/plat_fallthrough.h> #ifdef ENABLE_KBC_AT_DEV_LOG int kbc_at_dev_do_log = ENABLE_KBC_AT_DEV_LOG; @@ -135,7 +136,7 @@ kbc_at_dev_poll(void *priv) dev->port->wantcmd = 0; break; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case DEV_STATE_MAIN_WANT_IN: diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index ad3b8f7cb..c74e5216b 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -26,6 +26,7 @@ #include <86box/timer.h> #include <86box/serial.h> #include <86box/mouse.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #define SERMOUSE_PORT 0 /* attach to Serial0 */ @@ -507,7 +508,7 @@ sermouse_command_timer(void *priv) break; case PHASE_ACK: serial_write_fifo(dev->serial, 0x06); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case PHASE_BAUD_RATE: @@ -647,7 +648,7 @@ ltsermouse_write(UNUSED(struct serial_s *serial), void *priv, uint8_t data) switch (data) { default: mouse_serial_log("Serial mouse: Invalid period %02X, using 1200 bps\n", data); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x6E: diff --git a/src/device/smbus_ali7101.c b/src/device/smbus_ali7101.c index 1e1e61c52..855f0c270 100644 --- a/src/device/smbus_ali7101.c +++ b/src/device/smbus_ali7101.c @@ -28,6 +28,7 @@ #include <86box/timer.h> #include <86box/i2c.h> #include <86box/smbus.h> +#include <86box/plat_fallthrough.h> #ifdef ENABLE_SMBUS_ALI7101_LOG int smbus_ali7101_do_log = ENABLE_SMBUS_ALI7101_LOG; @@ -193,7 +194,7 @@ smbus_ali7101_write(uint16_t addr, uint8_t val, void *priv) case 0x4: /* block R/W */ timer_bytes++; /* count the SMBus length byte now */ -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index 03a465f1c..bad49b957 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -27,6 +27,7 @@ #include <86box/timer.h> #include <86box/i2c.h> #include <86box/smbus.h> +#include <86box/plat_fallthrough.h> #ifdef ENABLE_SMBUS_PIIX4_LOG int smbus_piix4_do_log = ENABLE_SMBUS_PIIX4_LOG; @@ -195,7 +196,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) timer_bytes++; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -216,7 +217,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) case 0x5: /* block R/W */ timer_bytes++; /* count the SMBus length byte now */ -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -251,7 +252,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) i2c_write(i2c_smbus, smbus_addr, dev->cmd); timer_bytes++; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index 1aa18bd62..258ea9d0f 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -338,7 +338,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv) esdi->command &= ~0x03; if (val & 0x02) fatal("Read with ECC\n"); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -399,7 +399,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv) default: esdi_at_log("WD1007: bad command %02X\n", val); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0xe8: /*???*/ diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index dfc308590..ace646328 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -1655,7 +1655,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) disabled, the Read Multiple operation is rejected with an Aborted Com- mand error. */ ide->blockcount = 0; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -1706,7 +1706,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) /* Turn on the activity indicator *here* so that it gets turned on less times. */ ui_sb_update_icon(SB_HDD | hdd[ide->hdd_num].bus, 1); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 0843a35ee..766d70145 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -623,7 +623,7 @@ st506_callback(void *priv) st506_complete(dev); break; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -1608,7 +1608,7 @@ st506_init(const device_t *info) case ST506_XT_TYPE_ST11R: /* Seagate ST-11R (RLL) */ dev->spt = RLL_SECTORS; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index d5cf829ba..b27648eca 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -509,7 +509,7 @@ hdc_callback(void *priv) case CMD_READ_VERIFY: no_data = 1; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -536,7 +536,7 @@ hdc_callback(void *priv) dev->buf_len = 512; dev->state = STATE_SEND; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -646,7 +646,7 @@ do_send: dev->buf_len = 512; dev->state = STATE_RECV; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/disk/mo.c b/src/disk/mo.c index 02ef29d39..eef83ec3a 100644 --- a/src/disk/mo.c +++ b/src/disk/mo.c @@ -655,7 +655,7 @@ mo_update_request_length(mo_t *dev, int len, int block_len) break; } } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif default: @@ -1344,7 +1344,7 @@ mo_command(scsi_common_t *sc, uint8_t *cdb) mo_invalid_field(dev); return; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case GPCMD_SCSI_RESERVE: diff --git a/src/disk/zip.c b/src/disk/zip.c index 6eb60bd6d..cd7359c05 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -821,7 +821,7 @@ zip_update_request_length(zip_t *dev, int len, int block_len) break; } } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -1411,7 +1411,7 @@ zip_command(scsi_common_t *sc, uint8_t *cdb) zip_invalid_field(dev); return; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case GPCMD_SCSI_RESERVE: @@ -1576,7 +1576,7 @@ zip_command(scsi_common_t *sc, uint8_t *cdb) zip_command_complete(dev); break; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case GPCMD_WRITE_6: diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index bbe4c05db..37e078b76 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -36,6 +36,7 @@ #include <86box/fdd.h> #include <86box/fdc.h> #include <86box/fdc_ext.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> extern uint64_t motoron[FDD_NUM]; @@ -916,7 +917,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv) fdc_bad_command(fdc); break; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x07: /*Recalibrate*/ @@ -961,7 +962,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv) fdc_bad_command(fdc); break; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x10: /*Get version*/ @@ -1085,7 +1086,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv) case 0x16: /* Verify */ if (fdc->params[0] & 0x80) fdc->sc = fdc->params[7]; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x06: /* Read data */ diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index 023296358..0e8085a71 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -1951,7 +1951,7 @@ d86f_format_track(int drive, int side, int do_write) if (dev->datac == 3) fdc_stop_id_request(d86f_fdc); } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -2296,7 +2296,7 @@ d86f_turbo_poll(int drive, int side) case STATE_0D_SPIN_TO_INDEX: dev->sector_count = 0; dev->datac = 5; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -2343,7 +2343,7 @@ d86f_turbo_poll(int drive, int side) dev->last_sector.id.r = dev->req_sector.id.r; dev->last_sector.id.n = dev->req_sector.id.n; d86f_handler[drive].set_sector(drive, side, dev->last_sector.id.c, dev->last_sector.id.h, dev->last_sector.id.r, dev->last_sector.id.n); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index 932dfe87b..02e5def3b 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -55,6 +55,10 @@ extern int strnicmp(const char *s1, const char *s2, size_t n); # define off64_t off_t #endif +#if !defined (__APPLE__) || !defined(__clang__) +# define FALLTHROUGH_ANNOTATION +#endif + #ifdef _MSC_VER # define UNUSED(arg) arg #else diff --git a/src/include/86box/plat_fallthrough.h b/src/include/86box/plat_fallthrough.h new file mode 100644 index 000000000..c256295ac --- /dev/null +++ b/src/include/86box/plat_fallthrough.h @@ -0,0 +1,25 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * Define the various platform support functions. + * + * + * + * Authors: Miran Grca, + * + * Copyright 2023 Jasmine Iwanek + */ + +#ifndef EMU_PLAT_FALLTHROUGH_H +#define EMU_PLAT_FALLTHROUGH_H + +#if !defined (__APPLE__) || !defined(__clang__) +# define FALLTHROUGH_ANNOTATION +#endif + +#endif /*EMU_PLAT_FALLTHROUGH_H*/ diff --git a/src/machine/m_elt.c b/src/machine/m_elt.c index c1aa6396b..573095223 100644 --- a/src/machine/m_elt.c +++ b/src/machine/m_elt.c @@ -50,6 +50,7 @@ #include <86box/rom.h> #include <86box/video.h> #include <86box/vid_cga.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> static void @@ -123,7 +124,7 @@ elt_vid_out(uint16_t addr, uint8_t val, void *priv) case 0x3d1: if (cga->crtcreg >= 32) return; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index 07969f1c8..225ae04a5 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -699,7 +699,7 @@ do_fmt: /* Done with this track. */ dev->state = STATE_FDONE; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case STATE_FDONE: diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 231b7d481..80dc4ec27 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -68,6 +68,7 @@ #include <86box/net_ne2000.h> #include <86box/bswap.h> #include <86box/isapnp.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> /* ROM BIOS file paths. */ @@ -749,7 +750,7 @@ nic_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) case 0x10: /* PCI_BAR */ val &= 0xe0; /* 0xe0 acc to RTL DS */ val |= 0x01; /* re-enable IOIN bit */ -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index 44df03e6e..61c35986d 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -64,6 +64,7 @@ #include <86box/net_dp8390.h> #include <86box/net_wd8003.h> #include <86box/bswap.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #include "cpu.h" @@ -734,7 +735,7 @@ wd_init(const device_t *info) /* Ethernet, MCA, 5x3 interface chip, RAM 16k */ case WD8003EA: dev->board_chip = WE_ID_SOFT_CONFIG; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif /* Ethernet, MCA, no interface chip, RAM 16k */ diff --git a/src/pci_dummy.c b/src/pci_dummy.c index 2046251ac..8ed6f9f30 100644 --- a/src/pci_dummy.c +++ b/src/pci_dummy.c @@ -9,6 +9,7 @@ #include <86box/io.h> #include <86box/pci.h> #include <86box/pci_dummy.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> typedef struct pci_dummy_t { @@ -210,7 +211,7 @@ pci_dummy_pci_write(int func, int addr, uint8_t val, void *priv) case 0x10: /* PCI_BAR */ val &= 0xe0; /* 0xe0 acc to RTL DS */ -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index 012e8b686..612a07cac 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -1462,7 +1462,7 @@ process_char(escp_t *dev, uint8_t ch) dev->curr_x = dev->left_margin; if (!dev->autofeed) return 1; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index d2a6797cd..e1183f0c0 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -283,7 +283,7 @@ process_char(prnt_t *dev, uint8_t ch) dev->curr_x = 0; if (!dev->autofeed) return 1; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 72c02ba1c..d38a967bd 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1232,7 +1232,7 @@ BuslogicPCIWrite(UNUSED(int func), int addr, uint8_t val, void *priv) case 0x10: val &= 0xe0; val |= 1; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -1258,7 +1258,7 @@ BuslogicPCIWrite(UNUSED(int func), int addr, uint8_t val, void *priv) case 0x14: val &= 0xe0; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 721e75c64..d192aec53 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -883,7 +883,7 @@ scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, int block_len) break; } } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif @@ -961,7 +961,7 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) scsi_cdrom_log("CD-ROM %i: Seek period: %" PRIu64 " us\n", dev->id, (uint64_t) period); dev->callback += period; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x25: @@ -1940,7 +1940,7 @@ begin: /* IMPORTANT: Convert the command to new read CD for pass through purposes. */ dev->current_cdb[0] = GPCMD_READ_CD; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index 600d9f6e3..2bd61313b 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -597,7 +597,7 @@ scsi_disk_command(scsi_common_t *sc, uint8_t *cdb) scsi_disk_invalid_field(dev); return; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case GPCMD_SCSI_RESERVE: diff --git a/src/scsi/scsi_pcscsi.c b/src/scsi/scsi_pcscsi.c index 3f30fdafc..7fa359396 100644 --- a/src/scsi/scsi_pcscsi.c +++ b/src/scsi/scsi_pcscsi.c @@ -1029,7 +1029,7 @@ esp_reg_write(esp_t *dev, uint32_t saddr, uint32_t val) switch (saddr) { case ESP_TCHI: dev->tchi_written = 1; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case ESP_TCLO: diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index 0b9cb0281..7a6923def 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -486,7 +486,7 @@ x54x_bios_command(x54x_t *x54x, uint8_t max_id, BIOSCMD *cmd, int8_t islba) default: x54x_log("BIOS: Unimplemented command: %02X\n", cmd->command); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x05: /* Format Track, invalid since SCSI has no tracks */ diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index 6e9f93f1d..929574dce 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -25,6 +25,7 @@ #include <86box/device.h> #include <86box/io.h> #include <86box/snd_ac97.h> +#include <86box/plat_fallthrough.h> static const struct { const device_t *device; @@ -417,7 +418,7 @@ rate: /* Writable only if VRA/VRM is set. */ /* Get actual previous value. */ prev = dev->vendor_reg_pages[(i << 3) | ((reg & 0x0e) >> 1)]; } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index 33379289d..acc143636 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -30,6 +30,7 @@ #include <86box/timer.h> #include <86box/sound.h> #include <86box/snd_ad1848.h> +#include <86box/plat_fallthrough.h> #define CS4231 0x80 #define CS4236 0x03 @@ -241,7 +242,7 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv) case 10: if (ad1848->type < AD1848_TYPE_CS4235) break; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/sound/snd_cmi8x38.c b/src/sound/snd_cmi8x38.c index c3d93aee9..ea81230a9 100644 --- a/src/sound/snd_cmi8x38.c +++ b/src/sound/snd_cmi8x38.c @@ -34,6 +34,7 @@ #include <86box/gameport.h> #include <86box/nmi.h> #include <86box/ui.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> enum { @@ -467,7 +468,7 @@ cmi8x38_sb_mixer_write(uint16_t addr, uint8_t val, void *priv) case 0xf8 ... 0xff: if (dev->type == CMEDIA_CMI8338) mixer->regs[mixer->index] = val; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index 8be3b6b33..fff716e28 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -36,6 +36,7 @@ #include <86box/snd_ad1848.h> #include <86box/snd_opl.h> #include <86box/snd_sb.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #define CRYSTAL_NOEEPROM 0x100 @@ -299,7 +300,7 @@ cs423x_write(uint16_t addr, uint8_t val, void *priv) switch (val) { case 0x55: /* Disable PnP Key */ dev->pnp_enable = 0; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index 1a4265c4c..c7e6d39f9 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -17,6 +17,7 @@ #include <86box/sound.h> #include <86box/timer.h> #include <86box/snd_ad1848.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> enum { @@ -626,7 +627,7 @@ writegus(uint16_t addr, uint8_t val, void *priv) else if (gus->irq != -1) picint(1 << gus->irq); } -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x20d: diff --git a/src/sound/snd_sb_dsp.c b/src/sound/snd_sb_dsp.c index 8c6d4146d..d4dcd5a79 100644 --- a/src/sound/snd_sb_dsp.c +++ b/src/sound/snd_sb_dsp.c @@ -25,6 +25,7 @@ #include <86box/sound.h> #include <86box/timer.h> #include <86box/snd_sb.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #define ADPCM_4 1 @@ -600,7 +601,7 @@ sb_exec_command(sb_dsp_t *dsp) case 0x75: /* 4-bit ADPCM output with reference */ dsp->sbref = dsp->dma_readb(dsp->dma_priv); dsp->sbstep = 0; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x74: /* 4-bit ADPCM output */ diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index ccc530e3b..a9d0a3f5d 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -536,7 +536,7 @@ ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len) case 0x92e8: if (len != 1) dev->test = val; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0xd2e8: diff --git a/src/video/vid_ati_eeprom.c b/src/video/vid_ati_eeprom.c index a3479c20a..4992fff40 100644 --- a/src/video/vid_ati_eeprom.c +++ b/src/video/vid_ati_eeprom.c @@ -26,6 +26,7 @@ #include <86box/timer.h> #include <86box/nvr.h> #include <86box/vid_ati_eeprom.h> +#include <86box/plat_fallthrough.h> void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type) @@ -93,7 +94,7 @@ ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat) if (!dat) break; eeprom->state = EEPROM_OPCODE; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case EEPROM_OPCODE: diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index d5e721aef..7140e0276 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -748,7 +748,7 @@ mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val) case 0x11e: case 0x11f: WRITE8(addr, mach64->dst_height_width, val); -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x113: @@ -973,7 +973,7 @@ mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val) case 0x2a4: case 0x2a5: addr += 2; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x2aa: @@ -990,7 +990,7 @@ mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val) case 0x2b0: case 0x2b1: addr += 2; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x2b6: diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 797ae3f19..e2b312c47 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -2838,7 +2838,7 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u case 0x92e8: if (len != 1) dev->test = val; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0xd2e8: diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index b06283a1c..a97d65cdb 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -52,6 +52,7 @@ #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> #define ET4000_TYPE_ISA 1 /* ISA ET4000AX */ @@ -432,7 +433,7 @@ et4000_kasan_out(uint16_t addr, uint8_t val, void *priv) case 5: et4000->kasan_cfg_regs[5] = val; et4000->svga.ksc5601_english_font_type = 0x100 | val; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 6: diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 2c44c8b28..bd09a9ede 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -35,6 +35,7 @@ #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> typedef struct ht216_t { @@ -320,7 +321,7 @@ ht216_out(uint16_t addr, uint8_t val, void *priv) svga->adv_flags &= ~FLAG_RAMDAC_SHIFT; if (val & 0x04) svga->adv_flags |= FLAG_RAMDAC_SHIFT; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif /*Bank registers*/ diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index f9387987b..67f8d5751 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -664,7 +664,7 @@ mystique_out(uint16_t addr, uint8_t val, void *priv) switch (addr) { case 0x3c8: mystique->xreg_idx = val; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif case 0x3c6: diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index e52322426..4b51daa33 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -39,7 +39,6 @@ #include <86box/vid_ddc.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> -#include <86box/plat_unused.h> static int dither[4][4] = { {0, 4, 1, 5}, @@ -4305,7 +4304,7 @@ s3_virge_init(const device_t *info) case S3_VIRGE_GX: virge->virge_rev = 0x01; -#ifndef __APPLE__ +#ifdef FALLTHROUGH_ANNOTATION [[fallthrough]]; #endif