Re: [fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-22 Thread Tom M.
Long time ago this looked like: https://github.com/FluidSynth/fluidsynth/blame/c9193d8f8182cd26785f6fdda502dbcad783ccbc/fluidsynth/src/fluidsynth.c#L90-L94 Perhaps these declarations were missing in the header at that time and manually added. I think it's redundant nowadays and removed it

Re: [fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-22 Thread Carlo Bramini
Hello you are right, I did not noticed that thing: that ugly addition on top of fluidsynth.c declares extern getopt(), but in the later code it is using getopt_long(). So, the re-declaration of getopt() looks more useless to me. You may want to re-declare getopt_long() instead, but I doubt that

Re: [fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-22 Thread Tom M.
> If HAVE_GETOPT is defined, let's use the function. We dont rely on getopt, fluidsynth.c will do the parsing itself if it's not present. The bigger problem is that getopt_long() may or may not be present in getopt.h. But so far I havent seen a getopt.h that doesnt provide it. Tom 2017-10-22 1

Re: [fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-22 Thread Carlo Bramini
Hello, in my opinion, that piece of code should be removed. The proper presence of getopt.h and the support of getopt() function should be tested by cmake. If HAVE_GETOPT_H is defined, let's include the file. If HAVE_GETOPT is defined, let's use the function. What do you think? Sincerely. > Il

Re: [fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-22 Thread Marcus Weseloh
Hi, to me it looks like somebody read the getopt man page and took the synopsis as a usage example and not as a short description of the header file contents. I think the lines int getopt(int argc, char * const argv[], const char *optstring); extern char *optarg; extern int optind, opterr, optopt

Re: [fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-21 Thread Tom M.
clang-tidy also remarks that on Linux. Not sure why it has been done that way. Tom 2017-10-21 17:01 GMT+02:00 Carlo Bramini : > Hello, > when compiling Fluidsynth on Windows, the compiler prints these messages > into the console: > > [ 97%] Building C object src/CMakeFiles/fluidsynth.dir/fluid

[fluid-dev] Current code overrides getopt.h declarations on Windows

2017-10-21 Thread Carlo Bramini
Hello, when compiling Fluidsynth on Windows, the compiler prints these messages into the console: [ 97%] Building C object src/CMakeFiles/fluidsynth.dir/fluidsynth.c.o /home/Carlo/fluidsynth/src/fluidsynth.c:67:14: warning: 'optarg' redeclared with out dllimport attribute: previous dllimport ign