More portability changes and cleanups. 86Box now also compiles (and runs) on FreeBSD 10.4-RELEASE.

This commit is contained in:
waltje
2017-10-27 04:54:45 -04:00
parent 0bbcac68d2
commit 77d695f430
11 changed files with 40 additions and 9 deletions

View File

@@ -10,7 +10,7 @@
# settings, so we can avoid changing the main one for all of # settings, so we can avoid changing the main one for all of
# our local setups. # our local setups.
# #
# Version: @(#)Makefile.local 1.0.5 2017/10/19 # Version: @(#)Makefile.local 1.0.6 2017/10/26
# #
# Author: Fred N. van Kempen, <decwiz@yahoo.com> # Author: Fred N. van Kempen, <decwiz@yahoo.com>
# #
@@ -73,6 +73,7 @@ DEV_BRANCH := n
CIRRUS := n CIRRUS := n
NE1000 := n NE1000 := n
NV_RIVA := n NV_RIVA := n
OPENAL := y
FLUIDSYNTH := y FLUIDSYNTH := y
MUNT := y MUNT := y
PAS16 := n PAS16 := n

View File

@@ -18,6 +18,11 @@
/* Modified for use with PCem by bit */ /* Modified for use with PCem by bit */
//#ifdef FREEBSD
//# define fopen64 fopen
//# define fseeko64 fseeko
//# define ftello64 ftello
//#endif
#define _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE
#ifdef WIN32 #ifdef WIN32
@@ -36,6 +41,7 @@
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <sys/stat.h> #include <sys/stat.h>
#include "../plat.h"
#include "cdrom_dosbox.h" #include "cdrom_dosbox.h"
#if !defined(WIN32) #if !defined(WIN32)

View File

@@ -8,7 +8,7 @@
* *
* Driver for the ESDI controller (WD1007-vse1) for PC/AT. * Driver for the ESDI controller (WD1007-vse1) for PC/AT.
* *
* Version: @(#)hdc_esdi_at.c 1.0.5 2017/10/16 * Version: @(#)hdc_esdi_at.c 1.0.6 2017/10/26
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -34,6 +34,7 @@
#include "../pic.h" #include "../pic.h"
#include "../rom.h" #include "../rom.h"
#include "../timer.h" #include "../timer.h"
#include "../plat.h"
#include "../ui.h" #include "../ui.h"
#include "hdc.h" #include "hdc.h"
#include "hdd.h" #include "hdd.h"

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI * Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices. * CD-ROM devices.
* *
* Version: @(#)hdc_ide.c 1.0.15 2017/10/26 * Version: @(#)hdc_ide.c 1.0.16 2017/10/26
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -35,6 +35,7 @@
#include "../device.h" #include "../device.h"
#include "../cdrom/cdrom.h" #include "../cdrom/cdrom.h"
#include "../scsi/scsi.h" #include "../scsi/scsi.h"
#include "../plat.h"
#include "../ui.h" #include "../ui.h"
#include "hdc.h" #include "hdc.h"
#include "hdc_ide.h" #include "hdc_ide.h"

View File

@@ -12,7 +12,7 @@
* based design. Most cards were WD1003-WA2 or -WAH, where the * based design. Most cards were WD1003-WA2 or -WAH, where the
* -WA2 cards had a floppy controller as well (to save space.) * -WA2 cards had a floppy controller as well (to save space.)
* *
* Version: @(#)hdd_mfm_at.c 1.0.9 2017/10/16 * Version: @(#)hdd_mfm_at.c 1.0.10 2017/10/26
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com> * Fred N. van Kempen, <decwiz@yahoo.com>
@@ -34,6 +34,7 @@
#include "../io.h" #include "../io.h"
#include "../pic.h" #include "../pic.h"
#include "../timer.h" #include "../timer.h"
#include "../plat.h"
#include "../ui.h" #include "../ui.h"
#include "hdc.h" #include "hdc.h"
#include "hdd.h" #include "hdd.h"

View File

@@ -41,7 +41,7 @@
* Since all controllers (including the ones made by DTC) use * Since all controllers (including the ones made by DTC) use
* (mostly) the same API, we keep them all in this module. * (mostly) the same API, we keep them all in this module.
* *
* Version: @(#)hdd_mfm_xt.c 1.0.10 2017/10/16 * Version: @(#)hdd_mfm_xt.c 1.0.11 2017/10/26
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com> * Fred N. van Kempen, <decwiz@yahoo.com>
@@ -66,6 +66,7 @@
#include "../pic.h" #include "../pic.h"
#include "../rom.h" #include "../rom.h"
#include "../timer.h" #include "../timer.h"
#include "../plat.h"
#include "../ui.h" #include "../ui.h"
#include "hdc.h" #include "hdc.h"
#include "hdd.h" #include "hdd.h"

View File

@@ -60,6 +60,10 @@ typedef unsigned long ioctlsockopt_t;
# define final_udp slirp_final_udp # define final_udp slirp_final_udp
#else #else
# include <inttypes.h> # include <inttypes.h>
# define HAVE_STDINT_H
# define HAVE_STDLIB_H
# define HAVE_STRING_H
# define HAVE_UNISTD_H
typedef uint8_t u_int8_t; typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t; typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t; typedef uint32_t u_int32_t;

View File

@@ -24,6 +24,15 @@
#endif #endif
#ifdef FREEBSD
/* FreeBSD has largefile by default. */
# define fopen64 fopen
# define fseeko64 fseeko
# define ftello64 ftello
# define off64_t off_t
#endif
/* A hack (GCC-specific) to allow us to ignore unused parameters. */ /* A hack (GCC-specific) to allow us to ignore unused parameters. */
#define UNUSED(arg) __attribute__((unused))arg #define UNUSED(arg) __attribute__((unused))arg

View File

@@ -1,4 +1,3 @@
#define USE_OPENAL
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
@@ -39,6 +38,7 @@ void al_set_midi(int freq, int buf_size)
midi_buf_size = buf_size; midi_buf_size = buf_size;
} }
#ifdef USE_OPENAL
void closeal(void); void closeal(void);
ALvoid alutInit(ALint *argc,ALbyte **argv) ALvoid alutInit(ALint *argc,ALbyte **argv)
{ {
@@ -80,6 +80,7 @@ ALvoid alutExit(ALvoid)
alcDestroyContext(Context); alcDestroyContext(Context);
} }
} }
#endif
void closeal(void) void closeal(void)

