General cleanup.

This commit is contained in:
waltje
2017-11-18 21:28:26 -05:00
parent aafdc7e529
commit 181bca1644
16 changed files with 146 additions and 178 deletions

View File

@@ -8,7 +8,7 @@
#
# Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.76 2017/11/12
# Version: @(#)Makefile.mingw 1.0.77 2017/11/17
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -272,6 +272,46 @@ EUROPC := m_europc.o
endif
ifeq ($(WX), y)
CFLAGS += -I$(WXLIB)/wx/include/msw-unicode-3.0 -I$(WXINC) \
-D__WXMSW__ -DWX_PRECOMP -D_FILE_OFFSET_BITS=64
# -lwx_mswu_gl-3.0.dll -llzma
WXLIBS := -mwindows -mthreads \
-L$(WXLIB) \
-lwx_mswu-3.0.dll \
-lrpcrt4 -loleaut32 -lole32 -luuid \
-lwinspool -lwinmm -lshell32 -lcomctl32 \
-lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
endif
ifeq ($(WX), static)
CFLAGS += -I$(WXLIB)/wx/include/msw-unicode-3.0 -I$(WXINC) \
-D__WXMSW__ -DWX_PRECOMP -D_FILE_OFFSET_BITS=64
# -lwx_mswu_gl-3.0 -lwxtiff-3.0 -llzma
WXLIBS := -mwindows -mthreads \
-L$(WXLIB) \
-lwx_mswu-3.0 -lwxscintilla-3.0 \
-lwxjpeg-3.0 -lwxpng-3.0 -lwxzlib-3.0 \
-lwxregexu-3.0 -lwxexpat-3.0 \
-lrpcrt4 -loleaut32 -lole32 -luuid \
-lwinspool -lwinmm -lshell32 -lcomctl32 \
-lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
endif
# Final versions of the toolchain flags.
#CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
# $(AFLAGS) -fomit-frame-pointer -mstackrealign -Wall
#CXXFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(AOPTIM) \
# $(AFLAGS) -fno-strict-aliasing -fvisibility=hidden \
# -Wall -Wundef -fvisibility-inlines-hidden \
# -Wunused-parameter -Wno-ctor-dtor-privacy \
# -Woverloaded-virtual
#########################################################################
# Create the (final) list of objects to build. #
#########################################################################
MAINOBJ := pc.o config.o random.o timer.o io.o dma.o nmi.o pic.o \
pit.o ppi.o pci.o mca.o mcr.o mem.o memregs.o rom.o \
device.o nvr.o nvr_at.o nvr_ps2.o $(VNCOBJ) $(RDPOBJ) \
@@ -481,6 +521,12 @@ ifneq ($(DEBUG), y)
@strip pcap_if.exe
endif
hello.exe: hello.o
$(CXX) $(LDFLAGS) -o hello.exe hello.o $(WXLIBS) $(LIBS)
ifneq ($(DEBUG), y)
@strip hello.exe
endif
clean:
@echo Cleaning objects..

76
src/win/plat_dir.h Normal file
View File

@@ -0,0 +1,76 @@
/*
* 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.
*
* Definitions for the platform OpenDir module.
*
* Version: @(#)plat_dir.h 1.0.1 2017/05/17
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2017 Fred N. van Kempen.
*/
#ifndef PLAT_DIR_H
# define PLAT_DIR_H
#ifdef _MAX_FNAME
# define MAXNAMLEN _MAX_FNAME
#else
# define MAXNAMLEN 15
#endif
# define MAXDIRLEN 127
struct direct {
long d_ino;
unsigned short d_reclen;
unsigned short d_off;
#ifdef UNICODE
wchar_t d_name[MAXNAMLEN + 1];
#else
char d_name[MAXNAMLEN + 1];
#endif
};
#define d_namlen d_reclen
typedef struct {
short flags; /* internal flags */
short offset; /* offset of entry into dir */
long handle; /* open handle to Win32 system */
short sts; /* last known status code */
char *dta; /* internal work data */
#ifdef UNICODE
wchar_t dir[MAXDIRLEN+1]; /* open dir */
#else
char dir[MAXDIRLEN+1]; /* open dir */
#endif
struct direct dent; /* actual directory entry */
} DIR;
/* Directory routine flags. */
#define DIR_F_LOWER 0x0001 /* force to lowercase */
#define DIR_F_SANE 0x0002 /* force this to sane path */
#define DIR_F_ISROOT 0x0010 /* this is the root directory */
/* Function prototypes. */
#ifdef UNICODE
extern DIR *opendirw(const wchar_t *);
#else
extern DIR *opendir(const char *);
#endif
extern struct direct *readdir(DIR *);
extern long telldir(DIR *);
extern void seekdir(DIR *, long);
extern int closedir(DIR *);
#define rewinddir(dirp) seekdir(dirp, 0L)
#endif /*PLAT_DIR_H*/

View File

@@ -10,7 +10,7 @@
*
* Based on old original code @(#)dir_win32.c 1.2.0 2007/04/19
*
* Version: @(#)win_opendir.c 1.0.3 2017/10/16
* Version: @(#)win_opendir.c 1.0.4 2017/11/18
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -27,7 +27,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../plat.h"
#include "../plat_dir.h"
#include "plat_dir.h"
#ifdef UNICODE