Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 8, 2011, 6:53:39 PM (14 years ago)
Author:
rgrieder
Message:

Added preprocessor macro UNIQUE_NUMBER which will return a new integer number every time is invoked if such a mechanism is available.
On GCC < 4.3, it will be defined as LINE. Newer GCC and MSVC support COUNTER, which is then used.
Also replaced uses of LINE with UNIQUE_NUMBER if appropriate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/network/NetworkFunction.h

    r7495 r8418  
    255255
    256256#define registerStaticNetworkFunction( functionPointer ) \
    257   static void* BOOST_PP_CAT( NETWORK_FUNCTION_, __LINE__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
     257  static void* BOOST_PP_CAT( NETWORK_FUNCTION_, __UNIQUE_NUMBER__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
    258258#define registerMemberNetworkFunction( class, function ) \
    259   static void* BOOST_PP_CAT( NETWORK_FUNCTION_##class, __LINE__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
     259  static void* BOOST_PP_CAT( NETWORK_FUNCTION_##class, __UNIQUE_NUMBER__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
    260260  // call it with functionPointer, clientID, args
    261261#define callStaticNetworkFunction( functionPointer, ...) \
Note: See TracChangeset for help on using the changeset viewer.