Skip to content

Commit

Permalink
Add HAVE_IFINFO macro (libretro#14265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cthulhu-throwaway authored Aug 1, 2022
1 parent f472e4d commit 20c4407
Show file tree
Hide file tree
Showing 48 changed files with 262 additions and 179 deletions.
5 changes: 2 additions & 3 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2124,9 +2124,8 @@ ifeq ($(HAVE_NETWORKING), 1)
OBJ += $(LIBRETRO_COMM_DIR)/net/net_socket_ssl_mbed.o
endif

ifneq ($(HAVE_SOCKET_LEGACY),1)
OBJ += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
else ifeq ($(TARGET), retroarch_vita)
ifeq ($(HAVE_IFINFO), 1)
DEFINES += -DHAVE_IFINFO
OBJ += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
endif

Expand Down
3 changes: 2 additions & 1 deletion Makefile.ctr
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_ZLIB -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES
#DEFINES += -DHAVE_UPDATE_ASSETS
DEFINES += -DHAVE_PATCH -DHAVE_RWAV
DEFINES += -DHAVE_SCREENSHOTS
Expand Down Expand Up @@ -89,6 +89,7 @@ else
HAVE_AUDIOMIXER = 1
HAVE_RWAV = 1
#HAVE_NETWORKING = 1
#HAVE_IFINFO = 1
#HAVE_CHEEVOS = 1
#HAVE_SOCKET_LEGACY = 1
HAVE_THREADS = 1
Expand Down
1 change: 1 addition & 0 deletions Makefile.dingux
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ HAVE_MENU_COMMON = 1
HAVE_GFX_WIDGETS = 1
HAVE_MMAP = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_OPENDINGUX_FBDEV = 1
HAVE_OPENGL = 1
HAVE_OPENGL1 = 0
Expand Down
3 changes: 2 additions & 1 deletion Makefile.dos
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_RUNAHEAD = 1
HAVE_NETWORKING = 0
HAVE_NETPLAYDISCOVERY = 1
HAVE_IFINFO = 0
HAVE_NETPLAYDISCOVERY = 0
HAVE_OVERLAY := 1
HAVE_STB_FONT = 1
HAVE_COMMAND := 1
Expand Down
18 changes: 16 additions & 2 deletions Makefile.griffin
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ else ifeq ($(platform), vita)
HAVE_7ZIP := 1
HAVE_VITA2D := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
Expand All @@ -366,8 +367,9 @@ else ifeq ($(platform), windows_msvc6_x86)
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 0
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_IFINFO := 0
HAVE_NETWORK_CMD := 0
HAVE_NETPLAYDISCOVERY := 0
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
Expand Down Expand Up @@ -413,6 +415,7 @@ else ifeq ($(platform), windows_msvc2003_x86)
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -468,6 +471,7 @@ else ifeq ($(platform), windows_msvc2005_x86)
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -550,6 +554,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -644,6 +649,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -729,6 +735,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -814,6 +821,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -914,6 +922,7 @@ else ifeq (qnx,$(platform))
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -959,6 +968,7 @@ else ifneq (,$(findstring unix,$(platform)))
HAVE_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
Expand Down Expand Up @@ -1112,6 +1122,10 @@ ifeq ($(HAVE_NETWORKING), 1)
CFLAGS += -DHAVE_NETWORKING
endif

ifeq ($(HAVE_IFINFO), 1)
CFLAGS += -DHAVE_IFINFO
endif

ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
CFLAGS += -DHAVE_NETPLAYDISCOVERY
endif
Expand Down
1 change: 1 addition & 0 deletions Makefile.libnx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_RUNAHEAD = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_STB_FONT = 1
HAVE_CHEEVOS = 1
Expand Down
1 change: 1 addition & 0 deletions Makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETWORK_CMD := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
Expand Down
1 change: 1 addition & 0 deletions Makefile.orbis
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ else
HAVE_OPENGLES := 1
HAVE_OPENGLES2 := 1
HAVE_NETWORKING := 0
HAVE_IFINFO := 0
HAVE_SOCKET_LEGACY := 1
HAVE_MENU := 1
HAVE_MENU_COMMON := 1
Expand Down
1 change: 1 addition & 0 deletions Makefile.vita
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ else
HAVE_VITAGL := 0
endif
HAVE_NETWORKING := 1
HAVE_IFINFO := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_SOCKET_LEGACY := 1
HAVE_MENU := 1
Expand Down
8 changes: 4 additions & 4 deletions Makefile.webos
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ HAVE_LIBRETRODB = 1
HAVE_MENU = 1
HAVE_MENU_COMMON = 1
HAVE_NEON = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_NETWORK_CMD = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETWORKGAMEPAD = 1
HAVE_NETWORKING = 1
HAVE_GFX_WIDGETS = 1
HAVE_MMAP = 1
HAVE_ONLINE_UPDATER = 1
Expand Down Expand Up @@ -136,7 +136,7 @@ DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_SDL2
DEFINES += -DHAVE_PULSE
DEFINES += -DHAVE_NETWORKING -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES

SDL2_CFLAGS := $(shell pkg-config --cflags sdl2)
SDL2_LIBS := $(shell pkg-config --libs sdl2)
Expand Down
1 change: 1 addition & 0 deletions Makefile.wii
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ HAVE_CC_RESAMPLER = 1
WHOLE_ARCHIVE_LINK = 0
BIG_STACK = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
PC_DEVELOPMENT_IP_ADDRESS = 255.255.255.255
PC_DEVELOPMENT_UDP_PORT = 3490
RARCH_CONSOLE = 0
Expand Down
3 changes: 2 additions & 1 deletion Makefile.wiiu
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ endif
DEFINES += -DHAVE_REWIND
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_SPIRV_CROSS -DHAVE_SLANG
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING -DHAVE_NETPLAYDISCOVERY
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_NETPLAYDISCOVERY
#DEFINES += -DWANT_IFADDRS
#DEFINES += -DHAVE_FREETYPE
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
Expand Down Expand Up @@ -155,6 +155,7 @@ endif
HAVE_LANGEXTRA = 1
HAVE_LIBRETRODB = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_CHEEVOS = 1
#WANT_IFADDRS = 1
Expand Down
1 change: 1 addition & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ HAVE_OPENGL = 1
HAVE_DYLIB = 1
HAVE_D3D9 = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_STDIN_CMD = 1
HAVE_COMMAND = 1
Expand Down
2 changes: 1 addition & 1 deletion griffin/griffin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ NETPLAY
#include "../libretro-common/net/net_compat.c"
#include "../libretro-common/net/net_socket.c"
#include "../libretro-common/net/net_http.c"
#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA)
#ifdef HAVE_IFINFO
#include "../libretro-common/net/net_ifinfo.c"
#endif
#include "../tasks/task_http.c"
Expand Down
12 changes: 3 additions & 9 deletions menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,9 @@
#define BYTES_TO_MB(bytes) ((bytes) / 1024 / 1024)
#define BYTES_TO_GB(bytes) (((bytes) / 1024) / 1024 / 1024)

#ifdef HAVE_NETWORKING
#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#if defined(HAVE_NETWORKING) && defined(HAVE_IFINFO)
#include <net/net_ifinfo.h>
#endif
#endif

/* TODO/FIXME - globals - need to find a way to
* get rid of these */
Expand Down Expand Up @@ -3878,15 +3876,13 @@ static unsigned menu_displaylist_parse_information_list(file_list_t *info_list)
}
#endif

