// This file is run through translate-c and exposed to Zig code // under the namespace bun.c (lowercase c). Prefer adding includes // to this file instead of manually porting struct definitions // into Zig code. By using automatic translation, differences // between platforms and subtle mistakes can be avoided. // // One way to locate a definition for a given symbol is to open // Zig's `lib` directory and run ripgrep on it. For example, // `sockaddr_dl` is in `libc/include/any-macos-any/net/if_dl.h` // // When Zig is translating this file, it will define these macros: // - WINDOWS // - DARWIN // - LINUX // - POSIX // For `POSIX_SPAWN_SETSID` and some other non-POSIX extensions in glibc #if LINUX #define _GNU_SOURCE #endif // OnBeforeParseResult, etc... #include "../packages/bun-native-bundler-plugin-api/bundler_plugin.h" #if POSIX #include #include #include #include #include #include #endif #if DARWIN #include #include #include #include #include #include #include #include #include #include #include #include #include #elif LINUX #include #include #include #include #include #include #include #include #endif #if WINDOWS #include #include #endif #undef lstat #undef fstat #undef stat #include #include