1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-03-26 10:03:39 +00:00

SCP: Updated to current.

This commit is contained in:
Richard Cornwell
2020-01-29 22:10:36 -05:00
parent c15b9ffa88
commit 1b91036179
5 changed files with 244 additions and 79 deletions

176
build_vstudio.bat Normal file
View File

@@ -0,0 +1,176 @@
@echo off
:: Rebuild all of SIMH simulators using Visual Studio
::
:: If this procedure is not invoked from a Developer command prompt
:: then the VS2008 tools are preferred if VS2008 is installed,
:: otherwise the installed Visual Studio tools will be used
:: prefering newer Visual Studio versions over older ones.
::
:: If this procedure is invoked from a Developer command prompt
:: then the tool chain provided with the command prompt is used
:: to build the simh projects.
::
:: A single argument to this procedure may be the word Debug, which
:: will cause Debug binaries to be built rather than the Release
:: binaries which is the default.
::
:: The default is to build all simulators mentioned in the simh solution.
:: Optionally, individual simulators may be built by listing the specific
:: simulator names on the command line invoking this procedure.
::
:: Individual simulator sources are in .\simulator_name
:: Individual simulator executables are produced in .\BIN\NT\Win32-{Debug or Release}\
::
::
:: Initialize target variables
set _BUILD_CONFIG=Release
set _BUILD_PROJECTS=
set _REBUILD_PROJECTS=
set _BUILD_PROJECT_DIR=%~dp0\Visual Studio Projects\
:_CheckArg
if "%1" == "" goto _DoneArgs
if /i "%1" == "Debug" set _BUILD_CONFIG=Debug& shift & goto _CheckArg
if /i "%1" == "Release" set _BUILD_CONFIG=Release& shift & goto _CheckArg
call :GetFileName "%_BUILD_PROJECT_DIR%%1.vcproj" _BUILD_PROJECT
if exist "%_BUILD_PROJECT_DIR%%1.vcproj" set _BUILD_PROJECTS=%_BUILD_PROJECTS%;%_BUILD_PROJECT%
if exist "%_BUILD_PROJECT_DIR%%1.vcproj" set _REBUILD_PROJECTS=%_REBUILD_PROJECTS%;%_BUILD_PROJECT%:Rebuild
if exist "%_BUILD_PROJECT_DIR%%1.vcproj" shift & goto _CheckArg
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR
echo **
echo ** No such project: %1
echo **
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR
exit /b 1
:_DoneArgs
set _VC_VER=
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
call :FindVCVersion _VC_VER
if not "%_VC_VER%" == "" goto GotVC
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR **
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR **
echo ** **
echo ** I can't find a Visual Studio version installed **
echo ** in the default location on this system. **
echo ** **
echo ** If you haven't installed any version of Visual **
echo ** Studio yet, you must install one before this **
echo ** procedure can be used. The earliest Visual **
echo ** Studio version that is supported is VS2008 which **
echo ** can be downloaded and installed from: **
echo ** **
echo http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso
echo ** **
echo ** Newer versions of Visual Studio are also **
echo ** supported, but the initial build will have to **
echo ** convert the VS2008 project definitions. **
echo ** **
echo ** If you installed a version of Visual Studio C++ **
echo ** in a non default location, then you must invoke **
echo ** this procedure from a developer command prompt **
echo ** for the version of Visual Studio you have **
echo ** installed. **
echo ** **
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR **
echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR **
exit /b 1
:WhichInPath
if "%~$PATH:1" EQU "" exit /B 1
set %2=%~$PATH:1
exit /B 0
:FindVCVersion
call :WhichInPath cl.exe _VC_CL_
for /f "tokens=3-9 delims=\" %%a in ("%_VC_CL_%") do call :VCCheck _VC_VER_NUM_ "%%a" "%%b" "%%c" "%%d" "%%e" "%%f" "%%g"
for /f "delims=." %%a in ("%_VC_VER_NUM_%") do set %1=%%a
set _VC_CL=
exit /B 0
:VCCheck
set _VC_TMP=%1
:_VCCheck_Next
shift
set _VC_TMP_=%~1
if "%_VC_TMP_%" equ "" goto _VCCheck_Done
if "%_VC_TMP_:~0,24%" EQU "Microsoft Visual Studio " set %_VC_TMP%=%_VC_TMP_:Microsoft Visual Studio =%
call :IsNumeric _VC_NUM_ %_VC_TMP_%
if "%_VC_NUM_%" neq "" set %_VC_TMP%=%~1
if "%_VC_NUM_%" neq "" goto _VCCheck_Done
goto _VCCheck_Next
:_VCCheck_Done
set _VC_TMP_=
set _VC_TMP=
set _VC_NUM_=
exit /B 0
:IsNumeric
set _Numeric_TMP_=%~1
set _Numeric_Test_=%2
set _Numeric_Test_=%_Numeric_Test_:~0,1%
set %_Numeric_TMP_%=
if "%_Numeric_Test_%"=="0" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="1" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="2" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="3" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="4" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="5" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="6" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="7" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="8" set %_Numeric_TMP_%=1
if "%_Numeric_Test_%"=="9" set %_Numeric_TMP_%=1
set _Numeric_TMP_=
set _Numeric_Test_=
exit /B 0
:GetFileName
set %2=%~n1
exit /B 0
:GotVC
set _BUILD_PARALLEL=8
if %_BUILD_PARALLEL% GTR %NUMBER_OF_PROCESSORS% set _BUILD_PARALLEL=%NUMBER_OF_PROCESSORS%
SET _X_SLN_VERSION=
for /F "usebackq tokens=8" %%a in (`findstr /C:"Microsoft Visual Studio Solution File, Format Version" "%_BUILD_PROJECT_DIR%Simh.sln"`) do SET _X_SLN_VERSION=%%a
if not "%_VC_VER%" == "9" goto _DoMSBuild
if "%_BUILD_PROJECTS%" == "" vcbuild /nologo /M%_BUILD_PARALLEL% /useenv /rebuild "%_BUILD_PROJECT_DIR%Simh.sln" "%_BUILD_CONFIG%|Win32" & goto :EOF
set _BUILD_PROJECTS=%_BUILD_PROJECTS:~1%
:_NextProject
set _BUILD_PROJECT=
for /f "tokens=1* delims=;" %%a in ("%_BUILD_PROJECTS%") do set _BUILD_PROJECT=%%a& set _BUILD_PROJECTS=%%b
if "%_BUILD_PROJECT%" == "" goto :EOF
echo.
echo Building %_BUILD_PROJECT%
vcbuild /nologo /useenv /rebuild "%_BUILD_PROJECT_DIR%%_BUILD_PROJECT%.vcproj" "%_BUILD_CONFIG%|Win32"
goto _NextProject
:_DoMSBuild
if "%_X_SLN_VERSION%" == "10.00" echo Converting the VS2008 projects to VS%_VC_VER%, this will take several (3-5) minutes & DevEnv /Upgrade "%_BUILD_PROJECT_DIR%Simh.sln"
if "%_BUILD_PROJECTS%" == "" MSBuild /nologo "%_BUILD_PROJECT_DIR%Simh.sln" /maxCpuCount:%_BUILD_PARALLEL% /Target:Rebuild /Property:Configuration=%_BUILD_CONFIG% /Property:Platform=Win32 & goto :EOF
set _BUILD_PROJECTS=%_BUILD_PROJECTS:~1%
set _REBUILD_PROJECTS=%_REBUILD_PROJECTS:~1%
MSBuild /nologo "%_BUILD_PROJECT_DIR%Simh.sln" /maxCpuCount:%_BUILD_PARALLEL% /Target:%_REBUILD_PROJECTS% /Property:Configuration=%_BUILD_CONFIG% /Property:Platform=Win32 & goto :EOF

