Skip to content

Commit

Permalink
[libc++][C++03] Use __cxx03/ headers in C++03 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
philnik777 committed Sep 17, 2024
1 parent e888ef3 commit 4d02649
Show file tree
Hide file tree
Showing 131 changed files with 7,329 additions and 6,563 deletions.
1 change: 1 addition & 0 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
fail-fast: false
matrix:
config: [
'cxx03-main-headers',
'generic-cxx03',
'generic-cxx26',
'generic-modules'
Expand Down
2 changes: 2 additions & 0 deletions libcxx/cmake/caches/cxx03-main-headers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(LIBCXX_TEST_PARAMS "std=c++03;test-main-headers=True" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
1 change: 1 addition & 0 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <__configuration/abi.h>
#include <__configuration/availability.h>
#include <__configuration/compiler.h>
#include <__configuration/cxx03.h>
#include <__configuration/platform.h>

#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
Expand Down
21 changes: 21 additions & 0 deletions libcxx/include/__configuration/cxx03.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// 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___CONFIGURATION_CXX03_H
#define _LIBCPP___CONFIGURATION_CXX03_H

#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
# pragma GCC system_header
#endif

// NOLINTNEXTLINE(libcpp-cpp-version-check)
# if __cplusplus < 201103L
# define _LIBCPP_CXX03_LANG
# endif

#endif // _LIBCPP___CONFIGURATION_CXX03_H
5 changes: 0 additions & 5 deletions libcxx/include/__cxx03/__config
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# define _LIBCPP_TOSTRING2(x) #x
# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)

// NOLINTNEXTLINE(libcpp-cpp-version-check)
# if __cplusplus < 201103L
# define _LIBCPP_CXX03_LANG
# endif

# ifndef __has_constexpr_builtin
# define __has_constexpr_builtin(x) 0
# endif
Expand Down
Loading

0 comments on commit 4d02649

Please sign in to comment.