Commit 9f4c3b31 authored by Franksen, Benjamin's avatar Franksen, Benjamin
Browse files

csmbase: indent CPP directives if nested inside #if or #else

parent 18e9ea56
......@@ -16,107 +16,108 @@
#ifndef DOXYGEN_SKIP_THIS
/*! \internal \brief needed for POSIX compability */
#define _INCLUDE_POSIX_SOURCE
# define _INCLUDE_POSIX_SOURCE
/*! \internal \brief use DBG module ? */
#define USE_DBG 0
# define USE_DBG 0
/*! \internal \brief use epics errlogPrintf ? */
#define USE_ERRLOGPRINTF 1
# define USE_ERRLOGPRINTF 1
/*! \internal \brief use semaphores at all ? */
#define USE_SEM 1
# define USE_SEM 1
/*! \internal \brief use psem semaphore module ? */
#define USE_PSEM 0
# define USE_PSEM 0
/* the following macros affect the debug (dbg) module: */
#if USE_DBG
# if USE_DBG
/*! \internal \brief compile DBG assertions */
#define DBG_ASRT_COMP 0
# define DBG_ASRT_COMP 0
/*! \internal \brief compile DBG debug messages */
#define DBG_MSG_COMP 0
# define DBG_MSG_COMP 0
/*! \internal \brief compile DBG trace messages */
#define DBG_TRC_COMP 0
# define DBG_TRC_COMP 0
/*! \internal \brief use local switch-variables for the dbg module */
#define DBG_LOCAL_COMP 1
# define DBG_LOCAL_COMP 1
/*! \internal \brief use async. I/O with message passing in DBG module*/
#define DBG_ASYNC_COMP 1
# define DBG_ASYNC_COMP 1
/* the following defines are for sci-debugging, they do not influence
any header-files but are placed here since they are usually changed
together with the above macros.*/
/*! \internal \brief for debug-outputs, "stdout" means console */
#define CSMBASE_OUT_FILE "stdout"
# define CSMBASE_OUT_FILE "stdout"
/*! \internal \brief csm trace level
\li level 6: dense traces for debugging
\li level 5: enter/exit tracing
*/
#define CSMBASE_TRC_LEVEL 0
# define CSMBASE_TRC_LEVEL 0
/*! \internal \brief flushmode, 0, 1 and 2 are allowed */
#define CSMBASE_FLUSHMODE 1
# define CSMBASE_FLUSHMODE 1
#else
# else /* USE_DBG */
#if !USE_ERRLOGPRINTF
#define errlogPrintf printf
#endif
# if !USE_ERRLOGPRINTF
# define errlogPrintf printf
# endif
/*! \internal \brief compability macro, needed when DBG is not used */
#define DBG_MSG_PRINTF2(f,x) errlogPrintf(f,x)
# define DBG_MSG_PRINTF2(f,x) errlogPrintf(f,x)
/*! \internal \brief compability macro, needed when DBG is not used */
#define DBG_MSG_PRINTF3(f,x,y) errlogPrintf(f,x,y)
# define DBG_MSG_PRINTF3(f,x,y) errlogPrintf(f,x,y)
/*! \internal \brief compability macro, needed when DBG is not used */
#define DBG_MSG_PRINTF4(f,x,y,z) errlogPrintf(f,x,y,z)
# define DBG_MSG_PRINTF4(f,x,y,z) errlogPrintf(f,x,y,z)
/*! \internal \brief compability macro, needed when DBG is not used */
#define DBG_MSG_PRINTF5(f,x,y,z,q) errlogPrintf(f,x,y,z,q)
#endif
#if !USE_SEM
#define SEM_TYPE int
#define SEMTAKE(x)
#define SEMGIVE(x)
#define SEMDELETE(x)
#define SEMCREATE(x) 0
#else
#if USE_PSEM
#define SEM_TYPE psem_mutex
#define SEMTAKE(x) psem_mutex_take(&(x))
#define SEMGIVE(x) psem_mutex_give(&(x))
#define SEMDELETE(x) psem_mutex_remove(&(x))
#define SEMCREATE(x) (!psem_mutex_create(&(x)))
#else
# define DBG_MSG_PRINTF5(f,x,y,z,q) errlogPrintf(f,x,y,z,q)
# endif /* USE_DBG */
# if !USE_SEM
# define SEM_TYPE int
# define SEMTAKE(x)
# define SEMGIVE(x)
# define SEMDELETE(x)
# define SEMCREATE(x) 0
# else /* !USE_SEM */
# if USE_PSEM
# define SEM_TYPE psem_mutex
# define SEMTAKE(x) psem_mutex_take(&(x))
# define SEMGIVE(x) psem_mutex_give(&(x))
# define SEMDELETE(x) psem_mutex_remove(&(x))
# define SEMCREATE(x) (!psem_mutex_create(&(x)))
# define epicsShareFunc
# else /* USE_PSEM */
/*! \internal \brief compability macro for semaphores */
#define SEM_TYPE epicsMutexId
# define SEM_TYPE epicsMutexId
/*! \internal \brief compability macro for semaphores */
#define SEMTAKE(x) epicsMutexLock(x)
# define SEMTAKE(x) epicsMutexLock(x)
/*! \internal \brief compability macro for semaphores */
#define SEMGIVE(x) epicsMutexUnlock(x)
# define SEMGIVE(x) epicsMutexUnlock(x)
/*! \internal \brief compability macro for semaphores */
#define SEMDELETE(x) epicsMutexDestroy(x)
# define SEMDELETE(x) epicsMutexDestroy(x)
/*! \internal \brief compability macro for semaphores */
#define SEMCREATE(x) (NULL==(x= epicsMutexCreate()))
#endif
# define SEMCREATE(x) (NULL==(x= epicsMutexCreate()))
# endif /* USE_PSEM */
#endif
# endif /* !USE_SEM */
#endif
#endif /* DOXYGEN_SKIP_THIS */
/*! \brief for type csm_bool */
#define CSM_TRUE 1
......@@ -314,7 +315,7 @@ static void csm_dbg_init(void)
DBG_FLUSHMODE(CSMBASE_FLUSHMODE);
}
#endif
#endif /* USE_DBG */
/*----------------------------------------------------*/
/* utilities for csm-coordinates (private) */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment