Apache OpenOffice (AOO) Bugzilla – Issue 48845
build broken in psprint because isnan defined twice in MacOSX10.4
Last modified: 2005-07-21 22:34:35 UTC
Concerns Mac OSX 10.4 + *gcc-3.3* Break in psprint because of isnan macro. The log : Making: ../../unxmacxp.pro/slo/strhelper.obj ccache g++ -fsigned-char -fmessage-length=0 -malign-natural -c -I. -I. -I../inc -I../../inc -I../../unx/inc -I../../unxmacxp.pro/inc -I. -I/Volumes/sauvegarde/OpenOffice.org680/solver/680/unxmacxp.pro/inc/stl -I/Volumes/sauvegarde/OpenOffice.org680/solver/680/unxmacxp.pro/inc/external -I/Volumes/sauvegarde/OpenOffice.org680/solver/680/unxmacxp.pro/inc -I/Volumes/sauvegarde/OpenOffice.org680/solenv/unxmacxp/inc -I/Volumes/sauvegarde/OpenOffice.org680/solenv/inc -I/Volumes/sauvegarde/OpenOffice.org680/res -I/Volumes/sauvegarde/OpenOffice.org680/solver/680/unxmacxp.pro/inc/stl -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I. -I../../res -I. -O2 -fno-strict-aliasing -pipe -malign-natural -fsigned-char -Wno-long-double -Wno-ctor-dtor-privacy -fexceptions -fno-enforce-eh-specs -fPIC -fno-common -DMACOSX -DUNX -DVCL -DGCC -DC300 -DPOWERPC -DGXX_INCLUDE_PATH=/usr/include/gcc/darwin/3.3/c++ -DCVER=C300 -D_USE_NAMESPACE -DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY -DPOWERPC -DPPC -DSTLPORT_VERSION=400 -D_USE_NAMESPACE=1 -DX_LOCALE -DNO_AUDIO -D__DMAKE -DUNIX -DCPPU_ENV=gcc3 -DSUPD=680 -DPRODUCT -DNDEBUG -DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA -DSRC680 -DBUILD_OS_APPLEOSX -DBUILD_OS_MAJOR=10 -DBUILD_OS_MINOR=4 -DBUILD_OS_REV=0 -DSHAREDLIB -D_DLL_ -DMULTITHREAD -o ../../unxmacxp.pro/slo/strhelper.o /Volumes/sauvegarde/OpenOffice.org680/psprint/source/helper/strhelper.cxx /Volumes/sauvegarde/OpenOffice.org680/psprint/source/helper/strhelper.cxx: In function `int psp::getValueOfDouble(char*, double, int)': /Volumes/sauvegarde/OpenOffice.org680/psprint/source/helper/strhelper.cxx:663: error: `__isnan' undeclared (first use this function) /Volumes/sauvegarde/OpenOffice.org680/psprint/source/helper/strhelper.cxx:663: error: (Each undeclared identifier is reported only once for each function it appears in.) dmake: Error code 1, while making '../../unxmacxp.pro/slo/strhelper.obj' '---* tg_merge.mk *---' ERROR: Error 65280 occurred while making /Volumes/sauvegarde/OpenOffice.org680/psprint/source/helper Looking more carefully at the code, I have seen that __isnan is, *in 10.4* already defined in math.h, precisely in /usr/include/architecture/ppc/math.h. Because the definition differs from the one in strhelper.cxx, this causes a mismatch, and breaks the build. In 10.3, this problem does not occur, I propose then to continue to use this macro in Mac OS X <10.4, and simply skip it in Mac OS 10.4. A tested and working patch is coming -- eric bachard
Created attachment 25869 [details] a patch for isnan macro in Mac OS 10.4
Issue started
This issue is approximatively the same as : <http://www.openoffice.org/issues/show_bug.cgi?id=27753>
Patch looks fine for me.
The patch is plain wrong. This e.g. about FreeBSD...
ericb -> pjanik I have carefully traced the build (build v and changing gcc options) and found this macro was the origin of all Mac OSX problems. Changes are only for Mac OSX. Can you please say what is wrong ? This can be true, but please say us more. And about FreeBSD, I don't know, sorry.
ericb -> pjanik Yes, you're right, this patch only works on Mac OSX10.4, and breaks all other OS. Sorry I'll modify this asap for something like : #if defined(MACOSX) && (BUILD_OS_MAJOR==10) && (BUILD_OS_MINOR<4) #define isnan( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ __isnand ( x ) : \ ( sizeof ( x ) == sizeof( float) ) ? \ #else // do nothing for all other OS, Tiger included ... Thank you, Pavel
Created attachment 25995 [details] correct patch for non use of isnan with Tiger
ericb -> maveric Eric, can you please try to rebuild psprint on 10.3 with this new patch ? Build is ok for me with 10.4
fixed in macosx07
Use ::rtl::math::isNan() instead, available from rtl/math.hxx
maveric->ericb er's suggested patch works for Mac OS X 10.3.9. Module psprint compiles.
Other possibility I have tested, following erAck's suggestion to use rtl/math.hxx -> see new patch
Created attachment 26013 [details] other possibility, using rtl/math.hxx
ericb" patch looks perfect! I like patches removing more code than adding :-)
If this patch is choosen, it has to be tested on every platform/os, not only MacOSX
fixed in macosx07 Build is fine on Mac OSX10.4 Thank's to complete the list...
JA->PL: please take a look at this patch. Eric Bachard mentioned in porting.dev it could probably break psprint on other platforms. It's in cws macosx07. Added you to CC list.
Created attachment 26024 [details] correct patch with full path in the filename (to be applied on m101 exactly)
patch looks good to me isnan is for completeness only anyway, should a NaN occur here it is an error anyway since getValueOfDouble is used in psprint only; NaN is not a value that should occur within PostScript code ...
ericb: patch works on GNU/Linux with gcc 3.4.1 as well -> VERIFIED.
Set target for 2.0
Is OK in cws macosx07.
issue closed