Skip to content

Commit

Permalink
Fixed XSYNC_ATOMIC_SUB macro
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Jun 23, 2023
1 parent a25aa98 commit 82c62c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ install:
@test -d $(INSTALL_BIN) || mkdir -p $(INSTALL_BIN)
@install -m 0755 $(ODIR)/$(NAME) $(INSTALL_BIN)/
@test -d $(INSTALL_INC) || mkdir -p $(INSTALL_INC)
@cp -r ./src/*.h $(INSTALL_INC)/
@cp -r ./src/crypt/*.h $(INSTALL_INC)/
@cp -r ./src/data/*.h $(INSTALL_INC)/
@cp -r ./src/net/*.h $(INSTALL_INC)/
@cp -r ./src/sys/*.h $(INSTALL_INC)/
@cp -r ./src/*.h $(INSTALL_INC)/

.PHONY: clean
clean:
Expand Down
4 changes: 2 additions & 2 deletions src/sys/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ typedef struct XSyncBar {

#ifdef _WIN32
#define XSYNC_ATOMIC_ADD(dst,val) InterlockedExchangeAdd(dst, val)
#define XSYNC_ATOMIC_SUB(dst,val) InterlockedExchangeSubtract(dst, dst)
#define XSYNC_ATOMIC_SUB(dst,val) InterlockedExchangeSubtract(dst, val)
#define XSYNC_ATOMIC_SET(dst,val) InterlockedExchange(dst, val)
#define XSYNC_ATOMIC_GET(dst) InterlockedExchangeAdd(dst, 0)
#else
#define XSYNC_ATOMIC_ADD(dst,val) __sync_add_and_fetch(dst, val)
#define XSYNC_ATOMIC_SUB(dst,val) __sync_sub_and_fetch(dst, dst)
#define XSYNC_ATOMIC_SUB(dst,val) __sync_sub_and_fetch(dst, val)
#define XSYNC_ATOMIC_SET(dst,val) __sync_lock_test_and_set(dst, val)
#define XSYNC_ATOMIC_GET(dst) __sync_add_and_fetch(dst, 0)
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/xver.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define XUTILS_VERSION_MAX 2
#define XUTILS_VERSION_MIN 5
#define XUTILS_BUILD_NUMBER 31
#define XUTILS_BUILD_NUMBER 32

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit 82c62c6

Please sign in to comment.