/[svn]/linuxsampler/trunk/src/common/atomic.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/atomic.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1648 by nagata, Sun Jan 13 16:36:14 2008 UTC revision 1649 by nagata, Fri Jan 25 15:06:02 2008 UTC
# Line 17  Line 17 
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
# Line 1238  static __inline__ int atomic_inc_and_tes Line 1238  static __inline__ int atomic_inc_and_tes
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
# Line 1283  atomic_dec (atomic_t * a) { Line 1294  atomic_dec (atomic_t * a) {
1294  #endif  #endif
1295  }  }
1296    
1297    #endif /* __APPLE__  */
1298  #endif /* linux */  #endif /* linux */
1299  #endif /* __linuxsampler_atomic_h__ */  #endif /* __linuxsampler_atomic_h__ */

Legend:
Removed from v.1648  
changed lines
  Added in v.1649

  ViewVC Help
Powered by ViewVC