Initial revision
This commit is contained in:
19
modules/src/malloc/getsize.c
Normal file
19
modules/src/malloc/getsize.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/* find out if a pointer-sized integer, preferably unsigned,
|
||||
must be declared as an unsigned int or a long
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
if (sizeof(unsigned int) == sizeof(char *)) {
|
||||
puts("typedef unsigned int size_type;");
|
||||
return 0;
|
||||
}
|
||||
if (sizeof(long) == sizeof(char *)) {
|
||||
puts("typedef long size_type;");
|
||||
return 0;
|
||||
}
|
||||
fputs(stderr, "funny pointer size\n");
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user