48 lines
815 B
C
48 lines
815 B
C
|
#ifndef CBDUTIL_H
|
||
|
#define CBDUTIL_H
|
||
|
|
||
|
/*
|
||
|
* Platform specific macros that affect system headers
|
||
|
*/
|
||
|
#ifdef linux
|
||
|
#ifndef _LARGEFILE64_SOURCE
|
||
|
#define _LARGEFILE64_SOURCE
|
||
|
#endif
|
||
|
#endif
|
||
|
|
||
|
/*
|
||
|
* Include and define all the basic things that would normally be
|
||
|
* expected to be available on the current platform.
|
||
|
*/
|
||
|
|
||
|
#include <ctype.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <stddef.h>
|
||
|
#include <stdint.h>
|
||
|
#include <stdarg.h>
|
||
|
#include <string.h>
|
||
|
#include <limits.h>
|
||
|
#include <errno.h>
|
||
|
#include <time.h>
|
||
|
|
||
|
#include <inttypes.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
#include <sys/types.h>
|
||
|
#include <sys/stat.h>
|
||
|
#include <fcntl.h>
|
||
|
#include <unistd.h>
|
||
|
|
||
|
static inline void __attribute__((noreturn))
|
||
|
error(const char* fmt, ...)
|
||
|
{
|
||
|
va_list ap;
|
||
|
|
||
|
va_start(ap, fmt);
|
||
|
vfprintf(stderr, fmt, ap);
|
||
|
exit(EXIT_FAILURE);
|
||
|
}
|
||
|
|
||
|
#endif
|