Code

more solaris 10 portability changes ....
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 27 Oct 2009 17:04:03 +0000 (17:04 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 27 Oct 2009 17:04:03 +0000 (17:04 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1954 a5681a0c-68f1-0310-ab6d-d61299d08faa

program/src/rrd_client.c
program/src/rrd_graph.h
program/src/rrd_restore.c

index b018ee0aa4fc1d86c4c35a2eec47efdb9d5cb2af..034beca9471a6a9ed7899e6c6f65d8b3322d386b 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 #include <assert.h>
 #include <pthread.h>
@@ -33,6 +34,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <netdb.h>
+#include <limits.h>
 
 #ifndef ENODATA
 #define ENODATA ENOENT
index d3de4cf05fc6e215e10312adf2e3d9a555f7e3d7..c11ac2fea851dc921420c1f6a07d9d21578483f0 100644 (file)
@@ -9,6 +9,11 @@
 #include <cairo-pdf.h>
 #include <cairo-svg.h>
 #include <cairo-ps.h>
+
+/* without this will not compile on solaris */
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__
+#endif
 #include <pango/pangocairo.h>
 
 
index d75247dc9e299943ad44bbfa05841ff62105abbe..d351cba169c6f8152bac6b7e9b3544107c20a9e6 100644 (file)
@@ -275,21 +275,26 @@ static int get_xml_double(
     double *value)
 {
     
-    char *text;
+    xmlChar *text;
     double temp;    
     if ((text = (char *)get_xml_text(reader))!= NULL){
-        if (strcasestr(text,"nan")){
+        char *c = text;
+        while (c){
+            *c=tolower((unsigned char)(*c));
+            c++;
+        }
+        if (xmlStrcasestr(text,(xmlChar *)"nan")){
             *value = DNAN;
             xmlFree(text);
             return 0;            
         }
-        else if (strcasestr(text,"-inf")){
+        else if (xmlStrcasestr(text,(xmlChar *)"-inf")){
             *value = -DINF;
             xmlFree(text);
             return 0;            
         }
-        else if (strcasestr(text,"+inf")
-                 || strcasestr(text,"inf")){
+        else if (xmlStrcasestr(text,(xmlChar *)"+inf")
+                 || xmlStrcasestr(text,(xmlChar *)"inf")){
             *value = DINF;
             xmlFree(text);
             return 0;