Skip to content
Permalink
Browse files

OS/2: Define max_align_t on C++11

C++11 requires max_align_t which is a C11 stuff. However, OS/2 kLIBC
headers are not ready for C11.

So, define max_align_t in os_defines.h which is a OS-specefic header
on C++. By this, it's possible to remove _GCC_MAX_ALIGN_T guard of
cstddef, too.

    modified:   libstdc++-v3/config/os/os2/os_defines.h
    modified:   libstdc++-v3/include/c_global/cstddef

Close #26.
  • Loading branch information...
komh committed Oct 1, 2016
1 parent fef1630 commit 21e0dd64d12d316004faedd38125e06872dd937a
Showing with 9 additions and 1 deletion.
  1. +8 −0 libstdc++-v3/config/os/os2/os_defines.h
  2. +1 −1 libstdc++-v3/include/c_global/cstddef
@@ -38,4 +38,12 @@
#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1
#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)

// C++11 requires max_align_t of C11. See gcc/ginclude/stddef.h.
#if __cplusplus >= 201103L
typedef struct {
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
#endif

#endif
@@ -44,7 +44,7 @@
#include <bits/c++config.h>
#include <stddef.h>

#if __cplusplus >= 201103L && defined(_GCC_MAX_ALIGN_T)
#if __cplusplus >= 201103L
namespace std
{
// We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.

0 comments on commit 21e0dd6

Please sign in to comment.
You can’t perform that action at this time.