View File

@@ -32,6 +32,10 @@
# installed, gmake should be invoked with LPATH=/usr/lib:/usr/local/lib
# defined (adjusted as needed depending on where they may be installed).
#
# In the unlikely event that someone wants to build network capable
# simulators without networking support, invoking GNU make with
# NONETWORK=1 will do the trick.
#
# The default build will build compiler optimized binaries.
# If debugging is desired, then GNU make can be invoked with
# DEBUG=1 on the command line.
@@ -66,12 +70,6 @@
# Internal ROM support can be disabled if GNU make is invoked with
# DONT_USE_ROMS=1 on the command line.
#
# The use of pthreads for various things can be disabled if GNU make is
# invoked with NOPTHREADS=1 on the command line.
#
# Asynchronous I/O support can be disabled if GNU make is invoked with
# NOASYNCH=1 on the command line.
#
# For linting (or other code analyzers) make may be invoked similar to:
#
# make GCC=cppcheck CC_OUTSPEC= LDFLAGS= CFLAGS_G="--enable=all --template=gcc" CC_STD=--std=c99
@@ -143,6 +141,10 @@ else
BESM6_BUILD = true
endif
endif
# someone may want to explicitly build simulators without network support
ifneq ($(NONETWORK),)
NETWORK_USEFUL =
endif
find_exe = $(abspath $(strip $(firstword $(foreach dir,$(strip $(subst :, ,${PATH})),$(wildcard $(dir)/$(1))))))
find_lib = $(abspath $(strip $(firstword $(foreach dir,$(strip ${LIBPATH}),$(wildcard $(dir)/lib$(1).${LIBEXT})))))
find_include = $(abspath $(strip $(firstword $(foreach dir,$(strip ${INCPATH}),$(wildcard $(dir)/$(1).h)))))
@@ -253,10 +255,7 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
LTO_EXCLUDE_VERSIONS =
PCAPLIB = pcap
ifeq (agcc,$(findstring agcc,${GCC})) # Android target build?
OS_CCDEFS = -D_GNU_SOURCE
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_CCDEFS = -D_GNU_SOURCE -DSIM_ASYNCH_IO
OS_LDFLAGS = -lm
else # Non-Android (or Native Android) Builds
ifeq (,$(INCLUDES)$(LIBRARIES))
@@ -463,38 +462,25 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
OS_LDFLAGS += -lrt
$(info using librt: $(call find_lib,rt))
endif
ifneq (,$(NOPTHREADS))
OS_CCDEFS += -DDONT_USE_READER_THREAD
else
ifneq (,$(call find_include,pthread))
ifneq (,$(call find_include,pthread))
ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD -DSIM_ASYNCH_IO
OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else
LIBEXTSAVE := ${LIBEXT}
LIBEXT = a
ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_CCDEFS += -DUSE_READER_THREAD -DSIM_ASYNCH_IO
OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else
LIBEXTSAVE := ${LIBEXT}
LIBEXT = a
ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else
ifneq (,$(findstring Haiku,$(OSTYPE)))
OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
$(info using libpthread: $(call find_include,pthread))
endif
ifneq (,$(findstring Haiku,$(OSTYPE)))
OS_CCDEFS += -DUSE_READER_THREAD -DSIM_ASYNCH_IO
$(info using libpthread: $(call find_include,pthread))
endif
LIBEXT = $(LIBEXTSAVE)
endif
LIBEXT = $(LIBEXTSAVE)
endif
endif
# Find PCRE RegEx library.
@@ -656,14 +642,12 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
endif
else
ifneq (,$(and $(findstring Linux,$(OSTYPE)),$(call find_exe,apt-get)))
$(info *** Info *** Install the development components of libSDL or libSDL2)
$(info *** Info *** packaged for your operating system distribution for)
$(info *** Info *** your Linux system:)
$(info *** Info *** Install the development components of libSDL2 packaged for)
$(info *** Info *** your operating system distribution for your Linux)
$(info *** Info *** system:)
$(info *** Info *** $$ sudo apt-get install libsdl2-dev libpng-dev)
$(info *** Info *** or)
$(info *** Info *** $$ sudo apt-get install libsdl-dev)
else
$(info *** Info *** Install the development components of libSDL packaged by your)
$(info *** Info *** Install the development components of libSDL2 packaged by your)
$(info *** Info *** operating system distribution and rebuild your simulator to)
$(info *** Info *** enable this extra functionality.)
endif
@@ -957,17 +941,11 @@ else
$(info include paths are: ${INCPATH})
# Give preference to any MinGW provided threading (if available)
ifneq (,$(call find_include,pthread))
PTHREADS_CCDEFS = -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
PTHREADS_CCDEFS += -DSIM_ASYNCH_IO
endif
PTHREADS_CCDEFS = -DUSE_READER_THREAD -DSIM_ASYNCH_IO
PTHREADS_LDFLAGS = -lpthread
else
ifeq (pthreads,$(shell if exist ..\windows-build\pthreads\Pre-built.2\include\pthread.h echo pthreads))
PTHREADS_CCDEFS = -DUSE_READER_THREAD -DPTW32_STATIC_LIB -D_POSIX_C_SOURCE -I../windows-build/pthreads/Pre-built.2/include
ifeq (,$(NOASYNCH))
PTHREADS_CCDEFS += -DSIM_ASYNCH_IO
endif
PTHREADS_CCDEFS = -DUSE_READER_THREAD -DPTW32_STATIC_LIB -D_POSIX_C_SOURCE -I../windows-build/pthreads/Pre-built.2/include -DSIM_ASYNCH_IO
PTHREADS_LDFLAGS = -lpthreadGC2 -L..\windows-build\pthreads\Pre-built.2\lib
endif
endif

