Library of Assembled Shared Sources
Common Macros

Detailed Description

usefull macros to use all over the place.

Author
Bramz

Macros

#define LASS_STRINGIFY(iA)
 convert to string at preprocessor time.
 
#define LASS_CONCATENATE(iA, iB)
 concatenate two words at preprocessor time.
 
#define LASS_CONCATENATE_3(iA, iB, iC)
 concatenate three words at preprocessor time.
 
#define LASS_BREAK_HERE   __debugbreak();
 user breakpoint
 
#define LASS_UNIQUENAME(iPrefix)
 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_NOTE(iMessage)
 pragma for leaving notes in build window
 
#define LASS_TODO(iMessage)
 pragma for leaving todo notes in build window
 
#define LASS_FIXME(iMessage)
 pragma for leaving fixme notes in build window
 
#define LASS_UNUSED(x)
 tell the compiler that some variable may stay unused.
 
#define LASS_EXECUTE_BEFORE_MAIN(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.
 

Macro Definition Documentation

◆ LASS_UNUSED

#define LASS_UNUSED ( x)
Value:
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;
#define LASS_UNUSED(x)
tell the compiler that some variable may stay unused.
Definition basic_ops.h:197

Definition at line 197 of file basic_ops.h.

◆ LASS_EXECUTE_BEFORE_MAIN

#define LASS_EXECUTE_BEFORE_MAIN ( x)
Value:
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 206 of file basic_ops.h.

◆ LASS_EXECUTE_BEFORE_MAIN_EX

#define LASS_EXECUTE_BEFORE_MAIN_EX ( iPrefix,
x )
Value:
namespace \
{ \
inline bool LASS_CONCATENATE( LASS_UNIQUENAME(iPrefix),func ) () \
{ \
x \
return true; \
} \
const bool LASS_UNUSED(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 212 of file basic_ops.h.