From e786e9c08e4b1bf51eec4ffe2627cd520603b27f Mon Sep 17 00:00:00 2001 From: k1w1 Date: Fri, 4 Dec 2009 12:46:32 -0800 Subject: [PATCH] * Added library API function to allow callers to prevent the standard libraries from being included. --- libtcc.c | 5 +++++ libtcc.h | 3 +++ 2 files changed, 8 insertions(+) mode change 100644 => 100755 libtcc.c mode change 100644 => 100755 libtcc.h diff --git a/libtcc.c b/libtcc.c old mode 100644 new mode 100755 index 54184e20..42fd5741 --- a/libtcc.c +++ b/libtcc.c @@ -2377,3 +2377,8 @@ void tcc_print_stats(TCCState *s, int64_t total_time) tt, (int)(total_lines / tt), total_bytes / tt / 1000000.0); } + +void tcc_set_nostdlib(TCCState *s, int nostdlib) +{ + s->nostdlib = nostdlib; +} diff --git a/libtcc.h b/libtcc.h old mode 100644 new mode 100755 index 96070e29..b7b7f949 --- a/libtcc.h +++ b/libtcc.h @@ -101,6 +101,9 @@ LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name); /* set CONFIG_TCCDIR at runtime */ LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path); +/* set whether to include the standard library. */ +LIBTCCAPI void tcc_set_nostdlib(TCCState *s, int nostdlib); + #ifdef __cplusplus } #endif -- 2.11.4.GIT