1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
/* vi: set sw=4 ts=4:
*
* Copyright (C) 2001 - 2014 Christian Hohnstaedt.
*
* All rights reserved.
*/
#ifndef __BASE_H
#define __BASE_H
#define QT_NO_CAST_TO_ASCII
#define OPENSSL_NO_STDIO
// Disable advertisement for crappy, insecure, non-conformant MS BS _s functions
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:4996)
#ifndef PACKAGE_NAME
#define XCA_TITLE "X Certificate and Key management"
#else
#define XCA_TITLE PACKAGE_NAME
#endif
#include <QtGlobal>
#include "local.h"
#define CCHAR(x) qPrintable(x)
#define TRACE qDebug("File: %s Func: %s Line: %d", __FILE__, __func__, __LINE__);
#define nativeSeparator(s) QDir::toNativeSeparators(s)
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
#define MIN(a,b) ((a)<(b)) ? (a) : (b)
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
#define xhtonl(x) (x)
#define xntohl(x) (x)
#elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
#if defined(Q_OS_WIN32)
#include <stdlib.h>
#define xhtonl(x) (_byteswap_ulong(x))
#define xntohl(x) (_byteswap_ulong(x))
#else
#define xhtonl(x) (__builtin_bswap32(x))
#define xntohl(x) (__builtin_bswap32(x))
#endif
#else
# error "What kind of system is this?"
#endif
#define COL_CYAN "\x1b[36m"
#define COL_BLUE "\x1b[94m"
#define COL_GREEN "\x1b[92m"
#define COL_LRED "\x1b[91m"
#define COL_YELL "\x1b[33m"
#define COL_RED "\x1b[31m"
#define COL_DGREEN "\x1b[32m"
#define COL_MAGENTA "\x1b[35m"
#define COL_RESET "\x1b[0m"
#define COL_BOLD "\x1b[1m"
#define COL_DIM "\x1b[2m"
#define COL_UNDER "\x1b[4m"
#endif
|