T#include <stdint.h>
Tint main(int argc, char **argv)
T{
T char xc = 'e';
T const char *x = "hello";
T uintptr_t q = 1;
T intptr_t r = 2;
T q = (uintptr_t)x;
T r = (intptr_t)&xc;
T if( (char*)r == &xc && *((char *)r)=='e'
T	&& (const char *)q == x && *((const char *)q)=='h'
T	)
T	return 0;
T return 1;
T}
X
Xcat <<'ENDEND' > misctest.c
X#include <stdio.h>
Xint main()
X{
X const char *x = "hello";
X int zint = 3;
X short zshort = 4;
X long zlong = 5;
X long long zll = 6;
X if(sizeof(x) == sizeof(zint)) {
X	printf("Htypedef int intptr_t;\n");
X	printf("Htypedef unsigned uintptr_t;\n");
X }
X else if(sizeof(x) == sizeof(zshort)) {
X	printf("Htypedef short intptr_t;\n");
X	printf("Htypedef unsigned short uintptr_t;\n");
X }
X else if(sizeof(x) == sizeof(zlong)) {
X	printf("Htypedef long intptr_t;\n");
X	printf("Htypedef unsigned long uintptr_t;\n");
X }
X else if(sizeof(x) == sizeof(zll)) {
X	printf("Htypedef long long intptr_t;\n");
X	printf("Htypedef unsigned long long uintptr_t;\n");
X }
X else return 1;
X return 0;
X}
XENDEND
Xmake misctest 1>&2 && ./misctest
