From fc02d9541c6b1277dba17af6c2f828aa7a93169b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 22 Dec 2020 07:39:13 -0800 Subject: configure: C++ fix for type size detection case. * configure: The new logic for detecting type sizes introduced in October, replacing the old nm-based trick, doesn't work with C++. An anonymous structure is being used to define an object with linkage: we fix that by giving the structure a tag name which be. C++ also doesn't like a one-character string literal like "\n" being used to initialize a char [1] array, so we make it [2]. --- configure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 885a531f..13e2521a 100755 --- a/configure +++ b/configure @@ -1334,7 +1334,7 @@ if [ -z "$intptr" ] ; then #define LD(S) D((S) % 10, '0') #define DEC(S) { UD(S), LD(S) } -struct { +struct sizes { char h_BYTE[32], s_BYTE[2]; #if HAVE_SUPERLONG_T char h_SUPERLONG[32], s_SUPERLONG[2]; @@ -1347,7 +1347,7 @@ struct { char h_INT[32], s_INT[2]; char h_SHORT[32], s_SHORT[2]; char h_WCHAR[32], s_WCHAR[2]; - char nl[1]; + char nl[2]; } foo = { "\nSIZEOF_BYTE=", DEC(CHAR_BIT), #if HAVE_SUPERLONG_T @@ -3282,10 +3282,10 @@ for try in NOTHING _LARGE_FILES=1 _FILE_OFFSET_BITS=64 ; do #define LD(S) D((S) % 10, '0') #define DEC(S) { UD(S), LD(S) } -struct { +struct sizes { char h_BYTE[32], s_BYTE[2]; char h_OFF_T[32], s_OFF_T[2]; - char nl[1]; + char nl[2]; } foo = { "\nSIZEOF_BYTE=", DEC(CHAR_BIT), "\nSIZEOF_OFF_T=", DEC(sizeof (off_t)), -- cgit v1.2.3