ERR: add more error/warning macros

This commit is contained in:
hasufell 2014-06-05 19:12:13 +02:00
parent d8ab090a40
commit 44896c0cb1
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -29,10 +29,32 @@
#ifndef NTRU_ERR_H #ifndef NTRU_ERR_H
#define NTRU_ERR_H #define NTRU_ERR_H
#define NTRU_ABORT(...) \ #define NTRU_ABORT(...) \
{ \ { \
fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \
abort(); \ abort(); \
} }
#define NTRU_ABORT_DEBUG(...) \
{ \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, " [file %s, line %d]:\n", \
__FILE__, __LINE__); \
abort(); \
}
#define NTRU_WARN(...) \
{ \
fprintf(stderr, __VA_ARGS__); \
}
#define NTRU_WARN_DEBUG(...) \
{ \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, " [file %s, line %d]:\n", \
__FILE__, __LINE__); \
}
#endif /* NTRU_ERR_H */ #endif /* NTRU_ERR_H */