OSDN Git Service

Fix C++ strict type checking inconsistency in <glob.h>
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Sun, 10 Jul 2016 21:38:45 +0000 (22:38 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Sun, 10 Jul 2016 21:38:45 +0000 (22:38 +0100)
mingwrt/ChangeLog
mingwrt/include/glob.h

index 84588ad..7b938f9 100644 (file)
@@ -1,3 +1,12 @@
+2016-07-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Fix C++ strict type checking inconsistency in <glob.h>
+
+       * include/glob.h (__ERRFUNC_P): New private macro; define it to match
+       the type signature of the error function pointer, to be passed to...
+       (glob): ...this function; use it to correctly represent error function
+       pointer argument in inline implementation.
+
 2016-07-09  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Factor out <ctype.h> vs. <wctype.h> duplicate elements.
index b9a7655..9cfa169 100644 (file)
@@ -8,7 +8,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2011, 2012, 2014, MinGW.org Project.
+ * Copyright (C) 2011, 2012, 2014, 2016, MinGW.org Project.
  *
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -132,15 +132,17 @@ _BEGIN_C_DECLS
  * However, our actual function implementations are provided via this
  * pair of reserved function names...
  */
-int __mingw_glob (const char *, int, int (*)( const char *, int ), glob_t *);
+int __mingw_glob (const char *, int, int (*)(const char *, int), glob_t *);
 void __mingw_globfree (glob_t *);
 
 /* ...to which the standard names are then mapped as aliases,
  * via __CRT_ALIAS inline function expansion.
  */
 __CRT_ALIAS __JMPSTUB__(( FUNCTION = glob ))
-int glob (const char *__pattern, int __flags, int (*__errfunc)(), glob_t *__data)
+# define __ERRFUNC_P  (*__errfunc) (const char *, int)
+int glob (const char *__pattern, int __flags, int __ERRFUNC_P, glob_t *__data)
 { return __mingw_glob (__pattern, __flags, __errfunc, __data); }
+# undef __ERRFUNC_P
 
 __CRT_ALIAS __JMPSTUB__(( FUNCTION = globfree ))
 void globfree (glob_t *__data){ return __mingw_globfree (__data); }