extern _crt_glob alias "_crt_glob" as integer
dim shared _crt_glob as integer = 0
print command
anti-globbing not working in 0.90.1
anti-globbing not working in 0.90.1
I started a new project and thought i would try compiling with with 0.90.1 instead of 0.24. i quickly found that COMMAND emits a list of file names in response to input of *. a bug?
Re: anti-globbing not working in 0.90.1
I used MinGW-w64 instead of MinGW.org for 0.90, and MinGW-w64 for some reason uses a different global variable to do this:
Code: Select all
extern _dowildcard alias "_dowildcard" as long
dim shared _dowildcard as long = 0
print command( )
Re: anti-globbing not working in 0.90.1
Then the Wiki must get updated: http://www.freebasic.net/wiki/wikka.php ... yPgCommand
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: anti-globbing not working in 0.90.1
Should we unify on Integer/Long in those two code snippets?
Re: anti-globbing not working in 0.90.1
I think these global variables are 32bit ints, even in 64bit MinGW-w64, so we should definitely use 32bit Longs on the FB side, considering that Integer would become 64bit in 64bit FB.
I'm hoping we could go back to using MinGW.org for the "official" FB-win32 build - the only reason to switch away was GCC v4 which MinGW.org didn't have, but now they're up to date, and binary size issues which I think are solved by 0537df1d/16032c1d. That would change the way to do globbing back to how it was before (unless MinGW.org changed it too in the meantime).
Of course for a future FB-win64 build, which would have to use MinGW-w64 (at least while there is no 64bit MinGW.org), the way to disable globbing would then still be different from FB-win32.
Perhaps we should add an fbc command line option or similar to control the globbing behaviour, and let FB take care of interfacing with the MinGW toolchain?
I'm hoping we could go back to using MinGW.org for the "official" FB-win32 build - the only reason to switch away was GCC v4 which MinGW.org didn't have, but now they're up to date, and binary size issues which I think are solved by 0537df1d/16032c1d. That would change the way to do globbing back to how it was before (unless MinGW.org changed it too in the meantime).
Of course for a future FB-win64 build, which would have to use MinGW-w64 (at least while there is no 64bit MinGW.org), the way to disable globbing would then still be different from FB-win32.
Perhaps we should add an fbc command line option or similar to control the globbing behaviour, and let FB take care of interfacing with the MinGW toolchain?
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: anti-globbing not working in 0.90.1
Yeah, this seems like a good thing to have some cross-platform support for where possible. Would it work for DOS too?
A command-line option sounds like a good idea, though I don't know whether a source-level solution would be better from the programmer's perspective. That would allow the preprocessor some control, e.g. for compiling in older versions.
A command-line option sounds like a good idea, though I don't know whether a source-level solution would be better from the programmer's perspective. That would allow the preprocessor some control, e.g. for compiling in older versions.