[rrd-users] rrdtool 1.4.4 Win32 compile -- "getopt" conditional directives lost

Tobias Oetiker tobi at oetiker.ch
Tue Aug 3 23:16:50 CEST 2010


Hi J,

Today jkane at mail.com wrote:
>
> First off, thanks for 1.4.4.  For A Win32 user, this has really made compile much easier with MSVC2008.  I'm not sure if anyone has tried the WIN32 compile yet here, but I have found some issues.
>
> It looks like rrd_getopt.h, rrd_getopt1.c, and rrd_getopt.c have some changes that may have inadvertently (bug?) lost the WIN32 compiler directives for the get_opt_long and _get_opt_internal function calls.
>
> MSVC2008 was giving compile errors on rrd_getopt1.c with the argv handling in the above functions in 1.4.4.   WIN32 versions of these function are much different in their argument definitions).
>
> I went back to my last known win32 compile of rddtool (1.3.8) and noticed that many #ifdef WIN32 sections were not present in 1.4.4 versions of rrd_getopt.h, rrd_getopt1.c, and rrd_getopt.c.
>
> As an example:
>
> Definition of getopt_long from rrd_getopt1.c (rrd source version 1.3.8)
>
> #ifdef WIN32
> int getopt_long(int argc,
>                 char** argv,
>                 const char* options,
>                 const struct option* long_options,
>                 int* opt_index)
> #else // WIN32
> int getopt_long(
>     argc,
>     argv,
>     options,
>     long_options,
>     opt_index)
>     int argc;
>     char     *const *argv;
>     const char *options;
>     const struct option *long_options;
>     int      *opt_index;
> #endif // WIN32
> {
>     return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
> }
>
>
> Compare with definition of getopt_long from rrd_getopt1.c (rrd source version 1.4.4).
> (this function will throw errors on WIN32 compile with regards to the argv casting)
>
> int getopt_long(int argc,
>                 char* const* argv,
>                 const char* options,
>                 const struct option* long_options,
>                 int* opt_index)
> {
>     return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
> }
>
>
> After doing some diffs and merging the missing Win32 conditional
> compile directives back in for these files, I got 1.4.4 to
> compile.  My work was hack and slash and I'm not yet familiar
> enough with your diff and repository tools to attempt a clean
> submission, but maybe you can see this problem from your
> view/compare.

please send me your modified getopt* files ... I will have a look

cheers
tobi

>
>
>
>
>
>
>
>
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-users mailing list