The MinGW/msys build fails with the following message:
.libs/ne_uri.o: In function `ne_path_compare':
c:/MinGW/bin/../lib/gcc/mingw32/3.4.4/../../../../include/string.h:103: undefined reference to `min'
I have attached two possible patches for this problem, although I think the second one makes more sense. Let me know what you think.

Thanks.

-Matthias Miller
Index: src/ne_uri.c
===================================================================
--- src/ne_uri.c        (revision 1069)
+++ src/ne_uri.c        (working copy)
@@ -523,10 +523,10 @@
 #undef CASECMP
 #undef CMPWITH
 
-#ifndef WIN32
+#ifdef min
 #undef min
+#endif
 #define min(a,b) ((a)<(b)?(a):(b))
-#endif
 
 /* TODO: implement properly */
 int ne_path_compare(const char *a, const char *b) 
Index: src/ne_uri.c
===================================================================
--- src/ne_uri.c        (revision 1069)
+++ src/ne_uri.c        (working copy)
@@ -523,11 +523,6 @@
 #undef CASECMP
 #undef CMPWITH
 
-#ifndef WIN32
-#undef min
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif
-
 /* TODO: implement properly */
 int ne_path_compare(const char *a, const char *b) 
 {
@@ -543,7 +538,7 @@
            ((traila && lena > lenb) || (trailb && lenb > lena))) {
            /* Compare them, ignoring the trailing slash on the longer
             * URI */
-           if (strncasecmp(a, b, min(lena, lenb)) == 0)
+           if (strncasecmp(a, b, lena < lenb ? lena : lenb)) == 0)
                ret = 0;
        }
     }
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to