Skip to content

Commit 4b3fbf5

Browse files
author
Alexey Samsonov
committed
[libc] Make two include/llvm-libc-types/ headers more self-contained.
* imaxdiv_t.h needs intmax_t. Get it from <stdint.h> directly instead of relying on prior inclusion inside generated inttypes.h. * include <termios-macros.h> for struct termios to get the #defined constant. We do allow inclusion of macro headers from types headers in other places.
1 parent f7a10f0 commit 4b3fbf5

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

libc/include/inttypes.h.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "__llvm-libc-common.h"
1313
#include "llvm-libc-macros/inttypes-macros.h"
14-
#include <stdint.h>
1514

1615
%%public_api()
1716

libc/include/llvm-libc-types/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ add_header(tss_dtor_t HDR tss_dtor_t.h)
9999
add_header(__atexithandler_t HDR __atexithandler_t.h)
100100
add_header(speed_t HDR speed_t.h)
101101
add_header(tcflag_t HDR tcflag_t.h)
102-
add_header(struct_termios HDR struct_termios.h DEPENDS .cc_t .speed_t .tcflag_t)
102+
add_header(
103+
struct_termios
104+
HDR
105+
struct_termios.h
106+
DEPENDS
107+
.cc_t .speed_t .tcflag_t
108+
libc.include.llvm-libc-macros.termios_macros
109+
)
103110
add_header(__getoptargv_t HDR __getoptargv_t.h)
104111
add_header(wchar_t HDR wchar_t.h)
105112
add_header(char8_t HDR char8_t.h)

libc/include/llvm-libc-types/imaxdiv_t.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef __LLVM_LIBC_TYPES_IMAXDIV_T_H__
1010
#define __LLVM_LIBC_TYPES_IMAXDIV_T_H__
1111

12+
#include <stdint.h>
13+
1214
typedef struct {
1315
intmax_t quot;
1416
intmax_t rem;

libc/include/llvm-libc-types/struct_termios.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "speed_t.h"
1414
#include "tcflag_t.h"
1515

16+
#include "../llvm-libc-macros/termios-macros.h" // NCCS
17+
1618
struct termios {
1719
tcflag_t c_iflag; // Input mode flags
1820
tcflag_t c_oflag; // Output mode flags

0 commit comments

Comments
 (0)