katie_check_function(fesetenv "fenv.h")
katie_check_function(feclearexcept "fenv.h")
katie_check_function(feenableexcept "fenv.h")
+# none
+katie_check_struct(sockaddr_ll sll_addr "netpacket/packet.h")
+katie_check_struct(sockaddr_dl sdl_index "net/if_dl.h")
# 64-bit offset alternatives, if any of the functions is not found it will set
# QT_LARGEFILE_SUPPORT to FALSE. QT_LARGEFILE_SUPPORT is used in qconfig.h
include(CMakePushCheckState)
include(CheckSymbolExists)
include(CheckFunctionExists)
+include(CheckStructHasMember)
# a macro to print a dev warning but only when the build type is Debug
macro(KATIE_WARNING MESSAGESTR)
endif()
endfunction()
+# a macro to check for C struct member presence in header, if member is found a
+# definition is added.
+function(KATIE_CHECK_STRUCT FORSTRUCT FORMEMBER FROMHEADER)
+ cmake_reset_check_state()
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${ARGN})
+ check_struct_has_member("struct ${FORSTRUCT}" "${FORMEMBER}" "${FROMHEADER}" HAVE_${FORSTRUCT}_${FORMEMBER})
+ cmake_pop_check_state()
+
+ if(HAVE_${FORSTRUCT}_${FORMEMBER})
+ string(TOUPPER "${FORSTRUCT}" upperstruct)
+ add_definitions(-DQT_HAVE_${upperstruct})
+ endif()
+endfunction()
+
# a macro to write data to file, does nothing if the file exists and its
# content is the same as the data to be written
macro(KATIE_WRITE_FILE OUTFILE DATA)
QT_END_INCLUDE_NAMESPACE
# endif
-# if defined(Q_OS_LINUX) && defined(__GLIBC__)
+# if defined(QT_HAVE_SOCKADDR_LL)
# include <netpacket/packet.h>
static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
return interfaces;
}
-# elif defined(Q_OS_BSD4)
+# elif defined(QT_HAVE_SOCKADDR_DL)
QT_BEGIN_INCLUDE_NAMESPACE
# include <net/if_dl.h>
QT_END_INCLUDE_NAMESPACE