1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-14 23:33:23 +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

@ -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