Fix MSVC builds, use C89 strtol() instead of C99 strtoll()
authorRobin Gareus <robin@gareus.org>
Mon, 30 Dec 2019 18:05:10 +0000 (19:05 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 30 Dec 2019 18:05:51 +0000 (19:05 +0100)
For the case at hand (plugin scale-points) it's highly unlikely to
encounter numbers > INT_MAX.

libs/pbd/pbd/natsort.h

index e96d6821474bc4fd49d91bca3aa13f1151b28c31..b16ffd69686c131a80974c4c76e67ae1f94a25a2 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <ctype.h>
 #include <stdlib.h>
+#include <stdint.h>
 
 namespace PBD {
 
@@ -83,8 +84,8 @@ numerically_less (const char* a, const char* b)
                        continue;
                }
                if (d_a) {
-                       const int64_t ia = strtoll (d_a, NULL, 0) * order_of_magnitude (d_a);
-                       const int64_t ib = strtoll (d_b, NULL, 0) * order_of_magnitude (d_b);
+                       const int64_t ia = strtol (d_a, NULL, 0) * order_of_magnitude (d_a);
+                       const int64_t ib = strtol (d_b, NULL, 0) * order_of_magnitude (d_b);
                        if (ia != ib) {
                                return ia < ib;
                        }