diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-27 22:29:30 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-27 22:29:30 +0400 |
commit | 8bdb1f61556bd480ddbb8c0eb993a3548effbf0b (patch) | |
tree | bd1afbca89047fb51fd373aec7a157048cb80ded /source/blender/blenlib | |
parent | 6b51c274149d854f57f2f1865578942a87e78869 (diff) |
Get rid of madness about fnmatch: BLI_fnmatch did not do the OS checks, they had to be done in every file using fnmatch (autoexec.c did not, wonder how it could work under unix???).
Thanks to Brecht for noting this!
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_fnmatch.h | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h index 6c466759010..f69f5b39869 100644 --- a/source/blender/blenlib/BLI_fnmatch.h +++ b/source/blender/blenlib/BLI_fnmatch.h @@ -28,6 +28,8 @@ extern "C" { #endif +#if defined WIN32 && !defined _LIBC || defined __sun + #if defined(__cplusplus) || (defined(__STDC__) && __STDC__) #undef __P #define __P(protos) protos @@ -65,6 +67,13 @@ extern "C" { extern int fnmatch __P((const char *__pattern, const char *__string, int __flags)); +#else +# ifndef _GNU_SOURCE +# define _GNU_SOURCE +# endif +# include <fnmatch.h> +#endif /* defined WIN32 && !defined _LIBC || defined __sun */ + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 2c06a812c8a..4d6c9797ed1 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -46,20 +46,12 @@ #include "BLI_path_util.h" #include "BLI_string.h" #include "BLI_string_utf8.h" +#include "BLI_fnmatch.h" #include "../blenkernel/BKE_blender.h" /* BLENDER_VERSION, bad level include (no function call) */ #include "GHOST_Path-api.h" -#if defined WIN32 && !defined _LIBC || defined __sun -# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ -#else -# ifndef _GNU_SOURCE -# define _GNU_SOURCE -# endif -# include <fnmatch.h> -#endif - #ifdef WIN32 # include "utf_winfunc.h" # include "utfconv.h" |