[Kstars-devel] profiling KStars

James Bowlin bowlin at mindspring.com
Thu May 25 07:29:36 CEST 2006


I got the HTM C++ code to compile and "make testrun" seemed to work without
error.  I am using the older gcc-2.95.3.

I needed to make a few minor changes to the source.  I needed to #define
LONG_LONG_MAX and then I needed to #include a few standard header files
when it couldn't find things like scanf() or strcat().

Below is a patch for the changes I made.  But even with these changes,
it stills fails to compile with gcc-3.4.5.  In fact #defining LONG_LONG_MAX
is redundent with the newer compiler.   The new compiler fails in the
system header (?) file vector.tcc.  It could be that if this problem
is fixed then my other changes would also become unneeded.  I think it
might be as simple as copying over the vector.h (and the files it includes)
from the gcc-2.95.3 include directories to the local include directory for
HTM but I must confess I would just be stabbing in the dark.

Here is the patch:

diff -B -b -u -r orig/htm/filter.cpp c-code/htm/filter.cpp
--- orig/htm/filter.cpp	2003-01-17 07:39:42.000000000 -0700
+++ c-code/htm/filter.cpp	2006-05-24 22:43:42.000000000 -0600
@@ -3,6 +3,7 @@
 #include <iomanip.h>  // setw()
 #include <stdlib.h>   // rand(), drand48() but on the mac osX there
                       // is no drand48 yet
+#include <stdio.h>
 
 #include <HtmRange.h>
 
diff -B -b -u -r orig/htm/include/SkipListElement.h 
c-code/htm/include/SkipListElement.h
--- orig/htm/include/SkipListElement.h	2003-01-16 08:55:57.000000000 -0700
+++ c-code/htm/include/SkipListElement.h	2006-05-24 
22:36:24.000000000 -0600
@@ -19,6 +19,8 @@
 #define OS_INDEX_WIDTH 2    // width for index
 #define NIL 0               // invalid pointer
 
+#define LONG_LONG_MAX 9223372036854775807LL
+
 #ifdef _WIN32
 #define KEY_MAX _I64_MAX
 #else
diff -B -b -u -r orig/htm/src/HtmRange.cpp c-code/htm/src/HtmRange.cpp
--- orig/htm/src/HtmRange.cpp	2003-01-30 08:57:13.000000000 -0700
+++ c-code/htm/src/HtmRange.cpp	2006-05-24 22:40:35.000000000 -0600
@@ -2,10 +2,8 @@
 #include <iomanip.h>  // setw()
 #include <HtmRange.h>
 
-#ifdef _WIN32
 #include <stdio.h>
 #include <string.h>
-#endif
 
 #define INSIDE     1
 #define OUTSIDE   -1


-- 
Peace, James


More information about the Kstars-devel mailing list