1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Build with newer toolchain.

Various fixups to build under win-builds.org toolchain rather than MinGW. No
longer builds under MinGW as I have removed headers/definitions that it lacks.
This commit is contained in:
Daniel Collins 2014-06-25 23:19:37 +01:00
parent d9a82081da
commit dcd484702e
15 changed files with 45 additions and 164 deletions

View File

@ -14,6 +14,16 @@
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
ifdef HOST
CC := $(HOST)-gcc
CXX := $(HOST)-g++
endif
WINDRES ?= $(shell \
(which "$(HOST)-windres" > /dev/null 2>&1 && echo "$(HOST)-windres") \
|| echo "windres" \
)
ifdef DEBUG
DBG_OPT := -g
else
@ -49,7 +59,7 @@ all: ipxwrapper.dll wsock32.dll mswsock.dll ipxconfig.exe dpwsockx.dll
clean:
rm -f ipxwrapper.dll wsock32.dll mswsock.dll ipxconfig.exe dpwsockx.dll
rm -f src/*.o src/*_stubs.s version.o Makefile.dep
rm -f src/*.o src/*_stubs.s icons/*.o version.o Makefile.dep
rm -f tests/*.exe tests/*.o
dist: all
@ -99,7 +109,7 @@ ipxwrapper.dll: $(IPXWRAPPER_DEPS)
$(CC) $(CFLAGS) -Wl,--enable-stdcall-fixup -shared -o ipxwrapper.dll $(IPXWRAPPER_DEPS) version.o -liphlpapi -lversion -lole32 -loleaut32
ipxconfig.exe: src/ipxconfig.cpp icons/ipxconfig.o src/addr.o src/interface.o src/common.o src/config.o src/wpcap_stubs.o
$(CXX) $(CXXFLAGS) -Wl,--enable-stdcall-fixup -static-libgcc -static-libstdc++ -D_WIN32_IE=0x0400 -mwindows -o ipxconfig.exe $^ -liphlpapi -lcomctl32 -lws2_32
$(CXX) $(CXXFLAGS) -Wl,--enable-stdcall-fixup -static-libgcc -static-libstdc++ -D_WIN32_IE=0x0500 -mwindows -o ipxconfig.exe $^ -liphlpapi -lcomctl32 -lws2_32
dpwsockx.dll: src/directplay.o src/log.o src/dpwsockx_stubs.o src/common.o src/config.o src/addr.o src/dpwsockx.def
$(CC) $(CFLAGS) -Wl,--enable-stdcall-fixup -shared -o $@ $^ -lwsock32
@ -120,7 +130,7 @@ src/wpcap_stubs.s: src/wpcap_stubs.txt
perl mkstubs.pl src/wpcap_stubs.txt src/wpcap_stubs.s 5
icons/%.o: icons/%.rc icons/%.ico
windres $< -O coff -o $@
$(WINDRES) $< -O coff -o $@
%.dll: src/stubdll.o src/%_stubs.o src/log.o src/common.o src/config.o src/addr.o src/%.def
$(CC) $(CFLAGS) -Wl,--enable-stdcall-fixup -shared -o $@ $^

View File

@ -1,117 +0,0 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 6.00.0366 */
/* Compiler settings for icftypes.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef __icftypes_h__
#define __icftypes_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
/* header files for imported files */
#include "wtypes.h"
#ifdef __cplusplus
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
/* interface __MIDL_itf_icftypes_0000 */
/* [local] */
typedef
enum NET_FW_POLICY_TYPE_
{ NET_FW_POLICY_GROUP = 0,
NET_FW_POLICY_LOCAL = NET_FW_POLICY_GROUP + 1,
NET_FW_POLICY_EFFECTIVE = NET_FW_POLICY_LOCAL + 1,
NET_FW_POLICY_TYPE_MAX = NET_FW_POLICY_EFFECTIVE + 1
} NET_FW_POLICY_TYPE;
typedef
enum NET_FW_PROFILE_TYPE_
{ NET_FW_PROFILE_DOMAIN = 0,
NET_FW_PROFILE_STANDARD = NET_FW_PROFILE_DOMAIN + 1,
NET_FW_PROFILE_CURRENT = NET_FW_PROFILE_STANDARD + 1,
NET_FW_PROFILE_TYPE_MAX = NET_FW_PROFILE_CURRENT + 1
} NET_FW_PROFILE_TYPE;
typedef
enum NET_FW_IP_VERSION_
{ NET_FW_IP_VERSION_V4 = 0,
NET_FW_IP_VERSION_V6 = NET_FW_IP_VERSION_V4 + 1,
NET_FW_IP_VERSION_ANY = NET_FW_IP_VERSION_V6 + 1,
NET_FW_IP_VERSION_MAX = NET_FW_IP_VERSION_ANY + 1
} NET_FW_IP_VERSION;
typedef
enum NET_FW_SCOPE_
{ NET_FW_SCOPE_ALL = 0,
NET_FW_SCOPE_LOCAL_SUBNET = NET_FW_SCOPE_ALL + 1,
NET_FW_SCOPE_CUSTOM = NET_FW_SCOPE_LOCAL_SUBNET + 1,
NET_FW_SCOPE_MAX = NET_FW_SCOPE_CUSTOM + 1
} NET_FW_SCOPE;
typedef
enum NET_FW_IP_PROTOCOL_
{ NET_FW_IP_PROTOCOL_TCP = 6,
NET_FW_IP_PROTOCOL_UDP = 17
} NET_FW_IP_PROTOCOL;
typedef
enum NET_FW_SERVICE_TYPE_
{ NET_FW_SERVICE_FILE_AND_PRINT = 0,
NET_FW_SERVICE_UPNP = NET_FW_SERVICE_FILE_AND_PRINT + 1,
NET_FW_SERVICE_REMOTE_DESKTOP = NET_FW_SERVICE_UPNP + 1,
NET_FW_SERVICE_NONE = NET_FW_SERVICE_REMOTE_DESKTOP + 1,
NET_FW_SERVICE_TYPE_MAX = NET_FW_SERVICE_NONE + 1
} NET_FW_SERVICE_TYPE;
extern RPC_IF_HANDLE __MIDL_itf_icftypes_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_icftypes_0000_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -219,9 +219,6 @@ typedef struct NetFwMgr NetFwMgr;
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
#ifndef __INetFwRemoteAdminSettings_INTERFACE_DEFINED__
#define __INetFwRemoteAdminSettings_INTERFACE_DEFINED__

