diff --git a/tcclib.h b/tcclib.h index 42f8f3f..8d59e4c 100644 --- a/tcclib.h +++ b/tcclib.h @@ -39,6 +39,7 @@ int getchar(void); char *gets(char *s); int ungetc(int c, FILE *stream); int fflush(FILE *stream); +int putchar (int c); int printf(const char *format, ...); int fprintf(FILE *stream, const char *format, ...); @@ -64,6 +65,7 @@ void *memcpy(void *dest, const void *src, size_t n); void *memmove(void *dest, const void *src, size_t n); void *memset(void *s, int c, size_t n); char *strdup(const char *s); +size_t strlen(const char *s); /* dlfcn.h */ #define RTLD_LAZY 0x001 diff --git a/tests/libtcc_test.c b/tests/libtcc_test.c index bead0ff..414cc9b 100644 --- a/tests/libtcc_test.c +++ b/tests/libtcc_test.c @@ -16,6 +16,8 @@ int add(int a, int b) } char my_program[] = +"#include // printf()\n" +"extern int add(int a, int b);\n" "int fib(int n)\n" "{\n" " if (n <= 2)\n"