mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 14:09:12 +00:00
Introduce #include <cosmo.h>
to toolchain users
This change improves the way internal APIs are being hidden behind the `COSMO` define. The cosmo.h header will take care of defining that, so that a separate define statement isn't needed. This change also does a lot more to define which APIs are standard, and which belong to Cosmo.
This commit is contained in:
parent
9b55dbe417
commit
4a59210008
115 changed files with 699 additions and 422 deletions
6
third_party/getopt/getopt.h
vendored
6
third_party/getopt/getopt.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_
|
||||
#ifdef COSMO
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
|
@ -12,8 +11,8 @@ COSMOPOLITAN_C_START_
|
|||
extern char *optarg;
|
||||
extern int optind, opterr, optopt, optreset;
|
||||
|
||||
int getopt(int, char *const[], const char *);
|
||||
int getsubopt(char **, char *const *, char **);
|
||||
int getopt(int, char *const[], const char *) paramsnonnull();
|
||||
int getsubopt(char **, char *const *, char **) paramsnonnull();
|
||||
|
||||
struct option {
|
||||
const char *name;
|
||||
|
@ -28,5 +27,4 @@ int getopt_long_only(int, char *const *, const char *, const struct option *,
|
|||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMO */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_ */
|
||||
|
|
3
third_party/getopt/getsubopt.c
vendored
3
third_party/getopt/getsubopt.c
vendored
|
@ -48,9 +48,6 @@ getsubopt(char **optionp, char * const *tokens, char **valuep)
|
|||
|
||||
suboptarg = *valuep = NULL;
|
||||
|
||||
if (!optionp || !*optionp)
|
||||
return(-1);
|
||||
|
||||
/* skip leading white-space, commas */
|
||||
for (p = *optionp; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p);
|
||||
|
||||
|
|
4
third_party/lua/luaencodejsondata.c
vendored
4
third_party/lua/luaencodejsondata.c
vendored
|
@ -21,7 +21,7 @@
|
|||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/log/rop.internal.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
|
@ -169,7 +169,7 @@ static int SerializeTable(lua_State *L, char **buf, int idx,
|
|||
bool multi;
|
||||
bool isarray;
|
||||
lua_Unsigned n;
|
||||
if (UNLIKELY(!HaveStackMemory(GUARDSIZE))) {
|
||||
if (UNLIKELY(!HaveStackMemory(APE_GUARDSIZE))) {
|
||||
z->reason = "out of stack";
|
||||
return -1;
|
||||
}
|
||||
|
|
4
third_party/lua/luaencodeluadata.c
vendored
4
third_party/lua/luaencodeluadata.c
vendored
|
@ -19,7 +19,7 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/log/rop.internal.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
|
@ -353,7 +353,7 @@ static int SerializeTable(lua_State *L, char **buf, int idx,
|
|||
int rc;
|
||||
bool multi;
|
||||
intptr_t rsp, bot;
|
||||
if (UNLIKELY(!HaveStackMemory(GUARDSIZE))) {
|
||||
if (UNLIKELY(!HaveStackMemory(APE_GUARDSIZE))) {
|
||||
z->reason = "out of stack";
|
||||
return -1;
|
||||
}
|
||||
|
|
2
third_party/lua/lunix.c
vendored
2
third_party/lua/lunix.c
vendored
|
@ -24,7 +24,7 @@
|
|||
#include "libc/calls/ioctl.h"
|
||||
#include "libc/calls/makedev.h"
|
||||
#include "libc/calls/pledge.h"
|
||||
#include "libc/calls/struct/bpf.h"
|
||||
#include "libc/calls/struct/bpf.internal.h"
|
||||
#include "libc/calls/struct/dirent.h"
|
||||
#include "libc/calls/struct/flock.h"
|
||||
#include "libc/calls/struct/itimerval.h"
|
||||
|
|
2
third_party/lua/serialize.c
vendored
2
third_party/lua/serialize.c
vendored
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/log/rop.internal.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
2
third_party/make/function.c
vendored
2
third_party/make/function.c
vendored
|
@ -24,7 +24,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "third_party/make/os.h"
|
||||
#include "third_party/make/commands.h"
|
||||
#include "libc/mem/critbit0.h"
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/log/rop.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/make/debug.h"
|
||||
|
||||
|
|
8
third_party/make/job.c
vendored
8
third_party/make/job.c
vendored
|
@ -24,9 +24,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/pledge.h"
|
||||
#include "libc/calls/pledge.internal.h"
|
||||
#include "libc/calls/struct/bpf.h"
|
||||
#include "libc/calls/struct/filter.h"
|
||||
#include "libc/calls/struct/seccomp.h"
|
||||
#include "libc/calls/struct/bpf.internal.h"
|
||||
#include "libc/calls/struct/filter.internal.h"
|
||||
#include "libc/calls/struct/seccomp.internal.h"
|
||||
#include "libc/calls/struct/sysinfo.h"
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/dce.h"
|
||||
|
@ -42,7 +42,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/log/rop.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nexgen32e/kcpuids.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
|
6
third_party/make/main.c
vendored
6
third_party/make/main.c
vendored
|
@ -28,9 +28,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "third_party/make/rule.h"
|
||||
/**/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/bpf.h"
|
||||
#include "libc/calls/struct/filter.h"
|
||||
#include "libc/calls/struct/seccomp.h"
|
||||
#include "libc/calls/struct/bpf.internal.h"
|
||||
#include "libc/calls/struct/filter.internal.h"
|
||||
#include "libc/calls/struct/seccomp.internal.h"
|
||||
#include "libc/calls/syscall_support-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/limits.h"
|
||||
|
|
1
third_party/python/Modules/mmapmodule.c
vendored
1
third_party/python/Modules/mmapmodule.c
vendored
|
@ -8,6 +8,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/sysconf.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/msync.h"
|
||||
|
|
2
third_party/python/pyobj.c
vendored
2
third_party/python/pyobj.c
vendored
|
@ -35,7 +35,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "libc/zip.h"
|
||||
#include "libc/zip.internal.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue