libc-top-half/headers/private/wasi/libc-environ-compat.h
raw| 1 | // This header file is meant to be included withinin the body of a function |
| 2 | // which uses `__environ`. Code using `__environ` expects it will be initialized |
| 3 | // eagerly. `__wasilibc_environ` is initialized lazily. Provide `__environ` as |
| 4 | // an alias and arrange for the lazy initialization to be performed. |
| 5 | |
| 6 | extern char **__wasilibc_environ; |
| 7 | |
| 8 | __wasilibc_ensure_environ(); |
| 9 | |
| 10 | #ifndef __wasilibc_environ |
| 11 | #define __environ __wasilibc_environ |
| 12 | #endif |