[xml] Fix for xmllib2-2.6.32 on CodeGear/Borland C++ Builder 2007



Greetings,

this fixes xmllib2-2.6.32 on Windows using Borland/CodeGear C++ Builder
2007. Without the fix, xmllib crashes on initalization with a fp exception.

I must admit a agree with the comment on this on
http://www.steike.com/code/useless/evil-c/ (search for "endian magic").

Moritz


--- __history\trionan.c.~5~     Sat Aug 30 01:22:02 2008
+++ trionan.c   Mon Sep 01 10:57:33 2008
@@ -129,7 +129,11 @@
  */
 #define TRIO_DOUBLE_INDEX(x) (((unsigned char
*)&internalEndianMagic)[7-(x)])

+#if (defined(__BORLANDC__) && __BORLANDC__ >= 0x0590)
+static TRIO_CONST double internalEndianMagic = 7.949928895127362e-275;
+#else
 static TRIO_CONST double internalEndianMagic = 7.949928895127363e-275;
+#endif

 /* Mask for the exponent */
 static TRIO_CONST unsigned char ieee_754_exponent_mask[] = {





-- 
Moritz Both
aldebaran    Programmierung    &   IT-Lösungen   GmbH
Amtsgericht Hannover HRB 56 991.     Geschäftsführer:
Usch Wildt,      Moritz Both,       Stefan Hackenthal
mail:  info aldebaran de     http://www.aldebaran.de/
Tel: 0511/270 4160              Fax: 0511/27 04 16 33
Adresse: Im Moore 26                 D-30167 Hannover



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]