#include <stdlib.h>
#include <stdio.h>
#include <utility>
#include "defTypes.h"
Aller au code source de ce fichier.
|
#define | SAFE_DELETE(x) { if ((x)!=NULL) { delete (x); x=NULL; } } |
|
#define | SAFE_DELETE_ARRAY(x) { if ((x)!=NULL) { delete [] (x); x=NULL; } } |
|
#define | FATAL_ERROR(msg) { printf("%s:%s\n",__FUNCTION__,msg); getchar(); exit(-1); } |
|
#define | ERROR(why, fmt,...) { printf("Error (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why,__VA_ARGS__ ); exit(-1); } |
|
#define | WARNING(why, fmt,...) { printf("Warning (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why,__VA_ARGS__ ); } |
|
#define | swap(a, b, c) { c=a; a=b; b=c; } |
|
#define | min(a, b) ( (a)<(b) ? (a):(b) ) |
|
#define | max(a, b) ( (a)>(b) ? (a):(b) ) |
|
|
const unsigned int | error = 0 |
|
const unsigned int | success = !error |
|
const color | black ={0x00,0x00,0x00,0xff} |
|
const color | cyan ={0x00,0xff,0xff,0xff} |
|
const color | red ={0xff,0x00,0x00,0xff} |
|
const color | magenta ={0xff,0x00,0xff,0xff} |
|
const color | green ={0x00,0xff,0x00,0xff} |
|
const color | yellow ={0xff,0xff,0xff,0xff} |
|
const color | blue ={0x00,0x00,0xff,0xff} |
|
const color | white ={0xff,0xff,0xff,0xff} |
|
#define ERROR |
( |
|
why, |
|
|
|
fmt, |
|
|
|
... |
|
) |
| { printf("Error (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why,__VA_ARGS__ ); exit(-1); } |
#define FATAL_ERROR |
( |
|
msg | ) |
{ printf("%s:%s\n",__FUNCTION__,msg); getchar(); exit(-1); } |
#define max |
( |
|
a, |
|
|
|
b |
|
) |
| ( (a)>(b) ? (a):(b) ) |
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| ( (a)<(b) ? (a):(b) ) |
#define SAFE_DELETE |
( |
|
x | ) |
{ if ((x)!=NULL) { delete (x); x=NULL; } } |
#define SAFE_DELETE_ARRAY |
( |
|
x | ) |
{ if ((x)!=NULL) { delete [] (x); x=NULL; } } |
#define swap |
( |
|
a, |
|
|
|
b, |
|
|
|
c |
|
) |
| { c=a; a=b; b=c; } |
#define WARNING |
( |
|
why, |
|
|
|
fmt, |
|
|
|
... |
|
) |
| { printf("Warning (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why,__VA_ARGS__ ); } |
void WriteConsole |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
const color black ={0x00,0x00,0x00,0xff} |
const color blue ={0x00,0x00,0xff,0xff} |
const color cyan ={0x00,0xff,0xff,0xff} |
const unsigned int error = 0 |
const color green ={0x00,0xff,0x00,0xff} |
const color magenta ={0xff,0x00,0xff,0xff} |
const color red ={0xff,0x00,0x00,0xff} |
const unsigned int success = !error |
const color white ={0xff,0xff,0xff,0xff} |
const color yellow ={0xff,0xff,0xff,0xff} |