-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdebug.h
More file actions
39 lines (27 loc) · 736 Bytes
/
debug.h
File metadata and controls
39 lines (27 loc) · 736 Bytes
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
//
// debug.h
// glututor1
//
// Created by Macbook White on 11/21/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#define _CRT_SECURE_NO_DEPRECATE
#ifndef DEBUG_H
#define DEBUG_H
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<stdarg.h>
#include<string.h>
typedef enum
{
Info,
Warning,
Fatal
}DebugLevel;
//https://github.com/justinkadima/cLibrary/blob/master/debug.c
#define __info(mes,...) debug(__FILE__,__LINE__,Info,mes,__VA_ARGS__)
#define __fatal(mes,...) debug(__FILE__,__LINE__,Fatal,mes,__VA_ARGS__)
#define __warn(mes,...) debug(__FILE__,__LINE__,Warning,mes,__VA_ARGS__)
void debug(char* file,int line,DebugLevel level,char *mes,...);
#endif