[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59560] trunk/blender/source/blender: 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???).

Bastien Montagne montagne29 at wanadoo.fr
Tue Aug 27 20:29:30 CEST 2013


Revision: 59560
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59560
Author:   mont29
Date:     2013-08-27 18:29:30 +0000 (Tue, 27 Aug 2013)
Log Message:
-----------
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!

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_fnmatch.h
    trunk/blender/source/blender/blenlib/intern/path_util.c
    trunk/blender/source/blender/editors/space_file/filesel.c
    trunk/blender/source/blender/editors/space_outliner/outliner_tree.c

Modified: trunk/blender/source/blender/blenlib/BLI_fnmatch.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_fnmatch.h	2013-08-27 16:44:11 UTC (rev 59559)
+++ trunk/blender/source/blender/blenlib/BLI_fnmatch.h	2013-08-27 18:29:30 UTC (rev 59560)
@@ -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 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

Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c	2013-08-27 16:44:11 UTC (rev 59559)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c	2013-08-27 18:29:30 UTC (rev 59560)
@@ -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"

Modified: trunk/blender/source/blender/editors/space_file/filesel.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/filesel.c	2013-08-27 16:44:11 UTC (rev 59559)
+++ trunk/blender/source/blender/editors/space_file/filesel.c	2013-08-27 18:29:30 UTC (rev 59560)
@@ -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) {

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_tree.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_tree.c	2013-08-27 16:44:11 UTC (rev 59559)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_tree.c	2013-08-27 18:29:30 UTC (rev 59560)
@@ -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"
 




More information about the Bf-blender-cvs mailing list