Changeset 19357


Ignore:
Timestamp:
Apr 10, 2010 2:27:35 AM (6 years ago)
Author:
rouault
Message:

Avoid definition functions in cpl_atomic_port.h if CPL_INLINE is not defined; define them in the .cpp file instead (#3526)

Location:
branches/1.7/gdal/port
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.7/gdal/port/cpl_atomic_ops.cpp

    r17734 r19357  
    111111
    112112#endif
     113
     114#ifndef CPL_INLINE
     115
     116int CPLAtomicInc(volatile int* ptr)
     117{
     118    return CPLAtomicAdd(ptr, 1);
     119}
     120
     121int CPLAtomicDec(volatile int* ptr)
     122{
     123    return CPLAtomicAdd(ptr, -1);
     124}
     125
     126#endif
  • branches/1.7/gdal/port/cpl_atomic_ops.h

    r16035 r19357  
    7070  * @return the pointed value AFTER the opeation: *ptr + 1
    7171  */
     72#ifdef CPL_INLINE
    7273CPL_INLINE int CPLAtomicInc(volatile int* ptr)
    7374{
    7475    return CPLAtomicAdd(ptr, 1);
    7576}
     77#else
     78int CPL_DLL CPLAtomicInc(volatile int* ptr);
     79#endif
    7680
    7781/** Decrement of 1 the pointed integer in a thread and SMP-safe way
     
    8488  * @return the pointed value AFTER the opeation: *ptr - 1
    8589  */
     90#ifdef CPL_INLINE
    8691CPL_INLINE int CPLAtomicDec(volatile int* ptr)
    8792{
    8893    return CPLAtomicAdd(ptr, -1);
    8994}
     95#else
     96int CPL_DLL CPLAtomicDec(volatile int* ptr);
     97#endif
    9098
    9199CPL_C_END
Note: See TracChangeset for help on using the changeset viewer.