Sync usage with man page.
[netbsd-mini2440.git] / gnu / lib / libg++ / g++-include / generic.h
blob743a26dcbcb99a6ed37ec4bf8f7360e0b7af0bae
1 // This may look like C code, but it is really -*- C++ -*-
2 /*
3 Copyright (C) 1988 Free Software Foundation
4 written by Doug Lea (dl@rocky.oswego.edu)
6 This file is part of GNU CC.
8 GNU CC is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY. No author or distributor
10 accepts responsibility to anyone for the consequences of using it
11 or for whether it serves any particular purpose or works at all,
12 unless he says so in writing. Refer to the GNU CC General Public
13 License for full details.
15 Everyone is granted permission to copy, modify and redistribute
16 GNU CC, but only under the conditions described in the
17 GNU CC General Public License. A copy of this license is
18 supposed to have been given to you along with GNU CC so you
19 can know your rights and responsibilities. It should be in a
20 file named COPYING. Among other things, the copyright notice
21 and this notice must be preserved on all copies.
24 #ifndef generic_h
25 #ifdef __GNUG__
26 #pragma once
27 #pragma interface
28 #endif
29 #define generic_h 1
32 * See the CPP manual, argument prescan section for explanation
35 #define name2(a,b) gEnErIc2(a,b)
36 #define gEnErIc2(a,b) a ## b
38 #define name3(a,b,c) gEnErIc3(a,b,c)
39 #define gEnErIc3(a,b,c) a ## b ## c
41 #define name4(a,b,c,d) gEnErIc4(a,b,c,d)
42 #define gEnErIc4(a,b,c,d) a ## b ## c ## d
44 #define GENERIC_STRING(a) gEnErIcStRiNg(a)
45 #define gEnErIcStRiNg(a) #a
47 #define declare(clas,t) name2(clas,declare)(t)
48 #define declare2(clas,t1,t2) name2(clas,declare2)(t1,t2)
50 #define implement(clas,t) name2(clas,implement)(t)
51 #define implement2(clas,t1,t2) name2(clas,implement2)(t1,t2)
53 extern genericerror(int,char*);
54 typedef int (*GPT)(int,char*);
56 #define set_handler(gen,type,x) name4(set_,type,gen,_handler)(x)
58 #define errorhandler(gen,type) name3(type,gen,handler)
60 #define callerror(gen,type,a,b) (*errorhandler(gen,type))(a,b)
63 #endif generic_h