library of assembled shared sources

http://lass.cocamware.com

Common Macros

usefull macros to use all over the place. More...


Defines

#define LASS_STRINGIFY(iA)   LASS_STRINGIFY_IMPL(iA)
 convert to string at preprocessor time.
#define LASS_CONCATENATE(iA, iB)   LASS_CONCATENATE_IMPL(iA, iB)
 concatenate two words at preprocessor time.
#define LASS_CONCATENATE_3(iA, iB, iC)   LASS_CONCATENATE_3_IMPL(iA, iB, iC)
 concatenate three words at preprocessor time.
#define LASS_BREAK_HERE   __asm__("int3")
 user breakpoint
#define LASS_UNIQUENAME(iPrefix)   LASS_CONCATENATE(iPrefix,LASS_LINE)
 create a unique name based on a prefix and line number
#define LASS_FILE   __FILE__
 current file
#define LASS_LINE   __LINE__
 current line (stringified!)
#define LASS_FUNCTION   "??"
 current function
#define LASS_EXECUTE_BEFORE_MAIN(x)   LASS_EXECUTE_BEFORE_MAIN_EX(lassDummyName, x)
 Executes code before the main has actually begun.
#define LASS_EXECUTE_BEFORE_MAIN_EX(iPrefix, x)
 Same as LASS_EXECUTE_BEFORE_MAIN but with an additional parameter that let's you specify the used prefix.
#define LASS_NOTE(iMessage)   message(LASS_FILE "(" LASS_STRINGIFY(LASS_LINE) "):\n[LASS BUILD MSG] " iMessage)
 pragma for leaving notes in build window
#define LASS_TODO(iMessage)   message(LASS_FILE "(" LASS_STRINGIFY(LASS_LINE) "):\n[LASS BUILD MSG] *** TODO: " iMessage " ***")
 pragma for leaving todo notes in build window
#define LASS_FIXME(iMessage)   message(LASS_FILE "(" LASS_STRINGIFY(LASS_LINE) "):\n[LASS BUILD MSG] *** FIXME: " iMessage " ***")
 pragma for leaving fixme notes in build window
#define LASS_UNUSED(x)   x
 tell the compiler that some variable may stay unused.


Detailed Description

usefull macros to use all over the place.

Author:
Bramz

Define Documentation

#define LASS_STRINGIFY ( iA   )     LASS_STRINGIFY_IMPL(iA)

convert to string at preprocessor time.

Definition at line 62 of file common_macros.h.

Referenced by lass::num::NumTraits< char >::name().

#define LASS_CONCATENATE ( iA,
iB   )     LASS_CONCATENATE_IMPL(iA, iB)

concatenate two words at preprocessor time.

Definition at line 68 of file common_macros.h.

#define LASS_CONCATENATE_3 ( iA,
iB,
iC   )     LASS_CONCATENATE_3_IMPL(iA, iB, iC)

concatenate three words at preprocessor time.

Definition at line 74 of file common_macros.h.

#define LASS_BREAK_HERE   __asm__("int3")

user breakpoint

Definition at line 81 of file common_macros.h.

#define LASS_UNIQUENAME ( iPrefix   )     LASS_CONCATENATE(iPrefix,LASS_LINE)

create a unique name based on a prefix and line number

Definition at line 93 of file common_macros.h.

#define LASS_FILE   __FILE__

current file

Definition at line 102 of file common_macros.h.

#define LASS_LINE   __LINE__

current line (stringified!)

Definition at line 107 of file common_macros.h.

#define LASS_FUNCTION   "??"

current function

Definition at line 118 of file common_macros.h.

#define LASS_EXECUTE_BEFORE_MAIN (  )     LASS_EXECUTE_BEFORE_MAIN_EX(lassDummyName, x)

Executes code before the main has actually begun.

The macro relies on line numbers, so only one LASS_EXECUTE_BEFORE_MAIN per line!

Definition at line 151 of file common_macros.h.

#define LASS_EXECUTE_BEFORE_MAIN_EX ( iPrefix,
 ) 

Value:

namespace \
    { \
        inline bool LASS_CONCATENATE( LASS_UNIQUENAME(iPrefix),func ) () \
        { \
            x \
            return true; \
        } \
        const bool LASS_CONCATENATE( LASS_UNIQUENAME(iPrefix),var ) = \
            LASS_CONCATENATE( LASS_UNIQUENAME(iPrefix),func ) (); \
    }
Same as LASS_EXECUTE_BEFORE_MAIN but with an additional parameter that let's you specify the used prefix.

Mmmh, let's use this as implementation of LASS_EXECUTE_BEFORE_MAIN :)

Definition at line 157 of file common_macros.h.

#define LASS_NOTE ( iMessage   )     message(LASS_FILE "(" LASS_STRINGIFY(LASS_LINE) "):\n[LASS BUILD MSG] " iMessage)

pragma for leaving notes in build window

Definition at line 175 of file common_macros.h.

#define LASS_TODO ( iMessage   )     message(LASS_FILE "(" LASS_STRINGIFY(LASS_LINE) "):\n[LASS BUILD MSG] *** TODO: " iMessage " ***")

pragma for leaving todo notes in build window

Definition at line 182 of file common_macros.h.

#define LASS_FIXME ( iMessage   )     message(LASS_FILE "(" LASS_STRINGIFY(LASS_LINE) "):\n[LASS BUILD MSG] *** FIXME: " iMessage " ***")

pragma for leaving fixme notes in build window

Definition at line 188 of file common_macros.h.

#define LASS_UNUSED (  )     x

tell the compiler that some variable may stay unused.

Some compilers throw warnings at us if a variable stays unused. Often this is a good thing, but sometimes that's exactly what we want. This macro will attempt to avoid the warning (as long as the compiler suports such an attempt).

  int LASS_UNUSED(foobar) = 0;

Definition at line 209 of file common_macros.h.


Generated on Mon Nov 10 14:22:06 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo