diff options
-rw-r--r-- | source/blender/blenlib/BLI_fnmatch.h | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 10 |
4 files changed, 12 insertions, 24 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" diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 5495390b819..9d762c80405 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -59,6 +59,7 @@ #include "BLI_dynstr.h" #include "BLI_utildefines.h" #include "BLI_fileops_types.h" +#include "BLI_fnmatch.h" #include "BKE_context.h" #include "BKE_global.h" @@ -81,12 +82,6 @@ #include "file_intern.h" #include "filelist.h" -#if defined WIN32 && !defined _LIBC -# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ -#else -# include <fnmatch.h> -#endif - FileSelectParams *ED_fileselect_get_params(struct SpaceFile *sfile) { if (!sfile->params) { diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 0a9478ed52c..b281a00db2b 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -32,15 +32,6 @@ #include <math.h> #include <string.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 - #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" @@ -65,6 +56,7 @@ #include "BLI_math.h" #include "BLI_ghash.h" #include "BLI_mempool.h" +#include "BLI_fnmatch.h" #include "BLF_translation.h" |