diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-06-01 00:47:29 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-06-01 00:47:29 +0300 |
| commit | e453c408da14448d3ac8ffabb8010aafe8ee9ac0 (patch) | |
| tree | 4fa493ab94ed9995e65a822535bd628291d5dea6 /test cases | |
| parent | ae62e8ca11b08b9b554b83b48e743f672708ace5 (diff) | |
| download | meson-e453c408da14448d3ac8ffabb8010aafe8ee9ac0.tar.gz | |
Can add extra #includes to sizeof checks.
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/common/35 sizeof/config.h.in | 1 | ||||
| -rw-r--r-- | test cases/common/35 sizeof/meson.build | 2 | ||||
| -rw-r--r-- | test cases/common/35 sizeof/prog.c | 5 |
3 files changed, 8 insertions, 0 deletions
diff --git a/test cases/common/35 sizeof/config.h.in b/test cases/common/35 sizeof/config.h.in index b5ed4ca8e..a442e8a4e 100644 --- a/test cases/common/35 sizeof/config.h.in +++ b/test cases/common/35 sizeof/config.h.in @@ -1 +1,2 @@ #define INTSIZE @INTSIZE@ +#define WCHARSIZE @WCHARSIZE@ diff --git a/test cases/common/35 sizeof/meson.build b/test cases/common/35 sizeof/meson.build index af04b4d55..b676fa900 100644 --- a/test cases/common/35 sizeof/meson.build +++ b/test cases/common/35 sizeof/meson.build @@ -2,9 +2,11 @@ project('sizeof', 'c') cc = meson.get_compiler('c') intsize = cc.sizeof('int') +wcharsize = cc.sizeof('wchar_t', prefix : '#include<wchar.h>') cd = configuration_data() cd.set('INTSIZE', intsize) +cd.set('WCHARSIZE', wcharsize) configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) e = executable('prog', 'prog.c', include_dirs : include_directories('.')) diff --git a/test cases/common/35 sizeof/prog.c b/test cases/common/35 sizeof/prog.c index 68e346285..9164c18b0 100644 --- a/test cases/common/35 sizeof/prog.c +++ b/test cases/common/35 sizeof/prog.c @@ -1,10 +1,15 @@ #include"config.h" #include<stdio.h> +#include<wchar.h> int main(int argc, char **argv) { if(INTSIZE != sizeof(int)) { fprintf(stderr, "Mismatch: detected int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); return 1; } + if(WCHARSIZE != sizeof(wchar_t)) { + fprintf(stderr, "Mismatch: detected wchar size %d, actual size %d.\n", WCHARSIZE, (int)sizeof(wchar_t)); + return 1; + } return 0; } |
