[Kst] branches/work/kst/portto4/kst/src

George Staikos staikos at kde.org
Fri Sep 28 21:47:40 CEST 2007


SVN commit 718474 by staikos:

on win32, use static libs for now.  build system needs work, but now we compile
as far as dirfile, which is not really win32 compatible.


 M  +0 -4      datasources/ascii/ascii.cpp  
 M  +21 -0     libkst/kstmath.h  
 M  +1 -0      libkst/libkst.pro  
 M  +1 -0      libkstmath/libkstmath.pro  


--- branches/work/kst/portto4/kst/src/datasources/ascii/ascii.cpp #718473:718474
@@ -37,10 +37,6 @@
 #include "ascii.h"
 #include "ui_asciiconfig.h"
 
-#ifndef INF
-double INF = 1.0/0.0;
-#endif
-
 #define DEFAULT_DELIMITERS "#/c!;"
 #define DEFAULT_COLUMN_WIDTH 16
 
--- branches/work/kst/portto4/kst/src/libkst/kstmath.h #718473:718474
@@ -56,6 +56,27 @@
 #define NAN (::nan__())
 #endif
 
+#if !defined(INF)
+#include <qconfig.h>
+static double inf__()
+{
+  /* work around some strict alignment requirements
+     for double variables on some architectures (e.g. PA-RISC) */
+  typedef union { unsigned char b[8]; double d; } kjs_double_t;
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+  static const kjs_double_t Inf_Bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+#elif defined(arm)
+  static const kjs_double_t Inf_Bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
+#else
+  static const kjs_double_t Inf_Bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
+#endif
+
+  const double Inf = Inf_Bytes.d;
+  return Inf;
+}
+#define INF (::inf__())
+#endif
+
 /*
 ** Both Solaris and FreeBSD-current do weird things with the
 ** isnan() defined in math.h - in particular on FreeBSD it
--- branches/work/kst/portto4/kst/src/libkst/libkst.pro #718473:718474
@@ -7,6 +7,7 @@
 MOC_DIR = tmp
 TARGET = kst
 DESTDIR = $$OUTPUT_DIR/lib
+win32:CONFIG += staticlib
 
 INCLUDEPATH += \
     tmp \
--- branches/work/kst/portto4/kst/src/libkstmath/libkstmath.pro #718473:718474
@@ -7,6 +7,7 @@
 MOC_DIR = tmp
 TARGET = kstmath
 DESTDIR = $$OUTPUT_DIR/lib
+win32:CONFIG += staticlib
 
 INCLUDEPATH += \
     tmp \


More information about the Kst mailing list