Initial commit of Pollcat library
This commit is contained in:
43
src/private.h
Normal file
43
src/private.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/** Private includes
|
||||
*
|
||||
* This file is part of the Pollcat Library.
|
||||
* Copyright (C) 2022 Expatria Technologies Inc.
|
||||
* Contact: Morgan Hughes <morgan@expatria.ca>
|
||||
*
|
||||
* The Pollcat Library is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received copies of the GNU General Public License and the GNU Lesser
|
||||
* General Public License along with the Pollcat Library. If not, see
|
||||
* https://www.gnu.org/licenses/
|
||||
*
|
||||
* vim:ts=4:noexpandtab
|
||||
*/
|
||||
#ifndef _SRC_PRIVATE_H_
|
||||
#define _SRC_PRIVATE_H_
|
||||
#include <pollcat.h>
|
||||
|
||||
|
||||
/** Local assert macro */
|
||||
#define POLLCAT_ASSERT(test) \
|
||||
do { \
|
||||
if ( !(test) ) { \
|
||||
if ( pollcat_assert_func ) \
|
||||
pollcat_assert_func(__FILE__, __LINE__, #test); \
|
||||
else if ( stderr ) \
|
||||
fprintf(stderr, "%s[%d]: assertion failed: %s (%s)\n", \
|
||||
__FILE__, __LINE__, #test, strerror(errno)); \
|
||||
abort(); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
extern pollcat_assert_f pollcat_assert_func;
|
||||
|
||||
|
||||
#endif /* _SRC_PRIVATE_H_ */
|
||||
Reference in New Issue
Block a user