1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-05-23 21:22:42 +00:00

Procan tells if char is signed or unsigned

This commit is contained in:
Gerhard Rieger 2024-10-31 10:39:29 +01:00 committed by Gerhard
parent 200ccb24cd
commit 699da5f522
2 changed files with 7 additions and 0 deletions

View file

@ -104,6 +104,8 @@ Features:
Procan prints more C-defines, esp.O_*, AI_*, EAI_*; __GLIBC__;
added option -V
Procan tells if char is signed or unsigned
Building:
Disabling certain features during configure could break build process.

View file

@ -33,6 +33,11 @@ int hostan(FILE *outfile) {
#endif
fprintf(outfile, "sizeof(size_t) = %u\n", (unsigned int)sizeof(size_t));
if ((char)-1 > 0)
fprintf(outfile, "typedef unsigned char char;\n");
else
fprintf(outfile, "typedef signed char char;\n");
# if HAVE_BASIC_SIZE_T==2
fprintf(outfile, "typedef unsigned short size_t; /* sizeof(size_t) = %u */\n", (unsigned int)sizeof(size_t));
#elif HAVE_BASIC_SIZE_T==4