mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* Fix two issues with the SwiftGlibc module map. The issues are: - Today, some submodules in `SwiftGlibc` fail to provide definitions that they should contain. As a consequence, Swift fails to import some code that compiles correctly with standalone Clang. As just one example, including `signal.h` should make the type `pid_t` available, but it currently does not. - `SwiftGlibc` is not compatible with the libc++ module map. Trying to include libc++ headers in a C++ module imported into Swift results in an error message about cyclic dependencies. This change fixes both of these issues by making it so that `SwiftGlibc` no actually longer defines a module map for the glibc headers but merely makes all of the symbols from those headers available in a module that can be imported into Swift. C / Objective-C / C++ code, on the other hand, will now include the glibc headers texually. For more context on the two issues and this fix, see this forum discussion: https://forums.swift.org/t/problems-with-swiftglibc-and-proposed-fix/37594 This change only modifies `glibc.modulemap.gyb` for the time being but leaves `bionic.modulemap.gyb` and `libc-openbsd.modulemap.gyb` unchanged. The intent is to fix these in the same way, but it will be easier to do this in separate PRs that can be tested individually. Co-authored-by: zoecarver <z.zoelec2@gmail.com> Co-authored-by: Marcel Hlopko <hlopko@google.com>
108 lines
1.5 KiB
Plaintext
108 lines
1.5 KiB
Plaintext
%{
|
|
headers = [
|
|
'stdc-predef.h',
|
|
'features.h',
|
|
|
|
# C standard library
|
|
'complex.h',
|
|
'ctype.h',
|
|
'errno.h',
|
|
'fenv.h',
|
|
'float.h',
|
|
'inttypes.h',
|
|
'iso646.h',
|
|
'libutil.h',
|
|
'limits.h',
|
|
'locale.h',
|
|
'math.h',
|
|
'pty.h',
|
|
'setjmp.h',
|
|
'signal.h',
|
|
'stdarg.h',
|
|
'stdbool.h',
|
|
'stddef.h',
|
|
'stdint.h',
|
|
'stdio.h',
|
|
'stdlib.h',
|
|
'string.h',
|
|
'tgmath.h',
|
|
'time.h',
|
|
'utmp.h',
|
|
'utmpx.h',
|
|
|
|
# POSIX
|
|
'aio.h',
|
|
'arpa/inet.h',
|
|
'bsd/ifaddrs.h',
|
|
'bsd/pty.h',
|
|
'cpio.h',
|
|
'dirent.h',
|
|
'dlfcn.h',
|
|
'fcntl.h',
|
|
'fmtmsg.h',
|
|
'fnmatch.h',
|
|
'ftw.h',
|
|
'glob.h',
|
|
'grp.h',
|
|
'iconv.h',
|
|
'ifaddrs.h',
|
|
'langinfo.h',
|
|
'libgen.h',
|
|
'link.h',
|
|
'monetary.h',
|
|
'net/if.h',
|
|
'netdb.h',
|
|
'netinet/in.h',
|
|
'netinet/tcp.h',
|
|
'nl_types.h',
|
|
'poll.h',
|
|
'pthread.h',
|
|
'pwd.h',
|
|
'regex.h',
|
|
'sched.h',
|
|
'search.h',
|
|
'semaphore.h',
|
|
'spawn.h',
|
|
'strings.h',
|
|
'sys/event.h',
|
|
'sys/file.h',
|
|
'sys/inotify.h',
|
|
'sys/ioctl.h',
|
|
'sys/ipc.h',
|
|
'sys/mman.h',
|
|
'sys/msg.h',
|
|
'sys/resource.h',
|
|
'sys/select.h',
|
|
'sys/sem.h',
|
|
'sys/sendfile.h',
|
|
'sys/shm.h',
|
|
'sys/socket.h',
|
|
'sys/stat.h',
|
|
'sys/statvfs.h',
|
|
'sys/time.h',
|
|
'sys/times.h',
|
|
'sys/types.h',
|
|
'sys/uio.h',
|
|
'sys/un.h',
|
|
'sys/user.h',
|
|
'sys/utsname.h',
|
|
'sys/wait.h',
|
|
'sysexits.h',
|
|
'syslog.h',
|
|
'tar.h',
|
|
'termios.h',
|
|
'ulimit.h',
|
|
'unistd.h',
|
|
'utime.h',
|
|
'utmpx.h',
|
|
'wait.h',
|
|
'wordexp.h',
|
|
]
|
|
}%
|
|
|
|
% for header in headers:
|
|
#if __has_include(<${header}>)
|
|
#include <${header}>
|
|
#endif
|
|
% end
|