Replace platform-dependent barriers with c++11 std

This commit is contained in:
Chris Cannam
2024-03-07 11:50:39 +00:00
parent 5a4e3a8466
commit e5bff67c13
3 changed files with 6 additions and 66 deletions

View File

@@ -117,43 +117,5 @@ void gettimeofday(struct timeval *p, void *tz);
} // end namespace
// The following should be functions in the RubberBand namespace, really
#ifdef _WIN32
namespace RubberBand {
extern void system_memorybarrier();
}
#define MBARRIER() RubberBand::system_memorybarrier()
#else // !_WIN32
#include <stdio.h>
#ifdef __APPLE__
# if defined __MAC_10_12
# define MBARRIER() __sync_synchronize()
# else
# include <libkern/OSAtomic.h>
# define MBARRIER() OSMemoryBarrier()
# endif
#else
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
# define MBARRIER() __sync_synchronize()
# else
namespace RubberBand {
extern void system_memorybarrier();
}
# define MBARRIER() ::RubberBand::system_memorybarrier()
# endif
#endif
#endif // !_WIN32
#ifdef NO_THREADING
# undef MBARRIER
# define MBARRIER()
#endif // NO_THREADING
#endif