Browse Source

Headers for Switch asio compilation

pull/2238/head
staphen 5 years ago committed by Anders Jenbo
parent
commit
0784ab857c
  1. 5
      CMake/switch/asio/include/errno.h
  2. 24
      CMake/switch/asio/include/net/if.h
  3. 8
      CMake/switch/asio/include/netinet/in.h
  4. 10
      CMake/switch/asio/include/sys/uio.h
  5. 16
      CMake/switch/asio/include/sys/un.h
  6. 5
      CMake/switch/asio_defs.cmake
  7. 0
      CMake/switch/switch_defs.cmake
  8. 3
      CMakeLists.txt

5
CMake/switch/asio/include/errno.h

@ -0,0 +1,5 @@
#pragma once
#include_next <errno.h>
#define ESHUTDOWN (__ELASTERROR + 1)

24
CMake/switch/asio/include/net/if.h

@ -0,0 +1,24 @@
#ifndef _NET_IF_H
#define _NET_IF_H 1
#define IF_NAMESIZE 16
struct if_nameindex {
unsigned int if_index;
char *if_name;
};
#ifdef __cplusplus
extern "C" {
#endif
unsigned int if_nametoindex(const char *__ifname);
char *if_indextoname(unsigned int __ifindex, char *__ifname);
struct if_nameindex *if_nameindex();
void if_freenameindex(struct if_nameindex *__ptr);
#ifdef __cplusplus
}
#endif
#endif

8
CMake/switch/asio/include/netinet/in.h

@ -0,0 +1,8 @@
#pragma once
#include_next <netinet/in.h>
struct ipv6_mreq {
struct in6_addr ipv6mr_multiaddr;
unsigned ipv6mr_interface;
};

10
CMake/switch/asio/include/sys/uio.h

@ -0,0 +1,10 @@
#ifndef _SYS_UIO_H
#define _SYS_UIO_H 1
#include <sys/types.h>
#include <sys/_iovec.h>
ssize_t readv(int __fd, const struct iovec *__iovec, int __count);
ssize_t writev(int __fd, const struct iovec *__iovec, int __count);
#endif

16
CMake/switch/asio/include/sys/un.h

@ -0,0 +1,16 @@
#ifndef _SYS_UN_H
#define _SYS_UN_H 1
#include <sys/types.h>
#ifndef _SA_FAMILY_T_DECLARED
typedef __sa_family_t sa_family_t;
#define _SA_FAMILY_T_DECLARED
#endif
struct sockaddr_un {
sa_family_t sun_family;
char sun_path[108];
};
#endif

5
CMake/switch/asio_defs.cmake

@ -0,0 +1,5 @@
# Enables a number of header file definitions required by ASIO
target_compile_definitions(asio INTERFACE _DEFAULT_SOURCE=ON)
# Missing headers and declarations provided by DevilutionX
target_include_directories(asio BEFORE INTERFACE CMake/switch/asio/include)

0
CMake/switch_defs.cmake → CMake/switch/switch_defs.cmake

3
CMakeLists.txt

@ -132,6 +132,7 @@ if(GPERF)
endif()
if(NINTENDO_SWITCH)
list(APPEND CMAKE_MODULE_PATH "${DevilutionX_SOURCE_DIR}/CMake/switch")
include(switch_defs)
endif()
@ -268,6 +269,8 @@ if(NOT NONET AND NOT DISABLE_TCP)
ASIO_HAS_UNISTD_H=ON)
target_include_directories(asio BEFORE INTERFACE CMake/ctr/asio/include)
elseif(NINTENDO_SWITCH)
include(asio_defs)
endif()
endif()

Loading…
Cancel
Save