Fossil SCM

For strtoll() with Visual Studio prior to MSVS 2013, fallback to _strtoi64().

ashepilko 2020-07-17 23:53 trunk
Commit d626ddb55490c5a560c7c55682b0892c22bcabe713c33075fb968ce2a2406432
1 file changed +4
--- src/mkversion.c
+++ src/mkversion.c
@@ -38,10 +38,14 @@
3838
#include <stdio.h>
3939
#include <string.h>
4040
#include <stdlib.h>
4141
#include <ctype.h>
4242
#include <time.h>
43
+
44
+#if defined(_MSC_VER) && (_MSC_VER < 1800) /* MSVS 2013 */
45
+# define strtoll _strtoi64
46
+#endif
4347
4448
static FILE *open_for_reading(const char *zFilename){
4549
FILE *f = fopen(zFilename, "r");
4650
if( f==0 ){
4751
fprintf(stderr, "cannot open \"%s\" for reading\n", zFilename);
4852
--- src/mkversion.c
+++ src/mkversion.c
@@ -38,10 +38,14 @@
38 #include <stdio.h>
39 #include <string.h>
40 #include <stdlib.h>
41 #include <ctype.h>
42 #include <time.h>
 
 
 
 
43
44 static FILE *open_for_reading(const char *zFilename){
45 FILE *f = fopen(zFilename, "r");
46 if( f==0 ){
47 fprintf(stderr, "cannot open \"%s\" for reading\n", zFilename);
48
--- src/mkversion.c
+++ src/mkversion.c
@@ -38,10 +38,14 @@
38 #include <stdio.h>
39 #include <string.h>
40 #include <stdlib.h>
41 #include <ctype.h>
42 #include <time.h>
43
44 #if defined(_MSC_VER) && (_MSC_VER < 1800) /* MSVS 2013 */
45 # define strtoll _strtoi64
46 #endif
47
48 static FILE *open_for_reading(const char *zFilename){
49 FILE *f = fopen(zFilename, "r");
50 if( f==0 ){
51 fprintf(stderr, "cannot open \"%s\" for reading\n", zFilename);
52

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button