ack/modules/src/malloc/getsize.c

28 lines
613 B
C
Raw Normal View History

1987-03-10 09:24:02 +00:00
/* $Header$ */
1987-03-09 15:15:03 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
1987-01-06 11:25:09 +00:00
/* find out if a pointer-sized integer, preferably unsigned,
must be declared as an unsigned int or a long
*/
#include <stdio.h>
main()
{
puts("#ifndef size_type");
1987-01-06 11:25:09 +00:00
if (sizeof(unsigned int) == sizeof(char *)) {
puts("#define size_type unsigned int");
1987-01-06 11:25:09 +00:00
}
else if (sizeof(long) == sizeof(char *)) {
puts("#define size_type long");
1987-01-06 11:25:09 +00:00
}
else {
fputs("funny pointer size\n", stderr);
exit(1);
}
puts("#endif");
exit(0);
1987-01-06 11:25:09 +00:00
}