path: root/compat/win32
AgeCommit message (Collapse)Author
2011-10-31compat/win32/poll.c: upgrade from upstreamErik Faye-Lund
poll.c is updated from revision adc3a5b in git:// The changes are applied with --whitespace=fix to reduce noise. poll.h is not upgraded, because the most recent version now contains template-stuff that breaks compilation for us. Signed-off-by: Erik Faye-Lund <> Acked-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2011-10-31mingw: move poll out of sys-folderErik Faye-Lund
Both XSI and upstream Gnulib versions expects to find poll.h at the root of some include path, not inside the sys-folder. This helps us when upgrading Gnulib. Signed-off-by: Erik Faye-Lund <> Acked-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2011-10-07mingw: avoid using strbuf in syslogErik Faye-Lund
strbuf can call die, which again can call syslog from git-daemon. Endless recursion is no fun; fix it by hand-rolling the logic. As a side-effect malloc/realloc errors are changed into non-fatal warnings; this is probably an improvement anyway. Signed-off-by: Erik Faye-Lund <> Noticed-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2010-12-16Merge branch 'rj/msvc-fix'Junio C Hamano
* rj/msvc-fix: msvc: Fix macro redefinition warnings msvc: Fix build by adding missing INTMAX_MAX define msvc: git-daemon.exe: Fix linker "unresolved externals" error msvc: Fix compilation errors in compat/win32/sys/poll.c
2010-12-09msvc: Fix compilation errors in compat/win32/sys/poll.cRamsay Jones
The msvc winsock2.h header file conditionally defines or declares poll() related symbols which cause many macro redefinition errors, a struct type redefinition error and syntax errors. These symbols are defined in support of the WSAPoll() API, new in Windows Vista, when the symbol _WIN32_WINNT is defined and _WIN32_WINNT >= 0x0600. In order to avoid the compilation errors, we set _WIN32_WINNT to 0x0502 (which would target Windows Server 2003) prior to including the winsock2.h header file. Signed-off-by: Ramsay Jones <> Acked-by: Erik Faye-Lund <> Signed-off-by: Junio C Hamano <>
2010-11-24win32: use our own dirent.hErik Faye-Lund
The mingw-runtime implemenation of opendir, readdir and closedir sets errno to 0 on success, something that POSIX explicitly forbids. 3ba7a06 ("A loose object is not corrupt if it cannot be read due to EMFILE") introduce a dependency on this behaviour, leading to a broken "git clone" on Windows. compat/mingw.c contains an implementation of readdir, and compat/msvc.c contains implementations of opendir and closedir. Move these to compat/win32/dirent.[ch], and change to our own DIR structure at the same time. This provides a generic Win32-implementation of opendir, readdir and closedir which works on both MinGW and MSVC and does not reset errno, and as a result git clone is working again on Windows. Signed-off-by: Erik Faye-Lund <> Signed-off-by: Junio C Hamano <>
2010-11-04mingw: use poll-emulation from gnulibErik Faye-Lund
Signed-off-by: Erik Faye-Lund <> Signed-off-by: Junio C Hamano <>
2010-11-04mingw: import poll-emulation from gnulibErik Faye-Lund
copy lib/poll.c and lib/ verbatim from commit 0a05120 in git:// to compat/win32/sys/poll.[ch] To upgrade this code in the future, branch out from this commit, copy new versions of the files above on top, and merge back the result. Signed-off-by: Erik Faye-Lund <> Signed-off-by: Junio C Hamano <>
2010-11-04mingw: implement syslogMike Pape
Syslog does not usually exist on Windows, so implement our own using Window's ReportEvent mechanism. Strings containing "%1" gets expanded into them selves by ReportEvent, resulting in an unreadable string. "%2" and above is not a problem. Unfortunately, on Windows an IPv6 address can contain "%1", so expand "%1" to "% 1" before reporting. "%%1" is also a problem for ReportEvent, but that string cannot occur in an IPv6 address. Signed-off-by: Mike Pape <> Signed-off-by: Erik Faye-Lund <> Signed-off-by: Junio C Hamano <>
2010-06-21Merge branch 'js/async-thread'Junio C Hamano
* js/async-thread: fast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f) Enable threaded async procedures whenever pthreads is available Dying in an async procedure should only exit the thread, not the process. Reimplement async procedures using pthreads Windows: more pthreads functions Fix signature of fcntl() compatibility dummy Make report() from usage.c public as vreportf() and use it. Modernize t5530-upload-pack-error. Conflicts: http-backend.c
2010-04-09Thread-safe xmalloc and xrealloc needs a recursive mutexJohannes Sixt
The mutex used to protect object access (read_mutex) may need to be acquired recursively. Introduce init_recursive_mutex() helper function in thread-utils.c that constructs a mutex with the PHREAD_MUTEX_RECURSIVE attribute. pthread_mutex_init() emulation on Win32 is already recursive as it is implemented on top of the CRITICAL_SECTION type, which is recursive. Add do-nothing compatibility wrappers for pthread_mutexattr* functions. Initial-version-by: Fredrik Kuivinen <> Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2010-03-07Windows: more pthreads functionsJohannes Sixt
This adds: pthread_self pthread_equal pthread_exit pthread_key_create pthread_setspecific pthread_getspecific Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2010-02-04Typofixes outside documentation areaJunio C Hamano
begining -> beginning canonicalizations -> canonicalization comand -> command dewrapping -> unwrapping dirtyness -> dirtiness DISCLAMER -> DISCLAIMER explicitely -> explicitly feeded -> fed impiled -> implied madatory -> mandatory mimick -> mimic preceeding -> preceding reqeuest -> request substition -> substitution Signed-off-by: Junio C Hamano <>
2010-01-30Implement pthread_cond_broadcast on WindowsJohannes Sixt
See, section "The SignalObjectAndWait solution". But note that this implementation does not use SignalObjectAndWait (which is needed to achieve fairness, but we do not need fairness). Note that our implementations of pthread_cond_broadcast and pthread_cond_signal require that they are invoked with the mutex held that is used in the pthread_cond_wait calls. Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2010-01-17MSVC: Windows-native implementation for subset of Pthreads APIAndrzej K. Haczewski
This patch implements native to Windows subset of pthreads API used by Git. It allows to remove Pthreads for Win32 dependency for MSVC, msysgit and Cygwin. [J6t: If the MinGW build was built as part of the msysgit build environment, then threading was already enabled because the pthreads-win32 package is available in msysgit. With this patch, we can now enable threaded code unconditionally.] Signed-off-by: Andrzej K. Haczewski <> Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>