17 |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
18 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 |
|
|
20 |
$Id: atomic.h,v 1.4 2008-01-13 16:36:13 nagata Exp $ |
$Id: atomic.h,v 1.5 2008-01-25 15:06:01 nagata Exp $ |
21 |
*/ |
*/ |
22 |
|
|
23 |
//TODO: should we put this into namespace? it might clash with system installed atomic.h, because we need to install atomic.h for the LS API |
//TODO: should we put this into namespace? it might clash with system installed atomic.h, because we need to install atomic.h for the LS API |
1238 |
|
|
1239 |
#else /* !linux */ |
#else /* !linux */ |
1240 |
|
|
1241 |
|
#if defined(__APPLE__) |
1242 |
|
|
1243 |
typedef unsigned long atomic_t; |
typedef unsigned long atomic_t; |
1244 |
|
|
|
/* Added by Toshi Nagata, 20071224 */ |
|
1245 |
#define ATOMIC_INIT(i) { (i) } |
#define ATOMIC_INIT(i) { (i) } |
1246 |
|
#define atomic_set(a, v) (*(a) = (v)) |
1247 |
|
#define atomic_read(a) (*(a)) |
1248 |
|
|
1249 |
|
/* TODO: should use atomic routines in CoreServices.framework */ |
1250 |
|
#define atomic_inc(a) (++(*a)) |
1251 |
|
#define atomic_dec(a) (--(*a)) |
1252 |
|
|
1253 |
|
#else |
1254 |
|
|
1255 |
|
typedef unsigned long atomic_t; |
1256 |
|
|
1257 |
#if defined(__sgi) |
#if defined(__sgi) |
1258 |
#undef atomic_set |
#undef atomic_set |
1294 |
#endif |
#endif |
1295 |
} |
} |
1296 |
|
|
1297 |
|
#endif /* __APPLE__ */ |
1298 |
#endif /* linux */ |
#endif /* linux */ |
1299 |
#endif /* __linuxsampler_atomic_h__ */ |
#endif /* __linuxsampler_atomic_h__ */ |