summaryrefslogtreecommitdiff
path: root/src/win32
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify GIT_UNUSED macrosRussell Belfer2012-03-021-3/+3
| | | | | | | Since casting to void works to eliminate errors with unused parameters on all platforms, avoid the various special cases. Over time, it will make sense to eliminate the GIT_UNUSED macro completely and just have GIT_UNUSED_ARG.
* Fix readdir usage across platformsRussell Belfer2012-02-232-11/+26
| | | | | | This fixes the missing readdir_r from win32 and fixes other platforms to always use the reentrant readdir_r form for reading directory contents.
* Update Copyright headerschu2012-02-1314-14/+14
| | | | Signed-off-by: schu <schu-github@schulog.org>
* msvc: Move `ssize_t` typedef to MSVC-onlyVicent Martí2012-01-261-0/+3
| | | | This is a MSVC-only issue. All other compilers we support work properly.
* Move path related functions from fileops to pathRussell Belfer2012-01-171-0/+39
| | | | | | | | | | | This takes all of the functions that look up simple data about paths (such as `git_futils_isdir`) and moves them over to path.h (becoming `git_path_isdir`). This leaves fileops.h just with functions that actually manipulate the filesystem or look at the file contents in some way. As part of this, the dir.h header which is really just for win32 support was moved into win32 (with some minor changes).
* Fix MSVC compilation warningnulltoken2012-01-171-1/+1
|
* Windows: store all 64 bits of the size in the stat structureCarlos Martín Nieto2012-01-161-1/+1
| | | | | We force stat to be a stat64 structure, so we can and should put all 64 bits of the size in st_size.
* Add missing semicolonVincent Lee2012-01-031-1/+1
|
* Add support for macros and cache flush API.Russell Belfer2011-12-292-0/+6
| | | | | | | | | | | | | | Add support for git attribute macro definitions. Also, add support for cache flush API to clear the attribute file content cache when needed. Additionally, improved the handling of global and system files, making common utility functions in fileops and converting config and attr to both use the common functions. Adds a bunch more tests and fixed some memory leaks. Note that adding macros required me to use refcounted attribute assignment definitions, which complicated, but probably improved memory usage.
* posix_w32: prevent segfaulting on Windows when building a temporary filenamenulltoken2011-12-141-1/+1
|
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-15/+20
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* Implement p_renameCarlos Martín Nieto2011-11-072-0/+15
| | | | | | Move the callers of git_futils_mv_atomic to use p_rename. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Merge pull request #456 from brodie/perm-fixesVicent Martí2011-10-282-8/+8
|\ | | | | Create objects, indexes, and directories with the right file permissions
| * fileops/posix: replace usage of "int mode" with "mode_t mode"Brodie Rao2011-10-142-8/+8
| | | | | | | | | | Note: Functions exported from fileops take const mode_t, while the underlying POSIX wrappers take mode_t.
* | global: Properly use `git__` memory wrappersVicent Marti2011-10-284-32/+32
| | | | | | | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* | windows: Add support for non-UTF codepagesVicent Marti2011-10-265-27/+48
|/ | | | | | | | | | | | | | | | Our previous assumption that all paths in Windows are encoded in UTF-8 is rather weak, specially when considering that Git is encoding-agnostic. These set of functions allow the user to change the library's active codepage globally, so it is possible to access paths and files on all international versions of Windows. Note that the default encoding here is UTF-8 because we assume that 99% of all Git repositories will be in UTF-8. Also, if you use non-ascii characters in paths, anywhere, please burn on a fire.
* include version information in git2.dll on WindowsSven Strickroth2011-10-091-0/+42
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* msvc: Properly handle inttypes.h/stdint.hVicent Marti2011-10-052-38/+15
|
* mingw: Fix compilation warningsVicent Marti2011-09-291-0/+7
|
* http-parser: Disable MSVC warnings locallyVicent Marti2011-09-291-10/+0
|
* msvc: Disable warnings in header fileVicent Marti2011-09-281-0/+10
| | | | | Remove clutter from the CMakeLists file by disabling the warnings programatically.
* Revert "Rewrite getenv to use Win32 version on Windows"Vicent Marti2011-09-271-24/+0
| | | | This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
* Implment p_access and use it in git_fileutils_existsCarlos Martín Nieto2011-09-232-1/+12
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Rewrite getenv to use Win32 version on WindowsPaul Betts2011-09-211-0/+24
|
* Do not have duplicate filenamesVicent Marti2011-09-211-0/+0
| | | | | | | Two `posix.c` files may or may not break MSVC builds under 2008. Do not have repeated objects. You will need to clean & regenerate CMake.
* Fix opendir/readdir and friends on Win32 to use Unicodeutf8-paths-win32Paul Betts2011-09-191-5/+14
|
* Rewrite p_* functions to use Unicode and marshal to UTF8 internallyPaul Betts2011-09-195-31/+245
|
* Create cross-platform setenvPaul Betts2011-09-192-0/+9
|
* Tabify everythingVicent Marti2011-09-198-203/+203
| | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* Cleanup legal dataVicent Marti2011-09-1910-98/+48
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* Fix compilation in MinGWVicent Marti2011-08-311-7/+4
|
* posix: Fix undeclared prototypeVicent Marti2011-08-301-0/+2
|
* compat: Move `mkstemp` to the POSIX compat layerVicent Marti2011-08-302-0/+18
|
* posix: Properly handle `snprintf` in all platformsVicent Marti2011-08-182-0/+13
|
* win32: replace usage of _MSV_VER with _MSC_VERnulltoken2011-07-091-1/+1
|
* posix: Portable `vsnprintf`Vicent Marti2011-07-092-0/+10
| | | | | | | | | | | | | | | Our good, lovely folks at Microsoft decided that there was no good reason to make `vsnprintf` compilant with the C standard, so that function in Windows returns -1 on overflow, instead of returning the actual byte count needed to write the full string. We now handle this situation more gracefully with the POSIX compatibility layer, by returning the needed byte size using an auxiliary method instead of blindly resizing the target buffer until it fits. This means we can now support `printf`s of any size by allocating a temporary buffer. That's good.
* fnmatch: Fix compilation under WindowsVicent Marti2011-07-061-2/+2
|
* fnmatch: Use native on Unix, emulate on Win32Vicent Marti2011-07-063-0/+254
|
* fileops: Fix stat() on directories for W32Vicent Marti2011-07-052-6/+15
| | | | | | | | The `stat` methods were having issues when called with a trailing slash in Windows platforms. We now use GetFileAttributes() where possible, which doesn't have this restriction.
* fileops: Drop `git_fileops_prettify_path`Vicent Marti2011-07-052-0/+12
| | | | | | | | | | The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
* fileops: CleanupVicent Marti2011-07-054-43/+218
| | | | | | | | | | | | | | | | Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
* build: Move OS-specific compat to their own foldersVicent Marti2011-07-032-0/+70
|
* win32/pthread.c: Move to new error handling mechanismJakob Pfender2011-05-231-1/+1
|
* win32/map.c: Move to new error handling mechanismJakob Pfender2011-05-231-10/+10
|
* Fix bug in the way pthead_mutex_t was being destroyed in win32.kelly.leahy2011-05-081-4/+3
| | | | | | | Win32 critical section objects (CRITICAL_SECTION) are not kernel objects. Only kernel objects are destroyed by using CloseHandle. Critical sections are supposed to be deleted with the DeleteCriticalSection API (http://msdn.microsoft.com/en-us/library/ms682552(VS.85).aspx).
* Thread safe cacheVicent Marti2011-03-202-50/+9
|
* Add proper threading support to libgit2Vicent Marti2011-03-152-0/+187
| | | | | | | We now depend on libpthread on all Unix platforms (should be installed by default) and use a simple wrapper for Windows threads under Win32. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Revised platform types to use 'best supported' size.Alex Budovski2011-01-111-4/+4
| | | | | This will allow graceful migration to 64 bit file sizes and timestamps should git's binary interface be extended to allow this.
* win32: Add a 'git__' prefix to the directory reading routinesRamsay Jones2010-01-201-5/+6
| | | | | | | | This reduces the global namespace pollution and allows for a win32 compiler (eg. Open Watcom) to provide these routines in a header other than <dirent.h> (eg in <io.h>). Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
* win32: Use an 64-bit file offset typeRamsay Jones2010-01-201-2/+2
| | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>