View File

@@ -8,7 +8,7 @@
* *
* Define the various UI functions. * Define the various UI functions.
* *
* Version: @(#)ui.h 1.0.6 2017/10/24 * Version: @(#)ui.h 1.0.7 2017/10/26
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com> * Fred N. van Kempen, <decwiz@yahoo.com>
@@ -28,7 +28,7 @@ extern "C" {
#ifdef WIN32 #ifdef WIN32
# include "win/resource.h" # include "win/resource.h"
#else #else
# include "lnx/strings.h" # include "unix/resource.h"
#endif #endif

View File

@@ -8,7 +8,7 @@
# #
# Makefile for Win32 (MinGW32) environment. # Makefile for Win32 (MinGW32) environment.
# #
# Version: @(#)Makefile.mingw 1.0.68 2017/10/26 # Version: @(#)Makefile.mingw 1.0.69 2017/10/26
# #
# Authors: Miran Grca, <mgrca8@gmail.com> # Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com> # Fred N. van Kempen, <decwiz@yahoo.com>
@@ -66,6 +66,9 @@ endif
ifndef NV_RIVA ifndef NV_RIVA
NV_RIVA := n NV_RIVA := n
endif endif
ifndef OPENAL
OPENAL := y
endif
ifndef FLUIDSYNTH ifndef FLUIDSYNTH
FLUIDSYNTH := y FLUIDSYNTH := y
endif endif
@@ -187,6 +190,9 @@ DYNARECOBJ := 386_dynarec_ops.o \
codegen_timing_winchip.o $(PLATCG) codegen_timing_winchip.o $(PLATCG)
endif endif
ifeq ($(OPENAL), y)
CFLAGS += -DUSE_OPENAL
endif
ifeq ($(FLUIDSYNTH), y) ifeq ($(FLUIDSYNTH), y)
CFLAGS += -DUSE_FLUIDSYNTH CFLAGS += -DUSE_FLUIDSYNTH
FSYNTHOBJ := midi_fluidsynth.o FSYNTHOBJ := midi_fluidsynth.o