"Fossies" - the Fresh Open Source Software Archive

Member "openpa-1.0.4/src/opa_util.h" (5 Dec 2012, 882 Bytes) of package /linux/misc/openpa-1.0.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "opa_util.h" see the Fossies "Dox" file reference documentation.

    1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
    2 /*
    3  *  (C) 2008 by Argonne National Laboratory.
    4  *      See COPYRIGHT in top-level directory.
    5  */
    6 
    7 #ifndef OPA_UTIL_H_INCLUDED
    8 #define OPA_UTIL_H_INCLUDED
    9 
   10 #define OPA_QUOTE(x_) OPA_QUOTE2(x_)
   11 #define OPA_QUOTE2(x_) #x_
   12 
   13 #if defined(OPA_HAVE_GCC_ATTRIBUTE)
   14 #  define OPA_ATTRIBUTE(x_) __attribute__ (x_)
   15 #else
   16 #  define OPA_ATTRIBUTE(x_)
   17 #endif
   18 
   19 /* FIXME this just needs a total rework in general with an OPA_NDEBUG or similar. */
   20 #define OPA_assert(expr_) do {} while (0)
   21 #define OPA_assertp(expr_) do { if (!(expr_)) ++((int *)NULL) } while (0) /* SEGV intentionally */
   22 
   23 /* A compile-time assertion macro.  It should cause a compilation error if (expr_) is false. */
   24 #define OPA_COMPILE_TIME_ASSERT(expr_) \
   25     do { switch(0) { case 0: case (expr_): default: break; } } while (0)
   26 
   27 #endif /* OPA_UTIL_H_INCLUDED */