Modules |
Files |
Inheritance Tree |
Inheritance Graph |
Name Index |
Config
File: Synopsis/Parser/C++/occ/main-con.cc
1| /*
2| Copyright (C) 1997-2000 Shigeru Chiba, University of Tsukuba.
3|
4| Permission to use, copy, distribute and modify this software and
5| its documentation for any purpose is hereby granted without fee,
6| provided that the above copyright notice appear in all copies and that
7| both that copyright notice and this permission notice appear in
8| supporting documentation.
9|
10| Shigeru Chiba makes no representations about the suitability of this
11| software for any purpose. It is provided "as is" without express or
12| implied warranty.
13| */
14| /*
15| Copyright (c) 1995, 1996 Xerox Corporation.
16| All Rights Reserved.
17|
18| Use and copying of this software and preparation of derivative works
19| based upon this software are permitted. Any copy of this software or
20| of any derivative work must include the above copyright notice of
21| Xerox Corporation, this paragraph and the one after it. Any
22| distribution of this software or derivative works must comply with all
23| applicable United States export control laws.
24|
25| This software is made available AS IS, and XEROX CORPORATION DISCLAIMS
26| ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
27| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28| PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY
29| LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS
30| EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING
31| NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED
32| OF THE POSSIBILITY OF SUCH DAMAGES.
33| */
34|
35| #include <iostream>
36|
37| #if !defined(_MSC_VER)
38|
39| #include "types.h"
40|
41| #else
42|
43| /*
44| JLF: The GC_gc_no *MUST* be declared as below to be able to link...
45| Unfortunately, this declaration collides with the one found in gc.h
46| This is due to the fact that the _DLL macro is not defined when
47| compiling occ.exe, thus driving to the extern declaration instead of
48| __declspec(dllimport). To bypass this problem, the Gc_gc_no is
49| temporarily renamed before including gc.h (through types.h).
50| */
51|
52| #define GC_gc_no my_GC_gc_no
53| #include "types.h"
54| #undef GC_gc_no
55|
56| #ifndef DONT_GC
57| extern "C" __declspec(dllimport) GC_word GC_gc_no;
58| #endif
59|
60| #endif /* !defined(_MSC_VER) */
61|
62|
63| extern bool verboseMode;
64| extern void Compile(int, char**);
65|
66| int main(int argc, char** argv)
67| {
68| Compile(argc, argv);
69| if(verboseMode) {
70| std::cerr << "[done.]\n";
71| #ifndef DONT_GC
72| std::cerr << "[GC happened " << GC_gc_no << " times.]\n";
73| #endif
74| }
75|
76| return 0;
77| }
78|