Commit 596a99f7 authored by Cedric Roux's avatar Cedric Roux
Browse files

- Added common directory for analyzer

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4250 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent dbd047da
This diff is collapsed.
#include <errno.h>
#include <string.h>
#ifndef RC_H_
#define RC_H_
#define RC_OK 0
#define RC_FAIL -1
#define RC_BAD_PARAM -2
#define RC_NULL_POINTER -3
#define CHECK_FCT(fCT) \
do { \
int rET; \
if ((rET = fCT) != RC_OK) { \
fprintf(stderr, #fCT" has failed (%s:%d)\n", __FILE__, __LINE__); \
return rET; \
} \
} while(0)
#define CHECK_FCT_POSIX(fCT) \
do { \
if (fCT == -1) { \
fprintf(stderr, #fCT" has failed (%d:%s) (%s:%d)\n", errno, \
strerror(errno), __FILE__, __LINE__); \
return RC_FAIL; \
} \
} while(0)
#define CHECK_FCT_DO(fCT, dO) \
do { \
int rET; \
if ((rET = fCT) != RC_OK) { \
fprintf(stderr, #fCT" has returned %d (%s:%d)\n", rET, __FILE__, __LINE__); \
dO; \
} \
} while(0)
#define CHECK_BUFFER(bUFFER) \
do { \
if ((bUFFER) == NULL) { \
fprintf(stderr, #bUFFER" is NULL (%s:%d)\n", __FILE__, __LINE__); \
return RC_NULL_POINTER; \
} \
} while(0)
#endif /* RC_H_ */
Markdown is supported
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