CMake: Don't bother checking for fcntl.h or floorl.

fcntl.h appears to be available on all of our supported platforms,
including Windows. We've also been including it without HAVE_FCNTL_H
guards in a few places (e.g. sshdump.c) without any issues for some
time.

floorl is part of C99.
This commit is contained in:
Gerald Combs 2021-07-14 18:53:12 -07:00 committed by Wireshark GitLab Utility
parent cbed7130de
commit 34ef2066e5
5 changed files with 0 additions and 28 deletions

View File

@ -151,11 +151,6 @@ if(WIN32)
set(EXTRA_INSTALLER_DIR ${_ws_lib_dir})
# XXX Add a dependency on ${_ws_lib_dir}/current_tag.txt?
# Prepopulate some ConfigureChecks values. Compilation checks
# on Windows can be slow.
set(HAVE_FCNTL_H TRUE)
set(HAVE_FLOORL TRUE)
endif(WIN32)
include(UseCustomIncludes)

View File

@ -13,7 +13,6 @@ include(CMakePushCheckState)
include(CheckIncludeFile)
include(CheckIncludeFiles)
check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
check_include_file("fcntl.h" HAVE_FCNTL_H)
check_include_file("getopt.h" HAVE_GETOPT_H)
check_include_file("grp.h" HAVE_GRP_H)
#
@ -84,16 +83,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.]
check_function_exists("getexecname" HAVE_GETEXECNAME)
endif()
#
# Use check_symbol_exists just in case math.h does something magic
# and there's not actually a function named floorl()
#
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${M_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${M_LIBRARIES})
check_symbol_exists("floorl" "math.h" HAVE_FLOORL)
cmake_pop_check_state()
#
# Check whether we have clock_gettime().
# It's not on Windows, so don't waste time checking for it.

View File

@ -43,9 +43,6 @@
/* Define to 1 if you have the `clock_gettime` function. */
#cmakedefine HAVE_CLOCK_GETTIME 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
/* Define to use the MaxMind DB library */
#cmakedefine HAVE_MAXMINDDB 1
@ -70,9 +67,6 @@
/* Define if you have the 'getexecname' function. */
#cmakedefine HAVE_GETEXECNAME 1
/* Define if you have the 'floorl' function. */
#cmakedefine HAVE_FLOORL 1
/* Define to 1 if you have the getopt_long function. */
#cmakedefine HAVE_GETOPT_LONG 1

View File

@ -19,10 +19,6 @@
#include "ui/ws_ui_util.h"
#ifndef HAVE_FLOORL
#define floorl(x) floor((double)x)
#endif
#define SHIFT_POS 0
#define SHIFT_NEG 1
#define SHIFT_SETTOZERO 1

View File

@ -20,9 +20,7 @@
#include <gmodule.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h> /* for open() */
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> /* for read(), write(), close(), etc. */