View File

@ -15,8 +15,10 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <windows.h>
#define WINSOCK_API_LINKAGE
#include <winsock2.h>
#include <windows.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

View File

@ -15,8 +15,8 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#include <stdlib.h>
#include <time.h>
#include <stdint.h>

View File

@ -16,10 +16,11 @@
*/
#define INITGUID
#define WINSOCK_API_LINKAGE
#include <winsock2.h>
#include <windows.h>
#include <dplaysp.h>
#include <winsock2.h>
#include <wsipx.h>
#include "ipxwrapper.h"

View File

@ -18,13 +18,18 @@
#define COBJMACROS
#define CINTERFACE
#include <winsock2.h>
#include <windows.h>
#include <objbase.h>
#include <netfw.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#include <netfw.h>
#pragma GCC diagnostic pop
#include "ipxwrapper.h"
/* Define the GUIDs of the relevant COM objects here since the ones in the

View File

@ -15,6 +15,8 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#define WINSOCK_API_LINKAGE
#include <windows.h>
#include <iphlpapi.h>
#include <utlist.h>
@ -34,9 +36,6 @@ static CRITICAL_SECTION interface_cache_cs;
static ipx_interface_t *interface_cache = NULL;
static time_t interface_cache_ctime = 0;
/* Missing in MinGW... */
char *_strdup(const char *strSource);
/* Fetch a list of network interfaces available on the system.
*
* Returns a linked list of IP_ADAPTER_INFO structures, all allocated within a

View File

@ -32,7 +32,10 @@ extern "C" {
/* TODO: Dynamic MTU, per interface. */
#define ETHERNET_MTU 1500
#define WILDCARD_IFACE_HWADDR addr48_in((unsigned char[]){0x00,0x00,0x00,0x00,0x00,0x00})
#define WILDCARD_IFACE_HWADDR ({ \
const unsigned char x[] = {0x00,0x00,0x00,0x00,0x00,0x00}; \
addr48_in(x); \
})
typedef struct ipx_interface_ip ipx_interface_ip_t;

View File

@ -460,7 +460,8 @@ static bool save_config()
if(pri_index == 0)
{
primary_iface = addr48_in((unsigned char[]){0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF});
const unsigned char f6[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
primary_iface = addr48_in(f6);
}
else{
/* Iterate over the NIC list to find the selected primary

View File

@ -15,8 +15,10 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <windows.h>
#define WINSOCK_API_LINKAGE
#include <winsock2.h>
#include <windows.h>
#include <wsipx.h>
#include <nspapi.h>
#include <iphlpapi.h>
@ -32,8 +34,6 @@
#include "router.h"
#include "addrcache.h"
int _putenv(const char *envstring);
extern const char *version_string;
extern const char *compile_time;

View File

@ -17,8 +17,9 @@
#ifndef IPXWRAPPER_H
#define IPXWRAPPER_H
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#include <iphlpapi.h>
#include <wsipx.h>
#include <stdint.h>

View File

@ -15,6 +15,7 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <winsock2.h>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>

View File

@ -15,8 +15,10 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <windows.h>
#define WINSOCK_API_LINKAGE
#include <winsock2.h>
#include <windows.h>
#include <uthash.h>
#include <time.h>
#include <pcap.h>

View File

@ -15,8 +15,10 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <windows.h>
#define WINSOCK_API_LINKAGE
#include <winsock2.h>
#include <windows.h>
#include <wsipx.h>
#include <mswsock.h>
#include <nspapi.h>
@ -28,32 +30,6 @@
#include "router.h"
#include "addrcache.h"
#define XP_CONNECTIONLESS 0x00000001
#define XP_GUARANTEED_DELIVERY 0x00000002
#define XP_GUARANTEED_ORDER 0x00000004
#define XP_MESSAGE_ORIENTED 0x00000008
#define XP_PSEUDO_STREAM 0x00000010
#define XP_GRACEFUL_CLOSE 0x00000020
#define XP_EXPEDITED_DATA 0x00000040
#define XP_CONNECT_DATA 0x00000080
#define XP_DISCONNECT_DATA 0x00000100
#define XP_SUPPORTS_BROADCAST 0x00000200
#define XP_SUPPORTS_MULTICAST 0x00000400
#define XP_BANDWITH_ALLOCATION 0x00000800
#define XP_FRAGMENTATION 0x00001000
#define XP_ENCRYPTS 0x00002000
typedef struct _PROTOCOL_INFO {
DWORD dwServiceFlags ;
INT iAddressFamily ;
INT iMaxSockAddr ;
INT iMinSockAddr ;
INT iSocketType ;
INT iProtocol ;
DWORD dwMessageSize ;
void *lpProtocol ;
} PROTOCOL_INFO;
struct sockaddr_ipx_ext {
short sa_family;
char sa_netnum[4];