View File

@@ -931,9 +931,9 @@ _sim_read_deck(UNIT * uptr, int eof)
if (data->hopper_cards >= data->hopper_size) {
data->hopper_size += DECK_SIZE;
data->images = (uint16 (*)[1][80])realloc(data->images,
data->hopper_size * sizeof(*(data->images)));
(size_t)data->hopper_size * sizeof(*(data->images)));
memset(&data->images[data->hopper_cards], 0,
(data->hopper_size - data->hopper_cards) *
(size_t)(data->hopper_size - data->hopper_cards) *
sizeof(*(data->images)));
}
@@ -961,9 +961,9 @@ _sim_read_deck(UNIT * uptr, int eof)
if (data->hopper_cards >= data->hopper_size) {
data->hopper_size += DECK_SIZE;
data->images = (uint16 (*)[1][80])realloc(data->images,
data->hopper_size * sizeof(*(data->images)));
(size_t)data->hopper_size * sizeof(*(data->images)));
memset(&data->images[data->hopper_cards], 0,
(data->hopper_size - data->hopper_cards) *
(size_t)(data->hopper_size - data->hopper_cards) *
sizeof(*(data->images)));
}

View File

@@ -379,6 +379,7 @@
/* Internal routines - forward declarations */
static int _eth_get_system_id (char *buf, size_t buf_size);
static int _eth_devices (int max, ETH_LIST* dev); /* get ethernet devices on host */
/*============================================================================*/
/* OS-independant ethernet routines */
@@ -657,10 +658,10 @@ void eth_packet_trace_detail(ETH_DEV* dev, const uint8 *msg, int len, const char
eth_packet_trace_ex(dev, msg, len, txt, 1 , dev->dbit);
}
const char* eth_getname(int number, char* name, char *desc)
static const char* _eth_getname(int number, char* name, char *desc)
{
ETH_LIST list[ETH_MAX_DEVICE];
int count = eth_devices(ETH_MAX_DEVICE, list);
int count = _eth_devices(ETH_MAX_DEVICE, list);
if ((number < 0) || (count <= number))
return NULL;
@@ -677,7 +678,7 @@ const char* eth_getname(int number, char* name, char *desc)
const char* eth_getname_bydesc(const char* desc, char* name, char *ndesc)
{
ETH_LIST list[ETH_MAX_DEVICE];
int count = eth_devices(ETH_MAX_DEVICE, list);
int count = _eth_devices(ETH_MAX_DEVICE, list);
int i;
size_t j=strlen(desc);
@@ -703,7 +704,7 @@ const char* eth_getname_bydesc(const char* desc, char* name, char *ndesc)
char* eth_getname_byname(const char* name, char* temp, char *desc)
{
ETH_LIST list[ETH_MAX_DEVICE];
int count = eth_devices(ETH_MAX_DEVICE, list);
int count = _eth_devices(ETH_MAX_DEVICE, list);
size_t n;
int i, found;
@@ -723,7 +724,7 @@ char* eth_getname_byname(const char* name, char* temp, char *desc)
char* eth_getdesc_byname(char* name, char* temp)
{
ETH_LIST list[ETH_MAX_DEVICE];
int count = eth_devices(ETH_MAX_DEVICE, list);
int count = _eth_devices(ETH_MAX_DEVICE, list);
size_t n;
int i, found;
@@ -777,7 +778,7 @@ t_stat eth_show (FILE* st, UNIT* uptr, int32 val, CONST void* desc)
ETH_LIST list[ETH_MAX_DEVICE];
int number;
number = eth_devices(ETH_MAX_DEVICE, list);
number = _eth_devices(ETH_MAX_DEVICE, list);
fprintf(st, "ETH devices:\n");
if (number == -1)
fprintf(st, " network support not available in simulator\n");
@@ -956,7 +957,7 @@ t_stat eth_filter (ETH_DEV* dev, int addr_count, ETH_MAC* const addresses,
t_stat eth_filter_hash (ETH_DEV* dev, int addr_count, ETH_MAC* const addresses,
ETH_BOOL all_multicast, ETH_BOOL promiscuous, ETH_MULTIHASH* const hash)
{return SCPE_NOFNC;}
int eth_devices (int max, ETH_LIST* dev)
int _eth_devices (int max, ETH_LIST* dev)
{return -1;}
const char *eth_version (void)
{return NULL;}
@@ -1062,22 +1063,28 @@ static HINSTANCE hLib = NULL; /* handle to DLL */
static void *hLib = 0; /* handle to Library */
#endif
static int lib_loaded = 0; /* 0=not loaded, 1=loaded, 2=library load failed, 3=Func load failed */
#define __STR_QUOTE(tok) #tok
#define __STR(tok) __STR_QUOTE(tok)
static const char* lib_name =
#if defined(_WIN32) || defined(__CYGWIN__)
"wpcap.dll";
#elif defined(__APPLE__)
"/usr/lib/libpcap.A.dylib";
#else
#define __STR_QUOTE(tok) #tok
#define __STR(tok) __STR_QUOTE(tok)
"libpcap." __STR(HAVE_DLOPEN);
#endif
static const char* no_pcap =
static char no_pcap[PCAP_ERRBUF_SIZE] =
#if defined(_WIN32) || defined(__CYGWIN__)
"wpcap load failure";
"wpcap.dll failed to load, install Npcap or WinPcap 4.x to use pcap networking";
#elif defined(__APPLE__)
"/usr/lib/libpcap.A.dylib failed to load, install libpcap to use pcap networking";
#else
"libpcap load failure";
"libpcap." __STR(HAVE_DLOPEN) " failed to load, install libpcap to use pcap networking";
#endif
#undef __STR
#undef __STR_QUOTE
/* define pointers to pcap functions needed */
static void (*p_pcap_close) (pcap_t *);
@@ -1147,12 +1154,6 @@ int load_pcap(void) {
#endif
if (hLib == 0) {
/* failed to load DLL */
sim_printf ("Eth: Failed to load %s\n", lib_name);
#ifdef _WIN32
sim_printf ("Eth: You must install Npcap or WinPcap 4.x to use networking\n");
#else
sim_printf ("Eth: You must install libpcap to use networking\n");
#endif
lib_loaded = 2;
break;
} else {
@@ -1212,10 +1213,19 @@ int pcap_compile(pcap_t* a, struct bpf_program* b, const char* c, int d, bpf_u_i
}
const char *pcap_lib_version(void) {
static char buf[256];
if ((load_pcap() != 0) && (p_pcap_lib_version != NULL)) {
return p_pcap_lib_version();
} else {
return NULL;
sprintf (buf, "%s not installed",
#if defined(_WIN32)
"npcap or winpcap"
#else
"libpcap"
#endif
);
return buf;
}
}
@@ -1241,6 +1251,7 @@ int pcap_findalldevs(pcap_if_t** a, char* b) {
} else {
*a = 0;
strcpy(b, no_pcap);
no_pcap[0] = '\0';
return -1;
}
}
@@ -2278,7 +2289,7 @@ if ((strlen(name) == 4)
&& isdigit(name[3])
) {
num = atoi(&name[3]);
savname = eth_getname(num, temp, desc);
savname = _eth_getname(num, temp, desc);
if (savname == NULL) /* didn't translate */
return SCPE_OPENERR;
}
@@ -3934,7 +3945,7 @@ return SCPE_OK;
returned by pcap_findalldevs.
*/
int eth_host_devices(int used, int max, ETH_LIST* list)
static int eth_host_devices(int used, int max, ETH_LIST* list)
{
pcap_t* conn = NULL;
int i, j, datalink = 0;
@@ -4037,7 +4048,7 @@ if (used < max) {
return used;
}
int eth_devices(int max, ETH_LIST* list)
static int _eth_devices(int max, ETH_LIST* list)
{
int i = 0;
char errbuf[PCAP_ERRBUF_SIZE] = "";
@@ -4049,7 +4060,8 @@ memset(list, 0, max*sizeof(*list));
errbuf[0] = '\0';
/* retrieve the device list */
if (pcap_findalldevs(&alldevs, errbuf) == -1) {
sim_printf ("Eth: error in pcap_findalldevs: %s\n", errbuf);
if (errbuf[0])
sim_printf ("Eth: %s\n", errbuf);
}
else {
/* copy device list into the passed structure */
@@ -4241,7 +4253,7 @@ int bpf_compile_skip_count = 0;
memset (&eth_tst, 0, sizeof(eth_tst));
eth_device_count = eth_devices(ETH_MAX_DEVICE, eth_list);
eth_device_count = _eth_devices(ETH_MAX_DEVICE, eth_list);
eth_opened = 0;
for (eth_num=0; eth_num<eth_device_count; eth_num++) {
char eth_name[32];

View File

@@ -350,7 +350,6 @@ t_stat eth_filter_hash (ETH_DEV* dev, int addr_count, /* set filter on incomin
t_stat eth_check_address_conflict (ETH_DEV* dev,
ETH_MAC* const address);
const char *eth_version (void); /* Version of dynamically loaded library (pcap) */
int eth_devices (int max, ETH_LIST* dev); /* get ethernet devices on host */
void eth_setcrc (ETH_DEV* dev, int need_crc); /* enable/disable CRC mode */
t_stat eth_set_async (ETH_DEV* dev, int latency); /* set read behavior to be async */
t_stat eth_clr_async (ETH_DEV* dev); /* set read behavior to be not async */