[PATCH] D46443: Add missing cstdalign header

Sam Clegg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 4 11:41:33 PDT 2018


sbc100 created this revision.
Herald added subscribers: cfe-commits, christof, aheejin.

Repository:
  rCXX libc++

https://reviews.llvm.org/D46443

Files:
  include/cassert
  include/cstdalign
  test/libcxx/min_max_macros.sh.cpp
  test/libcxx/utilities/any/size_and_alignment.pass.cpp


Index: test/libcxx/utilities/any/size_and_alignment.pass.cpp
===================================================================
--- test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -14,6 +14,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include <any>
+#include <cstdalign>
 
 int main()
 {
Index: test/libcxx/min_max_macros.sh.cpp
===================================================================
--- test/libcxx/min_max_macros.sh.cpp
+++ test/libcxx/min_max_macros.sh.cpp
@@ -70,6 +70,8 @@
 TEST_MACROS();
 #include <csignal>
 TEST_MACROS();
+#include <cstdalign>
+TEST_MACROS();
 #include <cstdarg>
 TEST_MACROS();
 #include <cstdbool>
Index: include/cstdalign
===================================================================
--- include/cstdalign
+++ include/cstdalign
@@ -1,25 +1,33 @@
 // -*- C++ -*-
-//===-------------------------- cassert -----------------------------------===//
+//===--------------------------- cstdalign --------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
 // This file is dual licensed under the MIT and the University of Illinois Open
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
 /*
-    cassert synopsis
+    cstdalign synopsis
 
 Macros:
 
-    assert
+   alignof
+   alignas
+    __alignof_is_defined
+    __alignas_is_defined
 
 */
 
 #include <__config>
-#include <assert.h>
+#include <stdalign.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: include/cassert
===================================================================
--- include/cassert
+++ include/cassert
@@ -8,6 +8,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef _LIBCPP_CASSERT
+#define _LIBCPP_CASSERT
+
 /*
     cassert synopsis
 
@@ -23,3 +26,5 @@
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
+
+#endif  // _LIBCPP_CASSERT


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46443.145240.patch
Type: text/x-patch
Size: 2203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180504/0c05edff/attachment-0001.bin>


More information about the cfe-commits mailing list