[rrd-developers] Compile rrdtool-1.4.8 in Visual Studio 2013

Tobias Oetiker tobi at oetiker.ch
Sun Jun 15 22:20:11 CEST 2014


Hi Peter,

would you like to make this a pull request on github.com ?

cheers
tobi


Today Peter wrote:

> Hi Tobi,
> below are the patch files from the actual clone of branch 1.4.
> An new error occured in rrd_restore.c
> Error	3	error C2440: '=' : cannot convert from 'void *' to
> 'stdioXmlReaderContext *'
> at the line: sctx = malloc(sizeof(*sctx));
> I added a type cast.
>
> Peter
>
> diff --git
> "a/C:\\Users\\Peter\\AppData\\Local\\Temp\\TortoiseGit\\con4F88.tmp\\config-fdd5a8e-left.h"
> "b/C:\\Users\\Peter\\Documents\\GitHub\\rrdtool-1.x\\win32\\config.h"
> index 587d02e..a1b5a0d 100644
> ---
> "a/C:\\Users\\Peter\\AppData\\Local\\Temp\\TortoiseGit\\con4F88.tmp\\config-fdd5a8e-left.h"
> +++ "b/C:\\Users\\Peter\\Documents\\GitHub\\rrdtool-1.x\\win32\\config.h"
> @@ -57,6 +57,19 @@
>
>  /* #define DEBUG 1 */
>
> +// in MSVC++ 12.0 / Visual Studio 2013 is a definition of round in math.h
> +// some values of _MSC_VER
> +//MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013)
> +//MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012)
> +//MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010)
> +//MSVC++ 9.0  _MSC_VER == 1500 (Visual Studio 2008)
> +//MSVC++ 8.0  _MSC_VER == 1400 (Visual Studio 2005)
> +//MSVC++ 7.1  _MSC_VER == 1310 (Visual Studio 2003)
> +//MSVC++ 7.0  _MSC_VER == 1300
> +//MSVC++ 6.0  _MSC_VER == 1200
> +//MSVC++ 5.0  _MSC_VER == 1100
> +#if _MSC_VER < 1800
>  __inline int round(double a){int x = (a + 0.5); return x;}
> +#endif
>
>  #endif                          /* CONFIG_H */
>
> diff --git
> "a/C:\\Users\\Peter\\AppData\\Local\\Temp\\TortoiseGit\\rrd5CEC.tmp\\rrd_create-fdd5a8e-left.c"
> "b/C:\\Users\\Peter\\Documents\\GitHub\\rrdtool-1.x\\src\\rrd_create.c"
> index a5c1294..062ba58 100644
> ---
> "a/C:\\Users\\Peter\\AppData\\Local\\Temp\\TortoiseGit\\rrd5CEC.tmp\\rrd_create-fdd5a8e-left.c"
> +++ "b/C:\\Users\\Peter\\Documents\\GitHub\\rrdtool-1.x\\src\\rrd_create.c"
> @@ -12,7 +12,9 @@
>  #include "rrd_rpncalc.h"
>  #include "rrd_hw.h"
>  #include "rrd_client.h"
> +#ifdef HAVE_CONFIG_H
>  #include "../rrd_config.h"
> +#endif
>
>  #include "rrd_is_thread_safe.h"
>  static int opt_no_overwrite = 0;
>
> diff --git
> "a/C:\\Users\\Peter\\AppData\\Local\\Temp\\TortoiseGit\\rrd568B.tmp\\rrd_restore-fdd5a8e-left.c"
> "b/C:\\Users\\Peter\\Documents\\GitHub\\rrdtool-1.x\\src\\rrd_restore.c"
> index 53380db..bd17df1 100644
> ---
> "a/C:\\Users\\Peter\\AppData\\Local\\Temp\\TortoiseGit\\rrd568B.tmp\\rrd_restore-fdd5a8e-left.c"
> +++ "b/C:\\Users\\Peter\\Documents\\GitHub\\rrdtool-1.x\\src\\rrd_restore.c"
> @@ -262,7 +262,11 @@ static int get_xml_time_t(
>  #elif SIZEOF_TIME_T == 8
>          temp = strtoll((char *)text,NULL, 0);
>  #else
> +#ifdef WIN32
> +		temp = strtoll((char *)text, NULL, 0);
> +#else
>  #error "Don't know how to deal with TIME_T other than 4 or 8 bytes"
> +#endif
>  #endif
>          if (errno>0){
>              rrd_set_error("ling %d: get_xml_time_t from '%s' %s",
> @@ -1171,7 +1175,7 @@ static rrd_t *parse_file(
>      /* special handling for XML on stdin (like it is the case when using
>         the pipe interface) */
>      if (strcmp(filename, "-") == 0) {
> -	sctx = malloc(sizeof(*sctx));
> +		sctx = (stdioXmlReaderContext *) malloc(sizeof(*sctx));
>  	if (sctx == NULL) {
>  	    rrd_set_error("parse_file: malloc failed.");
>  	    return (NULL);
>
>
>
>
> --
> View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/Compile-rrdtool-1-4-8-in-Visual-Studio-2013-tp7582052p7582174.html
> Sent from the RRDtool Developers Mailinglist mailing list archive at Nabble.com.
>
> _______________________________________________
> rrd-developers mailing list
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch tobi at oetiker.ch +41 62 775 9902



More information about the rrd-developers mailing list