aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2022-02-02 10:36:50 +0100
committerLuca Deri <deri@ntop.org>2022-02-02 10:36:50 +0100
commitcd3d720ae36e943a3e9ddd7275b983df6c6652d0 (patch)
tree6c6fc4ce4e683d7f2f8ffc5d6ca5c170219774b5
parent46bd09393496583ebe32810f57742b4d567ceb40 (diff)
Added missing __sync_fetch_and_add() definition in Windows
-rw-r--r--src/include/ndpi_win32.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/ndpi_win32.h b/src/include/ndpi_win32.h
index 03f1389df..00bebe6ca 100644
--- a/src/include/ndpi_win32.h
+++ b/src/include/ndpi_win32.h
@@ -82,4 +82,7 @@ typedef unsigned __int64 u_int64_t;
#define sleep(a /* sec */) Sleep(1000*a /* ms */)
+/* https://stackoverflow.com/questions/7993050/multiplatform-atomic-increment */
+#define __sync_fetch_and_add(a,b) InterlockedExchangeAdd ((a), b)
+
#endif /* __NDPI_WIN32_H__ */