Skip to content

Commit

Permalink
LibC: Add missing sys/cdefs.h include
Browse files Browse the repository at this point in the history
Some header files use __BEGIN_DECLS without including sys/cdefs.h.
This causes issues for C code that compiles against these headers,
which may occur with Ports.
  • Loading branch information
emilytrau authored and linusg committed Aug 23, 2022
1 parent e70624d commit abc1500
Show file tree
Hide file tree
Showing 27 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#pragma once

#include <stddef.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/dirent.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <Kernel/API/POSIX/fcntl.h>
#include <Kernel/API/POSIX/sys/stat.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/fnmatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <sys/cdefs.h>
#include <sys/types.h>

#define FNM_NOMATCH 1
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/glob.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <sys/cdefs.h>
#include <sys/types.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/net/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/net/if.h>
#include <sys/cdefs.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/netinet/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <Kernel/API/POSIX/netinet/in.h>
#include <endian.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <Kernel/API/POSIX/poll.h>
#include <signal.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/resolv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <sys/cdefs.h>
#include <sys/types.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/serenity.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <Kernel/API/POSIX/futex.h>
#include <Kernel/API/POSIX/serenity.h>
#include <stdio.h>
#include <sys/cdefs.h>
#include <time.h>
#include <unistd.h>

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Kernel/API/POSIX/ucontext.h>
#include <bits/sighow.h>
#include <signal_numbers.h>
#include <sys/cdefs.h>
#include <sys/types.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/stdio_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <stdio.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/mman.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/ptrace.h>
#include <sys/cdefs.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/socket.h>
#include <sys/cdefs.h>
#include <sys/un.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/statvfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/statvfs.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/time.h>
#include <sys/cdefs.h>
#include <time.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/times.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/times.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/uio.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/uio.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/utsname.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/sys/utsname.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <Kernel/API/POSIX/signal.h>
#include <Kernel/API/POSIX/sys/wait.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/sys/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <sys/cdefs.h>
#include <sys/types.h>

__BEGIN_DECLS
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/termios.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/termios.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <Kernel/API/POSIX/time.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <Kernel/API/POSIX/unistd.h>
#include <fd_set.h>
#include <limits.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibC/wctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <assert.h>
#include <ctype.h>
#include <sys/cdefs.h>
#include <wchar.h>

__BEGIN_DECLS
Expand Down

0 comments on commit abc1500

Please sign in to comment.