Commit ec42eafd by Scott J. Goldman

Hook up Windows compat fnmatch() for Solaris

Since Solaris does not support some of the same flags as glibc fnmatch(),
we just use the implementation we have for Windows.

Now that it's no longer a windows-specific thing, I moved it into compat/
instead of win32/
parent a9d9965b
......@@ -97,7 +97,9 @@ FILE(GLOB SRC_H include/git2/*.h)
# On Windows use specific platform sources
IF (WIN32 AND NOT CYGWIN)
ADD_DEFINITIONS(-DWIN32 -D_DEBUG -D_WIN32_WINNT=0x0501)
FILE(GLOB SRC src/*.c src/transports/*.c src/xdiff/*.c src/win32/*.c)
FILE(GLOB SRC src/*.c src/transports/*.c src/xdiff/*.c src/win32/*.c src/compat/*.c)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
FILE(GLOB SRC src/*.c src/transports/*.c src/xdiff/*.c src/unix/*.c src/compat/*.c)
ELSE()
FILE(GLOB SRC src/*.c src/transports/*.c src/xdiff/*.c src/unix/*.c)
ENDIF ()
......
......@@ -4,8 +4,8 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_fnmatch__w32_h__
#define INCLUDE_fnmatch__w32_h__
#ifndef INCLUDE_fnmatch__compat_h__
#define INCLUDE_fnmatch__compat_h__
#include "common.h"
......
......@@ -7,7 +7,12 @@
#ifndef INCLUDE_posix__w32_h__
#define INCLUDE_posix__w32_h__
#include <fnmatch.h>
#ifndef __sun
# include <fnmatch.h>
# define p_fnmatch(p, s, f) fnmatch(p, s, f)
#else
# include "compat/fnmatch.h"
#endif
#define p_lstat(p,b) lstat(p,b)
#define p_readlink(a, b, c) readlink(a, b, c)
......@@ -16,7 +21,6 @@
#define p_mkdir(p,m) mkdir(p, m)
#define p_fsync(fd) fsync(fd)
#define p_realpath(p, po) realpath(p, po)
#define p_fnmatch(p, s, f) fnmatch(p, s, f)
#define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a)
#define p_snprintf(b, c, f, ...) snprintf(b, c, f, __VA_ARGS__)
#define p_mkstemp(p) mkstemp(p)
......
......@@ -8,7 +8,7 @@
#define INCLUDE_posix__w32_h__
#include "common.h"
#include "fnmatch.h"
#include "compat/fnmatch.h"
#include "utf-conv.h"
GIT_INLINE(int) p_link(const char *old, const char *new)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment