diff options
| author | grischka <grischka> | 2017-02-18 09:55:34 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2017-02-18 09:55:34 +0100 |
| commit | 2d3b9559bf569f137cefb7f8386a0dc58e33c81f (patch) | |
| tree | 4da5267d5dd1bf907bdf82d7065c751a05757e6e /conftest.c | |
| parent | f34b1feaca557cd9da198610b67d4328fb0c7a84 (diff) | |
| download | tinycc-2d3b9559bf569f137cefb7f8386a0dc58e33c81f.tar.gz tinycc-2d3b9559bf569f137cefb7f8386a0dc58e33c81f.tar.bz2 | |
tcctools.c: integrate tiny_libmaker/_impdef
usage:
tcc -ar [rcsv] lib files...
tcc -impdef lib.dll [-v] [-o lib.def]
also:
- support more files with -c: tcc -c f1.c f2.c ...
- fix a bug which caused tcc f1.c f2.S to produce no asm
- allow tcc -ar @listfile too
- change prototype: _void_ tcc_set_options(...)
- apply -Wl,-whole-archive when a librariy is given
as libxxx.a also (not just for -lxxx)
Diffstat (limited to 'conftest.c')
| -rw-r--r-- | conftest.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -1,9 +1,9 @@ #include <stdio.h> /* Define architecture */ -#if defined(__i386__) +#if defined(__i386__) || defined _M_IX86 # define TRIPLET_ARCH "i386" -#elif defined(__x86_64__) +#elif defined(__x86_64__) || defined _M_AMD64 # define TRIPLET_ARCH "x86_64" #elif defined(__arm__) # define TRIPLET_ARCH "arm" @@ -18,6 +18,8 @@ # define TRIPLET_OS "linux" #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) # define TRIPLET_OS "kfreebsd" +#elif defined _WIN32 +# define TRIPLET_OS "win32" #elif !defined (__GNU__) # define TRIPLET_OS "unknown" #endif @@ -33,7 +35,9 @@ # define TRIPLET_ABI "gnu" #endif -#ifdef __GNU__ +#if defined _WIN32 +# define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS +#elif defined __GNU__ # define TRIPLET TRIPLET_ARCH "-" TRIPLET_ABI #else # define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS "-" TRIPLET_ABI @@ -59,6 +63,13 @@ int main(int argc, char *argv[]) case 'v': printf("%d\n", __GNUC__); break; +#elif defined __TINYC__ + case 'v': + puts("0"); + break; + case 'm': + printf("%d\n", __TINYC__); + break; #else case 'm': case 'v': @@ -68,9 +79,8 @@ int main(int argc, char *argv[]) case 't': puts(TRIPLET); break; - case -1: - /* to test -Wno-unused-result */ - fread(NULL, 1, 1, NULL); + + default: break; } return 0; |