#ifdef HAVE_NETWORKING
#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#if defined(HAVE_NETWORKING) && defined(HAVE_IFINFO)
if (menu_entries_append_enum(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETWORK_INFORMATION),
msg_hash_to_str(MENU_ENUM_LABEL_NETWORK_INFORMATION),
MENU_ENUM_LABEL_NETWORK_INFORMATION,
MENU_SETTING_ACTION, 0, 0))
count++;
#endif
#endif

if (menu_entries_append_enum(info_list,
Expand Down Expand Up @@ -7144,8 +7140,7 @@ unsigned menu_displaylist_build_list(
count++;
break;
case DISPLAYLIST_NETWORK_INFO:
#ifdef HAVE_NETWORKING
#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#if defined(HAVE_NETWORKING) && defined(HAVE_IFINFO)
{
net_ifinfo_t interfaces = {0};

Expand All @@ -7171,7 +7166,6 @@ unsigned menu_displaylist_build_list(
net_ifinfo_free(&interfaces);
}
}
#endif
#endif
break;
case DISPLAYLIST_OPTIONS_CHEATS:
Expand Down
4 changes: 2 additions & 2 deletions network/natt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <retro_miscellaneous.h>

#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#ifdef HAVE_IFINFO
#include <net/net_ifinfo.h>
#endif

Expand Down Expand Up @@ -97,7 +97,7 @@ bool natt_init(struct natt_discovery *discovery)
if (!bind_addr)
goto failure;

#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#ifdef HAVE_IFINFO
{
struct sockaddr_in *addr = (struct sockaddr_in *) bind_addr->ai_addr;

Expand Down
4 changes: 2 additions & 2 deletions network/netplay/netplay_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <features/features_cpu.h>
#include <lrc_hash.h>

#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#ifdef HAVE_IFINFO
#include <net/net_ifinfo.h>
#endif

Expand Down Expand Up @@ -219,7 +219,7 @@ bool init_netplay_discovery(void)

if (ret)
{
#if !defined(HAVE_SOCKET_LEGACY) || defined(VITA) || defined(GEKKO)
#ifdef HAVE_IFINFO
net_ifinfo_best("223.255.255.255",
&((struct sockaddr_in*)addr->ai_addr)->sin_addr, false);
#endif
Expand Down
1 change: 1 addition & 0 deletions pkg/android/phoenix-common/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ DEFINES += -DRARCH_MOBILE \
-DHAVE_RSOUND \
-DHAVE_NETWORKGAMEPAD \
-DHAVE_NETWORKING \
-DHAVE_IFINFO \
-DHAVE_NETPLAYDISCOVERY \
-DRARCH_INTERNAL \
-DHAVE_FILTERS_BUILTIN \
Expand Down
Loading

0 comments on commit 20c4407

Please sign in to comment.