diff --git a/CMakeLists.txt b/CMakeLists.txt index 7af2acb..53b3c49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ set(headers set(sources src/espstrutils.cpp + src/linker_hacks.cpp src/schedulertask.cpp src/taskutils.cpp ) diff --git a/src/linker_hacks.cpp b/src/linker_hacks.cpp new file mode 100644 index 0000000..d44c68d --- /dev/null +++ b/src/linker_hacks.cpp @@ -0,0 +1,15 @@ +// I dont know why but without this hack here the linker +// fails for asio and I could not fix it otherwise + +extern "C" char *lwip_if_indextoname(unsigned int ifindex, char *ifname); +extern "C" unsigned int lwip_if_nametoindex(const char *ifname); + +extern "C" char *if_indextoname(unsigned int ifindex, char *ifname) +{ + return lwip_if_indextoname(ifindex, ifname); +} + +extern "C" unsigned int if_nametoindex(const char *ifname) +{ + return lwip_if_nametoindex(ifname); +}