summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-22 15:00:46 -0500
committermidipix <writeonce@midipix.org>2018-12-22 19:19:18 -0500
commit2c68336b5c66fc89a1f906b62ca34b4fa717067e (patch)
tree1768590b102aecbd0965e5f9882e293bf626eed6
parente0398c7ac19765f10a0298a1bb67c1f63c5c9e4c (diff)
downloadsbpython2-2c68336b5c66fc89a1f906b62ca34b4fa717067e.tar.bz2
sbpython2-2c68336b5c66fc89a1f906b62ca34b4fa717067e.tar.xz
project: custom config: obtain type size information at config time.
-rw-r--r--profiles/toolchain/64-default.h22
-rw-r--r--project/config/cfgdefs.sh39
2 files changed, 39 insertions, 22 deletions
diff --git a/profiles/toolchain/64-default.h b/profiles/toolchain/64-default.h
deleted file mode 100644
index 957f6dd..0000000
--- a/profiles/toolchain/64-default.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef PY_TOOLCHAIN_64_DEFAULT_H
-#define PY_TOOLCHAIN_64_DEFAULT_H
-
-#define SIZEOF_DOUBLE 8
-#define SIZEOF_FLOAT 4
-#define SIZEOF_FPOS_T 16
-#define SIZEOF_INT 4
-#define SIZEOF_LONG 8
-#define SIZEOF_LONG_DOUBLE 16
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF_OFF_T 8
-#define SIZEOF_PID_T 4
-#define SIZEOF_PTHREAD_T 8
-#define SIZEOF_SHORT 2
-#define SIZEOF_SIZE_T 8
-#define SIZEOF_TIME_T 8
-#define SIZEOF_UINTPTR_T 8
-#define SIZEOF_VOID_P 8
-#define SIZEOF_WCHAR_T 4
-#define SIZEOF__BOOL 1
-
-#endif
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index ff48f02..560afa6 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -105,9 +105,48 @@ cfgdefs_perform_common_tests()
mb_cfgtest_headers='sys/sendfile.h'
cfgtest_interface_presence 'sendfile'
+ # size of system types
+ cfgtest_newline
+ cfgtest_comment 'size of system types'
+
+ cfgtest_type_size 'short'
+ cfgtest_type_size 'int'
+ cfgtest_type_size 'long'
+ cfgtest_type_size 'long long'
+ cfgtest_type_size 'float'
+ cfgtest_type_size 'double'
+ cfgtest_type_size 'long double'
+ cfgtest_type_size 'void *'
+
+ mb_cfgtest_headers='stdint.h'
+ cfgtest_type_size 'uintptr_t'
+
+ mb_cfgtest_headers='stdbool.h'
+ cfgtest_type_size '_Bool'
+
+ mb_cfgtest_headers='stddef.h'
+ cfgtest_type_size 'size_t'
+ cfgtest_type_size 'wchar_t'
+
+ mb_cfgtest_headers='unistd.h'
+ cfgtest_type_size 'pid_t'
+ cfgtest_type_size 'off_t'
+
+ mb_cfgtest_headers='time.h'
+ cfgtest_type_size 'time_t'
+
+ mb_cfgtest_headers='stdio.h'
+ cfgtest_type_size 'fpos_t'
+
+ mb_cfgtest_headers='pthread.h'
+ cfgtest_type_size 'pthread_t'
+
# getrandom: easier to simply test,
# than to test whether we need to test
# (and then test).
+ cfgtest_newline
+ cfgtest_comment 'getrandom'
+
mb_cfgtest_headers='sys/syscall.h'
if cfgtest_decl_presence 'SYS_getrandom'; then