]> git.proxmox.com Git - libgit2.git/blob - src/global.h
Oh yeah, bugs from my rebase
[libgit2.git] / src / global.h
1 /*
2 * Copyright (C) 2009-2012 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_global_h__
8 #define INCLUDE_global_h__
9
10 #include "mwindow.h"
11 #include "hash.h"
12
13 #if defined(GIT_THREADS) && defined(_MSC_VER)
14 # define GIT_MEMORY_BARRIER MemoryBarrier()
15 #elif defined(GIT_THREADS)
16 # define GIT_MEMORY_BARRIER __sync_synchronize()
17 #else
18 # define GIT_MEMORY_BARRIER /* noop */
19 #endif
20
21 typedef struct {
22 git_error *last_error;
23 git_error error_t;
24 } git_global_st;
25
26 git_global_st *git__global_state(void);
27
28 extern git_mutex git__mwindow_mutex;
29
30 #define GIT_GLOBAL (git__global_state())
31
32 #endif