From 699da5f52217ae1631f4472cf58af515d0bfc161 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger <gerhard@dest-unreach.org> Date: Thu, 31 Oct 2024 10:39:29 +0100 Subject: [PATCH] Procan tells if char is signed or unsigned --- CHANGES | 2 ++ hostan.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 7b888f4..6793b35 100644 --- a/CHANGES +++ b/CHANGES @@ -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. diff --git a/hostan.c b/hostan.c index 80ea569..4258d3c 100644 --- a/hostan.c +++ b/hostan.c @@ -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