diff options
| author | Vicent Martà <tanoku@gmail.com> | 2012-03-14 17:41:04 -0700 |
|---|---|---|
| committer | Vicent Martà <tanoku@gmail.com> | 2012-03-14 17:41:04 -0700 |
| commit | e24fbba94862fdb602846771f2ae41ef15834d10 (patch) | |
| tree | 4b11910d7d315a6db667cc4af4c6749630612ed3 /src/map.h | |
| parent | dda708e78f3c3f43d814d46c29ab9f2b9d47ed5c (diff) | |
| parent | deafee7bd7a9e2efcdff90627b6094d8c1519319 (diff) | |
| download | libgit2-e24fbba94862fdb602846771f2ae41ef15834d10.tar.gz | |
Merge pull request #595 from arrbee/new-errors-odb
Update odb code to new error handling
Diffstat (limited to 'src/map.h')
| -rw-r--r-- | src/map.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -31,6 +31,11 @@ typedef struct { /* memory mapped buffer */ #endif } git_map; +#define GIT_MMAP_VALIDATE(out, len, prot, flags) do { \ + assert(out != NULL && len > 0); \ + assert((prot & GIT_PROT_WRITE) || (prot & GIT_PROT_READ)); \ + assert((flags & GIT_MAP_FIXED) == 0); } while (0) + extern int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset); extern int p_munmap(git_map *map); |
