gerbv  2.6A
common.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * gEDA - GNU Electronic Design Automation
5  * This file is a part of gerbv.
6  *
7  * Copyright (C) 2007 Dan McMahill
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
21  */
22 
28 #ifndef __COMMON_H__
29 #define __COMMON_H__
30 
31 #ifdef HAVE_CONFIG_H
32 #include "config.h"
33 #endif
34 
35 #ifndef __GNUC__
36 #define __FUNCTION1(a,b) a ":" #b
37 #define __FUNCTION2(a,b) __FUNCTION1(a,b)
38 #define __FUNCTION__ __FUNCTION2(__FILE__,__LINE__)
39 #endif
40 
41 #include "gettext.h"
42 #define _(str) gettext(str)
43 #ifdef ENABLE_NLS
44 # ifdef gettext_noop
45 # define N_(str) gettext_noop(str)
46 # else
47 # define N_(str) (str)
48 # endif
49 #else
50 # define N_(str) (str)
51 #endif
52 
53 #undef max
54 #define max(a,b) ((a) > (b) ? (a) : (b))
55 #undef min
56 #define min(a,b) ((a) < (b) ? (a) : (b))
57 
58 #endif /* __COMMON_H__ */
59