[Liblas-commits] r1115 - trunk/src
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Mar 19 18:11:53 EDT 2009
Author: hobu
Date: Thu Mar 19 18:11:53 2009
New Revision: 1115
URL: http://liblas.org/changeset/1115
Log:
strncasecmp doesn't exist on windows
Modified:
trunk/src/las_c_api.cpp
Modified: trunk/src/las_c_api.cpp
==============================================================================
--- trunk/src/las_c_api.cpp (original)
+++ trunk/src/las_c_api.cpp Thu Mar 19 18:11:53 2009
@@ -82,6 +82,12 @@
#include <stdint.h>
#endif
+#ifdef WIN32
+#define compare_no_case(a,b,n) _strnicmp( (a), (b), (n) )
+#else
+#define compare_no_case(a,b,n) strncasecmp( (a), (b), (n) )
+#endif
+
// Error stuff
@@ -183,7 +189,7 @@
try {
std::ios::openmode const mode = std::ios::in | std::ios::binary;
std::istream* istrm;
- if (strncasecmp(filename,"STDIN",5) == 0)
+ if (compare_no_case(filename,"STDIN",5) == 0)
{
istrm = &std::cin;
}
@@ -1190,7 +1196,7 @@
m = std::ios::out | std::ios::binary | std::ios::ate;
}
- if (strncasecmp(filename,"STOUT",5) == 0)
+ if (compare_no_case(filename,"STOUT",5) == 0)
{
ostrm = &std::cout;
}
More information about the Liblas-commits
mailing list