Make compile on win32 without fnmatch

This commit is contained in:
Klaas Freitag 2013-09-18 16:17:58 +02:00
parent 525278450a
commit 219ce5fc4c
3 changed files with 13 additions and 1 deletions

View file

@ -24,7 +24,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <fnmatch.h>
#include "c_lib.h"

View file

@ -147,6 +147,7 @@ int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags) {
#include <shlwapi.h>
int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags) {
(void) __flags;
/* FIXME check if we rather should use the PathMatchSpecW variant here? */
if(PathMatchSpec(__name, __pattern))
return 0;
else

View file

@ -21,8 +21,20 @@
#ifndef _CSYNC_MISC_H
#define _CSYNC_MISC_H
#include "config.h"
#include "csync.h"
#ifdef HAVE_FNMATCH
#include <fnmatch.h>
#else
#define
/* Steal this define to make csync_exclude compile. Note that if fnmatch
* is not defined it's probably Win32 which uses a different implementation
* than fmmatch anyway, which does not care for flags.
**/
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#endif
char *csync_get_user_home_dir(void);
char *csync_get_local_username(void);