Unverified Commit f7329e61 authored by Nikolas Klauser's avatar Nikolas Klauser Committed by GitHub
Browse files

[libc++] Remove libc++'s own fenv.h (#194629)

Our own `fenv.h` only `#undef`s macros which the C header might define.
None of the libcs we support define any of these functions as macros, so
we can simply drop the header.
parent be8e0842
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1035,7 +1035,6 @@ set(files
  ext/__hash
  ext/hash_map
  ext/hash_set
  fenv.h
  filesystem
  flat_map
  flat_set
+5 −8
Original line number Diff line number Diff line
@@ -54,14 +54,11 @@ int feupdateenv(const fenv_t* envp);

#include <__cxx03/__config>

#if __has_include(<fenv.h>)
#  include <fenv.h>

#ifndef _LIBCPP_FENV_H
#   error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \
          This usually means that your header search paths are not configured properly. \
          The header search paths should contain the C++ Standard Library headers before \
          any C Standard Library, and you are probably using compiler flags that make that \
          not be the case.
#  ifdef _LIBCPP_FENV_H
#    error "If libc++ starts defining <fenv.h>, the __has_include check should move to libc++'s <fenv.h>"
#  endif
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+5 −8
Original line number Diff line number Diff line
@@ -57,14 +57,11 @@ int feupdateenv(const fenv_t* envp);
#else
#  include <__config>

#  if __has_include(<fenv.h>)
#    include <fenv.h>

#  ifndef _LIBCPP_FENV_H
#   error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \
          This usually means that your header search paths are not configured properly. \
          The header search paths should contain the C++ Standard Library headers before \
          any C Standard Library, and you are probably using compiler flags that make that \
          not be the case.
#    ifdef _LIBCPP_FENV_H
#      error "If libc++ starts defining <fenv.h>, the __has_include check should move to libc++'s <fenv.h>"
#    endif
#  endif

#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

libcxx/include/fenv.h

deleted100644 → 0
+0 −118
Original line number Diff line number Diff line
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_FENV_H
#define _LIBCPP_FENV_H

/*
    fenv.h synopsis

This entire header is C99 / C++0X

Macros:

    FE_DIVBYZERO
    FE_INEXACT
    FE_INVALID
    FE_OVERFLOW
    FE_UNDERFLOW
    FE_ALL_EXCEPT
    FE_DOWNWARD
    FE_TONEAREST
    FE_TOWARDZERO
    FE_UPWARD
    FE_DFL_ENV

Types:

    fenv_t
    fexcept_t

int feclearexcept(int excepts);
int fegetexceptflag(fexcept_t* flagp, int excepts);
int feraiseexcept(int excepts);
int fesetexceptflag(const fexcept_t* flagp, int excepts);
int fetestexcept(int excepts);
int fegetround();
int fesetround(int round);
int fegetenv(fenv_t* envp);
int feholdexcept(fenv_t* envp);
int fesetenv(const fenv_t* envp);
int feupdateenv(const fenv_t* envp);


*/

#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#  include <__cxx03/__config>
#else
#  include <__config>
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#  pragma GCC system_header
#endif

#if __has_include_next(<fenv.h>)
#  include_next <fenv.h>
#endif

#ifdef __cplusplus

extern "C++" {

#  ifdef feclearexcept
#    undef feclearexcept
#  endif

#  ifdef fegetexceptflag
#    undef fegetexceptflag
#  endif

#  ifdef feraiseexcept
#    undef feraiseexcept
#  endif

#  ifdef fesetexceptflag
#    undef fesetexceptflag
#  endif

#  ifdef fetestexcept
#    undef fetestexcept
#  endif

#  ifdef fegetround
#    undef fegetround
#  endif

#  ifdef fesetround
#    undef fesetround
#  endif

#  ifdef fegetenv
#    undef fegetenv
#  endif

#  ifdef feholdexcept
#    undef feholdexcept
#  endif

#  ifdef fesetenv
#    undef fesetenv
#  endif

#  ifdef feupdateenv
#    undef feupdateenv
#  endif

} // extern "C++"

#endif // defined(__cplusplus)

#endif // _LIBCPP_FENV_H
+0 −4
Original line number Diff line number Diff line
@@ -2449,10 +2449,6 @@ module std_errno_h [system] {
  header "errno.h"
  export *
}
module std_fenv_h [system] {
  header "fenv.h"
  export *
}
module std_math_h [system] {
  header "math.h"
  export *