mcpp-2.7.2/0000777000175000017500000000000011114177233007466 500000000000000mcpp-2.7.2/ChangeLog0000644000175000017500000004345111114177062011163 00000000000000ChangeLog of MCPP and its accompanying Validation Suite 2008/11/30 kmatsui * V.2.7.2 * Enabled some CPU-specific predefined macros in compiler- independent-build as well as compiler-specific-build, because there are some occasions which require those macros when we use some compiler system's header files. Created init_cpu_macro(). (configure.ac, noconfig.H, configed.H, main.c, system.c) * Enabled -m32 and -m64 options even on 32-bits systems and on compiler-independent-build, when the OS is UNIX-like one. These options change some predefined macros. (system.c) * Made -z option to output #include lines themselves. (system.c) * Fixed a bug of source line numbering in library-build. (by Dwayne Boone) (main.c) * Fixed a few minor bugs. * Dropped support for Borland C 4.0. * Updated the shell-scripts, makefiles and difference files, and revised some mistakes. * Updated the documents. 2008/05/19 kmatsui * V.2.7.1 * Fixed a bug of newline synchronization on -K option. Created sync_linenum(). (Thanks to Benjamin Smedberg) (directive.c) * Made GCC-specific-build on x86_64 and ppc64 have two sets of predefines for 32bit mode and 64bit mode, and implemented -m32 and -m64 options. (Thanks to Benjamin Smedberg) (configure.ac, set_mcpp.sh, system.c) * Stopped to use freopen() so that a main program which links libmcpp can use stdin, stdout and stderr. (by Benoit Foucher) (main.c) * Fixed a bug of file-handle leak on -MD and -MF options. (Thanks to Masashi Fujita) (system.c) * Added ports to Vicual C++ 6.0 and Borland C++ 5.9 (aka C++ Builder 2007). (by Dwayne Boone) (vc6.dif, bc59.dif, eval.c) * Revised declaration of stpcpy(). (internal.H) * Split mcpp_out.h from mcpp_lib.h. * Made library-build install also an mcpp executable and minimal documents as well as libmcpp for a convenience of library package. Created main_mcpplib.c. Made all the binary packages library-build. (by Yutaka Niibe and kmatsui) (Makefile.am, src/ Makefile.am) * Split config/cygwin_root and config/mingw_root from configure.ac to avoid a trouble of backslash character handling on some version of bash. (Thanks to Aleksandar Samardzic) * Changed autoconf 2.59 to 2.61 and automake 1.9.6 to 1.10. * Updated the documents accordingly. 2008/03/23 kmatsui * V.2.7 * Created macro notification mode, implemented -K option and '# pragma MCPP debug macro_call' sub-directive to enable this mode on STD mode. Created get_src_location(), print_macro_inf(), print_macro_arg(), close_macro_inf(), chk_magic_balance(), remove_magics(), some MAC_* macros to define magic characters, struct LINE_COL, MACRO_INF. Revised many functions. (Specifications mostly by Taras Glek, partly by Samuel, implemented mostly by kmatsui and partly by Taras Glek and Samuel). (internal.H, main.c, directive.c, eval.c, expand.c, support.c, system.c) * Created -k option to keep horizontal white spaces as they are and convert comment to spaces of the same length on STD mode. (Specs by Taras Glek, implemented by kmatsui). (internal,H, main.c, directive.c, mbchar.c, support.c) * Implemented GCC2-spec variadic macro on STD mode in GCC- specific-build. (by Taras Glek and kmatsui). (directive.c) * Enabled GCC-like buggy handling of macro containing 'defined' token in #if directive on GCC-specific-build. (by Taras Glek). (expand.c) * Reordered initialization steps and enabled undefining of not- Standard-required predefined macros. Created undef_macros(). Removed undef_a_predef(). (main.c, system.c) * Enabled non-conforming predefined macros such as 'linux' by default on GCC-specific-build for compatibility with GCC. Removed undef_gcc_macros(). Created DEF_NOARGS_* macros for diagnostics sake. (internal.H, system.c) * Fixed a bug of file searching failure when a file is specified by relative path in -include option. Split is_full_path() from open_include(). (thanks to Benjamin Smedberg) (system.c) * Fixed a bug of mcpplib initialization which caused problem on CygWIN. (main.c, system.c, lib.c) * Fixed a bug of unterminated source file handling. (thanks to Phil Knight) (support.c) * Made norm_path() check existence of directory/file before normalization. As its results, non-existent directory specified by -I option was disabled, "non-existent/../existent" was judged as non-existent before wrongly normalizing to "existent", and # include "directory" was made not to open. Created norm_dir(). (thanks to Taras Glek and Dave Mandelin) (system.c) * Stopped to convert path-list on Windows to lowercase-letters. Changed path-list comparing function on Windows from strcmp() to strcasecmp() or stricmp(). (system.c) * Changed allocation of buffer for -M* options and incdir[], fnamelist[], once_list[] from fixed size to dynamically enlarging ones. (system.c) * Made #line output for GCC-specific-build closer to GCC. Changed FILEINFO and DEFBUF struct, moved sharp() from main.c to system.c, revised many functions. (system.c, support.c, main.c, directive.c) * Absorbed lib.c into system.c. Renamed getopt() to mcpp_getopt (), also variables opt* to mcpp_opt*, and made static in order to prevent linking of glibc getopt(). (thanks to Dwayne Boone) * Fixed a bug of UTF-8 multibyte character handling, enabled 4- bytes long sequences, and enabled checking of overlong sequences and UTF-16 surrogate pairs. (by Matt Wozniski) (mbchar.c, support.c) * Fixed a bug of tokenization in KR and OLD modes. (support.c) * Changed FILENAME_MAX to PATH_MAX and FILENAMEMAX to PATHMAX, because FILENAME_MAX of some systems are too short. (thanks to Dwayne Boone) * Bundled some variables into structs (std_limits, option_flags, etc.). Tidied up the sources removing unused codes, rewriting old comments. (most of the sources) * Ported to Mac OS X / Apple-GCC. Enabled searching of "framework" directories for #include. Enabled to search "header map" file. Enabled #import, which is #include with unconditional "once only" feature. Implemented -F, -arch, -isysroot options. Created init_framework(), search_framework(), search_subdir(), search_header_map(), hmap_hash(). (system.c, directive.c, set_mcpp.sh, unset_mcpp.sh, configure.ac, src/ Makefile.am) * Ported to Visual C++ 2008. Enabled '$' in identifier by default in Visual-C-specific-build and GCC-specific-build. (system.H, internal.H, support.c, system.c) * Added documentation on source checking of firefox 3.0pre. Added comments on system headers in Mac OS X. (mcpp-manual.html) * Updated all the documents. (mainly by kmatsui, partly by Taras Glek) 2007/05/19 kmatsui * V.2.6.4 * Fixed memory leaks in subroutine-build related to file-> filename, sharp_filename and others. (by Juergen Mueller and kmatsui). (main.c, directive.c, support.c, system.c) * Revised expanding() and expanding_macro[] to fix memory leaks. Created clear_exp_mac(). (internal.H, expand.c, support.c) * Fixed a bug of accessing non-allocated memory. (by isr). (support.c) * Revised output of // comment by -C option. Output // comment as it is, not converting to /* */. (thanks to Taras Glek). (support.c) * Changed output of line top white spaces in other than POST_STANDARD mode to preserve them as they are, rather than squeezing to one space, in order to make output more human- readable. (main.c, support.c) * Removed the settings to be compiled with C++. (configed.H, noconfig.H, noconfig/*.mak) * Updated version-info for shared-library-build from 0:0:0 to 0: 1:0. * Changed installation directory of some documents in stand- alone-and-compiler-independent-build by configure or by binary packages. * Updated the documents. Note that cpp-test.html were not updated. 2007/04/07 kmatsui * V.2.6.3 * Fixed a bug of some #line directive handling which wrongly affected #include path. Added a new member for real file name to struct FILEINFO, and made #line directive does not affect real file name. (internal.H, main.c, support.c, system.c) * Enabled dereferencing of symbolic linked directory (as well as file) of #include path-list and include directory. Split deref_syml() from norm_path(). (system.c) * Revised again diagnostic messages for some macro expansions. (internal.H, expand.c, support.c) * Relaxed token checking and syntax checking in lang_asm mode. (expand,c, support.c) * Implemented GCC3-spec variadic macro for GCC-specific-build. (internal.H, directive.c, expand.c) * Added some predefined macro for GCC-specific-build. (system.c) * Revised output routines abstracting output device, and implementing optional memory buffer output when built with MCPP_LIB macro. Created mcpp_lib.h, mcpp_lib_fputs(), mcpp_lib_fputc(), mcpp_lib_fprintf(), mcpp_use_mem_buffers(), mcpp_get_mem_buffer(), mcpp_set_out_func(), mcpp_reset_def_out_func(), mem_putc(), mem_puts(), append_to_buffer(), function pointers mcpp_fputs, mcpp_fputc, mcpp_fprintf and some macros. This update disabled compilation by C++. (All were contributed by Greg Kress and slightly modified by kmatsui) (internal.H, main.c, directive.c, eval.c, expand.c, mbchar.c, support.c, system.c, lib.c, mcpp_lib.h) * Renamed some global names in order to lessen the possibility of name collisions in subroutine-build. Renamed the variables mode, cplus, line, debug, type[] and work[] to mcpp_mode, cplus_val, src_line, mcpp_debug, char_type[] and work_buf[] respectively. Renamed the functions install(), eval(), expand(), get() and unget() to install_macro(), eval_if(), expand_macro(), get_ch() and unget_ch() respectively. (internal.H, main.c, directive.c, eval.c, expand.c, mbchar.c, support.c, system.c) * Added 'mcpplib' target to make subroutine (library) build in configure.ac and noconfig/*.mak. * Revised some other minor points. (all sources) * Changed default setting of noconfig.H to that of FreeBSD 6.* / stand-alone / GCC 3.4. (noconfig.H) * Added documentation on source checking of glibc 2.4. (mcpp- manual.html) * Abolished 'install-data' and 'uninstall-data' targets of configured makefile. On the other hand, made 'install' target install also mcpp-manual.html. * Provided stand-alone-and-compiler-independent-build binary packages port, rpm, deb, zip and their corresponding source packages. 2006/11/12 kmatsui * V.2.6.2 * Renamed control.c as directive.c and renamed control() as directive(). * Fixed a bug of #else handling in pre-Standard modes. (directive.c) * Fixed a bug of mcpp specific directives such as #debug or # put_defines in pre-Standard modes. (system.c) * Fixed a bug of warning options for GCC-specific-builds. (system.c) * Fixed a bug of macro expansion timing in #include directive line. (system.c) * Revised some other minor points, moved cur_file() from main.c to system.c. (main.c, eval.c, system.c) * Revised diagnostic messages for some macro expansions. (internal.H, expand.c, support.c) * Fixed a bug of nested includes with relative paths. (thanks to Leo Savernik). (system.c) * Fixed memory leaks in routines related to normalizing path- list. (by Juergen Mueller). (system.c) * Added MCPP_LIB setting to use mcpp as a subroutine from other main program. Created init_main(), init_directive(), init_eval(), init_support(), init_system(), init_lib(), clear_filelist() and clear_symtable(). Created testmain.c as a sample source. (all were contributed by Juergen Mueller and slightly modified by kmatsui). (internal.H, main.c, directive.c, eval.c, expand.c, support.c, system.c, lib.c) * Changed the macro STAND_ALONE to INDEPENDENT. * Changed the terminology of building methods in the documents. (INSTALL, mcpp-porting.html, mcpp-manual.html) * Rewrote and converted the text files in 'doc' and 'doc-jp' directories into html files. * Updated and corrected many points of the documents. 2006/08/12 kmatsui * V.2.6.1 * Enabled automatic conversion from [CR+LF] to [LF]. (support.c) * Set the limit of #include nesting to INCLUDE_NEST (default: 256) in order to prevent infinitely recursive #includes. (system.H, system.c) * Revised white space handling in
style header-name which is defined by macro. (system.c) * Enabled -fworking-directory option for GCC-specific-build. created put_info(). (system.c) * Fixed a bug of macro definition. (lib.c) * Fixed a bug of '#pragma once' failure. (by Greg Kress). (system.c) * Fixed some other minor bugs in sources. * Revised path-list handling on CygWIN. Enabled -mno-cygwin option for CygWIN GCC-specific-build. (configure.ac, noconfig.H, system.c) * Ported to MinGW. Created cc1.c to be invoked from GCC and to invoke mcpp or GCC's cc1/cc1plus from it, because MinGW GCC rejects to invoke a shell-script even if it is named cc1 and because MinGW does not support symbolic link. (configure.ac, src/Makefile.am, configed.H, noconfig.H, system.c) * Fixed bugs in some noconfig/*.mak. * Moved changelogs from the source files to ChangeLog and ChangeLog.old. 2006/07/15 kmatsui * V.2.6 * Integrated STANDARD mode and PRE_STANDARD mode into one executable, differentiating the modes by the execution time options. (all the sources) * Absorbed DEBUG, DEBUG_EVAL, OK_MAKE into default, OK_DIGRAPHS, OK_PRAGMA_OP into default of STD and POST_STD mode, OK_TRIGRAPHS into default of STD mode, OK_SIZE into default of KR and OLD_PREP modes. (all the sources) * Changed --enable-maintainer-mode option of configure to --enable-replace-cpp option which generates compiler-specific- build of mcpp. Made compiler-specific-build to be installed only into a compiler-specific-directory. (configure.ac, src/ Makefile.am) * Made stand-alone-build independent from any compiler-systems. It no longer requires GCC-specific header files. (configure.ac, configed.H, noconfig.H, system.c) * Revised '#pragma once' and handling of include directories list, judging a identity of directory and file by converting it to absolute path, and dereferencing symbolic linked file. (system.c) * Revised #line output and its related problem at the end of an included file. (thanks to Jay Prakash). (internal.H, support.c) * Ported to GCC V.4.0, CygWIN 1.5.18, Visual C++ 2005 and LCC- Win32 2006-03. (noconfig.H, system.c) * Added some options for Visual C++. (system.c) * Removed settings for pre-C90 compiler (string concatenation by preprocessor, '\a' and '\v' handling, no unsigned long #if, no Standard library functions, non-prototype declarations, no # pragma). (all the sources) * Removed settings for MS-DOS compiler, DJGPP and Plan9. (*.H, system.c, mbchar.c) * Removed the implementation of post_preproc() for pre-Standard compiler. Removed conv_esc(), is_last_esc(), conv2oct(). Removed HAVE_C_BACKSLASH_A and CONCAT_STRINGS macros. (main.c) * Degraded the diagnostic of #if expression from error to warning, which only overflows the range of 'long / unsigned long' and does not overflow the range of 'long long / unsigned long long' in modes other than C99. (eval.c) * Enabled 'i64' ('ui64', 'i32', 'i16', etc.) suffixes for integer, which are recognized when COMPILER is MSC or BORLANDC. (eval.c) * Renamed functions and some variables, created expand_init(), according to integration of STANDARD and PRE_STANDARD modes. (expand.c) * Removed '#pragma MCPP include_next'. (system.c) * Created init_msc_macro(), parse_warn_level(), chk_opts(), init_predefines(), init_std_defines(), do_prestd_directive(). Removed set_cplus(), mem_model(). (system.c) * Removed Standard functions (memmove(), memcpy(), memcmp(), strstr(), strcspn()). (lib.c) * Changed default setting of noconfig.H to FreeBSD 5.* / stand- alone / GCC 3.4. (noconfig.H) * Renamed 'doc' directory as 'doc-jp' and renamed 'doc_eng' as 'doc'. * Removed some manuscript files of mcpp-summary.pdf from the distribution. * Validation Suite: Revised a few testcases. * Updated all the documents accordingly. mcpp-2.7.2/Makefile.am0000644000175000017500000000243511007552777011455 00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign SUBDIRS = src if REPLACE_CPP SUBDIRS += tests . man_page = mcpp-gcc else man_page = mcpp endif man1_MANS = $(man_page).1 EXTRA_DIST = $(top_srcdir)/LICENSE $(top_srcdir)/INSTALL* \ $(top_srcdir)/ChangeLog.old $(top_srcdir)/NEWS \ $(top_srcdir)/mcpp.1 $(top_srcdir)/mcpp-gcc.1 $(top_srcdir)/config \ $(top_srcdir)/src/preproc.c $(top_srcdir)/src/noconfig.H \ $(top_srcdir)/src/cc1.c $(top_srcdir)/src/*set_mcpp.sh \ $(top_srcdir)/src/testmain.c $(top_srcdir)/src/mcpp_lib.def \ $(top_srcdir)/tests/*_test.sh $(top_srcdir)/noconfig \ $(top_srcdir)/cpp-test $(top_srcdir)/test-t \ $(top_srcdir)/test-c $(top_srcdir)/test-l $(top_srcdir)/tool \ $(top_srcdir)/doc $(top_srcdir)/doc-jp if ! REPLACE_CPP install-exec-hook: $(top_srcdir)/config/install-sh -d "$(DESTDIR)$(prefix)/share/doc/mcpp" cp -pf $(top_srcdir)/LICENSE $(top_srcdir)/README $(top_srcdir)/NEWS \ $(DESTDIR)$(prefix)/share/doc/mcpp cp -pf $(top_srcdir)/doc/mcpp-manual.html \ $(DESTDIR)$(prefix)/share/doc/mcpp cp -pf $(top_srcdir)/doc-jp/mcpp-manual.html \ $(DESTDIR)$(prefix)/share/doc/mcpp/mcpp-manual-jp.html uninstall-hook: rm -rf $(DESTDIR)$(prefix)/share/doc/mcpp endif mcpp-2.7.2/doc/0000777000175000017500000000000011114176742010237 500000000000000mcpp-2.7.2/doc/cpp_test.sum0000644000175000017500000000665710516664771012551 00000000000000 M B G G V L M G V L G M C C C C C C C C C C C C C C C C 2 C P C 2 C C P P 5 2 3 0 W P 3 0 | 4 P 2 5 9 2 0 I 2 4 0 0 1 2 0 | 5 3 N 4 3 5 6 1 6 3 3 3 0 2 2 3 n_1: Trigraph sequences. * - * * * * * * * * * * n_2: Line splicing by . * - * * * * * * * * * * n_3: Handling of comment. * * * * * * * * * * * * n_4: Tokens spelled by digraphs. * - * * * - * * * - * * n_5: Spaces or tabs in pp-directive. * * * * * * * * * * * * n_6: #include directive. * - * * * * * * * * * * n_7: #line directive. * * * * * * * * * * * * n_9: #pragma directive. * * * * * * * * * * * * n_10: #if, #elif pp-directive. * * * * * * * * * * * * n_11: Operator "defined" in #if. * * * * * * * * * * * * n_12: Pp-number and type of #if expr. * * * * * * * * * * * * n_13: Valid operators in #if expr. * * * * * * * * * * * * n_13.5: Usual arithmetic conversion. * * * * o o * * o o * * n_13.7: Short-circuit evaluation of #if. * * * * - * * * - * * * n_13.8: Grouping of #if sub-expressions. * * * * - o * * - o * * n_13.13: #if expression with macros. * * * * * * * * * * * * n_15: #ifdef, #ifndef directives. * * * * * * * * * * * * n_18: #define directive. * * * * * * * * * * * * n_19: Valid re-definitions of macros. * * * * * * * * * * * * n_20: Macro name identical to keyword. * * * * * * * * * * * * n_21: Tokenization (no token merging). * - * * - * * * - * * * n_22: Tokenization of pp-number. * o * * o * * * o * * * n_23: ## operator in macro definition. * * * * * * * * * * * * n_24: # operator in macro definition. * - * * * * * * * * * * n_25: Pre-expansion of macro args. * * * * * * * * * * * * n_26: No recursive replacement. * * * * * * * * * * * * n_27: Rescanning of a macro. o o * * - * * * - * * * n_28: Standard pre-defined macros. * - * * - - * * - - * * n_29: #undef directive. * * * * * * * * * * * * n_30: Macro call crossing lines. * * * * * * * * * * * * n_32: Escape sequence in char-const. * * * * * * * * * * * * n_37: Translation limits. * * * * * * * * * * * * i_32.3: Character constant in #if. * * * * * * * * * * * * i_35: Multi-character character const. * * * * o * * * o * * * i_35.3: Multi-character wide character. * * * * * o * * * o * * Total number of tests unpassed. 1 9 0 0 8 5 0 0 8 5 0 0 mcpp-2.7.2/doc/mcpp-porting.html0000644000175000017500000037162111113260543013462 00000000000000

MCPP-PORTING

== How to Port MCPP ==

for V.2.7.2 (2008/11)
Kiyoshi Matsui (kmatsui@t3.rim.or.jp)

Contents

1. Overview
1.1. High portability
1.2. Standard C mode with highest conformance and other modes
1.3. Notations in this document

2. History

3. How to port mcpp to each compiler system: Overview
3.1. Already supported compiler systems: Making compiler-specific-build of mcpp
3.1.1. Commonly required settings
3.1.2. FreeBSD / GCC V.2.*, V.3.*, V.4.*
3.1.3. Linux / GCC V.2.*, V.3.*, V.4.*
3.1.4. Mac OS X / Apple-GCC V.4.*
3.1.5. CygWIN / GCC V.2.*, V.3.*
3.1.6. MinGW / GCC V.3.*
3.1.7. LCC-Win32 2003-08, 2006-03
3.1.8. Visual C++ V.6.0, 2002, 2003, 2005, 2008
3.1.9. Borland C V.5.*
3.2. Compiler systems to which DECUS-cpp had been ported
3.3. noconfig.H, configed.H, system.H
3.4. system.c
3.5. Library functions
3.6. Standard headers
3.7. Makefile and recompilation using mcpp
3.8. Compiler systems which can compile mcpp
3.9. Host compiler system and target compiler system
3.10. Compiler systems on MS-DOS and DJGPP
3.11. Making compiler-independent-build of mcpp
3.12. Making subroutine-build of mcpp
3.12.1. Using configure
3.12.2. Using noconfig/*.mak
3.12.3. Static library and shared library or DLL

4. How to port mcpp to each compiler system: Details
4.1. Setting of noconfig.H, configed.H, system.H
4.1.1. PART 1: Setting of Target system: for Compiler-specific-build
4.1.1.1. Predefined macros
4.1.1.2. Include directories and others
4.1.1.3. Output format of line number information and others
4.1.1.4. Settings corresponding to the compiler system's language specification
4.1.1.5. Multi-byte character
4.1.1.6. Target and host system common settings
4.1.2. PART 2: Setting of Host system
4.1.3. PART 3: Setting of the mcpp behavior specification
4.1.3.1. Several behavioral modes of new and old
4.1.3.2. Specifying the details of the behavioral modes
4.1.3.3. Specifying translation limits
4.2. system.c
4.extra. malloc()

5. Bug reporting and porting report
5.1. Is this a bug?
5.2. Check for malloc() related bugs
5.3. Bug report
5.4. Porting report
5.5. Information about configure for other compiler systems than GCC
5.6. I will try to port if you send me the data.
5.7. Please report the test of other compiler systems by the Validation Suite.
5.8. The feed back for improvement

6. Long way to mcpp
6.1. Three days to plan and six years to develop
6.2. V.2.3
6.3. Selected to "Exploratory Software Project"

1. Overview

mcpp is a C preprocessor developed by kmatsui (Kiyoshi Matsui) based on the DECUS cpp written by Martin Minow, and then rewritten entirely. mcpp means Matsui cpp. This software is supplied as source codes, and to use mcpp in any systems, a small amount of compiler-system-specific modifications are required before it can be compiled into an executable. *1

This document explains how to port the source to different compiler systems. Please refer to the separate manual called "mcpp-manual.html" for the operating instructions of the generated executable.

All these sources and related documents are provided as an open-source-software.

Before going into detail, some of the mcpp features are introduced here.

Note:

*1 mcpp V.2.6.3 onward provides some binary packages too, at the following site. This document, however, does not explain them. As for the binary packages, see the web page.

http://mcpp.sourceforge.net/


1.1. High portability

mcpp is a portable preprocessor, supporting various operating systems, including Linux, FreeBSD and Windows. Its source has a wide portability, and can be compiled by any compilers which support Standard C (ANSI/ISO C). The library functions used are only the classic ones.

To port mcpp to each compiler system, in many cases, one only needs to change some macro definitions in the header files and simply compile it. In the worst case, adding several dozen of lines into a source file would be enough.

To process multi-byte characters (Kanji), it supports Japanese EUC-JP, shift-JIS and ISO2022-JP, Chinese GB-2312, Taiwanese Big-5 and Korean KSC-5601 (KSX 1001), as well as UTF-8. For shift-JIS, ISO2022-JP or Big-5, mcpp can complement the compiler-proper if it does not recognize them.


1.2. Standard C mode with highest conformance and other modes

mcpp has various behavioral modes. Other than Standard-conforming mode, there are K&R 1st mode, "Reiser" cpp mode and what I call post-Standard mode. mcpp has also an execution option for C++ preprocessor.

Different from many existing preprocessors, Standard mode of mcpp has the highest conformance to Standards: all of C90, C99 and C++98. It has been developed aiming to become the reference model of the Standard C preprocessor. Those versions of the Standard can be specified by an execution option. *1

In addition, it provides several useful enhancements: #pragma MCPP debug, which traces the process of macro expansion or #if expression evaluation, and the header file "pre-preprocessing" facility.

mcpp also provides several useful execution options, such as warning level or include directory specification options.

Even if there are any mistakes in source, mcpp deals suitably with accurate plain diagnostic messages without running out of control or displaying misguiding error messages. It also displays warnings for portability problems. The detailed documents are also attached.

In spite of its high quality, mcpp code size and memory usage is relatively small.

A disadvantage of mcpp, if any, is slower processing speed. It takes two or three times time of GCC 3.*, 4.* / cc1, but seeing that its processing speed is almost the same as that of Borland C 5.5/cpp32 and that it runs a little bit faster when the header file pre-preprocessing facility is used, it cannot be described as particularly slow. mcpp puts an emphasis on standard conformance, source portability and operability in a small memory space, making this level of processing speed inevitable.

Validation Suite for Standard C Preprocessing, which is used to test the extent to which a preprocessor conforms to Standard C, its documentation cpp-test.html, which contains results of applying Validation Suite to various preprocessors, are also released with mcpp. When looking through this file, you will notice that so-called Standard-conforming preprocessors have so many conformance-related problems.

Note:

*1 ISO/IEC 9899:1990 (JIS X 3010-1993) had been used as C Standard, but in 1999, ISO/IEC 9899:1999 was adopted as a new Standard. This document calls the former C90 and latter C99. The former is generally called ANSI C or C89 because it migrated from ANSI X3.159-1989. ISO/IEC 9899:1990 plus its Amendment 1995 is sometimes called C95. C++ Standards are ISO/IEC 14882:1998 and its corrigendum version ISO/IEC 14882:2003. This document calls both of them C++98.


1.3. Notations in this Document

Though this document was text-file in the older versions, it has changed to html-file at V.2.6.2.
This document uses the following typographical conventions:


2. History

  1. DECUS cpp was created by Martin Minow, and released in usenet/net.sources on May 1984. Apparently, DECUS is an acronym for "DEC User's Society" which was a user group of DEC (Digital Equipment Corporation). DECUS cpp is the C preprocessor written for DEC's C compiler systems of those days, such as PDP-11 / RT11, PDP-11 / RSX, VAX / VMS, VAX / ULTRIX. As it had been written well for portability, it was quite easy to port to other systems. Even the original version had already been ported to some other UNIX systems besides DEC's.

  2. I used the distribution No.243, of the C Users' Group, to be the base for mcpp. According to the revision history of this source, the original author's final modification was June 1985. I do not hear that the author has upgraded it since then.

  3. After that, some people ported it to some of the compiler systems on MS-DOS until December 1988. This is the version which is included in the CUG disc.

  4. There are also sources in ftp.ora.com/pub/examples/nutshell/imake/DECUS-cpp.tar.gz. The time stamp of this shows Feb 1993, but the actual contents are older than CUG's and it is Jan 1985's. According to the README by Martin Minow which was included there, this program is stated to be "public domain". (This README also seems to be of 1984 or 1985.)

  5. The one ported to Microware C of OS-9/6x09, by Gigo & others, had been registered in NIFTY-SERVE / FOS9 / lib 2 in April 1989.

  6. mcpp V.2 is based on these, and I rewrote it entirely. I improved the portability further. In order to completely comply with the Standard C, I changed the partitioning of source files, added lots of macros and drastic addition/separation/rewriting/renaming of functions and variables has been done. The size of the source is three times that of the original version. All the documents and the Validation Suite are written completely new by me.
    I release these as an open-source-software. I do not have any relationship with DECUS.
    The original version does not have a version number, but I refer to them as "DECUS cpp" to differentiate them from mcpp.

  7. For the algorithm of macro expansion for Standard C, the source of CPP V.5.3 (Aug 1989, CUG #319) - PDS on MS-DOS by E.Ream, was also referred to. Additionally, I took some hints from the behavior of GCC/cpp and J. Roskind's JRCPP document.

  8. mcpp V.2.0 was released with Validation Suite V.1.0 on NIFTY SERVE / FC / LIB2 in August 1998, and also re-distributed on Vector's web site.

  9. V.2.1 was a revised V.2.0 according to the C99 1998/08 draft. In September 1998, this had been uploaded with Validation Suite V.1.1 to NIFTY SERVE / FC / LIB2 and at the same time to Vector's web site.

  10. V.2.2 was an updated V.2.1 according to the C++ Standard (ISO/ IEC 14882:1998), which was adopted on July 1998. With the Validation Suite, this had been uploaded to NIFTY SERVE / FC / LIB2 and at the same time to Vector's web site in November 1998.

  11. mcpp V.2.3 was an updated V.2.2 according to C99. Added porting to Linux / GCC 2.95, GCC 3.2, etc., and augmented the compatibility with GCC/cpp. Also, the execution time options are added and some options were changed. In V.2.3, English versions of the documents are also created. In the Validation Suite attached to mcpp, an edition which allows automatic testing as a part of GCC / testsuite is added.

  12. In the middle of development of V.2.3, mcpp with Validation Suite V.1.3. was selected for one of the 2002 "Exploratory Software Projects" of the Information-technology Promotion Agency, Japan (IPA) by the project manager, Yutaka Niibe. During the period of July 2002 - Feb 2003, the development was progressed by the IPA's funding, and based on PM Niibe's advice. The documents are consigned to "HighWell inc." (Tokyo) for translation to an English version, and completed with my modifications. During this project, "cvs repository" and "ftp site" were prepared. V.2.3 was developed with pre-release 1 in August 2002, pre-release 2 in December 2002, and then the released version in February 2003. Since then, V.2.3 patch 1 was released in March 2003. *1

  13. mcpp has continued to be selected as the "Exploratory Software Projects" for 2003 by the project manager, Hiroshi Ichiji. During the period of June 2003 - Feb 2004, the update to V.2.4. was proceeded with the IPA's funding, and based on PM Ichiji's advice. In this project, V.2.4 pre-release was developed in November 2003. In this version, the porting to Visual C++ 2003 is added, and also a configuration script to automate 'make' of mcpp was created. Also, mcpp did not have a clear license indication so far, but a BSD style license has been included from this version. Furthermore, the release version was developed in February 2004. In this version, the processing of multi-byte characters was enhanced. The documents were consigned to HighWell for translation to an English version, as they were updated from the Japanese version.
    In March 2004, V.2.4.1 was released. In this version, recursive macro expansion was revised.

  14. In March 2005, V.2.5 was released. In this version, the compile time mode named POST_STANDARD was absorbed into STANDARD mode as an execution time option, the compile time setting named OLD_PREPROCESSOR was absorbed into an execution time option of PRE_STANDARD. Recursive macro expansion was revised again and became perfect. While the portings to GCC V.3.3 and 3.4 were added, most of the documents on 16-bits system compilers was removed.

  15. In July 2006, V.2.6 was released. In this version, STANDARD and PRE_STANDARD modes are integrated into one executable, all the behavioral modes are made to be specified by the execution options. The specifications of compiler-independent-build became entirely independent from compiler systems. While the portings to new versions of some compiler systems are added, the settings for pre-C90 compiler systems and settings for MS-DOS compiler systems are removed. The sources were rewritten in many parts. I think that so much rewriting as this version will not happen hereafter, except adding codes and refining details.
    In August 2006, V.2.6.1 was released. In this version, porting to MinGW was added, some bugs were fixed and some relatively small improvements were done.
    In November 2006, V.2.6.2 was released. In this version, most of the text file documents were converted to html, some bugs were fixed, and subroutine-build of mcpp was implemented by contribution from Juergen Mueller.
    In April 2007, V.2.6.3 was released. In this version, compatibility of GCC-specific-build to GCC was increased, and output to memory buffer was implemented in subroutine-build by contribution from Greg Kress. In addition, binary packages for some systems were begun to be provided.
    In May 2007, V.2.6.4 was released. This is a bug-fixed version of V.2.6.3.

  16. In March 2008, V.2.7 was released. In this version, 'macro notification mode' to embed macro informations into comments was implemented, and much codes were added. This mode enables to know the line and column position of macro calls on the source file from the preprocessed output. It was implemented for C/C++ refactoring tools. A porting to Mac OS X / Apple-GCC was added. Also a porting to Visual C++ 2008 was done. GCC-specific-build became closer to GCC. Some bugs of the previous version were fixed.
    In May 2008, V.2.7.1 was released. This is a bug-fixed version of V.2.7. This version changed each binary package on UNIX-like systems to install a shared library or DLL of mcpp and an mcpp executable linking the library.
    In November 2008, V.2.7.2 was released. This is a bug-fixed version of V.2.7.1.

Note:

*1 The outline of the "Exploratory Software Project" can be seen at the following site (Japanese pages only).

http://www.ipa.go.jp/jinzai/esp/

mcpp from V.2.3 through V.2.5 had been located at:

http://www.m17n.org/mcpp/

In April 2006, mcpp project moved to:

http://mcpp.sourceforge.net/

The older version of mcpp, cpp V.2.2 and Validation Suite V.1.2 are located in the following Vector's web site. They are in the directory called dos/prog/c, but they are not for MS-DOS exclusively. Sources are for UNIX, WIN32, MS-DOS. The documents are Japanese only.

http://www.vector.co.jp/soft/dos/prog/se081188.html
http://www.vector.co.jp/soft/dos/prog/se081189.html
http://www.vector.co.jp/soft/dos/prog/se081186.html

The text files in these archive files available at Vector use [CR]+[LF] as a <newline> and encode Kanji in shift-JIS for DOS/Windows. On the other hand, those from V.2.3 through V.2.5 available at SourceForge use [LF] as a <newline> and encode Kanji in EUC-JP for UNIX. From V.2.6 on two types of archive, .tar.gz file with [LF]/EUC-JP and .zip file with [CR]+[LF]/shift-JIS, are provided.


3. How to port mcpp to each compiler system: Overview

The source of mcpp consists of five header files and seven *.c files. The parts which are dependent on OS or compiler system are included in the four source files configed.H, noconfig.H, system.H and system.c. Either of configed.H or noconfig.H is used depending the compiling method, they are never used simultaneously. There are also a few library function sources in system.c. When mcpp is compiled by any compiler system, these source files need to be modified to match that compiler system.

There are several types of MCPP executable corresponding to its building methods. The building methods of MCPP have following two axis:

  1. stand-alone-build vs subroutine-build
  2. compiler-independent-build vs compiler-specific-build

The following sections from 3.1 through 3.9 explain compiler-specific-builds. "mcpp for GCC", "implemented for Visual C" or such in this document mean GCC-specific-build, Visual C-specific-build, respectively.

There are two ways to compile mcpp. The first is to automatically generate a header file named config.h and a Makefile by executing the 'configure' script. After generating them, just run 'make; make install'. The header file named configed.H will be used in this way. However, the configure script can only be used in UNIX-like systems and CygWIN or MinGW.

Another way is to 'make' using a makefile for each compiler system, with the modified/edited (if required) header file by difference files. noconfig.H will be used in this case. Difference files and makefiles are in the 'noconfig' directory. Even for systems which can use the configure script, editing header files and makefiles directly allows you to control compilation in detail. However, difference files are only available for supported compiler systems.

In this chapter, I explain how to compile mcpp using the difference files. Please refer to INSTALL for the configure script.

Note:

*1 While V.2.6 and V.2.6.1 called this as 'stand-alone-build', V.2.6.2 changed the name according to the creation of subroutine-build.

*2 mcpp V.2.6.3 and later provides some binary packages at the SourceForge site. They are all stand-alone and compiler-independent-builds.


3.1. Already supported compiler systems: Making Compiler-specific-build of mcpp

The C/C++ compiler systems I could use are the following, and mcpp has been ported to all of these. Therefore, it has been verified that this source code can be compiled, and that generated preprocessors run correctly on each compiler system. In any case the CPU used is the x86 type. The systems are all 32 bit version, except Ubuntu which is 64 bit version.

FreeBSD 6.3 GCC V.3.4.6
Vine Linux 4.2 GCC V.2.95.3, V.3.2, V.3.3.6, V.3.4.3, V.4.1.1
Fedora Linux 9 GCC V.4.3.0
Debian LInux 4.0 GCC V.4.1.2
Ubuntu Linux 8.04 / x86_64 GCC V.4.2.3
Mac OS 10.5 GCC V.4.0.1
CygWIN 1.3.10 GCC V.2.95.3
CygWIN 1.5.18 GCC V.3.4.4
MinGW (MSYS 1.0.11)GCC V.3.4.5
WIN32 Visual C++ 2003, 2005, 2008
WIN32 Borland C++ V.5.5J
WIN32 LCC-Win32 2003-08, 2006-03

In addition, there are informations from some users on Visual C++ V.6.0, Visual C++ 2002 and C++Builder 2007 (aka BCC V.5.9), and you can compile mcpp on them, too.

Settings are quite easy for creating mcpp executables by these compiler systems. One only needs to change some macro definitions in noconfig.H.

*.dif files in noconfig directory are difference files for modifying noconfig.H, which is by default for FreeBSD 6.* / GCC 3.4, to use with each compiler system.

For Visual C++ 2005, as an example, in the src directory, doing the following command modifies these files.

patch -c < ..\noconfig\vc2005.dif

Patch is a standard UNIX command, and has been ported to Windows or other. Of course, you can directly edit the source file referring the difference file without using patch.

Modifications to match your own systems, such as specifying include directory have to be done by yourself, apart from the modifications made by difference file.

Makefiles for each compiler system which are to compile these modified sources, are also attached. (See sec. 3.7)
Copy the makefile into the src directory as:

copy ..\noconfig\visualc.mak Makefile

All the following operations should be done in the src directory. These are all modifications of noconfig.H unless it is otherwise mentioned.


3.1.1. Commonly required settings

For any of the following compiler systems, in order to make the compiler-specific-build, change the macro INDEPENDENT of the line:

#define COMPILER        INDEPENDENT

to the macro for the compiler system, for example:

#define COMPILER        MSC

Next, change the line appropriately:

#define VERSION_MSG     "GCC 3.4"

as:

#define VERSION_MSG     "Visual C 2005"

You can also overwrite the definition of COMPILER by make option as:

nmake COMPILER=MSC
nmake COMPILER=MSC install

If you modify noconfig.H applying the difference file, the compiler-specific setting will be also modified for the compiler system, so you need not rewrite the definition of COMPILER in the file. Then, if you do 'make' with option defining COMPILER, compiler-specific-build will be made, otherwise compiler-independent-build will be made.

In case of the default include directories are different from the ones in this file, the macros C_INCLUDE_DIR1 and C_INCLUDE_DIR2 should be rewritten. If C++ has its own include directories different from the ones in C, these should be written in CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2 and CPLUS_INCLUDE_DIR3. (These directories can be specified also by environment variables or the -I option at the time of execution.) All of these directories are of compiler-system-specific ones.

Include directories are also set in system.c. In UNIX terms, those set by system.c are OS-specific (usually /usr/include) and site specific (usually /usr/local/include). As for Windows, nothing is set for include directories in system.c nor in noconfig.H by default, they are to be specified by environment variables INCLUDE and CPLUS_INCLUDE.

If required, you should also change built-in macro names defined by the macros such as COMPILER_STD1 or COMPILER_STD2.

The default setting of multi-byte character encodings is set to EUC-JP on UNIX, shift-JIS on Windows. If required, modify the macro called MBCHAR to change the encoding. (The change of multi-byte character encoding can be done also by the environment variables, execution options and #pragma.)

On certain compiler systems, because they do not support encodings such as shift-JIS or Big5, the tokenization gets errors when there is the same value byte of 0x5c as '\\' within multi-byte characters. For these systems, mcpp needs special setting to compensate for an inability of the compiler. Please refer to sec 4.1.1.5 for this setting.

With regard to the attached makefiles, you need to rewrite BINDIR, which is the directory where the executables of the compiler system are located.

In GCC V.3, V.4, the preprocessor is absorbed into the compiler (ccl, cclplus). So, to use mcpp, you must replace the call of gcc, g++ with shell-script and set to execute first mcpp, then cc1 or cc1plus. The attached makefiles set this automatically by doing:

make COMPILER=GNUC
make COMPILER=GNUC install

For the details, please see mcpp-manual.html#3.9.7.

When the user does not have write permission into the BINDIR, you must do 'sudo make COMPILER=GNUC install' on UNIX-like systems. On Windows, you must modify the permission of the directory by an administrator account, prior to installation.

3.1.2. FreeBSD / GCC V.2.*, V.3.*, V.4.*

The source is to be compiled by GCC (GNU C) V.3.4 on FreeBSD 6.* and to make mcpp of compiler-independent-build. In order to make the compiler-specific-build for FreeBSD 6.* / GCC V.3.4.*, first change the line:

#define COMPILER    INDEPENDENT

to:

#define COMPILER    GNUC

Then, just complete it by compiling. You can also overwrite COMPILER by 'make COMPILER=GNUC' command.

For the other version of GCC, modify the version number of the VERSION_MSG, and

#define COMPILER_EXT_VAL    "3"
#define COMPILER_EXT2_VAL   "4"
#define COMPILER_CPLUS_VAL  "3"
#define GCC_MAJOR_VERSION   3

For the first, write major version number of GCC, and for the second, write minor version number, both by string-literal. The third is value of the macro __GNUG__, which is the same with the first. And for the fourth, write the same number with the first by a digit.

If the version of FreeBSD is not 6.*, then change the following values.

#define SYSTEM_EXT_VAL      "6"     /* V.5.*: 5, V.6.*:6    */

Furthermore, in case of include directories are different from the default ones of FreeBSD 6.*, you need to change the following definition.

#define CPLUS_INCLUDE_DIR1  "/usr/include/c++/3.4"
#define CPLUS_INCLUDE_DIR2  "/usr/include/c++/3.4/backward"

In some cases you may need to set also C_PLUS_INCLUDE_DIR3 and C_INCLUDE_DIR1.

If the version of GCC is 2.7-2.95, then change the following macro to 199409L.

#define STDC_VERSION        0L

Even for other UNIX-like OSes, if the compiler system is GCC, I suspect one only needs to change things like these version numbers, the setting of include directories or OS specific built-in macros. (See sec 4.1.1)

3.1.3. Linux / GCC V.2.*, V.3.*, V.4.*

To change the setup for GCC on FreeBSD to GCC on Linux, you should change the line:

#define SYSTEM      SYS_FREEBSD

to:

#define SYSTEM      SYS_LINUX

Then modify the macros, as on FreeBSD, COMPILER, VERSION_MSG, COMPILER_EXT_VAL, COMPILER_EXT2_VAL, COMPILER_CPLUS_VAL, GCC_MAJOR_VERSION, CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2, C_INCLUDE_DIR1.

For GCC 2.* modify the value of STDC_VERSION. and change:

#define COMPILER_SP3_VAL    "int"

to:

#define COMPILER_SP3_VAL    "long int"

You should make sure the include directories by these commands:

gcc -xc -E -v /dev/null
g++ -xc++ -E -v /dev/null

The difference files in 'noconfig' directory named linux_gcc2953.dif, linux_gcc32.dif, linux_gcc336.dif, linux_gcc343.dif and linux_gcc411.dif are for VineLinux 4.0 / GCC V.2.95.3, V.3.2, V.3.3.6, V.3.4.3 and V.4.1.1, respectively. For the compiler-specific-build, change COMPILER too. The include directories may vary between distributions of Linux. Also, if another version is installed in addition to the system standard version of GCC, it should create another include directory for the specific version. Specify the particular directory using the above macros.

The specification of getopt() of glibc is different from the standard ones such as POSIX, please use the mcpp_getopt() in system.c instead.

3.1.4. Mac OS X / Apple-GCC V.4.*

On Mac OS X, you can install GCC by installing the Xcode package.

After that installation, you will find many gcc, cc, g++, c++ or such in /usr/bin. In Mac OS X 10.5 Leopard on Intel-Mac, i686-apple-darwin9-gcc-4.0.1 and i686-apple-darwin9-g++-4.0.1 are the native compilers for the machine. The cross compilers are installed, too. On Intel-Mac, powerpc-apple-darwin9-gcc-4.0.1 and powerpc-apple-darwin9-g++-4.0.1 are the cross compilers to generate a binary for PowerPc. The names just gcc and g++ are symbolic links to gcc-4.0 and g++-4.0, which behave as native compilers by default, but when invoked with '-arch ppc' option, call the compiler-propers cc1 or cc1plus for powerpc. Note that these compilers are also installed into /Developer/usr/bin.

These are GCCs with many extensions specific to Mac OS X made by Apple. The compiler system of Mac OS X differs from the GCCs on other systems in some important aspects. First, it handles the special directories called "framework" as its system header directories. Second, it can generate both of the binaries for Intel-Mac and PowerPc-Mac on either machine. Moreover, it has a mechanism to make a "universal binary", which is a bundle of both binaries and is able to run on either machine. In fact, gcc-4.0, i686-apple-darwin9-gcc-4.0.1, powerpc-apple-darwin9-gcc-4.0.1 and their corresponding g++s and cc1, cc1plus and other compiler-propers in /usr/libexec/gcc/SYSTEM/4.0.1 are all universal binaries for i386 and ppc. (SYSTEM is i686-apple-darwin9 and powerpc-apple-darwin9.) If we copy these universal binaries from Intel-Mac to PowerPc-Mac, they will run reversing native and cross positions, I suppose. In addition, Intel-Mac even executes most of ppc binaries automatically translating to x86 codes.

To sum up: there are many gccs and g++s in /usr/bin and /Developer/usr/bin: also there are links to them; there are libexec directories for x86 and ppc: an executable contains two binaries bundled in it: a binary for ppc runs on x86. Such being the situation, we easily lose which is which. Be careful. Here, I take examples of Mac OS X 10.5 (Leopard) on Intel-Mac. On PowerPc-Mac, read these sections swapping i686 and powerpc (ppc). On Mac OS X 10.4 (Tiger), read darwin9 as darwin8.

3.1.4.1. Native compiler versus cross compiler

It is quite simple to install mcpp by the native compiler. To make settings for Mac OS X 10.5 / GCC 4.0.1 on Intel-Mac, apply mac_gcc401_i686.dif to noconfig.H. Use mac_osx.mak as a Makefile. The command sequence 'make; sudo make install' will generate a compiler-independent-build, and 'make COMPILER=GNUC; sudo make COMPILER=GNUC install' will install a GCC-specific-build. The compilers in /usr/bin will be used for these commands, since usually /Devepoler/usr/bin is not set to $PATH.

To install mcpp on Intel-Mac with or for the cross compiler for PowerPc, apply mac_gcc401_powerpc.dif to noconfig.H. Then edit the Makefile (mac_osx.mak).

For a compiler-independent-build, change the definition of variables NAME, CC and CXX to those containing "powerpc" as noted by the comments in mac_osx.mak. Then, do 'make; sudo make install'. The binary is the one compiled "with the cross compiler", so should run on ppc-Mac.

For a GCC-specific-build, change the definition of variables NAME, INCDIR, BINDIR, target_cc and arch to those containing "powerpc" (do not change CC and CXX), and do 'make COMPILER=GNUC; sudo make COMPILER=GNUC install'. This is a binary "for the cross compiler" running on Intel-Mac, hence runs on Intel-Mac.

On PowerPc-Mac, mac_gcc401_powerpc.dif makes settings for the native compiler, and mac_gcc401_i686.dif do for the cross compiler, in reverse of Intel-Mac. To compile mcpp with or for the cross compiler for Intel-Mac on PowerPc-Mac, change the definition of the variables above to those containing "i686".

3.1.4.2. Universal binary

To make a universal binary, just enable the variable UFLAGS in mac_osx.mak removing the '#' which comments out the line. All the other settings are the same with the section above.

3.1.5. CygWIN / GCC V.2.*, 3.*

For CygWIN V.1.3.10 / GCC V.2.95.3, add the changes in cyg1310.dif to noconfig.H.
For CygWIN V.1.5.18 / GCC V.3.4.4, apply cyg1518.dif.

Then, rewrite the macro CYGWIN_ROOT_DIRECTORY to define CygWIN's root directory on Windows as:

#define CYGWIN_ROOT_DIRECTORY   "C:/pub/compilers/cygwin"

The letters in the path-list are case-insensitive.

For other versions, it should be able to be ported by modifying macros such as VERSION_MSG, C_INCLUDE_DIR?, CPLUS_INCLUDE_DIR? and CYGWIN_ROOT_DIRECTORY.

Although CygWIN is a system on Windows, it simulates UNIX file system. Therefore, mcpp treats CygWIN/GCC in almost the same way with UNIX/GCC, and presets include directories as mcpp on UNIX.

3.1.6. MinGW / GCC V.3.*

For MinGW / GCC V.3.4.5, add the changes in mingw345.dif to noconfig.H. Then, rewrite the macro MSYS_ROOT_DIRECTORY and MINGW_DIRECTORY to define MSYS's / and /mingw directory on Windows as:

#define MSYS_ROOT_DIRECTORY "C:/Program Files/MSYS/1.0"
#define MINGW_DIRECTORY     "C:/Program Files/MinGW"

The letters in the path-list are case-insensitive.

For other versions, it should be able to be ported by modifying macros such as VERSION_MSG, C_INCLUDE_DIR?, CPLUS_INCLUDE_DIR?, MSYS_ROOT_DIRECTORY and MINGW_DIRECTORY. The path-list for the include directories may be either of absolute path as "c:/dir/mingw/include" or MinGW's own path as "/mingw/include".

Since MinGW does not support symbolic link, GCC-specific-build of mcpp cannot be invoked from gcc through symbolic link. Moreover, MinGW / gcc rejects to invoke a shell-script even if it is named cc1. Therefore, the compiling of mcpp generates an executable named cc1.exe instead of shell-script. In execution, gcc invokes this cc1.exe from which mcpp.exe or GCC's cc1.exe/cc1plus.exe are invoked.

Although the include directories are preset on GCC-specific-build, they are not set on compiler-independent-build, hence you should specify them by the environment variables INCLUDE and CPLUS_INCLUDE.

3.1.7. LCC-WIN32 2003-08, 2006-03

In LCC-WIN32 2003-08 or 2006-03, it needs to be changed as per lcc0308.dif, lcc0603.dif respectively. In other versions, the VERSION_MSG macro needs to be modified.

3.1.8. Visual C++ V.6.0, 2002, 2003, 2005, 2008

In Visual C++ 6.0, 2002, 2003, 2005, 2008, it needs modifications as vc6.dif, vc2002.dif, vc2003.dif, vc2005.dif, vc2008.dif respectively. For the compiler-specific-build, modify COMPILER or overwrite it by the nmake option, of course.

For other versions of Visual C, besides modifying VERSION_MSG macro, the values of predefined macros, _MSC_VER and _MSC_FULL_VER, should be changed by modifying the definition of COMPILER_EXT_VAL and COMPILER_EXT2_VAL respectively.

3.1.9. Borland C++ V.5.*

In Borland C V.5.5, V.5.9 (C++Builder 2007) / bcc32, it needs to be changed with bc55.dif, bc59.dif respectively.

In other versions of Borland C++, besides the VERSION_MSG macro, the values of predefined macros, __TURBOC__, __BORLANDC__ and __BCPLUSPLUS__ should be changed by modifying macros COMPILER_STD2_VAL, COMPILER_EXT_VAL and COMPILER_CPLUS_VAL, in noconfig.H. (Refer Sec 4.1.1.1.) If the version can handle digraphs, the definition of HAVE_DIGRAPHS needs to be changed. If the version has __STDC_VERSION__ macro, change the definition of STDC_VERSION.


3.2. Compiler systems to which the DECUS-cpp had been ported

The DECUS cpp seems to had supported RT-11/DECUS C and RSX/DECUS C on PDP-11, VMS/VAX-11C, PDP-11/UNIX and VAX/ULTRIX - some kind of C on VAX. It also seemed to have supported a quite old version of Microsoft C and Lattice C on MS-DOS. I removed these, as I suppose it is no longer required and I cannot maintain them.


3.3. noconfig.H, configed.H, system.H

system.H includes configed.H when the macro HAVE_CONFIG_H is defined to non-0, otherwise it includes noconfig.H. PART 1 and PART 2 of the mcpp setting are in configed.H and noconfig.H, and PART 3 is in system.H.

In these files, some macros which are required to port to each compiler system are defined. When porting to compiler systems which have not been ported to yet, one needs to add from a few lines to a dozen lines in Part 1.

Part 1 is the definition dependent on OS and target compilers, Part 2 is the definition dependent on host systems, and Part 3 is the definition of the mcpp behavior specification.

In configed.H and noconfig.H, the target compiler system is assumed to be the same as the host, so PART 2 needs to be modified when it is different.

When you do porting with different configurations from the default, please make sure to look through these files.


3.4. system.c

system.c absorbs the discrepancies of OS or compiler which cannot be absorbed solely by configed.H (noconfig.H) or system.H macros. To port to a new compiler system, adding tens of lines of source into this file may be required.

This file includes functions such as options for mcpp invocation, usage message, include directory, the handling of OS unique directory paths when opening header files or source files, processing of #pragma, and processing of compiler system unique extension directives. Most of them are setup for the target OS and target compiler systems.


3.5. Library functions

Of library functions, C source code for getopt() and stpcpy(), which are not in Standard, are written in system.c. Though mcpp uses also getcwd(), stat() and in UNIXes readlink(), they are not included here, because they are functions dependent on OS, so cannot be written portably. They are only three low-level functions used in mcpp. Though they are not Standard C function, they are required by POSIX. Every compiler system seems to provide it. *1, *2

Usage of library functions in mcpp does not depend on the specification difference on different compiler systems, so those functions of any compiler systems will not cause a problem unless there is a bug.

Note:

*1 On MinGW, spawnv() is used too.

*2 mcpp up to V.2.6.4 had a separate source file lib.c. But, it was absorbed into system.c on V.2.7, since the functions written in it decreased to only two (getopt() and stpcpy()). At the same time, getopt() was renamed to mcpp_getopt() in order to prevent linking troubles.


3.6. Standard headers

In the source code of mcpp, stdio.h, string.h, stdlib.h, ctype.h, errno.h, limits.h, time.h, sys/types.h, sys/stat.h are included unconditionally. For UNIX-like systems, unistd.h is also included. There should not be a compiler system which does not have these.


3.7. Makefile and recompilation using mcpp

*.mak are the makefiles for each compiler system, and a detailed setup is possible. 'make' command itself is assumed to the one which is attached to each compiler system or the standard for the system. For Visual C, 'nmake' should be used instead of 'make'.

Except for FreeBSD/GCC, modify the noconfig.H as follows: (Assume the system is xyz)

patch -c < ../noconfig/xyz.dif

Then edit macros COMPILER and VERSION_MSG, and edit the macros such as C_INCLUDE_DIR? in noconfig.H to suit your own system. After copying the corresponding noconfig/xyz.mak to Makefile, and setting up the target directory to match your system, run as

make
make install
make clean

For other compiler systems, please write the necessary makefile referring to these files. The dependencies of the source files are simple:

  1. main.c, directive.c, eval.c, expand.c, support.c, system.c, mbchar.c depend on system.H, internal.H
  2. system.H depends on configed.H (noconfig.H)

system.H needs to be included before internal.H.
internal.H further includes mcpp_lib.h.

To recompile mcpp using mcpp itself, place the executable into the location where the preprocessor of the compiler system exists. For instance, in the cases of GCC 2.95, rename the resident cpp0 to something like cpp0_gnuc and link cpp0 to whichever cpp you use at the time. Therefore, if mcpp is the preprocessor you are going to use, you need to do

ln -sf mcpp cpp0

For Windows, you need to copy the one you are going to use, to cpp32.exe or such. *1

You can name the executable of mcpp as:

make NAME=mcpp

(The same thing needs to be done in BC make requires make -DNAME=mcpp. For UCB make, -D can be either added or not. For GNU make, -D should not be added.)

Using the attached makefiles, 'make install' does not do any detailed work. Except for GCCs (i.e.: freebsd.mak, linux.mak, mac_osx.mak, cygwin.mak and mingw.mak), please do rest of the work manually. Please copy the resident preprocessor into the other name beforehand, so as to prevent being deleted by 'make install'.

When you recompile mcpp using the one-pass compiler such as Visual C or Borland C, you should supply the output file of mcpp as the source file to the compiler. (For instance, output the preprocessed result of source file main.c as main.i, and compile that with cl or bcc32.)

When recompiling using mcpp, if the "pre-preprocess" functionality for the header file is used, the preprocess time will be reduced dramatically. When you use the attached makefile, for UCB make, GNU make or MS nmake, you run

make PREPROCESSED=1

for BC make, you run

make -DPREPROCESSED=1

which automatically pre-preprocesses the header files, next preprocess, then compiles. For LCC-Win32's 'make', 'if' statement cannot be used, so you need to edit the makefile and recompile. The details of the modification are in the makefile itself as comments.

In BSD make, GNU make or MS nmake, if you run make with the option MALLOC=KMMALLOC, this links the malloc() which I wrote. About this, please refer to 4.extra. For BC make, the same thing can be done by the option -DKMMALLOC. To link my malloc() with the make of LCC-Win32, you need to edit the makefile.

Note:

*1 In FreeBSD, the standard directory in which preprocessor is located is /usr/libexec. See mcpp-manual.html#2.1. In Linux, it is located in the really deep directory as /usr/lib/gcc-lib/i686-redhat-linux/3.3.2. In Linux/GCC, according to the distribution or the version, this directory setting in the makefile needs to be modified. There are various different include directories, for which you need to check.

Also, in Linux or FreeBSD, there is /usr/bin/cpp which calls cpp0 or cc1, and gcc also calls cpp0 or cc1.
For further information, see mcpp-manual.html#3.9.5 and mcpp-manual.html#3.9.7. In GCC V.3 or V.4, the preprocessor is absorbed in the compiler (ccl, cclplus), so the call of gcc, g++ needs to be replaced with shell-scripts if you want to use mcpp.


3.8. Compiler systems which can compile mcpp

Though some configuration is required to port to each compiler system, compiling mcpp's source code can be done by any compiler system which satisfies C90 specifications. *1, *2

The char type can be either signed or unsigned.

Floating point operation is not necessary.

This source code is written so as not be affected by the minor discrepancies of the compiler systems. Of course, it is necessary to avoid the compiler system's own bugs in order to actually compile with the compiler system. This cannot be found out until it has to be done. When I was porting to some compiler systems, there were a few cases which took me a long time to trace the bug and to find out a work around.

The compiler systems which mcpp does not support are those with special character sets or special CPU, as well as pre-C90 compilers.

EBCDIC is not supported.

The CPUs for which integer operation is not two's complement are also not supported. If it is not two's complement, it may run incorrectly when an overflow has occurred at a #if expression.

Note:

*1 Up to V.2.5, mcpp source was compilable even by K&R 1st compiler. From V.2.6, it presupposes C90 compiler, because K&R spec is no longer required by current compiler systems. I tidied up the source and this document accordingly.

*2 Up to V.2.6.2, mcpp source was compilable by C++, too. V.2.6.3 and later, however, is compilable only by C.


3.9. Host compiler system and target compiler system

There is no need for the compiler system which compiles the mcpp source code (host) and the compiler system which will use the generated mcpp executable (target) to be the same. If these are different, select the target by SYSTEM and COMPILER and the host by HOST_SYSTEM and HOST_COMPILER within noconfig.H (configed.H). Also, the definitions in PART 1 are the settings for the target, and the ones in PART 2 are for the host. system.c is mainly for the target.

However, there are the following limitations.

  1. The host compiler system should be on the same OS as the target compiler system, otherwise a cross-compiler has to be used. The character set of the host system and the target system should be both ASCII.
  2. 'long' ('unsigned long') in the host compiler system has to be an equal or wider range than the one in the target compiler system. This is also the condition required by the Standard. The same thing can be said for the 'long long' ('unsigned long long') in C99.

By the way, the host and the target stated here are nothing to do with the ones in the cross-compiler. Cross-compiling is the job of the compiler itself, and in principle the preprocessor is not concerned about that. When mcpp is ported "to a cross-compiler", this cross-compiler is the target compiler system in here. As for the host compiler, you need to use the one which is not the cross-compiler. When mcpp is compiled "by a cross-compiler", the cross-compiler is the host compiler system, and the target of the cross-compiler becomes the target compiler system.


3.10. Compiler systems on MS-DOS and DJGPP

This section describes about the compiler systems which the older versions of mcpp had supported and later stopped support.

Although the following systems were supported in the older versions, mcpp V.2.4 removed the settings for them.

MS-DOS Turbo C V.2.0
OS-9/6x09 Microware C

The documents on the following compiler systems were removed in V.2.5.

DJGPP V.1.12 GCC V.2.7.1
MS-DOS LSI C-86 V.3.3 Trial Version

In V.2.6, the codes for the above two were removed, and codes and documents on the following compiler systems were removed.

MS-DOS Borland C 4.0
Plan 9 pcc

V.2.6 also removed all the settings for MS-DOS and other small memory systems, and removed the settings for pre-C90 compiler systems.

V.2.7.2 removed a setting for the following system.

Win32 Borland C 4.0

The above compiler systems are old ones, and users of these systems probably have gotten small now.
However, if you would like to compile mcpp with these compilers, you will easily succeed in making compiler-independent-build by the following procedures, as long as the compiler has most of C90 specifications, though compiler-specific-build is not easy because it requires various settings.

As for DJGPP, define SYSTEM, HOST_SYSTEM to SYS_WIN32 and HAVE_INTMAX_T, HAVE_INTTYPES_H to FALSE in noconfig.H, define NBUFF as about 1/4 of the default value in system.H. *1

As for the compiler systems on MS-DOS, define SYSTEM, HOST_SYSTEM to SYS_WIN32 and HAVE_LONG_LONG to FALSE in noconfig.H, define NBUFF as about 1/16 of the default, IDMAX as about 1/4 of the default in system.H, define SBSIZE as about 1/8 of the default in directive.c. Then compile with large memory model.
However, since memory is scarce on MS-DOS, you may get an "out of memory" error on preprocessing a source which has many long macro definitions, even if you have compiled mcpp with these settings.

Note:

*1 It was reported that DJGPP / GCC 4.1.0 successfully compiled mcpp V.2.6.1 with this setting.


3.11. Making compiler-independent-build of mcpp

mcpp can be built as an independent preprocessor which behaves on its own not depending on any compiler systems. Making a compiler-independent-build is quite easy, because the almost only requirement is that the compiler system can compile mcpp's source successfully. The invocation options and other specifications of the compiler-independent-build are the same across the compilers with which mcpp is compiled. The include directories are not preset except /usr/include and /usr/local/include in UNIX-like systems, hence you have to specify the rest of them by environment variables or by -I option. *1, *2

To make a compiler-independent-build with GCC, simply do in the mcpp's root directory:

./configure; make; make install

In this case, the header file configed.H is used. For further details of configuring, see the document INSTALL.

On a system where configure is not applicable, you can patch noconfig.H using the certain difference file in noconfig directory, if mcpp has already been ported to the compiler system. No other modification of source is needed. As a makefile, you can copy the corresponding *.mak file in noconfig directory, and edit the variable BINDIR to specify the installation directory. Then, in src directory, do 'make' and 'make install'.

In case of the version of the compiler differs a little from the already ported version, first apply the patch for the nearest version, then edit noconfig.H.

For the compiler systems to which mcpp is not yet ported, edit noconfig.H and modify or add several macros. First, define HOST_COMPILER appropriately. Next, define COMPILER as INDEPENDENT, and define VERSION_MSG appropriately. There is no target compiler for the compiler-independent-build, so nothing is required in PART 1.

PART 2 depends on the extent to which the host compiler implements the Standard's specifications, and also depends on whether the necessary functions are provided. The most often encountered discrepancy among the compilers is implementation of 'long long' or its corresponding data type. In Visual C 2002, 2003, 2005 and Borland C 5.5, the type is '__int64'. It's length modifier for printf() is 'I64', not 'j' nor 'll', except Visual C 2005. Hence, define the macro LL_FORM as "I64" for these compilers. On MinGW, the specifier is also "I64", though it has long long. In Visual C 2008, type name 'long long' is available.

If the compiler's library has not the function stpcpy(), define HOST_HAVE_STPCPY to FALSE.

Write makefile yourself referring the *.mak files. (Refer 3.7 too.)

Mac OS X provides a cross compiler as well as a native compiler so that we can make binaries for both of x86 and powerpc on either machine. Moreover, it provides a mechanism to make a "universal binary", which is a bundle of binaries for x86 and powerpc. Therefore, the settings necessary to compile mcpp on Mac OS X is a bit complex. I explain compiler-independent-build and compiler-specific-build together at 3.1.4.

By the way, at the SourceForge site, mcpp V.2.6.3 and later supplies some binary packages of compiler-independent-build. These are the ones packaged after each packaging method, and their packaging specifications are found in the setting files contained in each corresponding source package. All the packages on FreeBSD, Linux and Mac OS X use configure script to compile.

Note:

*1 In mcpp V.2.4 and V.2.5, the specification of the compiler-independent-build was a compromise with the compiler's specification. From V.2.6 on, the specification is its own and independent from the compiler.

*2 Even if you could compile mcpp on MS-DOS, you may run into shortage of memory on execution, since the memory is very scarce on MS-DOS. You must largely cut down translation limits before compiling. Refer 3.10.


3.12. Making subroutine-build of mcpp

mcpp can be compiled as a subroutine to be called from some other main program. Like a stand-alone preprocessor, this subroutine accepts execution options from the caller, preprocesses the specified input file, writes its result into the output file, then returns to the caller. It can be called repeatedly on several input files, if required. It does not, however, pass on the output token by token to its caller.

The subroutine-build also can write output into on-memory buffer.

mcpp is compiled as a subroutine when a macro MCPP_LIB is defined to non-0. The entry to this subroutine is mcpp_lib_main() which is a rename of main() in stand-alone-build, and is declared as:

    int mcpp_lib_main( int argc, char ** argv);

If you use GCC, do not define the macro COMPILER to GNUC, leave it defined as INDEPENDENT, because GCC-specific setting generates an executable to be installed into GCC libexec directory and to be called from gcc command, which is not the desired one.

On the other hand, if you use Visual C, Borland C or LCC-Win32, you can define COMPILER to either of INDEPENDENT or one of MSC, BORLANDC, LCC, because these compilers have no independent preprocessor and they never call mcpp even if it is compiled with compiler-specific settings. Each compiler-specific setting defines the compiler-specific predefined macros, compiler-specific options, and some peculiar language specifications. You can choose either of compiler-specific or compiler-independent setting for your convenience.

There are two ways of compiling subroutine (library) build: using configure script and using noconfig/*.mak makefiles.

3.12.1. Using configure

You can use 'configure' script, if you compile with GCC.

./configure --enable-mcpplib
make
sudo make install

On Linux and FreeBSD, these commands will generate libmcpp.a and libmcpp.so.$(SHLIB_VER) of compiler-independent-build, and will install them into /usr/local/lib by default. Then libmcpp.so and libmcpp.so.0 will be created as links to libmcpp.so.$(SHLIB_VER). The *.a is a static library, and the *.so is a shared library. The file named libmcpp.la will also be created, which is for the tool 'libtool'. $(SHLIB_VER) is 0.0.0 on mcpp V.2.6.3, 0.0.1 on V.2.6.4, 0.1.0 on V.2.7, 0.2.0 on V.2.7.1 and 0.3.0 on V.2.7.2. Also header files mcpp_lib.h and mcpp_out.h are installed into /usr/local/include, which are necessary for user program to use libmcpp.

On Mac OS X, the name of the shared library is *.dylib, not *.so. And, if you specify some CPUs by -arch option, such as "make CFLAGS+='-arch i386 -arch ppc'", a universal binary for those CPUs will be generated. In addition, you can widen the range of Mac OS X version on which the binary will run by -isysroot and -mmacosx-version-min= options. This is an example to generate a shared library on Leopard as a universal binary for i386 and ppc usable on Tiger.

make CFLAGS+='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc'

On CygWIN and MinGW, DLL named *.dll will be generated instead of *.so. On CygWIN, libmcpp.a, libmcpp.dll.a, libmcpp.la will be generated and installed into /usr/local/lib, and cygmcpp-0.dll will be generated and installed into /usr/local/bin. On MinGW, those are the same with CygWIN, except cygmcpp-0.dll changes to libmcpp-0.dll. To use the DLL, link your main program against libmcpp.dll.a, which is an 'import library' for the DLL.

Also main_libmcpp.c is compiled and installed into /usr/local/bin under the name of mcpp which links the generated libmcpp.so. As you see in the source, you should include mcpp_lib.h to use libmcpp. *1

Minimal documents are installed too.

You can compile testmain.c as well and link it against one of the libraries. The configure does not do this. See 3.12.2.

Note:

*1 The compiler-independent-build of stand-alone mcpp, which does not use libmcpp, is installed into the same directory under the same name. So, they overwrite each other. As for documents, the same ones are installed into the same directory, so overwrite each other.

3.12.2. Using noconfig/*.mak

If you use 'noconfig.H' and the makefiles in 'noconfig' directory, (after applying an appropriate patch to noconfig.H according to the compiler and its version, and adjusting the directory settings in the makefile), do:

make MCPP_LIB=1 mcpplib
make MCPP_LIB=1 mcpplib_install

While the above commands makes a compiler-independent-build, you can also make a compiler-specific-build by adding an option 'COMPILER=MSC' or the like, unless the compiler is GCC.
For Visual C, use 'nmake' instead of 'make'.
Since the 'make' command attached to LCC-Win32 cannot handle 'if' directive, you must edit the makefile whenever you do different 'make's.

On Linux, FreeBSD, Max OS X, CygWIN and MinGW, the result is the same with that of the configure above, except libmcpp.la is not created and the documents are not installed.
On Mac OS X, if you remove the '#' which comments out the definition of variable UFLAGS in mac_osx.mak, universal binary will be generated for each library.
On Windows, the name of the libraries are different from those on Linux as shown in the table below.

FreeBSD / GCCLinux / GCCMac OS X / GCCCygWIN / GCCMinGW / GCCVisual C, Borland C, LCC-Win32
static librarylibmcpp.alibmcpp.alibmcpp.alibmcpp.alibmcpp.amcpp.lib
shared library or DLLlibmcpp.so.$(SHL_VER)libmcpp.so.$(SHLIB_VER)libmcpp.$(SHLIB_VER).dylibcygmcpp-$(DLL_VER).dlllibmcpp-$(DLL_VER).dllmcpp$(DLL_VER).dll
import library of DLLlibmcpp-$(DLL_VER).dll.alibmcpp-$(DLL_VER).dll.amcpp$(DLL_VER).lib

$(SHL_VER) is 0, 1, 2, 3 on mcpp V.2.6.3-V.2.6.4, V.2.7, V.2.7.1, V.2.7.2, respectively. $(SHLIB_VER) is 0.0.0, 0.0.1, 0.1.0, 0.2.0, 0.3.0 on mcpp V.2.6.3, V.2.6.4, V.2.7, V.2.7.1, V.2.7.2, respectively. $(DLL_VER) is 0 on any of mcpp V.2.6.3, V.2.6.4, V.2.7, V.2.7.1 and V.2.7.2. If the first digit of $(SHLIB_VER) or $(DLL_VER) is the same, the versions with the higher second or third digit of $(SHLIB_VER) are upper-compatible to the one with lower second or third digit.

On Windows, so-called 'import library' is generated too, which is to use the DLL. In order to use the DLL, you must link your main program against this import library. The static library and the import library are installed into the $(LIBDIR) specified in the makefile, and the DLL itself is installed into the $(BINDIR). Note that any DLL must be located at some of the execution directories specified by the environment variable PATH on Windows.

mcpp_lib.h and mcpp_out.h are installed into $(INCDIR).

main_mcpplib.c is compiled and installed into $(BINDIR) under the name of mcpp, which links libmcpp. On Windows, an option 'DLL_IMPORT=1' specifies to link against DLL.

You can test libmcpp further by compiling testmain.c as a main program and linking it against one of the libraries as follows.

make testmain
make testmain_install

testmain.c also has a sample to pass output via memory buffer. To enable the memory buffer, include the header file 'mcpp_lib.h' in your main program, and use the functions declared in it. The option 'OUT2MEM=1' will enable this in testmain.c. Note that the macro OUT2MEM is only for testmain.c, not for mcpp.

When you use the library-build of mcpp, write your makefile referring to noconfig/*.mak, and write your main program referring to testmain.c.

3.12.3. Static library and shared library or DLL

There are two kinds of library: static and shared. On Windows the latter is called DLL (dynamically-linked library). A static library is a collection of *.o (*.obj) files, which is linked (i.e. copied) to an executable at compile time. All the global names of functions and data in the static library are visible to the executable, and face to danger of name collisions. This is a problem for mcpp, since it had been developed without considering library use until V.2.6.1. On the other hand, a shared library (or a DLL) is linked at run time, and shared by several executables, if any, at the same time.

On Windows, the global names in the DLL are not visible from outside, and only the names explicitly exported can be imported. From the DLL of mcpp, for example, only the names in mcpp_lib.h can be imported.

On UNIXes, the global names in the shared library are all visible from outside by default, hence you have to be sensitive to name collisions. GCC 4.0 and later, however, can cope with this problem. From the shared library of mcpp V.2.7 and later, compiled by GCC V.4.0 or later, only the names in mcpp_lib.h are visible. *1, *2

To sum up, it is recommended to use DLL on Windows and shared library compiled by GCC 4.0 or later on UNIXes, because you need not to worry about name collision on these libraries.

Note:

*1 mcpp V.2.7 and later uses '#pragma GCC visibility *' directive which has been implemented since GCC V.4.0.

*2 Though GCC V.4.1 and later have '-fstack-protector' option, the option does not seem to coexist with '#pragma GCC visibility hidden' directive. So, the option can't be used to compile libmcpp.


4. How to port mcpp to each compiler system: Details

4.1. Setting of noconfig.H, configed.H, system.H

I think you should be able to understand most of what is written in these header files if you read them. I have written lots of comments as well. In case, I write the following note.

noconfig.H (configed.H) contains PART 1 and PART 2 of the settings, and PART 3 is in system.H.

First, select the target system (the system for which mcpp is to be built) and the host system (the system which compiles mcpp.).

Though there is a certain naming convention for SYSTEM and COMPILER, it is easier to see the source code. Though this is overstating it a bit, SYSTEM is only used for the type of path list of include files or to know the standard include directory of the OS, so one does not need to be concerned with it too much.

4.1.1. PART 1: Setting of Target system: for Compiler-specific-build

4.1.1.1. Predefined macros

There are some other macros predefined in system.c according to run-time options, such as CPU-dependent ones. Besides, GCC V.3.3 or later predefines many macros, hence mcpp installation auto-generates specific 4 header files named mcpp_g*.h for those macros.

All the macros predefined by above settings become disabled by the -N option at execution time.

4.1.1.2. Include directories and others

4.1.1.3. The output format of line number information and others

4.1.1.4. Settings corresponding to the system's language specifications

4.1.1.5. Multi-byte characters

The macro called MBCHAR is used to specify the type of encoding for multi-byte characters. In mcpp, all the following encodings are implemented at the same time. MBCHAR only specifies the default encoding, that can be changed by environment variables/options/#pragma at execution time (Refer mcpp-manual.#2.3, mcpp-manual.html#2.8, mcpp-manual.html#3.4 for how to use).

By the way, the behavior of the compiler as regards multi-byte characters may vary depending on the environment at execution time. Set these macros to match your environment. Regarding this, please refer to mcpp-manual.#2.8.

4.1.1.6. Target and host system common settings

The next two are written in PART 2 for convenience. Set these TRUE when both target and host systems have the nominated type, otherwise set to FALSE.

4.1.2. PART 2: Setting of Host system

In noconfig.H and configed.H, the target system is assumed to be the same as the host system. If not, PART 2 needs to be rewritten.

Also in PART 1, there are a few parts which assume the target is the same as the host. Modify it, if required. For example, the line using the predefined macro of the host compiler as:

#if _MSC_VER >= 1200

4.1.3. PART 3: Setting of the mcpp behavior specification

4.1.3.1. Several behavioral modes of new and old

In system.H, there are macro definitions to specify the behavioral specification of mcpp.

There is a variable named 'mcpp_mode' in mcpp source, and the value of this variable determines the frame of mcpp behavior, such as macro expansion method, available preprocessing directives and predefined macros. There are following 4 modes (4 values of variable 'mcpp_mode') in mcpp. The mode of mcpp is specified by the run-time options. Therefore, in compiling mcpp, nothing is required to be set concerning these 4 macros. Nevertheless, you must understand the difference of these behavioral modes in order to set the other macros correctly.
There is another mode called COMPAT which is a variation of STD.

In this document, I group OLD_PREP and KR into pre-Standard mode, and group STD and POST_STD into Standard mode. For the details of the specification of these modes, refer to mcpp-manual.html#2.1.

4.1.3.2. Specifying the details of the behavioral modes

Note:

*1 UCN is a C++98, C99 specification, notation of Unicode character value by hexadecimal escape sequence beginning with \u or \U. (See mcpp-manual.html#3.7, cpp-test.html#2.8, cpp-test.html#4.6).

4.1.3.3. Specifying translation limits

The specification becomes better with bigger sizes for each, but the bigger the size of NWORK, NBUFF, NMACWORK or SBSIZE thus uses more memory. Other than the buffer, the actual memory consumption increases with the number of macro definitions. (Specifically, this is not the actual number of macro definitions themselves, but the total of each macro definition length, which is a problem. The internal format of macro definitions are written as 'struct defbuf' in internal.H)

NMACWORK, NEXP and RESCAN_LIMIT consumes stack.

Other settings do not need much memory, but it may be meaningless in real processing if the values are set to over the default ones within system.H.

The minimal limitations of translation limits required by C90 or C99 are written towards to the end of system.H. The translation limits of the C++98 are also written, but this is not the required specification, unlike the C Standards.


4.2. system.c

Some settings, mainly for the target compiler systems, are written here.

Source code for getopt() and stpcpy() among non-Standard library functions are written here. getopt() is renamed to mcpp_getopt() in order to prevent linking troubles. The stpcpy() is used when HOST_HAVE_STPCPY == FALSE.


4.extra malloc()

"kmmalloc -- malloc() with debugging functions" is a portable source of malloc(), free(), realloc() and calloc() which I wrote. I wrote this to improve the memory efficiency and debugging convenience. I also attach the debug routine. Unexpected bugs can be caught if this is linked. *1, *2

The reason why I provide -DKMMALLOC -D_MEM_DEBUG -DXMALLOC options in noconfig/*.mak, is to link my malloc() which has debug routines. If the mcpp, linked with this, exits with error number EFREEP, EFREEBLK, EALLOCBLK, EFREEWRT or ETRAILWRT, it indicates a mcpp bug.

If you define any of BSD_MALLOC, DB_MALLOC or MALLOC_DBG to 1 and compile mcpp, with each debugging malloc() will be used, not my malloc(). In any case, to use the malloc() other than system library, you have to make the library before you compile. About this, please see the document of kmmalloc. (This document is written in Japanese only, sorry.)

Note:

*1 kmmalloc is at the following location.

http://download.vector.co.jp/pack/dos/prog/se026997.html

*2 In CygWIN, my malloc() cannot be used as other malloc()s are not allowed to be used by the library structure. Also, Visual C 2005 and 2008 have the same kind of problem.

5. Bug reporting and porting report

5.1. Is this a bug?

"The Validation Suite for the Standard C conformance of preprocessing" is also made public with mcpp. I tried to make this be able to verify all the specifications of Standard C preprocessing. Of course, mcpp is checked by this suite. It was also compiled by all the above mentioned compiler systems and verified. Therefore, I don't think there are much bugs or wrong specifications, but there may have been some left. When porting to new compiler systems never ported before, it may be that there are some bugs of the compiler systems.

If you find unusual behavior, please contact me. Please check the following points.

  1. For STD mode, use the Validation Suite first to make sure your understanding of the Standard is correct. For the system with which GCC / testsuite can be used, automatic testing can be done by executing the 'configure' script with options first then executing 'make check'.
  2. Check the document to make sure there are no mistakes in porting your mcpp.
  3. Extract the sample source to reproduce the bug.
  4. Trace the behavior of mcpp by enclosing the place where you get the bug with #pragma MCPP debug <args> and #pragma MCPP end_debug. Increase these <args> and trace in detail.

If the diagnostic message of "Bug: ..." is displayed, that is definitely a bug of the mcpp or compiler systems (more like mcpp). Even if the mcpp goes out of control by processing jumbled "source", that is also a bug.

Of course, mcpp of modes other than STD behave "incorrectly" in the Validation Suite, as that is the specification. (Even that should not run uncontrollably). Please see 4.1.3 for details of the specifications.


5.2. Check for malloc() related bugs

There is a library called kmmalloc which I wrote, with functions such as malloc(). (Refer 4.extra

If mcpp is linked to my malloc() and exits out with the error number 120-124 (or 2120-2124 for some compilers), that is definitely the mcpp or compiler bug. (Possibly the library function's.) Also, if you write,

#pragma MCPP debug memory

somewhere in the sample source used in the test, the information for the heap memory will be output at that location and at the end. If the error message "Heap error: ..." is shown there, then that is also the mcpp or compiler system's bug.

If any bugs are found, please repeat the test by enclosing each part of the sample source by #if 0 and #endif, and mark out where the bug is.


5.3. Bug report

Please attach the following data for the bug report.

  1. The compiler system to which mcpp is ported.
  2. Porting method (the configuration of noconfig.H, etc.)
  3. Sample source to reproduce the problem.
  4. The results.

5.4. Porting report

I tried to write mcpp to be able to be ported relatively easily to any compiler system. However, I only have a small number of the compiler systems. Porting to other compiler systems will require adding some source code. I am looking forward to hearing about the porting reports to those compiler systems. I would like to feedback the reports into source.

Please include the following data in the porting report.

  1. Compiler system.
  2. The configuration of noconfig.H (configed.H), system.H and system.c. Possibly the difference file with the original is best, but just a note is fine for a simple one.

For the compiler-specific-build, to check whether it has been ported correctly, it may be easiest replacing the preprocessor first and then re-compiling mcpp itself by using the pre-preprocess functionality.

Furthermore, use the Validation Suite for STD mode. However, this requires lots of effort when repeating the debug since there are so many files. During the debug, at first, compile 'n_std.c' to see if this compiles and executes correctly. Some compiler drivers attached to the system may not have the option to pass to the mcpp, please refer to mcpp-manual.html#2.2 for that. Alternatively, you can first preprocess with mcpp, then pass the output to the compiler.

If it failed, check manually where the problem is by using the sample n_std.t. If this is a success, check e_std.t, m_*.t, unspcs.t, warns.t and misc.t. In "post-Standard" mode, n_post.t and e_post.t should be used.

Process these with mcpp -QCz23 option (except -3 for post-Standard). If mcpp is compiled with STDC == 0, add -S1 -V199409L option as well. As the comments will also be outputted by the -C option, you should be able to see that the process result is the expected one or not.
As the diagnostic messages are output to the file called mcpp.err by the -Q option, read it using a pager or similar. -z option omits the output of the header files.
Digraph and trigraph becomes valid by -2 or -3. -S1 and -V199409L sets __STDC__ to 1 and __STDC_VERSION__ to 199409L.
To test C99 compatibility, check n_std99.t, e_std99.t with -V199901L option.

If you use the program cpp_test.c in the Validation Suite, you can run the sample test of n_*.c, i_*.c automatically. (This is just to check yes and no, and this doesn't tell the details. Also, other tests such as e_*.?, u_*.?, unspcs.?, warns.? are not included. To test mcpp itself, it is quicker to compile n_std.c.)

Validation Suite has testcases for GCC / testsuite. Therefore, when mcpp is ported to one of the versions of GCC, mcpp's automatic test can be done by replacing the preprocessor of GCC to mcpp, if GCC / testsuite is installed. About this, please see cpp-test.html#3.2.3 and mcpp-manual.html#3.9.7.


5.5. Information about Configure for other compiler systems than GCC

mcpp provides the configure script available in UNIX-like systems. However, I do not have any idea for other compiler systems besides GCC in UNIX systems, so some options need to be specified to configure compiler-specific-build.

Someone who is using these compiler systems should know or be able to check about details of specifying these options. If you know, please let me know. I would like to do further work with the configure script.

Please refer INSTALL for the configure script.


5.6. I will try to port if you send me the data.

When you can't port successfully, please let me know what is happening. If you attach the following data, I may be able to return the ported source.

In environments where the configure can be used, you can find out lots of data through its use.

By the way, from mcpp V.2.6 onward, pre-C90 compiler system is excluded from supporting.

  1. OS and the format of the path list. (I only know UNIX, DOS/Windows and OS-9.)
  2. The compiler system and its version.
  3. The basic character set is ASCII or not. The encoding of multi-byte characters (Kanji characters) is shift JIS or EUC-JP or something else. If the encoding includes the codes such as <backslash> in the multi-byte character like Shift-JIS, whether the compiler-proper recognizes this or not.
  4. The shell (command processor) is case sensitive or not.
  5. The file name is case sensitive or not.
  6. The execution options which one wants to implement. The option passed from the compiler driver. The options when running by preprocessor alone. (One that cannot be implemented by getopt() is impossible.)
  7. Whether the preprocessor is separated or built-in in the compiler.
  8. The predefined macros of the compiler system and their values. How it goes for C++. (Distinguish between the macro passed from compiler driver by some options such as -D or the predefined macros of the preprocessor itself.)
  9. Is there the data type long long? If there is long long, what is its length modifier for printf(). If there isn't long long, is there the same size type?
  10. The argument of #pragma line is subject to the macro expansion?
  11. What kind of name should be used for the environment variables to specify the include directory. What separator should be used for writing the multiple path in the environment variables.
  12. Include directory for standard use. The rule when searching the header file by #include.
  13. Is any necessary function missing from libraries?
  14. Does the compiler proper recognize digraphs?
  15. '$' needs to be used in an identifier?
  16. Are there #asm and #endasm? How about the passing format of the block enclosed by these directives to the compiler proper? What are the other non-standard directives?
  17. Which #pragma sub-directive should be processed by preprocessor?
  18. How long is maximum length to be received by the compiler proper? (You can find out by compiling test_l/l_37_8.c in the Validation Suite.)
  19. How many bytes can be identified for the identifier in the compiler proper?
  20. After compiling, what is the suffix of "object file" before the link? (equivalent to .o of the compiler systems on UNIX or .obj of the systems on Windows.)
  21. The result of the following sample t_line.c processed only by the preprocessor. (Use separated preprocessor or specify the output after preprocessing by option.) This is to see the method of passing the line number and file name information to the compiler proper. As the contents of <stdio.h> are too long, it is enough with the first 10-20 lines and the last 10-20 lines.
    Also, for the compiler systems, which the processed results of #line 1000 does not become #line 1000 "t_line.c", but other formats such as #1000 "t_line.c", modify this to #line 1000 "t_line.c" and pass through to the compiler proper. Once it has been passed, check to see if this can be recognized or not. (If it does not error out by #line 1000 "t_line.c", it should have an error message in the line of the "error line;". Check to see how the line number displays in the error message.)
/* t_line.c */
#include    <stdio.h>

#line 1000

    error line;

main(void)
{
    return  0;
}

If the host compiler and the target compiler are different, I need all the above data for both systems.

To look at it like this, there are so many things to check, but practically, most of the compiler systems should have common characteristics with the ones already successfully ported, so it should not have too many problems to port for just running. The implementations of the execution options, #pragma and the non-standard specification will be the relatively time consuming ones. These can be done gradually after porting just to be able to run. The only annoying aspects are when one gets caught by compiler bugs.


5.7. Please report the test of other compiler systems by the Validation Suite.

The Validation Suite results of preprocessors for the compiler systems I have are summarized in cpp-test.#6.

Please let me know the result of testing with other compiler systems. It may be a bit of effort, as there are so many items.

The test by cpp_test.c does not take long, please send me this. In case of GCC, the automatic test can be done by the Validation Suite.


5.8. The feedback for improvement

Besides reporting bugs, please send me feedback for anything, such as the handiness of mcpp, diagnostic messages, source code, Validation Suite, my interpretation of Standard C or the document writing method.

This preprocessor was created as a hobby, but it was the result of having devoted six and a half years, with lots of ideas even up until V.2.0. I want to make this the best, as much as I can, after such a work. About the C preprocessor, I think I have done almost everything meaningful, except testing and porting to the compiler systems I don't have. I would like to improve it if there are any problems that exist.

The code of Martin Minow was very clear, viceless and easy to understand, and I learned a lot by just reading this source code.

The people who are interested in this field may be very limited, but I am looking forward the feedback and the information.

Please send the information and the feedback to "Open Discussion Forum" at:

http://mcpp.sourceforge.net/

or by e-mail.


6. Long way to mcpp

6.1. Three days to plan and six years to develop

When I started messing about with DECUS cpp in Jan 1992, I had never even dreamed to take this long a stretch. I just thought I would change it a bit in the new years break.

Once I started, I realized I had to read the source properly and it took me about two months to read through. I did it because the source was worth reading as well. Then I revised some of the specification to adapt to C90. It was as planned till this point.

Then, I realized I did not really know the preprocessor specification of C90 precisely. When I read P. J. Plauger & Jim Brodie "Standard C" (1989), the function-like macro expansion methods turned my prejudice around completely. (A Japanese translation version of this part was miss-translated.) So I bought a copy of Standard C and I repeatedly read those difficult sentences related to preprocessing. As a result, I found the preprocessing of C90 is different in many points from the traditional one. The addition of #, ## operators are only a small part of them.

Significantly, I puzzled my brain about the function-like macro expansion routine. I thought it over for 2-3 weeks consulting the cpp source of E. Ream, and then I wrote the new macro expansion routine for C90. I have never used my brain so hard as for thinking the algorithm of the program. That was April, 1992.

Well, I thought I was over the hump and that the cpp playing was finished, but it took almost a further six years since then. There were not many problems that made me suffer during the rest. Nevertheless, it took so long. That was partly because I got bored thinking and couldn't concentrate on messing around with cpp. But that wasn't all. I did the following things.

  1. Made the specification clearer. In Standard mode, completely adapted to the standard.
  2. Re-structured the program/data structures to focus on the Standard C mode.
  3. Changed the style of the source to improve portability.
  4. To do debugging. Dealt with bugs or imperfections of the compiler systems.
  5. Created the test programs which is the Validation Suite.
  6. Tested other compiler systems.
  7. Wrote documentation.
  8. As I bought a new PC in July 1997, I spent the time for the installation and learning of WindowsNT/95, X Window System and their software. While doing that, C99-1997/11-draft had been released and it required adaptation to this.

In this list, the documentation took a long time. Especially the last four years, the time changing the source was only a little bit while most of the time was dominated by writing the documentation. Due to that, the documentation became such a volume, but the time taken was not only because of the volume. When I was writing the documents, the uncertain parts of the specification kept coming up. Each time I re-read the Standards, I revised the source code. The length of time revising the source was not a lot, but the number of times revising the source was a lot. Not only the preprocess specifications, but I also read well whole of the Standard including the Rationale of ANSI C. It's like I learned C90 by creating the preprocessor. Also, I could understand the problems of the C90 standard through this.

At first, I wrote a few test programs as samples. However, I found unexpected bugs each time I wrote samples and tested on mcpp. Then I decided to write the Validation Suite which would test every specification of the C90 preprocess. The problems of C90 became obvious by writing this Validation Suite. To comply to the irregular parts of C90 was such trouble and a bit meaningless for myself, but I am sure there were more meaningful things.

What I learned through this work are the following things.

  1. The program specification cannot be definite until finishing off the detailed document.
  2. The debugging of the program cannot be completed until completion of the samples which test every specification.

This thinking is a sort of perfectionism. Things in the world mostly cannot be achieved by perfectionism, and software is not an exception. Nevertheless, there are some areas for which perfectionism has a very important role. The language processing systems may be one of them.

I can say that I could spend so many years, through and through, because this was my hobby. But six and half years was too long. I kept thinking about who would be going to use this after I spent so many years to create a perfect program. I think this must be the limit of the size for making a program as a hobby.

Anyway, as I have already done mcpp, I will keep maintaining it. Therefore, could everyone please send me feedback, bug reports or porting reports.


6.2. V.2.3

After releasing mcpp V.2.0, I updated to V.2.1, V.2.2 and then V.2.3. These updates were adapting to C99 or officially approved ISO / C++, increasing the supported systems or fixing bugs.

I could update quite easily until V.2.2. It only took three months from V.2.0 to V.2.2. In contrast, it took nearly four years from V.2.2 to V.2.3. The main reason was that I became busy and didn't have enough time to spend. I cut down my jobs to 4 days a week after turning to 60 years of age in July 2000, then I went back to playing with cpp again.

V.2.3 not only took time but took quite a lot of work as well. When I ported to GCC V.2.9x, I found out that I had to modify a lot to keep the compatibility with GCC/cpp. I added many options and implemented the extended specifications. Also I eased restrictions of the Standard by downgrading some errors to warnings or removing the highly frequent warnings from the default warning class.

Lots of those modifications are backward ones and were not enjoyable. Especially, maintaining both the C99 specification and the part of the "traditional" specification earlier than C90 was very much against my will. Unfortunately, this is a reality of the open source world, I had to meet to certain expectations.

By relaxing the restrictions of the standard, I think mcpp became easier to use also for the other compiler systems, in replacing the system resident preprocessor.


6.3. Selected to "Exploratory Software Project"

During the update to V.2.3, mcpp and Validation Suite was selected to 2002 "Exploratory Software Project" of Information-technology Promotion Agency, Japan (IPA). I found out about this project by chance and I entered. Then, the project manager Yutaka Niibe selected me. That is how the development went from July 2002 to Feb 2003 by IPA's funding and based on PM Niibe's advice. The translation of the documents is also taken by HighWell.

Though this was relatively small software, it became a kind of my life work after spending so much time. I had confidence with the quality, but I was disappointed without having an opportunity to be known to the world. Finally, the opportunity was given. To accomplish this project, I cut down my job to three days a week.

These were the things that I had intended to do in this project.

  1. Create English version of the documents. By using these, release mcpp and Validation Suite to the international sites. In the current situation of most C compiler systems being made outside Japan, it is vital to have English versions of the documents to spread and get evaluations for this.
  2. Increase the compiler systems to support, especially the major commercial compiler systems, as well as the later versions of the compiler systems which have already been supported.

Then, Project Manager Niibe proposed the following points:

  1. Support GCC 3.x and make the Validation Suite to be able to be used in testsuite of GCC.
  2. Make everything public during the development. Adopt standard methods of sharing development and sharing the result, in order to ease sharing.

As I wanted to do these things too, I gratefully added these points to the project.

Actually, however, my project had delay after delay for various reasons. First, I was hit by a disc crash. Whenever I did new things, it took a long time as I had to use new software never used before. It was also the first time to compile GCC from the source, but also I had got a few problems. The updating of massive volumes of documents and the review and the correction of English version also took a considerable time. Furthermore, my mother was admitted to hospital. As a result, a part of the project, such as the support of the commercial compiler systems, had to be given up at the end.

As I had always done the way which is like digging a hole deeper and deeper, it took a long time when I had to try to widen the hole. When an amateur-programmer digs deeper into the matter, this is the only way to do it. Nevertheless, to make the result to go out into the world, the hole had to be widened to some extent.

During the process of widening up the hole, I managed to learn some new software and to be in the frontline of development while receiving the advice and the encouragements from Project Manager Niibe. Also, I was delighted to see my documents coming back in a flowing English. Though being pressed for time was a painful thing, each experience was fresh and fun.

This "Exploratory Software Project" did not finish there. Project Manager Ichiji also selected mcpp as a continual project for year 2003. This is how I started to do some unfinished tasks from the previous year, and also some areas which I did not have experience of before.

This time, my six year old PC experienced some troubles, and there were also further troubles during the upgrade of the hardware and OS. It also took time to learn the new software, and of course, the development was getting behind schedule. The condition of my mother, who had been out of hospital and in relatively good condition, became worse along with getting closer to the end of the project. This was also a source of my anxiety. (My mother died in February, 2004.) However, thanks to Project Manager Ichiji setting the due date to a reasonable time frame, I could work the tasks through thoroughly without rushing.

I accomplished tasks such as the porting to Visual C++, the creation of the configure script and supporting the various multi-byte character encodings. I also managed to do the clean-up of the source code which, though inconspicuous, can not be ignored by myself as the author. The time consuming work of updating the Japanese and English documents was accomplished with the co-operation of HighWell.

With these achievements, I was evaluated as one of the "super-creator"s of software by PM Ichiji! Though it may be overestimation for my ability, I think it is mcpp development over years that was recognized, and I am very glad.

I think mcpp has become the world's best quality C/C++ preprocessor, thanks to the "Exploratory Software Project" which took nearly two years. As a middle-aged amateur-programmer, I am satisfied with myself having done my best.

I am keeping on updates of mcpp even after the project. Many tasks are still to be done. To achieve the remaining tasks and to make mcpp widely known, I will continue to proceed steadily.

mcpp-2.7.2/doc/mcpp-manual.html0000644000175000017500000142341611113265634013264 00000000000000

MCPP-MANUAL

== How to Use MCPP ==

for V.2.7.2 (2008/11)
Kiyoshi Matsui (kmatsui@t3.rim.or.jp)

Contents

1. Overview
1.1. High Portability
1.2. Standard C Mode with Highest Conformance and Other Modes
1.3. Notations in this Manual

2. Invocation Options and Environment Settings
2.1. Two Kinds of Build and Five Behavioral Modes
2.2. How to Specify Invocation Options
2.3. Common Options
2.4. Options by mcpp Behavioral Modes
2.5. Common Options Except for Some Compiler Systems
2.6. Options by Compiler System
2.7. Environment Variables
2.8. Multi-Byte Character Encodings
2.9. How to Use mcpp in One-Pass Compilers
2.10. How to Use mcpp in IDE
2.10.1. How to Make mcpp available in Visual C++ IDE
2.10.2. How to Make mcpp available in Mac OS X / Xcode.app

3. Enhancement and Compatibility
3.1. #pragma MCPP put_defines, #pragma MCPP preprocess and others
3.1.1. Pre-preprocessing of Header File
3.2. #pragma once
3.2.1. Tool to Write #pragma once to Header Files
3.3. #pragma MCPP warning, #include_next, #warning
3.4. #pragma MCPP push_macro, #pragma __setlocale and others
3.5. #pragma MCPP debug, #pragma MCPP end_debug, #debug, #end_debug
3.5.1. #pragma MCPP debug path, #debug path
3.5.2. #pragma MCPP debug token, #debug token
3.5.3. #pragma MCPP debug expand, #debug expand
3.5.4. #pragma MCPP debug if, #debug if
3.5.5. #pragma MCPP debug expression, #debug expression
3.5.6. #pragma MCPP debug getc, #debug getc
3.5.7. #pragma MCPP debug memory, #debug memory
3.5.8. #pragma MCPP debug macro_call
3.6. #assert, #asm, #endasm
3.7. New C99 Features (_Pragma() operator, Variadic Macro and others)
3.8. Particular specifications for certain compiler system
3.8.1. Variadic macro of GCC and Visual C
3.8.2. Handling of 'defined' by GCC
3.8.3. Asm Statement in Borland C and Other Special Syntaxes
3.8.4. #import and Others
3.9. Problems of GCC and Compatibility with GCC
3.9.1. Preprocessing FreeBSD 2/Kernel Sources
3.9.2. Preprocessing FreeBSD 2/Libc
3.9.3. Problems Concerning GCC 2/cpp
3.9.4. Preprocessing Linux/glibc 2.1
3.9.5. To Use mcpp with GCC 2
3.9.5.1. To Sort mcpp's Warnings
3.9.6. Preprocessing GCC 3.2 Source
3.9.7. To Use mcpp with GCC 3 or 4
3.9.8. Preprocessing Linux/glibc 2.4
3.9.9. The Problems of Linux / stddef.h, limits.h and #include_next
3.9.10. Problems of Mac OS X / Apple-GCC and its System Headers
3.9.11. Preprocessing firefox 3.0b3pre
3.10. Visual C++ System Header Problems
3.10.1. Comment Generating Macro?
3.10.2. '$' in Identifiers

4. Implementation-defined Behaviors
4.1. Status Value on Exit
4.2. Include Directory Search Path
4.3. How to Construct Header Name
4.4. Evaluation of #if Expression
4.5. Character Constant Evaluation in #if Expression
4.6. #if sizeof (type)
4.7. How to Handle White-Space Sequence
4.8. Default Specifications for mcpp Executables

5. Diagnostic Messages
5.1. Diagnostic Messages Format
5.2. Translation Limits
5.3. Fatal Errors
5.3.1. mcpp's Own Bugs
5.3.2. Physical Errors
5.3.3. Translation Limits and Internal Buffer Errors
5.3.4. #pragma MCPP preprocessed Related Errors
5.4. Errors
5.4.1. Character and Token Related Errors
5.4.2. Unterminated Source File Related Errors
5.4.3. Ill-Balanced Preprocessing Group Related Errors
5.4.4. Simple Syntax Errors on Directive Lines
5.4.5. Syntax Errors in #if Expressions
5.4.6. #if Expression Evaluation Errors
5.4.7. #define Related Errors
5.4.8. #undef Related Errors
5.4.9. Macro Expansion Errors
5.4.10. #error and #assert
5.4.11. Failure of #include
5.4.12. Other Errors
5.5. Warnings (Class 1)
5.5.1. Character, Token and Comment Related Warnings
5.5.2. Unterminated Source File Related Warnings
5.5.3. Directive Line Related Warnings
5.5.4. #if Expression Related Warnings
5.5.5. Macro Expansion Related Warnings
5.5.6. Line Number Related Warnings
5.5.7. #pragma MCPP warning, #warning
5.6. Warnings (Class 2)
5.7. Warnings (Class 4)
5.8. Warnings (Class 8)
5.9. Warnings (Class 16)
5.10. Diagnostic Messages Index

6. Reporting on Bugs and Others

1. Overview

mcpp is a C preprocessor developed by kmatsui (Kiyoshi Matsui) based on DECUS cpp written by Martin Minow, and then rewritten entirely. mcpp means Matsui cpp. This software is supplied as source codes, and to use mcpp in any compiler systems, a small amount of modifications to adapt to the compiler system are required before it can be compiled into an executable. *1

This document describes the specification for mcpp executables that has been already ported to certain compiler systems. For those who want to know more about mcpp or want to port it to other compiler systems, refer to mcpp source and its document mcpp-porting.html.

All these sources and related documents are provided as an open-source-software.

Before going into detail, some of the mcpp features are introduced here.

Note:

*1 mcpp V.2.6.3 onward provides some binary packages too, at the following site.

http://mcpp.sourceforge.net/


1.1. High portability

mcpp is a portable preprocessor, supporting various operating systems, including Linux, FreeBSD and Windows. Its source has a wide portability, and can be compiled by any compilers which support Standard C or C++ (ANSI/ISO C or C++). The library functions used are only the classic ones.

To port mcpp to each compiler system, in many cases, one only needs to change some macro definitions in the header files and simply compile it. In the worst case, adding several dozen of lines into a source file would be enough.

To process multi-byte characters (Kanji), it supports Japanese EUC-JP, shift-JIS and ISO2022-JP, Chinese GB-2312, Taiwanese Big-5 and Korean KSC-5601 (KSX 1001), as well as UTF-8. For shift-JIS, ISO2022-JP or Big-5, mcpp can complement the compiler-proper if it does not recognize them.


1.2. Standard C mode with highest conformance and other modes

mcpp has various behavioral modes. Other than Standard-conforming mode, there are K&R 1st mode, "Reiser" cpp mode and what I call post-Standard mode. mcpp has also an execution option for C++ preprocessor.

Different from many existing preprocessors, Standard mode of mcpp has the highest conformance to Standards: all of C90, C99 and C++98. It has been developed aiming to become the reference model of the Standard C preprocessor. Those versions of the Standard can be specified by an execution option. *1

In addition, it provides several useful enhancements: '#pragma MCPP debug', which traces the process of macro expansion or #if expression evaluation, and the header file "pre-preprocessing" facility.

mcpp also provides several useful execution options, such as warning level or include directory specification options.

Even if there are any mistakes in the source, mcpp deals suitably with accurate plain diagnostic messages without running out of control or displaying misguiding error messages. It also displays warnings for portability problems. The detailed documents are also attached.

In spite of its high quality, mcpp's code size and memory usage is relatively small.

A disadvantage of mcpp, if any, is slower processing speed. It takes two or three times time of GCC 3.*, 4.* / cc1, but seeing that its processing speed is almost the same as that of Borland C 5.5/cpp32 and that it runs a little bit faster when the header file pre-preprocessing facility is used, it cannot be described as particularly slow. mcpp puts an emphasis on standard conformance, source portability and operability in a small memory space, making this level of processing speed inevitable.

Validation Suite for Standard C Preprocessing, which is used to test the extent to which a preprocessor conforms to Standard C, its documentation cpp-test.html, which contains results of applying Validation Suite to various preprocessors, are also released with mcpp. When looking through this file, you will notice that so-called Standard-conforming preprocessors have so many conformance-related problems.

During the course of developing mcpp V.2.3, it was selected as one of the "Exploratory Software Projects for 2002" by Information-technology Promotion Agency (IPA), Japan, along with its Validation Suite. From July 2002 to February 2003, the project, financed by IPA, proceeded under advice of Yutaka Niibe project manager. I asked "HighWell, Inc." Limited Company, Tokyo, for translation of all the documents. For technical details, I revised and corrected the translated documents.

mcpp was continuously adopted to one of the "Exploratory Software Projects" in 2003 by Hiroshi Ichiji project manager. The update of mcpp proceeded into the next version, V.2.4. *2

After the project, I am still going on updating mcpp and Validation Suite.

Note:

*1 ISO/IEC 9899:1990 (JIS X 3010-1993) had been used as C Standard, but in 1999, ISO/IEC 9899:1999 was adopted as a new Standard. This document calls the former C90 and latter C99. The former is generally called ANSI C or C89 because it migrated from ANSI X3.159-1989. ISO/IEC 9899:1990 + Amendment 1995 is sometimes called C95. C++ Standards are ISO/IEC 14882:1998 and its corrigendum version ISO/IEC 14882:2003. This document calls both of them C++98.

*2 The outline of the "Exploratory Software Project" can be seen at the following site (Japanese only).

http://www.ipa.go.jp/jinzai/esp/

mcpp from V.2.3 through V.2.5 had been located at:

http://www.m17n.org/mcpp/

In April 2006, mcpp project moved to:

http://mcpp.sourceforge.net/

The old version of mcpp, cpp V.2.2 and Validation Suite V.1.2 are located in the following Vector's web site. They are in the directory called dos/prog/c, but they are not for MS-DOS exclusively. Sources are for UNIX, WIN32, MS-DOS. The documents are Japanese only.

http://www.vector.co.jp/soft/dos/prog/se081188.html
http://www.vector.co.jp/soft/dos/prog/se081189.html
http://www.vector.co.jp/soft/dos/prog/se081186.html

The text files in these archive files available at Vector use [CR]+[LF] as a <newline> and encode Kanji in shift-JIS for DOS/Windows. On the other hand, those from V.2.3 through V.2.5 available at SourceForge use [LF] as a <newline> and encode Kanji in EUC-JP for UNIX. From V.2.6 on two types of archive, .tar.gz file with [LF]/EUC-JP and .zip file with [CR]+[LF]/shift-JIS, are provided.


1.3. Notations in this Manual

Though this manual was text-file in the older versions, it has changed to html-file at V.2.6.2.
This manual uses the following typographical conventions:


2. Invocation Options and Environment Settings

2.1. Two Kinds of Build and Five Behavioral Modes

There are two types of build (or compiling configuration) for mcpp executable. *1, *2

  1. Compiler-independent-build: the preprocessor which behaves on its own not depending on compiler system. The invocation options of compiler-independent-build are the same across the compilers with which mcpp is compiled. Although it can preprocess source files, it cannot behave as an integrated part of a compiler system.
  2. Compiler-specific-build: the preprocessor to replace the resident preprocessor of certain compiler system, if possible. Each compiler-specific-build has some different specifications for compatibility with the compiler system. It has the options common with the compiler-independent-build, except a few options different from the commons to avoid conflict with the compiler system.

Each mcpp executable has following 5 behavioral modes regardless of the building types.

  1. STD: Standards (C90, C99, C++98) conforming mode. This is the default.
  2. COMPAT: A variation of STD mode, which expands recursive macro more than the Standards' specification.
  3. POSTSTD: Special "post-Standard" mode created by the author, based on the Standards and simplified removing all the Standards irregular specifications.
  4. KR: K&R 1st specification mode.
  5. OLDPREP: "Reiser" model cpp mode (old-preprocessor mode).

The mode of mcpp is specified by the run-time options as follows:

In this document, I group OLDPREP and KR into pre-Standard modes, and group STD, COMPAT and POSTSTD into Standard modes. Since COMPAT mode is almost the same with STD mode, STD includes COMPAT unless otherwise mentioned. *3

There are differences in the macro expansion methods between Standard and pre-Standard modes. Roughly speaking, this difference is the difference between C90 and pre-C90. The biggest difference is the expansion of the function-like macros (macros with arguments). For the arguments with macros, while in Standard mode, mcpp substitutes the parameter within the replacement list of the original macro after completely expanding the arguments, in pre-Standard, mcpp substitutes the parameter without expanding, then expands the argument at rescan time.

Also, in Standard mode, a macro is not expanded recursively in principle, even if the macro definition is recursive directly or indirectly. If there is a recursive macro definition in pre-Standard mode, it causes infinite recursion and becomes an error at expansion time.

Handling of \ at line end is also different by mode. In Standard mode, after processing the trigraph, the sequence of <backslash><newline> gets deleted before tokenization, but in pre-Standard mode, these only get deleted when they are within the string literals or in a #define line.

There is a subtle difference in tokenization (token parsing, decomposition to tokens). In Standard mode, it tokenizes on "token based processing" principle. To put it concretely, in Standard mode, spaces will be inserted surrounding the expanded macro to prevent the unexpected merging with its adjacent tokens. In pre-Standard mode, traditional, convenient and tacit tokenization and the macro expansion methods of "character based text replacement" are left a trace. About these, please see cpp-test.html#2.

In Standard mode, it handles the numeric token, called preprocessing number, according to the Standard specification. In pre-Standard, the numeric tokens are the same as integer constant tokens or floating point tokens. The suffix 'U', 'u', 'LL' and 'll' of the integer constant and the suffixes 'F', 'f', 'L' and 'l' of floating point are not recognized as a part of the tokens in pre-Standard.

The string literals and character constants of wide characters are recognized as single tokens only in Standard mode.

Digraph, #error, #pragma, and _Pragma() operator are available only in Standard mode. Also, -S <n> option (strict-ansi specs) and -+ option (the one run as C++ preprocessor) are used only in Standard mode. Pre-defined macros __STDC__, __STDC_VERSION__ are defined in Standard mode, and they don't get defined in pre-Standard.

#if defined, #elif cannot be used in pre-Standard mode. Macros cannot be used within argument of #include or #line in pre-Standard. Predefined macros, __FILE__, __LINE__, __DATE__, __TIME__ are not defined at pre-Standard.

On the other hand, #assert, #asm (#endasm), #put_defines and #debug are available in pre-Standard mode only.

#if expression is evaluated in long / unsigned long or long long / unsigned long long at Standard mode, and in (signed) long only at pre-Standard. sizeof (type) in #if expression can be used only in pre-Standard.

Trigraphs and UCN (universal character name) are available only in STD mode.

The output of diagnostic messages is also slightly different between the modes. Please see chapter 5 for details.

Any other items, which do not have any distinct rules between K&R 1st and the Standards, follow the C90 rules in pre-Standard mode.

The difference of OLDPREP mode from KR mode and the difference of POSTSTD and COMPAT modes from STD mode are as follows:

Moreover, there is a mode called lang-asm. That is a mode to process anomalous sources which are assembler sources and nevertheless have comments, directives and macros of C embedded. While POST_STD cannot become this mode, STD, KR and OLD get to this mode when specified by an option. See 2.5 for its specifications.

For the above reasons, there are some different specifications in mcpp executables. So, please read this manual carefully. This chapter describes first the common options, next the behavioral-mode-dependent options, then the the options common to most compiler systems, finally the compiler-dependent options for each compiler-specific-build.

Note:

*1 There is another one named subroutine-build which is called as a subroutine from some other main program. The behavioral specification of subroutine-build is, however, the same with either of compiler-specific-build or compiler-independent-build according to its compile time setting. Hence, this manual does not mention subroutine-build particularly. As for subroutine-build, refer to mcpp-porting.html#3.12.

*2 The binary packages provided at the SourceForge site are of compiler-independent-builds.

*3 mcpp had two separate executables for Standard mode and pre-Standard mode; they were integrated into one at V.2.6.

*4 This option is for compatibility with GCC, Visual C++ and other major implementations. 'compat' means "compatible mode".


2.2. How to Specify Invocation Options

The <arg> and [arg] shown below indicate required and optional arguments respectively. Note that the <, >, [, or ] character itself must not be entered.

mcpp invocation takes a form of:

mcpp [-<opts> [-<opts>]] [in_file] [out_file] [-<opts> [-<opts>]]

Note that you have to replace the above "mcpp" with other name, depending on how mcpp is installed.

When out_file (an output path) is omitted, stdout is used unless the -o option is specified. When in_file (an input path) is omitted, stdin is used. A diagnostic message is output to stderr unless the -Q option is specified.

If any of these files cannot be opened, preprocessing is terminated, issuing an error message.

For an option with argument, white-space characters may or may not be inserted between the option character and an argument. In other words, both of "-I<arg>" and "-I <arg>" are acceptable. For options without argument, both of "-Qi" and "-Q -i" are valid.

For an option with an argument, missing a required argument causes an error except for the -M option,

If -D, -U, -I, or -W option is specified multiple times, each of them is valid. For -S, -V, or -+ option, only the first one is valid. For -2, or -3 option, its specification switches each time an option is specified. For other options, the last one is valid.

The option letters are case sensitive.

The switch character is '-', not '/', even under Windows.

When invalid options are specified, a usage statement is displayed. To check valid options, enter a command, such as "mcpp -?". In addition to the usage message, there are several error messages, but they are self-explanatory. I will omit their explanations.


2.3. Common Options

This section covers common options across mcpp modes or compiler systems.

The -M* options are to output source file dependency lines for makefile. When there are several source files and the -M* option is specified for each of these source files to process and merge the outputs into a file, dependency description lines are aligned. These options are similar to those of GCC, but there are several differences. *1

Note:

*1 mcpp differs from GCC in that:

  1. mcpp does not provide the -MG option because its option specification is too complicated. (Therefore, I will omit its explanation.) The -M option can substitute for the -MG option because when include files cannot be found using the -M option, mcpp fails but outputs dependency description lines.
  2. mcpp, other than GCC-specific-build, excludes a wider range of header files when using the -MM and -MMD options.

2.4. Options by mcpp Behavioral Modes

mcpp has several behavioral modes. For their specifications refer to sec 2.1.

This manual shows a list of various mcpp behaviors by mode, which may not be readable. Please be patient. In this manual, all the uppercased names that do not begin with "__" and displayed in italics, such as DIGRAPHS_INIT, TRUE, FALSE, etc, are macros defined in system.H. These macros are only used for compiling mcpp itself and a mcpp executable generated does not predefine these macros. You must understand this point clearly.

The following options are available in Standard mode:

The following option is available for STD mode:

Note:

*1 C++'s __STDC__ is not desirable and causes many problems. GCC document says that __STDC__ needs to be predefined in C++ because many header files expect __STDC__ to be defined. The header files should be blamed for this. For common parts among C90, C99 and C++, "#if __STDC__ || __cplusplus" should be used.

*2 Different from C99, the C++ Standard makes much of UCN. So did C 1997/11 draft. Half-hearted implementation is not permitted. However, implementing Unicode in earnest is too much burden for preprocessor.

*3 In C90 mcpp treats // as a comment but issues a warning.

*4 This is for compatibility with GCC.

*5 If you install GCC-specific-mcpp, cc1 (cc1plus) is set to be handed from mcpp preprocessed file with -fpreprocessed option. Though this option means that the input is already preprocessed, cc1 still processes comment. Therefore, you can safely pass output of -K to cc1 with -fpreprocessed. Furthermore, if you add -save-temps option to gcc (g++) command, preprocessed output is left as *.i (*.ii) file, and you can read it by some refactoring tool.

*6 Comment insertion by -K option causes column shifts in sources, and this makes *.S file of GCC, which is not C/C++ source and compiled with -x assembler-with-cpp option, unable to be assembled. Also comments kept by -C option are sometimes confusing with that inserted by -K option. Therefore these options cannot be used at the same time.

*7 This option fails to keep column position on some particularly complex cases. When line splicing by a <backslash><newline> and line splicing by a line-crossing comment are intermingled on one output line, or a comment crosses over 256 lines, column position will be lost. Note that each '\v' and '\f' is converted to a space with or without this option.


2.5. Common Options Except for Some Compiler Systems

The following 2 options can be used on UNIX-like systems, for either of compiler-independent-build and GCC-specific-build. On GCC-specific-build, however, these will get an error if the GCC does not support them.

Since GCC has so many options that GCC-specific-build of mcpp has some different options from the other builds in order to avoid conflicts with GCC. Note that the options in compiler-independent-build are all the same even if compiled by GCC. The options common to the builds other than GCC-specific are as follows.


2.6. Options by Compiler System

To use mcpp replacing the compiler system's resident preprocessor, install it in the directory where the resident preprocessor is located under an appropriate name. Before copying mcpp, be sure to change the name of resident preprocessor so that it may not be overwritten.

For settings on Linux, FreeBSD, or CygWIN see 3.9.5. For settings in GCC 3.*, 4.*, see also 3.9.7, and 3.9.7.1. For MinGW, see 3.9.7.1.

Possibly the compiler driver cannot pass some options to mcpp in a normal manner. However, GCC provides the -Wp almighty option to allow you to pass any options to the preprocessor. For example, if you specify as follows:

gcc -Wp,-W31,-Q23

The -W31 and -Q23 options are passed to preprocessor. The options you want to pass to preprocessor have to be specified following -Wp with each option delimited by ", ". *1, *2

For other compiler systems, if their compiler driver source is available, it is recommended that this type of an almighty option should be added to the source. If you modify the compiler driver source code in the way that, for example, when -P<opt> is specified, only -<opt> is passed to preprocessor, it would be very convenient because any options can be passed.

An alternative way to use all the options of mcpp is to write a makefile in which first preprocess with mcpp, then compile the output file of mcpp as a source file. For this method, refer to sections 2.9 and 2.10.

The following options are available for some compiler-specific-builds. The compiler-independent-build has not these options, of course.

The following options are available for the LCC-Win32-specific-build.

The following options are available for the Visual C-specific-build.

mcpp on Mac OS X accepts the following option, on both of GCC-specific-build and compiler-independent-build.

mcpp on Mac OS X accepts the following option on GCC-specific-build.

The following options (until at the end of this 2.6 section) are available for the GCC-specific-build. Note that since __STDC__ is set to 1 for GCC, the result is same with or without the -S1 option.

The followings are available across the modes.

The following options are available for Standard mode.

For STD mode, following options are available. (These cannot be used in POSTSTD mode.)

The following option is available for pre-Standard mode of GCC-specific-build.

The next option is available on CygWIN GCC-specific-build.

mcpp neither makes the following options an error nor does anything about them. (It sometime issues a warning.)

In GCC V.3.3 or later, preprocessor has been absorbed into compiler, and independent preprocessor does not exist. Moreover, gcc often passes to preprocessor the options not for preprocessor, even if it is invoked with -no-integrated-cpp option. GCC-specific-build of mcpp for V.3.3 or later ignores the following options, if it cannot recognize them, as that kind of false options.

Note:

*1 -Wa and -Wl are almighty options for assembler and linker, respectively. The documentation on UNIX/System V/cc describes these options. Probably, GCC provides the -W<x> option for compatibility.

*2 In GCC V.3, cpp was absorbed into cc1 (cc1plus). Therefore, the options specified with -Wp are normally passed to cc1 (cc1plus). To have cpp (cpp0), not ccl, preprocess, the -no-integrated-cpp option must be specified on gcc invocation.

*3 GCC V.3.3 or later predefines several dozen of macros. -dD option does not regard these macros as predefined and output them.

*4 The output of -dM option is similar to that of '#pragma MCPP put_defines' ('#put_defines') with the following differences:

  1. 'put_defines' outputs also Standard predefined macros as comments.
  2. 'put_defines' outputs also the file name and the line number of the macro definition as a comment, arranging to readable format. On the other hand, -d* options output in the same simple format with GCC, because some makefiles expect that format.

*5 Refer 3.9.6.3.


2.7. Environment Variables

In compiler-independent-build of mcpp, the include directories are not set up other than /usr/include and /usr/local/include in UNIX systems. Other directories, if required, must be specified using environment variables or runtime options. The environment variable in compiler-independent-build is INCLUDE for C and CPLUS_INCLUDE for C++. Searching the file starts from the includer's source directory by default. (refer to 4.2 for the search rule.) Besides, in Linux there is a confusion of include directories, hence special setup is necessary to cope with this problem. Refer to 3.9.9 for the problem.

For the default include directories on GCC-specific-build, refer to noconfig/*.dif files, and for search rule and environment variable name, refer to 4.2.

For the environment variable LC_ALL, LC_CTYPE, LANG, refer to 2.8.


2.8. Multi-Byte Character Encodings

mcpp can process various multi-byte character encodings as follows.

EUC-JP Japanese extended UNIX code (UJIS)
shift-JIS Japanese MS-Kanji
GB-2312 EUC-like Chinese encoding (Simplified Chinese)
Big-Five Taiwanese encoding (Traditional Chinese)
KSC-5601 EUC-like Korean encoding (KSX 1001)
ISO-2022-JP1International standard Japanese
UTF-8 A kind of Unicode encoding

The encoding used during execution can be specified as follows (Priority is given in this order):

  1. The encoding specified in '#pragma __setlocale( "<encoding>")' in source code. (For Visual C-specific-build, '#pragma setlocale( "<encoding>")'.) This directive allows you to specify several encodings in one source file.
  2. The encoding specified with -e <encoding> or -finput-charset=<encoding> as run-time option.
  3. The encoding specified with the LC_ALL, LC_CTYPE and LANG environment variables. Priority is given in this order.
  4. The default encoding specified when mcpp is compiled.

How to specify a <encoding> is basically same across #pragma __setlocale, -e option, and the environment variables; in the table below, the encoding on the left-side hand is specified by the <encoding> on right-hand side; <encoding> is not case sensitive; '-' and '_' are ignored. Moreover, if it has '.', the character sequence to the '.' is ignored. Therefore, EUC_JP, EUC-JP, EUCJP, euc-jp, eucjp and ja_JP.eucJP are regarded as same. '*' represents any character sequence of zero or more bytes. (iso8859-1, iso8859-2 are equivalent to iso8859*.).

EUC-JP eucjp, euc, ujis
shift-JIS sjis, shiftjis, mskanji
GB-2312 gb2312, cngb, euccn
BIG-FIVE bigfive, big5, cnbig5, euctw
KSC-5601 ksc5601, ksx1001, wansung, euckr
IS0-2022-JP1 iso2022jp, iso2022jp1, jis
UTF-8 utf8, utf
Not specifiedc, en*, latin*, iso8859*

If any of the following encodings is specified, mcpp is no longer able to recognize multi-byte characters: C, en* (english), latin* and iso8859*. When a non-ASCII ISO-8859 Latin-<n> single-byte character set is used, one of these encodings must be specified. When an empty name is used (#pragma __setlocale( "")), the encoding is restored to the default.

Only in the Visual C-specific-build, the following encoding name can be specified with '#pragma setlocale'. This is for compatibility with Visual C++. It is recommended you should use these names because the Visual C++ compiler cannot recognize encoding names other than these. ('-' can be omitted for mcpp, but not for the Visual C++ compiler-proper.)

shift-JIS japanese, jpn
GB-2312 chinese-simplified, chs
BIG-FIVE chinese-traditional, cht
KSC-5601 korean, kor
Not specifiedC, english

In Visual C++, the default multi-byte character encoding varies, depending on what language the language parameter and "Region and Language Option" of Windows are set to. However, the #pragma setlocale specification takes precedence over these Windows's settings.

GCC sometimes fails to handle shift-JIS, ISO2022JP and BIG-FIVE encodings, which contain the byte of 0x5c value. So, GCC-specific-build of mcpp complements it. *1

Note

*1 If the --enable-c-mbchar option is specified to configure GCC itself, that GCC recognizes an encoding specified by an environmental variable LANG set to one of C-EUCJP, C-SJIS or C-JIS, gcc's info says. This way of configuring seems to be available from 1998 onward, but it has been seldom used, and its implementation does not work. Although GCC-specific-build of mcpp had supported these environmental variables, such as LANG=C-SJIS, it removed that feature since V.2.7.
Also GCC info says that, besides LANG, environmental variables LC_ALL and LC_CTYPE can be used to specify an encoding. However, the difference between using LC_ALL or LC_CTYPE or not lies only in their diagnostic messages, in actual.


2.9. How to Use mcpp in One-Pass Compilers

Compilers whose preprocessor is integrated into themselves are called one-pass compilers. These includes Visual C, Borland C, and LCC-Win32. Such compilers are becoming more popular because they can achieve a little higher processing speed. However, the time for preprocessing becomes shorter due to better hardware performance. In the first place, there is much point for preprocessing to be a common phase, mostly independent of run-time environment and compiler systems. It is not desirable that one-pass compilers become more popular. There will be more compiler-system-specific specifications.

Anyhow, it is impossible to replace the preprocessor of a one-pass compiler with mcpp. To use mcpp, a source program is preprocessed with mcpp and then the output is passed to a one-pass compiler. As you see, preprocessing takes place twice. It is useless but inevitable. Using of mcpp still has merits of source checking and can avail functions not available in resident preprocessor.

To use mcpp with a one-pass compiler, the procedure must be written in makefile. For sample procedures, refer to the makefile re-compilation settings used to compile mcpp itself, such as visualc.mak, borlandc.mak, and lcc_w32.mak.

Although GCC 3 or 4 compiler now integrates its preprocessing facility into itself, gcc provides an option to use an external preprocessor. Use this option when mcpp is used. (See 3.9.7.)


2.10. How to Use mcpp in IDE

It is difficult to use mcpp in Integrated Development Environment (IDE) because IDE's GUI follows compiler-system-specific specifications and internal interfaces are not usually made available to third parties. Furthermore, one-pass compilers make it more difficult to insert a phase to use mcpp.

This subsection describes how to make mcpp available in Windows / Visual C++ 2003, 2005, 2008 IDE. Use the compiler-specific-build for Borland C and LCC-Win32 on command lines.

Also, it is described here how to make mcpp available in Mac OS X / Xcode.app / Apple-GCC.

2.10.1. How to Make mcpp Available in Visual C++ IDE

mcpp cannot be used in a normal "project" since the internal specifications of Visual C++'s IDE are not made available to third parties and the compiler is a one-pass compiler. However, once a makefile that uses mcpp is created, Visual C++'s IDE can recognize the makefile and you can create a "makefile project" using that file. This allows you to utilize most of the IDE functions, including source editing, search, and source level debugging.

"Creating a Makefile Project" of a Visual C++ 2003 document, Visual C++ 2005 Express Edition Help and Visual C++ 2008 Express Edition Help describe how to make a makefile project. Perform the following procedure to create a makefile project.

  1. Login as a user with debugging privilege. *1
  2. Write a makefile that specifies mcpp. (Refer to noconfig/visualc.mak.) *2
  3. Start Visual Studio. *3
  4. Click "New Project" to display the "New Project" window. Select "Makefile Project" and specify "Name" and "Location", and then click "OK".
  5. Then the "Makefile Application Wizard" windows appears. Click "Application settings", and enter appropriate values in the "Build command line", "Output", "Clean commands", and "Rebuild command line" fields.
    Let me explain the appropriate values for these fields by taking an example of making the compiler-independent-build of mcpp itself. (Assuming the name of mcpp executable as mcpp.exe.)
    "Build command line":   nmake
    "Output":               mcpp.exe
    "Clean command":        nmake clean
    "Rebuild command line": nmake PREPROCESSED=1
    
    To make the Visual C-specific-build of mcpp, add an option COMPILER=MSC as:
    "Build command line":   nmake COMPILER=MSC
    "Output":               mcpp.exe
    "Clean command":        nmake clean
    "Rebuild command line": nmake COMPILER=MSC PREPROCESSED=1
    
    Since a Makefile project does not provide a 'make install' equivalent command, you must write the makefile in such a way that the commands you specify in "Build command line" and "Rebuild command line" also perform installation. *4
    If you do not compile mcpp, "Build command line" and "Rebuild command line" can be the same.
    When completed, click "Finish".
  6. Then the Makefile project appears in "Solution Explorer". Click the "Source Files" folder, choose "Add Existing Solution Item" from the "Project" menu, select all the source files, and then click "OK". Then the source file names appear in Solution Explorer.

You can now use every functions, including Edit, Build, Rebuild and Debugging.

Note:

*1 On VC 2003 and 2005, to use the debugging function under Windows XP pro or Windows 2000, a user must belong to a group called "Debugger users". However, Windows XP HE does not provide such a group, so one has to login as an administrator. On VC 2008, such a limitation on users group was lifted.

*2 In order to perform the source level debugging function, makefile must be written in such a way that cl.exe is called with the -Zi option appended to generate debugging information.

*3 If you start Visual Studio by selecting "Start" -> "Programs", environment variables, such as for include directories, are not set. In order to have these variables set, you should open the 'Visual Studio command prompt' to start Visual Studio by typing on VC 2003:

devenv <Project File> /useenv

On VC 2005 express edition and VC 2008 express edition:

vcexpress <Project File> /useenv

*4 You must have a writing permission to the directory into which you install mcpp. If you try to install into 'bin' or 'lib' directories of the compiler system, the permission should be carefully set by an administrator account. It is recommended to make the user account belong to "Power users" or "Authenticated users" group and set "write" and "modify" permissions to the directory for the group. Another way of controlling the permission is to install the compiler system into a directory which the user has wrinting permission on, such as a shared directory.

2.10.2. How to Make mcpp available in Mac OS X / Xcode.app

You can use Xcode.app, which is an IDE on Mac OS X, with mcpp without problems. *1

Xcode.app uses gcc (g++) in /Developer/usr/bin rather than /usr/bin for some reason. (/Developer is the default install directory for Xcode.) To use mcpp in Xcode.app, you must install GCC-specific-build for the gcc (g++) in that directory. You should do as follows to install it. (${mcpp_dir} means the directory where the source of mcpp is placed.)

export PATH=/Developer/usr/bin:$PATH
configure ${mcpp_dir}/configure --enable-replace-cpp
make
sudo make install

The installation method is the same with that for gcc in /usr/bin, except PATH setting. So, please refer to INSTALL for installation to cross-compiler or installation of universal binary.

After installing mcpp in such a way, you can use Xcode.app without any special setting for mcpp. Also the Apple-GCC-specific *.hmap files, which are "header map" files generated by Xcode.app, are read and processed by mcpp. However, mcpp does not process precompiled-header. It processes '#include "header.pch"' as an ordinary #include. Also, mcpp does not preprocess Objective-C and Objective-C++, so *.m and *.mm source files are directly handed on to cc1obj and cc1objplus, bypassing mcpp.

When you use mcpp-specific options, specify them as follows:
From screen top menu bar of Xcode.app, select "Project" > "Edit Project Settings". The "project editor" window will appear. Then, select "Build" pane of it, and edit "Other C flags" item. The options should be specified following '-Wp,' and separated by commas, for example:

-Wp,-23,-W3

Note:

*1 Here we refer to Mac OS X Leopard / Xcode 3.0.


3. Enhancements and Compatibility

mcpp has its own enhancements. Each compiler-system-resident preprocessor has its own enhancements, some of which are not available in mcpp. This section covers these enhancements and their compatibility problems.

Principally, mcpp outputs #pragma lines as they are. This principle is applied to the #pragma lines processed by mcpp itself. This is because the compiler-proper may interpret the same #pragma for itself.

However, mcpp does not outputs the lines beginning with '#pragma MCPP', since these are for mcpp only. Also, mcpp does not outputs lines of '#pragma GCC' followed by either 'poison', 'dependency' or 'system_header'. Moreover, mcpp outputs neither of '#pragma once', '#pragma push_macro', nor '#pragma pop_macro' because they are useless on the later phases. On the other hand, '#pragma GCC visibility *' is outputted, because it is for the compiler and the linker. *1

mcpp compiled with EXPAND_PRAGMA == TRUE expands macros in #pragma line (in actual, EXPAND_PRAGMA is set TRUE only for Visual C-specific-build and Borland C-specific-build). However, #pragma lines followed by STDC, MCPP or GCC are never expanded.

#pragma sub-directives are implementation-defined, hence there are risks of same name sub-directive having different meanings to different compiler-systems. Some device is necessary to avoid name collision. Moreover, when EXPAND_PRAGMA == TRUE, there should be a device to avoid the name of #pragma sub-directive itself being macro expanded. This is why mcpp-specific sub-directives begin with '#pragma MCPP' and are not subject to macro expansion. This device is adopted from '#pragma STDC' of C99 and '#pragma GCC' of GCC 3.

'#pragma once' is, however, implemented as it is, since this pragma has been implemented in many preprocessors and has now no risk of name collision. '#pragma __setlocale' is prefixed with "__" instead of MCPP, because it has also meaning for compiler-proper, and because the prefix avoids user-name-space.

Note:

*1 The GCC-specific-build of mcpp only supports '#pragma GCC system_header' of the pragmas starting with GCC. It does not support '#pragma GCC poison' and '#pragma GCC dependency'.


3.1. #pragma MCPP put_defines, #pragma MCPP preprocess and others

mcpp in Standard mode uses '#pragma MCPP put_defines', '#pragma MCPP preprocess' and '#pragma MCPP preprocessed'. Pre-Standard mode uses #put_defines, #preprocess and #preprocessed. Let me explain by taking an example of #pragma.

When mcpp encounters '#pragma MCPP put_defines' directive, it outputs all the macros defined at that time in the form of #define lines. Of course, the #undef-ed macros are not output. The macros that cannot be #defined or #undef-ed, such __STDC__ and etc, are output in the form of #define lines, but are enclosed with comment marks. (Since __FILE__ and __LINE__ are special macros defined dynamically on a macro invocation, the replacement list output here means nothing.)

In pre-Standard mode and POSTSTD mode mcpp do not memorize parameter names of function-like macro definitions. So, these directives mechanically represent names of the first, second, third parameters as a, b, c, ... and so on. If it reaches the 27th parameter, it begins with a1, b1, c1, ..., a2, b2, c2, ... and so on.

If you enter the following directive after invoking mcpp from keyboard without specifying input and output files, all the predefined macros are listed.

#pragma MCPP put_defines

It also outputs a comment to indicate the source file name where each macro definition is found, as well as its line number. If you invoke mcpp with options such as -S1 or -N, you will see a different set of predefined macros.

When mcpp encounters '#pragma MCPP preprocess' directive, it outputs the following line:

#pragma MCPP preprocessed

This indicates that the source file has been already preprocessed by mcpp.

When mcpp encounters a '#pragma MCPP preprocessed' directive, it determines that the source file has been preprocessed by mcpp and continues to output the code it reads as it is, until it encounters a #define line. When mcpp does encounter a #define directive, mcpp determines that the rest of the source file are all #define lines and defines macros. At this time, mcpp would memorize the source filename and line number in the comment. *1, *2

A '#pragma MCPP preprocessed' is applied only to the lines that follow the directive in the source file where the '#pragma MCPP preprocessed' directive is found. If the source file is an #included one, when control is returned to the #including file, '#pragma MCPP preprocessed' is no longer applied.

Note:

*1 Actual processing is a little more complex. When mcpp encounters a '#pragma MCPP preprocessed', mcpp outputs lines it has read just as they are, except for #line lines, which compiler-specific-build of mcpp converts and outputs into a format that the compiler-proper can accept. mcpp disregards predefined standard macro because its #define line is enclosed with comment marks.

*2 Therefore, information on where a macro definition is found is not lost during pre-preprocessing.

3.1.1. Pre-preprocessing of Header File

With above directives, you can "pre-preprocess" header files. Pre-preprocessing considerably saves the entire preprocessing time. I think the explanation so far has already given you an understanding of how to pre-preprocess header files, but to deepen your understanding, let me explain it by taking an example of mcpp's own source code.

mcpp source consists of eight *.c files, of which seven files include "system.H" and "internal.H". No other headers are included. The source looks like this:

#if PREPROCESSED
#include  "mcpp.H"
#else
#include  "system.H"
#include  "internal.H"
#endif

The system.H includes noconfig.H or configed.H, as well as several standard header files. mcpp.H is not a source file I provide and is a "pre-preprocessed" header file I am going to generate.

To generate mcpp.H (of course, after setting up noconfig.H and other headers), invoke mcpp as follows:

mcpp > mcpp.H

For compiler systems, such as GCC, also specify the -b option.

Enter the following directives from the keyboard:

#pragma MCPP preprocess
#include "system.H"
#include "internal.H"
#pragma MCPP put_defines

Enter "end-of-file" to terminate mcpp.

This has accomplished mcpp.H, which consists of the preprocessed system.H and internal.H and a set of #define lines following them. Including mcpp.H gives the same effect as including system.H and internal.H, but its size is one-nth of the original header files including the standard ones. This is because #if and comments are eliminated. It takes far less time to include mcpp.H in seven *.c files than to include system.H and internal.H seven times. By using '#pragma MCPP preprocess', much more time can be saved.

On compilation, use the -DPREPROCESSED=1 option.

It is recommended that the above procedure should be written in a file and the makefile should refer to it. The makefile and preproc.c appended to mcpp sources contain the procedure. Please refer to it.

Although the usage of independent preprocessor is limited for one-pass compilers like Visual C, Borland C or LCC-Win32, the pre-preprocessing facility is useful even for those.

The pre-preprocessing facility of header files is similar to that of the -dD option of GCC, but it differs from it in that:

  1. GCC outputs line number information not in the form of '#line 123 "filename"', but in the form of '# 123 "filename"', which allows GCC to reprocess the information, but the Standard C preprocessor cannot.
  2. GCC/cpp of older version outputs a #define line whenever it encounters it, but does not output a #undef line. Therefore, reprocessing the preprocessed result may produce a different result from what the original source intends.
  3. By using '#pragma MCPP preprocess', which is not provided by GCC, mcpp can provides a higher processing speed.

As far as the pre-preprocessing facility is concerned, mcpp is more accurate and practical than GCC.


3.2. #pragma once

#pragma once directive is available in Standard mode.

#pragma once is also available for GCC, Visual C, LCC-Win32 and compiler-independent preprocessor called Wave.

This directive is used when you want to include a header file only once. With the following directive in a header file, mcpp includes the header file only once even if a #include line for that file appears many times.

#pragma once

Usually, compiler-system-specific standard header files prevent duplicate definitions by using the following code:

#ifndef __STDIO_H
#define __STDIO_H
/* Contents of stdio.h */
#endif

#pragma once provides similar functionality to this. Using macros always involves reading a header file. (The preprocessor cannot skip reading the code as people do and must read the entire header file for #if's or #endif's; It must read a comment before it can determine whether a line is a directive line, that is, a line with # at the beginning followed by a preprocessing directive; To do so, the preprocessor must identify a string literal; After all, it must read through the entire header file and perform most of tokenization.) #pragma once eliminates the need of even accessing to a header file, resulting in a improved processing speed for multiple includes.

To determine whether two header files are identical, file name characters, including directory names in a search path, are compared. Windows is not case sensitive. Therefore, "/DIR1/header.h" and "/DIR2/header.h" are regarded as distinct, but "header.h" and "HEADER.H" are regarded as the same on Windows, but distinct on UNIX-like systems. A directory is memorized after converting to absolute path, and a symbolic link in UNIX systems is memorized after dereferencing. Moreover, path-list is normalized by removing redundant part such as "foo/../". So, the identical files are determined always correctly. *1, *2, *3

I borrowed the idea of #pragma once from GCC V.1.*/cpp. GCC V.2.*, and V.3.* still has this functionality but it is regarded as obsolete. The specification of GCC V.2.*/cpp has been changed as follows: If the entire header file is enclosed with #ifndef _MACRO, #define _MACRO, and #endif, the cpp memorizes it and inclusion occurs only once, even without #pragma once.

However, this GCC V.2 and V.3 specification sometimes does not work for commercially available compiler systems that are not based on the GCC specification, due to a difference in the standard header file notation. In addition, the GCC V.2 and V.3 specification is more complex to implement. For this reason, I decided to implement only #pragma once.

As with other preprocessors, it is not advisable to rely only on #pragma once when the same header files are used. It is recommended that #pragma once should be combined with macros as follows:

#ifndef __STDIO_H
#define __STDIO_H
#pragma once
/* Contents of stdio.h */
#endif

Note that #pragma once must not be written in <assert.h>. For the reason, see cpp-test.html#5.1.2. The same thing can be said with <cassert> and <cassert.h> of C++.

Another problem is that the recent GCC/GLIBC system has header files, like <stddef.h>, which are repeatedly #included by other system headers. They define macros, such as __need_NULL, __need_size_t, and __need_ptrdiff_t, and then #include <stddef.h>. Each time they do so, definitions such as NULL, size_t, and ptrdiff_t are defined in the <stddef.h>. The same thing can be said with <errno.h> and <signal.h>, and even with <stdio.h>. Other system headers define macros, such as __need_FILE, __need___FILE, and then #include <stdio.h>. Each time they do so, definitions such as FILE may be defined in <stdio.h>. #pragma once can not be used in such header files. *4

Note:

*1 The normalized result can be seen by '#pragma MCPP debug path'. See 3.5.1. '#pragma MCPP put_defines' and diagnostics use the same result, too.
However, the path-list is not normalized usually in #line line. By default, the #line line is output as specified by #include line, prepending the normalized include path, if any. But, if -K option is specified, it is normalized so as to be easily utilized by some other tools.

*2 On CygWIN, /bin and /usr/bin are the same directory in real, also /lib and /usr/lib are the same, and supposing / is C:/dir/cygwin on Windows, /cygdrive/c/dir/cygwin is the same as /. mcpp treats these directories as the same, converting the path-list to the format of /cygdrive/c/dir/cygwin/dir-list/file.

*3 On MinGW, / and /usr are the same directory in real. Supposing / is C:/dir/msys/1.0, /c/dir/msys/1.0 is the same as /, and supposing /mingw is C:/dir/mingw, /c/dir/mingw is the same with /mingw. mcpp treats each of these as the same directories, converting the path-list to the format of c:/dir/msys/1.0/dir-list/file or c:/dir/mingw/dir-list/file.

*4 This is applied at least to Linux/GCC 2.9x, 3.* and 4.*/glibc 2.1, 2.2 and 2.3. FreeBSD 4, 5, 6 has much simpler system headers because it does not use glibc.

3.2.1. Tool to Write #pragma once to Header Files

With a small number of header files, writing #pragma once to them does not require much effort, but it would be tremendous work if there are many header files. I wrote a simple tool to write it automatically to header files.

tool/ins_once.c is a tool written for old versions of GCC. As Borland 5.5 conform to the same standard header file notation with GCC, this tool can be used. However, it is advisable that this tool should not be used in the systems like Glibc 2 that has many exceptions shown above.

Even in the compiler systems that can use the tool, some header files do not strictly conform to the GCC notation. GCC's read-once functionality also does not work properly for these header files.

Compile ins_once.c and perform the following command in a directory, such as /usr/include or /usr/local/include, under UNIX.

chmod -R u+w *

and then execute ins_once as follows:

ins_once -t *.h */*.h */*/*.h

Ins_once reports header files that do not begin with #ifndef or #if !defined. Manually modify these files. Then, execute ins_once as follows:

ins_once *.h */*.h */*/*.h

If the first directive in each header file is #ifndef or #if !defined, a #pragma once line is inserted immediate below the line. Only a root user or a user with an appropriate permission is eligible for this modification. When you modified access permission, use 'chmod -R u-w *' to restore to original permission.

Ins_once provides the following options. Select the most appropriate one for your system.

ins_once roughly checks to write a #pragma once line only once in the same header file even if it is executed several times, but the check is not very strict. As this ins_once is of temporary and tentative nature, it scarcely performs tokenization. It worked as I expected with FreeBSD 2.0 and 2.2.7, Borland C 5.5, but it may not work properly for special header files. So before executing this tool, be sure to make a backup of an original file.

Have the shell expand a wild-card. (In case of buffer overflow, execute ins_once several times by specifying some of your system header files.)


3.3. #pragma MCPP warning, #include_next, #warning

These directives are provided for compatibility with GCC. GCC provides the #include_next and #warning directives. Although these directives are non-conforming, not only some source programs sometimes use them but also some Glibc2 system header files do. Taking this situation into consideration, I implemented the #include_next and #warning directives in GCC-specific-build to allow compilation of such source programs, however, mcpp issues a warning when it finds the directives. Regardless of the compiler systems mcpp is ported to, mcpp in Standard mode also implements #pragma MCPP warning.

With the following directive, mcpp skips the current file's directory and start searching header.h from the next directory of search path.

#include_next  <header.h>

CygWIN and MinGW ignores the distinctions of alphabetical case of header names.

The following code outputs 'any message' to stderr as a warning message:

#pragma MCPP warning    any message

#warning  any message

Different from #error, this is not counted as an error.


3.4. #pragma MCPP push_macro, #pragma __setlocale and others

When I ported mcpp to Visual C, I implemented these directives in mcpp, and then made them available for other systems.

'#pragma MCPP push_macro( "MACRO")' and '#pragma MCPP pop_macro( "MACRO")' are used to "push" or "pop" a macro definition (MACRO) to the current macro definition stack.

'#pragma push_macro( "MACRO")' and '#pragma pop_macro( "MACRO")' are also available for Visual C.

push_macro saves a macro definition to the stack, and pop_macro retrieves the macro definition. The pushed macro definition remains valid after push_macro. To invalidate it, use #undef or redefine the macro with a new definition. push_macro can be used multiple times for a same name macro.

'#pragma __setlocale( "<encoding>")' changes the current multi-byte character encoding to <encoding>. The argument of setlocale must be a string literal. For <encoding>, refer to 2.8. This directive allows you to use several encodings in one translation unit.

In Visual C++, '#pragma __setlocale' cannot be used. Use '#pragma setlocale' instead. Encoding specification must be conveyed not only to mcpp but also to the compiler-proper. The latter can recognize only #pragma setlocale. For other compiler systems, when the compiler-proper cannot recognize an encoding, mcpp complements it.

There is not yet any compiler-proper which can recognize '#pragma __setlocale'.


3.5. #pragma MCPP debug, #pragma MCPP end_debug, #debug, #end_debug

'#pragma MCPP debug' and '#pragma MCPP end_debug' are for Standard mode. #debug and #end_debug are for pre-Standard mode.

The '#pragma MCPP debug <args>' directive can be written anywhere in a source program. <args> specifies a debug information type. One #pragma MCPP debug directive can take several <arg>. One or more <arg> must be specified for each directive. mcpp begins to output debug information when it finds this directive, and stops it when it encounters '#pragma MCPP end_debug <args>'. The <args> can be omitted, in which case all types of debug information is reset. If <args> contains an argument that is not supported by mcpp, mcpp issues a warning, but all the preceding arguments are regarded as valid.

All the debug information is output to the same path with the preprocessing output to synchronize with it. Therefore, this directive usually prevents compilation. Nevertheless, #pragma MCPP debug macro_call outputs informations embedding into comments, and can be re-preprocessed and compiled.

When you noticed something was wrong with the preprocessing result, enclose the coding you want to debug with the following directives, for example:

#pragma MCPP debug token expand
/* Coding you want to debug  */
#pragma MCPP end_debug

As this directive was originally used for debugging mcpp itself, it was not developed with end users in mind. So, you may not understand its behavior unless you read its source code, and you may sometimes feel it outputs too much information, but it is useful for tracing the preprocessing process. Be patient.

The following debug information types can be specified with <arg>.

path Displays the include file search path.
token Parses tokens one by one and displays its type.
expand Traces a macro expansion process.
macro_callEmbed macro notifications into comments on each macro definition and macro expansion.
if Displays the result (true or false) of #if, #elif, #ifdef and #ifndef.
expressionTraces #if expression evaluation.
getc Traces preprocess 1-byte by 1-byte.
memory Displays the status of heap memory used by mcpp.

3.5.1. #pragma MCPP debug path, #debug path

With these directives, mcpp displays include directories in the search path (excluding the current and source directories with which search begins) in the order of priority, starting with the highest one first.

In addition, with a #include directive, mcpp displays all the directories, including the current one, it actually searched for the #include file.
When a header file with #pragma once specified is #included again, the message to that effect is displayed.
Moreover, mcpp normalizes the path-list removing the redundant part such as "foo/../", and displays the result when the normalized path-list differs from the original one.
Also mcpp dereferences the symbolic link to its linked-file, and displays the result when conversion is occurred.

3.5.2. #pragma MCPP debug token, #debug token

With these directives, mcpp displays a source line it has read, and then displays a token and its type on the source line each time it has read. This token, more specifically, is a preprocessing-token (pp-token). Not only pp-tokens on a source line but also ones mcpp reads again internally during macro expansion are displayed repeatedly.

However, the following 1-byte tokens are not displayed for mcpp program's convenience sake:

  1. 1. '#' at the beginning of a preprocessing directive line.
  2. 2. '(' at the beginning of a parameter list of a function-like macro definition.
  3. 3. ',' delimiting between function-like macro definition parameters.
  4. 4. '(' at the beginning of an argument list used for a function-like macro invocation.

A pp-token has the following types:

NAM Identifier
NUM Preprocessing-number
OPE Operator or punctuator
STR String literal
WSTRWide string literal
CHR Character constant
WCHRWide character constant
SPE Special pp-tokens, such as $ and @
SEP Token separator white space

Of SEP, other than <newline> are not normally displayed. Control codes such as <newline> are displayed as <^J> or <^M>.

3.5.3. #pragma MCPP debug expand, #debug expand

With these directives, mcpp traces the expansion process of a macro invocation. When mcpp in Standard mode encounters a #pragma MCPP debug, it behaves as follows:

If there is a macro invocation, mcpp displays the macro definition. Each argument is read, the argument is substituted for the corresponding parameter in the replacement list and the replacement list is rescanned. mcpp displays this whole process. In case of nested macro definitions, they are rescanned and expanded one by one. If an argument has a macro, mcpp traces the above process recursively before parameter substitution.

Each time control is passed to and returned from a certain set of mcpp internal functions, mcpp displays the trace information along with the function name. The following table shows the role of these functions. Reading mcpp source code will gives you a concrete idea on what each function is doing.

expand_macroEntrance routine for macro expansion
replace Expands a macro one level down.
collect_argsCollects arguments.
prescan Scans a replacement list and processes # and ## operator.
substitute Substitutes parameters with arguments.
rescan Rescans a replacement list.

Except for expand_macro, above functions are indirectly recursive with each other.

For replace and collect_args, mcpp displays data it internally stacks during macro expansion. This data is displayed using the following internal codes:

<n> Nth parameter
<TSEP> Token delimiter inserted by mcpp
<MAGIC> Code that inhibits re-replacement of the macro of the same name
<RT_END>Code that indicates the end of a replacement list
<SRC> Code that indicates an identifier taken from source file while rescanning

<SRC> is used only in STD mode, and is not used in POSTSTD mode nor in COMPAT mode.

It is recommended that '#pragma MCPP debug token' should be also used.

If you specify also '#pragma MCPP debug macro_call' or -K option, macro notifications are output embedded in comments. However, in replace() and its subordinate routines some magic characters (internal codes) are written or removed in the input stream instead of comment. These magic characters are displayed as:

<MACm> Call of the m'th macro contained in one macro call
<MAC_END> The end of the macro call started by previous MACm
<MACm:ARGn>The n'th argument of the m'th macro call
<ARG_END> The end of the argument started by previous MACm:ARGn

If you specify -v option too, the MAC_END and the ARG_END markers also display the same numbers with corresponding starting markers.

For #debug expand, mcpp uses internal routines considerably different from those used for Standard mode. The explanations are omitted.

3.5.4. #pragma MCPP debug if, #debug if

With these directives, mcpp displays #if, #elif, #ifdef and #ifndef lines and reports their evaluation result (true or false). As for a skipped #if section, no report is made.

3.5.5. #pragma MCPP debug expression, #debug expression

With these directives, mcpp traces evaluation of a #if or #elif expression. DECUS cpp, based on which mcpp has been developed, provides these directives for the purpose of debugging cpp itself. I scarcely modified them. This directive outputs a very long list of internal functions, as well as variable names and their values. Unless you read the mcpp source code, you may not understand these variables. However, without the source code, you can manage to understand how the mcpp pushes onto and takes out of a evaluation stack a complex expression value.

3.5.6. #pragma MCPP debug getc, #debug getc

With these directives, mcpp outputs detailed data each time it calls get_ch(), a function to read one byte. When mcpp in Standard mode scans a pp-token, this routine is called to read only the first byte of the pp-token.

With a #debug getc, mcpp calls this routine during token scan, resulting in a tremendous amount of data output.

In any way, using these directives outputs a huge amount of data, so you scarcely need to use them.

3.5.7. #pragma MCPP debug memory, #debug memory

With these directives, mcpp reports the status of the heap memory it has internally allocated or released using malloc(), realloc() or free() only once. Only the kmmalloc I developed and some other types of malloc() provide this functionality. Refer to mcpp-porting.html#4.extra. In case of other malloc(), mcpp will neither cause an error nor report a status.

mcpp reports the heap memory status again when it terminates with these directives on. The same thing happens when mcpp terminates due to out of memory.

3.5.8. #pragma MCPP debug macro_call

With this directive, mcpp starts macro notification mode. In this mode, on each macro definition and macro expansion, its line and column information on source file are output embedded in comments. On a macro call with arguments, location information on each arguments are reported too. Token concatenation by macro, however, may cause loss of macro information about the tokens before concatenation.
In addition, some informations are output on #undef, #if (#elif, #ifdef, #ifndef) and #endif, too.
This mode is specified also by -K option.

Macro notification mode is designed to allow reconstruction of the original source position from the preprocessed output. The primary purpose of this mode is to allow C/C++ refactoring tools to refactor source code without having to implement a special-purpose C preprocessor. This mode is also handy for debugging macro expansions. *1

The goal for macro expansion mode is to annotate every macro expansion, while still allowing the output to be compiled. On the other hand, '#pragma MCPP debug expand' is to trace macro expansion and outputs detailed informations, but its output is not compilable.

Note:

*1 Most of the specifications of macro notification mode were proposed by Taras Glek. He is working on refactoring of sources at mozilla project:

http://blog.mozilla.com/tglek/

3.5.8.1. Comment on #define

For example, macro definition directives such as:

#define NULL 0L
#define BAR(x, y) x ## y
#define BAZ(a, b) a + b

produce the following output:

/*mNULL 1:9-1:16*/
/*mBAR 2:9-2:25*/
/*mBAZ 3:9-3:24*/

where the format means:

/*m[NAME] [start line]:[start column]-[end line]:[end column]*/

Line and column numbers start from 1. When you specify -K option, predefined macros are output too, which have no location information.

3.5.8.2. Comment on #undef

#undef  BAZ

This line produces the output:

/*undef 10*//*BAZ*/

The [lnum] and [NAME] in the format of /*undef [lnum]*//*[NAME]*/ indicate line number of the line and the undefined MACRO name.

3.5.8.3. Comment on Macro Expansion

Within source code other than directives, macros are expanded with markers indicating start and stop of the macro expansion. The format allows for HTML-like nesting. /*<...*/ signals start of macro expansion and /*>*/ the end. The start of macro expansion takes the following format replacing /*m of start of macro definition format to /*<:

/*<[NAME] [start line]:[start column]-[end line]:[end column]*/

On macro with arguments, markers indicating source location of each argument and markers indicating start and end of each argument expansion are output too. The marker for argument location takes the format of /*!...*/. When a macro is found in an argument, informations on that macro is output recursively, with its location information if it is on the source file. Macro argument marker also have a disambiguating naming scheme. An argument name is of the format:

[func-like-macro-name]:[nesting level]-[argument number]

This way, if someone calls 'BAZ(BAZ(a,b), c)', it would possible to distinguish nested macros of the same name and their arguments from each other. The argument number starts from 0. Then the location format follows it as:

[start line]:[start column]-[end line]:[end column]

The marker for start of an argument also takes the format:

/*<[func-like-macro-name]:[nesting level]-[argument number]*/

The marker for end of an argument is the same with the one for end of a macro expansion: /*>*/.

The following lines:

foo(NULL);
foo(BAR(some_, var));
foo = BAZ(NULL, 2);
bar = BAZ(BAZ(a,b), c);

expand to:

foo(/*<NULL 4:5-4:9*/0L/*>*/);
foo(/*<BAR 5:5-5:20*//*!BAR:0-0 5:9-5:14*//*!BAR:0-1 5:16-5:19*/some_var/*>*/);
foo = /*<BAZ 6:7-6:19*//*!BAZ:0-0 6:11-6:15*//*!BAZ:0-1 6:17-6:18*//*<BAZ:0-0*//*<NULL 6:11-6:15*/0L/*>*//*>*/ + /*<BAZ:0-1*/2/*>*//*>*/;
bar = /*<BAZ 7:7-7:23*//*!BAZ:0-0 7:11-7:19*//*!BAZ:0-1 7:21-7:22*//*<BAZ:0-0*//*<BAZ 7:11-7:19*//*!BAZ:1-0*//*!BAZ:1-1*//*<BAZ:1-0*/a/*>*/ + /*<BAZ:1-1*/b/*>*//*>*//*>*/ + /*<BAZ:0-1*/c/*>*//*>*/;

Moreover, when -v option is specified along with -K option, the marker for end of macro expansion and the marker for end of an argument expansion also output the macro name and its number same with their starting markers as:

foo(/*<NULL 4:5-4:9*/0L/*NULL>*/);
foo(/*<BAR 5:5-5:20*//*!BAR:0-0 5:9-5:14*//*!BAR:0-1 5:16-5:19*/some_var/*BAR>*/);
foo = /*<BAZ 6:7-6:19*//*!BAZ:0-0 6:11-6:15*//*!BAZ:0-1 6:17-6:18*//*<BAZ:0-0*//*<NULL 6:11-6:15*/0L/*NULL>*//*BAZ:0-0>*/ + /*<BAZ:0-1*/2/*BAZ:0-1>*//*BAZ>*/;
bar = /*<BAZ 7:7-7:23*//*!BAZ:0-0 7:11-7:19*//*!BAZ:0-1 7:21-7:22*//*<BAZ:0-0*//*<BAZ 7:11-7:19*//*!BAZ:1-0*//*!BAZ:1-1*//*<BAZ:1-0*/a/*BAZ:1-0>*/ + /*<BAZ:1-1*/b/*BAZ:1-1>*//*BAZ>*//*BAZ:0-0>*/ + /*<BAZ:0-1*/c/*BAZ:0-1>*//*BAZ>*/;

As you see in this example, all the ending markers correspond to the last preceding starting markers of the same nesting level. Hence, you can judge their correspondence automatically even without -v option.

3.5.8.4. Comment on #if (#elif, #ifdef, #ifndef)

On #if (#elif, #ifdef, #ifndef) line, informations on the macros in the line are shown.

For example, this is bar.h:

#define NULL 0L
#define BAR(x, y) x ## y
#define BAZ(a, b) a + b

And here is foo.c:

#include "bar.h"
#ifdef  BAR
#ifndef BAZ
#if 1 + BAR( 2, 3)
#endif
#else
#if 1
#endif
#if BAZ( 1, BAR( 2, 3))
#undef  BAZ
#endif
#endif
#endif

Then, foo.c produces the following output:

#line 1 "/dir/foo.c"
#line 1 "/dir/bar.h"
/*mNULL 1:9-1:16*/
/*mBAR 2:9-2:25*/
/*mBAZ 3:9-3:24*/
#line 2 "/dir/foo.c"
/*ifdef 2*//*BAR*//*i T*/
/*ifndef 3*//*BAZ*//*i F*/


/*else 6:T*/
/*if 7*//*i T*/
/*endif 8*/
/*if 9*//*BAZ*//*BAR*//*i T*/
/*undef 10*//*BAZ*/
#line 11 "/dir/foo.c"
/*endif 11*/
/*endif 12*/
/*endif 13*/

As you see, on #if line, an annotation starts with a /*if [lnum]*/ format where [lnum] indicates the current line number. Then one or more /*[NAME]*/ markers follow, if some macros are found, a /*[NAME]*/ for each macro. The annotation terminates with /*i T*/ or /*i F*/ which indicates that the directive is evaluated true or false, respectively. The expansion result is not displayed, unlike a macro on lines other than directives. On a line such as '#if 1' which has no macro, no /*[NAME]*/ is displayed.

Also annotations on #elif, #ifdef and #ifndef start with /*elif [lnum]*/, /*ifdef [lnum]*/ and /*ifndef [lnum]*/, respectively, followed by /*[NAME]*/, if some macros are found, and terminate with /*i T*/ or /*i F*/.

In any blocks where compilation is to be skipped, no annotation is displayed.

3.5.8.5. Comment on #else and #endif

On #else line, as the above examples, an information is displayed in /*else [lnum]:[C]*/ format where [lnum] is the current line number and [C] is 'T' or 'F' which indicates that the #else - #endif block is to be compiled or to be skipped.

On #endif line, as the above examples, an information is displayed in /*endif [lnum]*/ format where [lnum] indicates the current line number. Of course, the #endif corresponds to the last #if (#ifdef, #ifndef) which is not yet closed.

3.5.8.6. #line Output

In addition, on the macro notification mode, the output format of filename in #line line differs from the default. It outputs the filename in the "normalized" full-path-list. See 3.2. This is for the convenience of refactoring tool making.


3.6. #assert, #asm, #endasm

#assert is available in pre-Standard mode, except the GCC-specific-build. #assert provides the functionality equivalent to the #error directive in the Standard C. The following code in the Standard C:

#if ULONG_MAX/2 < LONG_MAX
#error Bad unsigned long handling.
#endif

can be expressed as:

#assert LONG_MAX <= ULONG_MAX/2

The argument of #assert is evaluated as a #if expression. If it evaluates to true (non-zero), mcpp does nothing and if false (0), it displays the following message and then the argument line (after processing line splicing and comments):

Preprocessing assertion failed

mcpp counts this as error but continues processing.

This #assert is quite different from that of System V or GCC.

mcpp in pre-Standard mode regards a block enclosed with the #asm and #endasm directives as assembler coding. mcpp implements this functionality for Microware C/6809 only. To implement this functionality in other compiler systems, do_old() and put_asm() in system.c must be modified.

For a #asm block, mcpp performs trigraphs conversion and deletes <backslash><newline> sequence, but it neither performs comment processing, checks tokens or characters, nor deletes white-space characters at the beginning of a line. Also, it does not expand a token that happens to have the same name with a macro and outputs it as it is. Other directive lines have no meaning within the #asm block.

These #asm and #endasm directives do not conform to Standard C. In the first place, extension directives in the form other than "#pragma sub-directive" are not Standard C conforming. Changing their directive names to #pragma asm and #pragma endasm does not solve this problem. In Standard C, the source code must consist of a C token sequence (more precisely, a preprocessing token sequence), however, an assembler program is not a C token sequence. To use assembly code in the Standard C, there is no other way but to embed it in a string literal token. Then, you have to implement a built-in function that processes that string literal in the compiler-proper and call it as follows:

asm (
    " leax _iob+13,y\n"
    " pshs x\n"
);

However, this is not suitable for a longer assembly code, in which case, you had better write the assembly code as a separate file like a library function, and assemble and link the program. This seems to be inconvenient, but it is necessary to separate the assembler portion completely to write a portable C program. It is recommended that you should write assembly code in a separate file rather than using #asm.


3.7. New C99 Features (_Pragma() operator, Variadic Macro and others)

These features are available in Standard mode. The -V199901L option with __STDC_VERSION__ set to 199901L enables the following C99's features. The same thing can be said with C++ for the -V199901L option with __cplusplus set to 199901L or more. Although C++ Standard does not provides for the features other than 1 or 7, mcpp in Standard mode provides them for better compatibility with C99. Standard mode also allows variable argument macros even in the C90 and C++ modes. *1

  1. Treats the text from // to the end of a line as a comment.

  2. Enables variable argument macros.

  3. Allows the sequence of p+, P+, p-, and P-, as well as e+, E+, e-, and E-, in the preprocessing-number. This is to represent a bit pattern of a floating-point number in Hex, like 0x1.FFFFFEp+128.

  4. Enables the _Pragma() operator.

  5. mcpp compiled with the EXPAND_PRAGMA macro set to TRUE macro-expands the argument of #pragma line that do not begin with STDC, MCPP nor GCC. (By default, mcpp is compiled with EXPAND_PRAGMA == FALSE, so it is not subject to macro expansion. It is macro expanded only in Visual C-specific-build and Borland C-specific-build.)

  6. For compiler-systems with long long, a #if expression is evaluated in long long or unsigned long long.

  7. Allows an escape sequence named UCN for Unicode in the forms of \unnnn and \Unnnnnnnn in identifiers, character constants, string literals and pp-numbers. The value of a UCN in #if expression is evaluated as a hexadecimal representation. (UCN cannot be used in POSTSTD mode.)
A variable argument macro takes a form of:
#define debug(...)  fprintf(stderr, __VA_ARGS__)

Here is a macro invocation:

debug( "X = %d\n", x);

This macro is expanded as follows:

fprintf(stderr, "X = %d\n", x);

... in the parameter list corresponds to one or more parameters. In the above example, ... corresponds to __VA_ARGS__ in the replacement list. During a macro invocation, several arguments that correspond to the ..., including ",", are concatenated to be treated as one argument.

_Pragma( "foo bar") has the same effect as specifying #pragma foo bar. The argument of the _Pragma() operator must be one string literal or wide string literal. For a wide string, the prefix (L) is deleted and treated as same as a string literal. For a string literal, " enclosing that string literal is deleted, and \" and \\ in that literal is replaced with " and \, respectively, before it is treated as a #pragma argument.

#pragma must be written somewhere in one logical line and its argument is not macro-expanded at least for C90. On the other hand, the _Pragma() operator can be written anywhere in source code (even in a replacement list), which gives the same effect with #pragma written in a logical line. The _Pragma() operator generated during macro expansion is also valid. This flexibility provides the pragma directive with a wide range of portability and allows a header file to absorb the difference in #pragma among compiler systems. (For this sample, see pragmas.h and pragmas.t of "Validation Suite".) *2

C99 stipulates a #if expression is of maximum integer type. As "long long" and "unsigned long long" are required types, the type of an #if expression is "long long / unsigned long long" or larger. C90 and C++98 stipulate the type is long / unsigned long. mcpp, however, evaluates it by long long / unsigned long long even in C90 and C++98, and issues a warning when the value is out of range of long / unsigned long. *1

Note:

*1 This is for compatibility with GCC and Visual C++ 2005, 2008. It is difficult also for other compiler systems to implement C99 specifications all at once. Probably, they will begin to implement them little by little with __STDC_VERSION__ set to 199409L or so.

*2 C99 says that a #pragma argument that begins with STDC is not macro-expanded. For other #pragma arguments, whether macro is expanded is implementation-defined.


3.8. Particular specifications for certain compiler systems

mcpp of compiler-specific-builds have some specifications peculiar to each compiler system. Such particular specifications, other than execution option and #pragma, are explained in this section.

3.8.1. Variadic macro of GCC and Visual C

GCC has variadic macro of its own specification from V.2 as shown in 3.9.1.6. In this manual we call this as GCC2-spec variadic macro. Moreover, GCC implemented one more spec of variadic from V.3 as shown in 3.9.6.3, which we call GCC3-spec variadic macro. GCC V.2.95 and later implements C99 variadic, too. Nevertheless, softwares such as glibc or Linux system headers do not use C99 variadic, nor even GCC3-spec one, and still use that of GCC2-spec.

mcpp of GCC-specific-build on STD mode implemented GCC3-spec variadic from V.2.6.3, and GCC2-spec one from V.2.7, in order to avoid inconveniences on Linux or some other softwares. Yet, mcpp warns at use of them. GCC-spec variadics, especially GCC2-spec one, are not only unportable, but also syntactically unclean. Use of them in sources to write in future is not recommendable.

Visual C had not implemented variadic macro up to 2003. But, Visual C 2005 finally implemented it. Its specification is C99 one with a modification like GCC3-spec one. When variable arguments are absent, Visual C removes their immediately preceding comma. It does not use '##' token used in GCC3-spec. The specification is illustrated as below. Visual C document says that in the third example, a comma is not removed. In actual, however, it removes even the comma in this case.

#define EMPTY
#define VC_VA( format, ...)     printf( format, __VA_ARGS__)
VC_VA( "var_args: %s %d\n", "Hello", 2005);     /* printf( "var_args: %s %d\n", "Hello", 2005); */
VC_VA( "absence of var_args:\n");               /* printf( "absence of var_args:\n");   */
VC_VA( "empty var_args:\n", EMPTY);             /* printf( "empty var_args:\n", );  */  /* trailing comma   */

Visual C-specific-build of mcpp implemented in STD mode this special handling from V.2.7. Still, it warns at use of the spec. mcpp implements the behavior on the above third example as its spec, and does not remove the comma.

3.8.2. Handling of 'defined' by GCC

On a macro with 'defined' token in it, GCC expands it differently from usual when it is in #if line. I explain this problem at 3.9.4.6.

mcpp of GCC-specific-build from V.2.7 onward handles this sort of macro like GCC in STD mode. This behavior was implemented to cope with a few wrong macros used in Linux system headers. Yet, it warns at use of 'defined' token in macro on #if line. You should write correct #if expression.

3.8.3. Asm Statement in Borland C and Other Special Syntaxes

Borland C has the asm keyword. This keyword is used to write assembly code as follows:

asm {
    mov x,4;
    ...;
}

This is quite irregular and deviates from the C grammar. If there happen to be a token with the same name as a macro, it will be macro-expanded. The same can be said with Borland C itself and mcpp. It is recommended that an assembler program should be written in a separate .asm file. mcpp does not treat this specially.

Visual C++ also has the __asm keyword, which provides the similar functionality to this.

GCC provide a Standard-conforming built-in function asm() which is used as asm( " mov x,4\n").

3.8.4. #import and Others

3.8.4.1. #import of Mac OS X / GCC

GCC has #import directive, which is a feature of Objective-C and imported to C/C++. #import is a #include with an implicit '#pragma once'. It is occasionally used in C/C++ sources on Mac OS X.

mcpp V.2.7 and later implements this directive only on Mac OS X, in both of GCC-specific-build and compiler-independent-build.

3.8.4.2. #import and #using of Visual C

Visual C has peculiar directives named #import and #using, which have form of preprocessing-directive, in fact, they are directives for compiler and linker. The #import of Visual C has no relation to that of GCC.

mcpp of Visual-C-specific-build outputs these lines as they are.


3.9. Problems of GCC and Compatibility with GCC

Although I tried to develop mcpp in such manner that the GCC-specific-build provides compatibility with GCC / cpp (cc1) to the extent that it does not hinder practical use, it is still incompatible in many aspects.

First of all, as shown in Chapter 2, there are many differences in execution options. mcpp implements neither -A option nor non-conforming directives, including #assert and #ident. *1

Fortunately, there seems to be quite few sources that cannot be compiled due to a lack of this compatibility.

It is more problematic that there are some sources that assume special behaviors of old preprocessors. Most of such source code receives a warning when -pedantic is specified in GCC. mcpp in Standard mode, by default, provides almost the same behavior as GCC's -pedantic since it implements Standard conforming error checking. However, since GCC/cpp, by default, allows such Standard violations without issuing a diagnostic, there are some sources that take advantage of this.

It is very easy to rewrite such non-conforming code to Standard-conforming code in most cases, so it is meaningless to take the trouble to write non-conforming code only to impair portability and, what is worse, to provide a hotbed of bugs. When you find such code, do not hesitate to correct it. *2

Note:

*1 The functionality of #assert and #ident should be implemented using #pragma, if necessary. The same can be said with #include_next and #warning, but these directives seem to be sometimes used in GCC system, so I grudgingly implemented them in GCC-specific-build, however, a warning is issued when they are used.

*2 From 3.9 through 3.9.3 sections of this document was written in 1998, when the sources depending on traditional preprocessors were frequently found. After that time, such sources have greatly decreased, and on the other hand, sources depending on the local features and implementation trivialities of GCC have much increased. The 3.9.4 and later, especially 3.9.8 and later sections describe mainly such problems. (2008/03)

3.9.1. Preprocessing FreeBSD 2/Kernel Source

Taking FreeBSD 2.2.2-R (1997/05) kernel source code as an example, this section explains some preprocessing problems. All the directories that appear in this section are installed in /sys (/usr/src/sys). Of the items I point out below, 3.9.1.7 and 3.9.1.8 are not necessarily Standard violations and work as expected in mcpp, but mcpp issues a warning because their coding is confusing. 3.9.1.6 is an enhancement and C99 provides the same functionality, but it differs from GNUC/cpp in notation.

3.9.1.1. Multi-Line String Literal

Assembly codes are embedded by the following manner in i386/apm/apm.c, i386/isa/npx.c, i386/isa/seagate.c, i386/scsi/aic7xxx.h, dev/aic7xxx/aic7xxx_asm.c, dev/aic7xxx/symbol.c, gnu/ext2fs/i386- bitops.h, pc98/pc98/npx.c:

asm("
    asm code0
#ifdef PC98
    asm code1
#else
    asm code2
#endif
    ...
");

When no " closing a string literal appears by the end of line, GCC/cpp, by default, interprets that the string literal ends at the end of line. The above coding is based on this specification. In addition, the compiler-proper seems to interpret the whole content of asm() as a string literal spreading across lines.

I think that assembler source code should be written in a separate file, but if you want to embed it in ".c" file by all means, write it in the following manner, instead of using the confusing coding shown above.

asm(
    "  asm code0\n"
#ifdef PC98
    "  asm code1\n"
#else
    "  asm code2\n"
#endif
    "  ...\n"
);

Standard C conforming preprocessors will accept it.

3.9.1.2. #else junk, #endif junk

The following line appears in ddb/db_run.c, netatalk/at.h, netatalk/aarp.c, net/if-ethersubr.c, i386/isa/isa.h, i386/isa/wdreg.h, i386/isa/tw.c, i386/isa/b004.c, i386/isa/matcd/matcd.c, i386/isa/sound/sound_calls.h, i386/isa/pcvt/pcvt_drv.c, pci/meteor.c, and pc98/pc98/pc98.h:

#endif MACRO

This line should be changed to:

#endif /* MACRO */

3.9.1.3. #ifdef 0

To my surprise, i386/apm/apm.c contains the following strange line:

#ifdef 0

Of course, this should be written as:

#if 0

This code must have been neither debugged nor used.

3.9.1.4. Duplicate Definition of Macro

gnu/i386/isa/dgb.c has a duplicate definition of the following macro:

#define DEBUG

Some of header files have a macro definition conflicting with this.

The Standard C regards duplicate definitions as "violation of constraint", but how they are treated depends on compiler systems; some make the first definition valid after issuing an error message and others, like GCC 2/cpp, make the last definition valid without issuing any message by default. To make the last definition valid, the following code should be added immediately before the last definition.

#undef DEBUG

3.9.1.5. #warning

i386/isa/if_ze.c, and i386/isa/if_zp.c have the #warning directive. This is the only Standard violation directive I found in the kernel source. To conform to the Standard C, there is no way but to comment out this line.

mcpp accepts #warning.

3.9.1.6. Variable Argument Macros

gnu/ext2fs/ext2_fs.h and i386/isa/mcd.c have the following macro that takes variable number of arguments:

#define MCD_TRACE(fmt, a...)        \
{                                   \
    if (mcd_data[unit].debug) {     \
        printf("mcd%d: status=0x%02x: ",    \
            unit, mcd_data[unit].status);   \
        printf(fmt, ## a);          \
    }                               \
}

#   define ext2_debug(fmt, a...)  { \
        printf("EXT2-fs DEBUG (%s, %d): %s:",   \
            __FILE__, __LINE__, __FUNCTION__);  \
        printf(fmt, ## a);          \
        }

This is a GCC-specific enhanced specification and cannot be applied to other compiler systems. The above "## a" can be simply written as "a". With ## and in the absence of an argument corresponding to "a..." in a macro invocation, the preceding comma is deleted. C99 also provides for variable argument macros, but their notation differs from that of GCC. The above example is written as follows in C99:

#define MCD_TRACE( ...)             \
{                                   \
    if (mcd_data[unit].debug) {     \
        printf("mcd%d: status=0x%02x: ",    \
            unit, mcd_data[unit].status);   \
        printf( __VA_ARGS__);       \
    }                               \
}

#  define ext2_debug( ...)     {    \
       printf("EXT2-fs DEBUG (%s, %d): %s:",   \
           __FILE__, __LINE__, __FUNCTION__);  \
       printf( __VA_ARGS__);   \
       }

The most annoying difference is that in C99 requires one or more arguments on a macro invocation corresponding to "..." while GNUC/cpp requires 0 or more arguments corresponding to "a...". To handle this, when there is no argument corresponding to "...", mcpp issues a warning, instead of making it an error. Therefore, you can change the above code as follows:

#define MCD_TRACE(fmt, ...)         \
{                                   \
    if (mcd_data[unit].debug) {     \
        printf("mcd%d: status=0x%02x: ",    \
            unit, mcd_data[unit].status);   \
        printf(fmt, __VA_ARGS__);   \
    }                               \
}

#  define ext2_debug(fmt, ...)     {    \
       printf("EXT2-fs DEBUG (%s, %d): %s:",   \
           __FILE__, __LINE__, __FUNCTION__);  \
       printf(fmt, __VA_ARGS__);   \
       }

This is simpler with one-to-one correspondence. However, this way of writing has a disadvantage that a comma immediately before an empty argument remains, resulting in, for example, printf( fmt, ). In this case, there is no other way but to write a macro definition in accordance with C99 specifications, or avoid using an empty argument in a macro invocation. Harmless tokens, such as NULL or 0, are used to write, for example, MCD_TRACE(fmt, NULL). *1

Note:

*1

GCC 2.95.3 or later also implements variable argument macros based on the C99 syntax. It is recommended to use this syntax. GCC specific one provides the flexibility of allowing for zero number of variable argument, but its notation is bad in that (1) for the "args..." parameter, a white space must not be inserted between "args" and "...", but such a pp-token is not permitted in C/C++, and that (2) it is not desirable that the notation for a token concatenation operator is used for different meaning in a replacement list. It is desirable to allow zero number of variable arguments based on the C99 notation. GCC 3 introduced a notation for variable argument macros that is a mixture of GCC 2's traditional notation and C99 one. For details, refer to 3.9.6.3.

3.9.1.7. Empty Argument in Macro Call

The following macro invocations appear in nfs/nfs.h, nfs/nfsmount.h, nfs/nfsmode.h, netinet/if_ether.c, netinet/in.c, sys/proc.h, sys/socketvars.h, i386/scsi/aic7xxx.h, i386/include/pmap.h, dev/aic7xxx/scan.l, dev/aic7xxx/aic7xxx_asm.c, kern/vfs_cache.c, pci/wd82371.c, vm/vm_object.h, and vm/device/pager.c. So do in /usr/include/nfs/nfs.h.

LIST_HEAD(, arg2)
TAILQ_HEAD(, arg2)
CIRCLEQ_HEAD(, arg2)
SLIST_HEAD(, arg2)
STAILQ_HAED(, arg2)

The first argument is empty. C99 approved empty arguments but C90 regarded them as undefined. Taking it consideration that an argument may happen to be empty during a nested macro invocation, empty arguments should be approved, however, it is neither necessary nor desirable to write an empty argument in source code. Note that for a one-argument macro, there is syntax ambiguity between an empty argument and a lack of argument.

Taking everything into consideration, the following notation is recommended:

#define EMPTY

LIST_HEAD(EMPTY, arg2)
TAILQ_HEAD(EMPTY, arg2)
CIRCLEQ_HEAD(EMPTY, arg2)
SLIST_HEAD(EMPTY, arg2)
STAILQ_HAED(EMPTY, arg2)

Any Standard C conforming preprocessor will accept this notation.

By the way, some of the header files (in the nfs directory) shown above neither have the macro definitions shown above nor #include any other header files. This is because such header files assume that these macro definitions exist in sys/queue.h and that *.c programs will #include sys/queue.h first. These files arise ambiguity.

kern/kern_mib.c has the following macro definitions:

SYSCTL_NODE(, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)

In this case, the first argument cannot be changed to EMPTY. Because the corresponding macro definition in the sys/sysctl.h is as follows:

#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)      \
    extern struct linker_set sysctl_##parent##_##name;              \
    SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access,              \
        (void*)&sysctl_##parent##_##name, 0, handler, "N", descr);  \
    TEXT_SET(sysctl_##parent##_##name, sysctl__##parent##_##name);

In other words, these arguments are not macro-expanded. The arguments of the SYSCTL_OID macro shown above, including the first one, are not macro expanded. In this case, there is no way but to leave the empty argument as it is. *1

Note:

*1 C99 approves empty arguments as legitimate. Taking macros, such as SYSCTL_NODE() and SYSCTL_OID(), into consideration, the EMPTY macro is not almighty and using empty arguments has some reason. In addition, even if EMPTY is used, a nested macro invocation may cause empty arguments. However, for source readability, using EMPTY is recommended whenever possible.

3.9.1.8. Object-Like Macros Replaced with Function-like Macro Name

i386/include/endian.h, as well as /usr/include/machine/endian.h, has the following macro definitions. (There are four same kinds of definitions.)

#define __byte_swap_long(x) (replacement text)
#define NTOHL(x)            (x) = ntohl ((u_long)x)
#define ntohl               __byte_swap_long

The problem is the ntohl definition. Although ntohl is an object-like macro, it is expanded to a function-like macro name, then rescanned with subsequent text, and is expanded as if it were a function-like macro. This way of macro-expansion has been regarded as an implicit specification since K&R 1st, and the Standard C somehow approved it as legitimate. However, as I discuss in other documents, it is this specification that makes macro-expansion unnecessarily complicated and brings confusion to Standard documents. This is a bug specification. *1

This ntohl is actually a function-like macro, written as an object-like macro omitting the parameter list. You had better define this like a function-like macro that it is:

#define ntohl(x)    __byte_swap_long(x)

This causes no problem.

i386/isa/sound/os.h has the same kind of macro definitions:

#define INB         inb
#define INW         inb

This should be written as follows:

#define INB(x)      inb(x)
#define INW(x)      inb(x)

Note:

*1 ISO 9899:1990 Corrigendum 1:1994 regarded the notation as undefined. C99 replaced this article with other. However, Standard documents are still confusing about this. For details, see cpp-test.html#2.7.6.

3.9.1.9. Preprocessing .S File

Some kernel sources are contained in several ".S" files, that is, they are written in assembler. These sources contain #include's or #ifdef's, which require preprocessing. To preprocess them, in FreeBSD 2.2.2-R, 'cc' is called with the '-x assembler-with-cpp' option, and 'cc' calls '/usr/libexec/cpp' with the '-lang-asm' option and then calls 'as'.

Of course, this ways of using .S files is non-conforming. This assembler source code must not contain a token that happens to have the same name with a macro. White spaces between tokens and at the beginning of a line must be retained during preprocessing. In addition, if the first token at the beginning of a line is a # indicating an assembler comment, special processing is required on the preprocessor side. This not only considerably limits available preprocessors but also increases the possibility of unknowingly introducing bugs. So, using .S files in this way is not recommended. *1

To preprocess source code for use with several types of machines, the code should be written in the following manner and be saved in not ".S" but ".c" file. 4.4BSD-Lite actually adopts this way of coding.

asm(
    "  asm code0\n"
#ifdef Machine_A
    "  asm code1\n"
#else
    "  asm code2\n"
#endif
    "  ...\n"
);

Note:

*1 In FreeBSD 2.0-R, these kernel sources are contained not in *.S but in *.s file. The Makefile is so defined as to call 'cpp', instead of 'cc', to process them. Then the 'cc' calls 'as'. When the 'cpp' is called, '/usr/bin/cpp' is invoked. '/usr/bin/cpp' is a shell-script that calls '/usr/libexec/cpp -traditional'. This method was more convenient in that it provides a way to change preprocessors to be used by modifying the script.

3.9.2. Preprocessing FreeBSD 2/libc Source

I compiled all the source files in /usr/src/lib/libc of FreeBSD 2.2.2R. There was no problem, probably because most of them comes from 4.4BSD-Lite without much modification. It is quite rare and surprising that a huge amount of source files in excellent quality is gathered together.

Only at one place, I found the following coding in gen/getgrent.c. Of course, ";" at the end of line is surplus.

#endif;

3.9.3. Problems Concerning GCC 2/cpp

As seen so far, writing a Standard-conforming source code with better portability in a more secure manner neither requires much effort nor provides any demerits. In spite of it, why does source code less conforming to Standards still exist at all?

When comparing the FreeBSD 2.0-R kernel sources with those of 2.2.2-R, non-conforming ones do not decrease in number. The problem is that newer sources are not necessarily more conforming to the Standards. There are few non-conforming sources in 4.4BSD-Lite. This is probably because the 4.4BSD sources were rewritten to become conforming to the Standard C and POSIX. However, during the process of implementing these sources to FreeBSD, the old writing style revived in some sources. For example, although the ntohl shown above is written as ntohl(x) in 4.4BSD-Lite, it is written as ntohl in FreeBSD. Why did the notation once put away revive?

I blame GCC/cpp for this revival, which passes these non-conforming sources without issuing a diagnostic. If -pedantic had been a default behavior, the old style source would have never revived. If -pedantic-errors had been a default behavior, although, GCC/cpp would not have been put into practical use because too many sources failed to be compiled. The gcc's man page describes the -pedantic option as: "There is no reason to use this option except for satisfying pedants." Now that eight years have already passed since Standard C was established, it is a high time that GCC/cpp should set -pedantic as default, not go so far as to set -pedantic-errors. *1

In FreeBSD 2.0-R, nested comments were sometimes found, but in 2.2.2-R, they disappeared. This is because GCC/cpp no longer allowed them. This has nothing to do with -pedantic, but I want to say how influential preprocessor's source checking is.

Note:

*1 I wrote 3.9.3 subsection in 1998. After that, gcc's man page or info deleted this expression, however, the specification remains almost the same.

3.9.4. Preprocessing Linux/glibc 2.1

I compiled glibc (GNU LIBC) 2.1.3 sources (February, 2000). Different from those of FreeBSD libc, I found many problems. Some sources are written based on GCC/cpp's undocumented specifications, in which case it took me a lot of time to identify them.

3.9.4.1. Multi-Line String Literal

sysdeps/i386/dl-machine.h and stdlib/longlong.h have many multi-line string literals as shown below:

#define MACRO asm("
    instr 0
    instr 1
    instr 2
")

Some string literals are very long. compile/csu/version-info.h created by make also has a multi-line string literal. Of course, it is non-conforming, but GCC treats it as a string literal with embedded <newline>.

The -lang-asm (-x assembler-with-cpp, -a) option allows mcpp to convert a multi-line string literal into the following code:

#define MACRO asm("\n  instr 0\n  instr 1\n  instr 2\n")

However, this option cannot work properly for a string literal with a directive inserted in the middle as shown in 3.9.1.1, in which case there is no way but to rewrite the source.

3.9.4.2. #include_next, #warning

#include_next appears in the following files:

catgets/config.h, db2/config.h, include/fpu_control.h, include/limits.h, include/bits/ipc.h, include/sys/sysinfo.h, locale/programs/config.h, and sysdeps/unix/sysv/linux/a.out.h

sysvipc/sys/ipc.h has #warning.

Although these directives are not approved by the Standard C, #include_next, in particular, becomes indispensable for glibc 2. So, mcpp for GCC implements #include_next and #warning.

The problems concerning #include_next is that it is not only a standard violation but also that what headers are actually included depends on the setting of include directories and a search order, which are changed by users via environment variables.

When glibc is installed, some files in glibc's include directory are copied to the /usr/include directory. These files are used as system header files. That these header files contain #include_next means system headers become patchy. It seems to be time to reorganize them.

3.9.4.3. Variable Argument Macros

The following files contain definitions of macros with variable number of arguments based on the GCC specification, as well as macro invocations:

elf/dl-lookup.c, elf/dl-version.c, elf/ldsodefs.h, glibc-compat/nss_db/db-XXX.c, glibc-compat/nss_files/files-XXX.c, linuxthreads/internals.h, locale/loadlocale.c, locale/programs/linereader.h, locale/programs/locale.c, nss/nss_db/db-XXX.c, nss/nss_files/files-XXX.c, sysdeps/unix/sysdep.h, sysdeps/unix/sysv/linux/i386/sysdep.h, and sysdeps/i386/fpu/bits/mathinline.h

This is a deviation from the C99 Standard. You must rewrite the source code before you can use mcpp. *1

Note:

*1 This is a spec since GCC2. There is another spec of GCC3 which is a compromise of GCC2 and C99 specs. See 3.9.6.3.

3.9.4.4. Empty Argument During Macro Calls

The following files have macro invocations with empty arguments:

catgets/catgetsinfo.h, elf/dl-open.c, grp/fgetgrent_r.c, libio/clearerr_u.c, libio/rewind.c, libio/clearerr.c, libio/iosetbuffer.c, locale/programs/ld-ctype.c, locale/setlocale.c, login/getutent_r.c, malloc/thread-m.h, math/bits/mathcalls.h, misc/efgcvt_r.c, nss/nss_files/files-rpc.c, nss/nss_files/files-network.c, nss/nss_files/files-hosts.c, nss/nss_files/files-proto.c, pwd/fgetpwent_r.c, shadow/sgetspent_r.c, sysdeps/unix/sysv/linux/bits/sigset.h, sysdeps/unix/dirstream.h

math/bits/mathcalls.h, in particular, contains as much as 79 empty arguments. This header file is installed in /usr/include/bits/mathcalls.h and is #included by /usr/include/math.h. Even with an EMPTY macro, nested macro invocations generate a lot of empty arguments. Are there any other ways to write macros more clearly?

3.9.4.5. Object-Like Macros Replaced with Function-like Macro Name

The following files contain object-like macro definitions replaced with function-like macro names:

argp/argp-fmtstream.h, ctype/ctype.h, elf/sprof.c, elf/dl-runtime.c, elf/do-rel.h, elf/do-lookup.h, elf/dl-addr.c, io/ftw.c, io/ftw64.c, io/sys/stat.h, locale/programs/ld-ctype.c, malloc/mcheck.c, math/test-*.c, nss/nss_files/files-*.c, posix/regex.c, posix/getopt.c, stdlib/gmp-impl.h, string/bits/string2.h, string/strcoll.c, sysdeps/i386/i486/bits/string.h, sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h

Of these, some function-like macros, like the ones in math/test-*.c , are first replaced with an object-like macro name and then further replaced with a function-like macro name. Why did these macros have to be written in this way?

3.9.4.6. Macros Expanded to 'defined'

sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h, and malloc/malloc.c contain the following macro definition expanded to the "defined" pp-token.

#define HAVE_MREMAP defined(__linux__) && !defined(__arm__)

The intention of this macro definition is that with the following directive,

#if HAVE_MREMAP

the above line is expected to be expanded as follows:

#if defined(__linux__) && !defined(__arm__)

However, the behavior is undefined in Standard C when a #if line has a "defined" pp-token in a macro expansion result. Apart from it, this macro definition is strange in the first place.

The HAVE_MREMAP macro is first replaced with the following,

defined(__linux__) && !defined(__arm__)             (1)

and then the identifiers defined, __linux__ and __arm__ are rescanned for more macro replacement. If any of them is a macro, it is expanded. In this case, defined cannot be defined as a macro (Otherwise, it causes another undefined result), and if __linux__ is defined as 1 and __arm__ is not defined, this macro is finally expanded as follows:

defined(1) && !defined(__arm__)

defined(1), of course, is a syntax error of a #if expression.

However, GCC/cpp stops macro expansion at (1) and regards it as the final macro expansion result of the #if line. Since this is "undefined" anyhow, this GNU specification cannot be described as wrong, but it lacks of consistency in that how to expand a macro differs between macros in a #if line and in other lines. At least, it lacks of portability. *1

The above code should be written as follows:

#if defined(__linux__) && !defined(__arm__)
#define HAVE_MREMAP 1
#endif

I hope this kind of confusing code be eliminated as early as possible. *2

Note:

*1 GCC 2/cpp internally treats defined in a #if line as a special macro. For this reason, when GCC/cpp rescans the following sequence of tokens for macro expansion, it evaluates it as a #if expression, as a result of special handling of defined pseudo-macro, instead of expanding the original macro. In other words, distinction between macro expansion and #if expression evaluation is ambiguous.

defined(__linux__) && !defined(__arm__)

This problem relates to GCC/cpp' own program structure. GCC 2/cpp has a de facto main routine rescan(), which is a macro rescanning routine. This routine reads and processes source file from the beginning to the end, during the course of which, it calls a preprocessing directive processing routine. Although implementing everything using macros is a traditional program structure of a macro processor, this structure can be thought to cause mixture of macro expansion and other processing.

*2 In glibc 2.4, this macro was corrected. Nevertheless, many other macros of the same sort were newly defined.

3.9.4.7. Preprocessing .S File

The files named *.S contain assembler source code requiring preprocessing. Some of these files have preprocessing directives, such as #include, #define, and #if. In addition, the file named compile/csu/crti.S generated by Make contains the following lines:

#APP

or

#NO_APP

From a syntax point of view, preprocessors cannot tell whether these lines are invalid preprocessing directives or valid assembler comments. GCC seems to leave these lines as they are during preprocessing and treat it as assembler comments.

Concatenation of pp-tokens using the ## operator sometimes generates an invalid pp-token. GCC/cpp outputs these pp-tokens without issuing a diagnostic.

For compatibility with GCC, I reluctantly decided that, with the -lang-asm (-x assembler-with-cpp, -a) option, mcpp does not treat these non-conforming directives and invalid pp-tokens generated by ## as error, and outputs them as they are and issues a warning.

Essentially, these sources should be processed with an assembler macro processor. GNU seems to provide a macro processor called gasp, but it seems to be scarcely used for some reason.

3.9.4.8. Problems of rpcgen and -dM Option

When invoked with the -dM option, GCC outputs only macro definitions, which is used by stdlib/isomac.c in 'make check' routine.

The problem of the isomac.c is that it accepts only GCC/cpp's macro definition file format and regards a comment or a blank line as an error.

Glibc make sometimes uses a program called rpcgen. The problem of rpcgen is that it accepts only GCC/cpp's output format of preprocessor line number information as follows:

#123 "filename"

Rpcgen does accept neither:

#line 123

nor

#line 123 "filename"

Rpcgen regards them as error.

I reluctantly decided that GCC-specific-mcpp uses the GCC format by default. Rpcgen's specification is poor in that it is based on a particular compiler system's format and cannot accept the standard one.

3.9.4.9. -include, -isystem and -I- Options

Glibc 2.1 'makefile' often uses the -include option and sometimes uses -isystem and -I- options. The former can be substituted with #include at the beginning of source code. The latter two are less necessary; these are only necessary to update system headers.

Only GCC-specific-build of mcpp implements these two options, but I would like these less necessary options to be made obsolete. *1

Note:

*1 GCC/cpp provides several more options that specify include directories and their search orders, such as -iprefix, -iwithprefix, and -idirafter. It also provides the -remap option that specifies mapping between long-file-names and MS-DOS 8+3 format filenames. On CygWIN systems, specs files contain these options, but it is not necessary to use these options because include directories can be specified with environment variables and because such mapping is no longer necessary on CygWIN.

3.9.4.10. Undocumented Predefined Macros

This is not a problem of glibc, but of GCC. The following macros are GCC/cpp predefined macros although their names do not appear in documentation.

__VERSION__,  __SIZE_TYPE__,  __PTRDIFF_TYPE__, __WCHAR_TYPE__

On Vine Linux 2.1 (egcs-1.1.2) systems, __VERSION__ is set to "egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)". On many systems, including Linux/i386, the values of other three macros have types unsigned int, int, and long int, respectively. However, on FreeBSD and CygWIN systems, their types are slightly different from them (I do not know why). Why does those predefines macros remain undocumented?

3.9.4.11. Undocumented Environment Variables

The most strange thing is the undocumented environment variable named SUNPRO_DEPENDENCIES. sysdeps/unix/sysv/linux/Makefile contains the following script:

SUNPRO_DEPENDENCIES='$ (@:.h=.d)-t $@' \
$ (CC) -E -x c $ (sysinclude) $< -D_LIBC -dM | \
... \
etc.

The intent of this script is to specify a file name with the environment variable SUNPRO_DEPENDENCIES, and to have cpp output macro definitions in source code and dependency description lines between source files to that file.

I had no other way but to read the GCC/cpp source code (egcs-1.1.2/gcc/cccp.c) to know how this environment variable works.

In addition, there is another environment variable, DEPENDENCIES_OUTPUT, which has a similar function. The difference between the two is that SUNPRO_DEPENDENCIES also outputs dependency description lines among system headers, but DEPENDENCIES_OUTPUT does not.

Only GCC-specific-build of mcpp enables these two environment variables, but I would like these undocumented specifications to be made obsolete as early as possible.

3.9.4.12. Other Problems

Linux (i386)/GCC 2 appends the -Asystem(unix), -Acpu(i386) or -Amachine(i386) to cpp invocation options by using specs file. As long as the glibc 2.1.3 for Linux/x86 is concerned, there seems to be no source code that utilizes this functionality.

It is a big problem that glibc's system headers have become patchy and very complicated. A small difference in settings may result in a big difference in preprocessing results.

On the other hand, Glibc 2.1.3 did not contain #else junk, #endif junk, or duplicate macro definitions that were found in FreeBSD 2.2.2/kernel sources. In some aspects, Glibc 2.1 source is better organized than FreeBSD 2/kernel source.

However, as a whole, there were not a few sources that are based on GCC-specific specifications in glibc 2.1, which impairs portability to other compiler systems although such sources form only a small portion of several thousand source files. Dependence on GCC local specifications is not desirable for program readability and maintainability. I hope that GCC V.3 will make obsolete these local specifications and that all the source code based on them will be completely rewritten.

3.9.5. To Use mcpp with GCC 2

You must modify some source code as follows before you can use mcpp to compile glibc 2.1 sources: *1

  1. Macro definitions with variable number of arguments: Modify the 14 files in 3.9.4.3 as shown in 3.9.1.6. Of course, you had better save the original files.

  2. Macros contained in the three files shown in 3.9.4.6 that has defined in its replacement list: /usr/include/_G_config.h is a file generated when sysdeps/unix/sysv/linux/_G_config.h is installed and has the same contents with this. You had better modify /usr/include/_G_config.h.

In addition to the options specified in Makefile or specs file, you must specify the -lang-asm (-xassembler-with-cpp) option to process *.S files containing multi-line string literals or assembler comments before you can invoke mcpp. Usually, you can leave this option specified when preprocessing other files.

When you want to use GCC/cpp or mcpp, or change the default options, you had better perform the following steps:

  1. Become a super-user to move to the directory where cpp resides (here assuming /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66). Let me assume that this directory has GCC/cpp installed under the name of cpp and mcpp as mcpp.

  2. Create a file called mcpp.sh with the following contents. *2
    #!/bin/sh
    /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/mcpp -Q -lang-asm "$@"
    
    The -Q options are optional, however, I recommend that you should use -Q to record a large amount of diagnostic messages.

  3. Enter the following commands:
    chmod a+x mcpp.sh
    mv cpp cpp_gnuc
    ln -sf mcpp.sh cpp
    
    These commands execute mcpp.sh linked to cpp when gcc calls cpp, and mcpp.sh calls mcpp using the above options before the ones specified by gcc.

  4. To change default options, modify mcpp.sh or call mcpp directly. To use GCC/cpp do:
    ln -sf cpp_gnuc cpp
    

Note:

*1 mcpp V.2.7 implemented these specs. Hence, editing of sources are not necessarily required.

*2 If you use 'configure' and 'make' to compile GCC-specific-build of mcpp, the 'make install' command will set the script appropriately. The only thing left for you here is to add '-Q -lang-asm' options to the script.

3.9.5.1. To Sort mcpp's Warnings

Another problem of using mcpp is that it issues a huge amount of warning messages. You can redirect them to a file using the -Q option, but when you preprocess a large amount of source code, such as glibc, total of several hundred MB or more of 'mcpp.err' are created, so it is impossible for you to look through the whole files.

Taking a close look at mcpp.err, you will find same warnings being issued repeatedly. This is because the same *.h files are #included by many source programs. To make the files more readable, perform the following procedure:

  1. To find error messages, enter the following command:
    grep 'fatal:' `find . -name mcpp.err`
    grep 'error:' `find . -name mcpp.err`
    
  2. To sort warning messages, enter the following command:
    grep 'warning:' `find . -name mcpp.err` | sort -k3 -u > mcpp-warnings-sorted
    
  3. To find all the source lines causing a 'warning:', enter the following command:
    grep 'warning:' `find . -name mcpp.err` | sort -k3 | uniq > mcpp-warnings-all
    
  4. To find a particular type of 'warning:'s, enter the following command, for example:
    grep 'warning: Replacement' `find . -name mcpp.err` | sort -k3 | uniq | less
    
    After you get an overall idea of what source lines are causing what kinds of errors or warnings, you can see a particular mcpp.err by "less" and then, if necessary, see the source file in question.

    In addition, you can sandwich the source code in question with '#pragma MCPP debug expand' and '#pragma MCPP end_debug' and preprocess it again to see the output, in which case I recommend you to invoke mcpp in the following manner so that preprocessing results and diagnostic messages are output to the same file:
    mcpp <-opts> in-file.c > in-file.i 2>&1
    
    When you use "make", you must temporarily change the above shell-script.

3.9.6. Preprocessing GCC 3.2 Source

I first compiled GCC 3.2 sources on Linux and FreeBSD, then I used the generated gcc to compile mcpp and then I recompiled GCC 3.2 sources using mcpp for preprocessing.

New GCC compilers are bootstrapped during various phases of make; gcc and cc1, etc generated in an earlier phase are used to recompile themselves, and those generated compiler drivers and compiler-propers are used again to recompile themselves, and so on. During the bootstrap, gcc exists under the name of xgcc.

Other than cc1 and cc1plus, GCC 2 has a separate preprocessor called cpp. In GCC 3, cpp was absorbed into cc1 and cc1plus. However, there still exists a separate preprocessor cpp0. To have cpp0 preprocess, the -no-integrated-cpp option must be specified when you invoke gcc or g++. Therefore, to have mcpp preprocess, you must use a shell-script that have gcc (xgcc) or g++ invoke mcpp first then invoke cc1 or cc1plus. *1

In the GCC compiler system, the settings of system headers and their search order are becoming very complex. So, a small difference in settings may result in a difference in preprocessing results. Even successful compilation was often difficult to attain. In addition, compilation and tests require a lot of other software. Older versions of such software may cause failure in compilation or tests. Actually, compilation sometimes failed due to some hardware problems on my machine.

Actually, I failed to compile GCC 3.2 source under FreeBSD 4.4R. I had to upgrade FreeBSD to 4.7R and changed software packages to those for FreeBSD 4.7R before I was able to succeed in compilation. *2

I used VineLinux 2.5 on two PCs. Although compilation of GCC 3.2 sources using GCC 2.95.3 was successful on one PC (K6/200MHz), recompilation of GCC 3.2 sources using the generated GCC 3.2/cc1 failed, and caused many segmentation faults. Then I changed CPU from K6 to AthlonXP. This time, recompilation was successful; no segmentation faults occurred. Hardware may have caused the problem.

When I compiled GCC 3.2 sources using GCC 2.95.4 under FreeBSD on K6, "make -k check" of the generated gcc was almost successful. When I recompiled GCC 3.2 itself using the generated GCC 3.2, in "make -k check" of g++ and libstdc++-v3, about 20 percent of testsuite was unsuccessful. However, when using AthlonXP, instead of K6, everything went OK. Hardware may have caused the problem.

On both VineLinux PCs, when I recompiled GCC 3.2 sources using GCC 3.2 itself and mcpp, "make -k check" of the generated gcc was successful. However, in "make -k check" of g++ and libstdc++-v3, 20 percent of testsuite failed. *3, *4, *5

In anyway, the cause of this testsuite failure seems to lie not in the generated compilers themselves, such as gcc, g++, cc1 and cc1plus, but in the header files or some other settings.

mcpp cannot be described as completely compatible with GCC/cpp, but is highly compatible. So, mcpp and GCC/cpp can be used interchangeably.

GCC 3.2 sources were compiled in the following environment:

OS make library CPU
VineLinux 2.5GNU makeglibc 2.2.4Celeron/1060MHz
VineLinux 2.5GNU makeglibc 2.2.4K6/200MHz, AthlonXP/2.0GHz
FreeBSD 4.7R UCB makelibc.so.4 K6/200MHz, AthlonXP/2.0GHz

Only C and C++ were compiled.

Note:

*1 I had to do this for each bootstrap stage. Since makefile is too large and too complex to change, I employed an inelegant method; I kept on sitting in front of PC screen during the entire process of bootstrap. At each end of the stages, I entered ^C and replaced xgcc and others with shell-scripts.

*2 Due to dependency between packages, the system falls into confusion unless appropriate versions are installed. Actually, for this reason, my FreeBSD temporarily failed to invoke kterm.

*3 "make -k check" cannot be used with mcpp because diagnostics of mcpp are different from those of GCC.

*4 "make -k check" seems to require an English environment, so the LANG environment variable should be set to C.

*5 All the testsuite failures were caused by inability of the pthread_* functions, such as pthread_getspecific and pthread_setspecific, to be linked in the library i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.5.0.0. When a correctly generated library was installed, "make -k check" was successful. On FreeBSD, this problem never happened. This is probably because of small differences in settings.

3.9.6.1. Multi-Line String Literal

This very old way of coding was no longer found in GCC 3.2 sources. Multi-line string literals were made obsolete as late as at GCC 3.2. GCC 3.2 processes a source with a multi-line string literal as you expect, but issues a warning.

3.9.6.2. #include_next and #warning

limits.h and syslimits.h in build/gcc/include generated during the course of make have #include_next. When GCC 3.2 is installed, these header files are copied to limits.h and syslimits.h in lib/gcc-lib/i686-pc-linux-gnu/3.2/include.

GCC 3.2 sources does not have #warnings.

3.9.6.3. Variable Argument Macros

GCC 3.2 sources have some variable argument macros, but most of them are found in testsuite and they are nothing but test samples. Although GCC 3.2 still supports variable argument macros in GCC 2 notation, the ones using __VA_ARGS__ (in C99 notation) are more frequently found in GCC 3.2 sources.

In GCC 3, variable argument macros in a mixed notation of GCC 2 and C99 are found: *1

#define eprintf( fmt, ...)   fprintf( stderr, fmt, ##__VA_ARGS__)

This definition corresponds to the following one of GCC 2 spec.

#define eprintf( fmt, args...)   fprintf( stderr, fmt, ##args)

According to the GCC specifications, in the absence of an argument corresponding to "...", the comma immediately before "##" is deleted. So, this is expanded as follows:

eprintf( "success!\n")  ==>  fprintf( stderr, "success!\n")

As far as this example is concerned, this specification seems to be convenient, but is not desirable in that (1) a comma in a replacement list of a macro definition is not always used to delimit parameters, (2) it allows a token concatenation operator (##) to have other functionality, (3) it makes rules more complex by allowing exceptions. *2, *3, *4

Note:

*1 This manual calls the variadic macro of specification since GCC 2 as GCC2 spec, and that of created in GCC 3 as GCC3 spec.

*2 While on GCC 2.* 'args...' in definition of GCC2 spec variadic macro should not be separated as 'args ...', on GCC 3 the intervening spaces are allowed.

*3 When -ansi option (or any of -std=c* or -std=iso* option) is specified, GCC, however, does not remove the comma even if the variable argument is absent. Nevertheless, the '##' disappears silently.

*4 mcpp V.2.6.3 implemented variadic macro of GCC3 spec for STD mode on GCC-specific-build only. V.2.7 even implemented GCC2 spec one.

3.9.6.4. Empty Arguments in Macro Invocation

Apart from #include-ed system headers, such as /usr/include/bits/mathcalls.h and /usr/include/bits/sigset.h, empty arguments in a macro invocation are found only in gcc/libgcc2.h of GCC 3.2 sources themselves. *1

Note:

*1 These two header files are copied into the system header directory when glibc is installed. They do not exist on FreeBSD because glibc is not used.

3.9.6.5. Object-Like Macros Replaced with Function-Like Macros

gcc/fixinc/gnu-regex.c and libiberty/regex.c have object-like macros that are replaced with function-like macro name. /usr/lib/bison.simple, a #included file, also has such macros. These macros are all relevant to alloca. For example, libiberty/regex.c has the following macro definitions.

#define REGEX_ALLOCATE  alloca
#define alloca( size)   __builtin_alloca( size)

This should be written as follows:

#define REGEX_ALLOCATE( size)   alloca( size)

Why did they omit (size)?

In addition, regex.c also has another alloca, which is defined as follows:

#define alloca  __builtin_alloc

Their writing style is inconsistent.

Furthermore, regex.c has a #include "regex.c" line, which is including itself. regex.c is a strange and unnecessarily complicated source.

3.9.6.6. Macros Expanded to 'defined'

GCC 3.2 sources do not have macros expanded to 'defined'. According to GCC 3.2 documents, this type of macro is preprocessed in the same way as GCC 2/cpp, but GCC 3.2 issues a warning to indicate "may not portable". However, GCC 3.2 does not issue a warning to an example shown in 3.9.4.6.

3.9.6.7. Preprocessing of .S Files

cpp.info of GCC 3 says:

Wherever possible, you should use a preprocessor geared to the language you are writing in. Modern versions of the GNU assembler have macro facilities.

However, the gcc/config directory has several *.S files.

3.9.6.8. rpcgen and -dM Option

Make of GCC 3.2 uses neither rpcgen nor -dM option. However, specifications of rpcgen and the -dM option do not seem to change from the previous versions.

3.9.6.9. -include, -isystem and -I- Options

These options are frequently used in make of GCC 3.2. Sometimes, the -isystem option is used to specify several system include directories at one time. Is it inevitable to use the option during software compilation that updates system headers themselves? I think they had better use an environment variable to specify all the system include directories.

On the other hand, GCC 3/cpp documents discourage to use the -iwithprefix and -iwithprefixbefore options. GCC provides many options to specify include directories. Does GCC 3.2 move toward reorganization or reduction in number of them? *1

Note:

*1 GCC 3.2 Makefile uses the -iprefix option in a stand alone manner (without using -iwithprefix or -iwithprefixbefore), although the -iprefix option makes sense only when used with one of these two options following it.

3.9.6.10. Undocumented Predefined Macros

GCC 2 did not document predefined macros, such as __VERSION__, __SIZE_TYPE__, __PTRDIFF_TYPE__ and __WCHAR_TYPE__. Even with the -dM option, their existence was unknown. GCC 3 not only documents them but also enhances -dM to show their definitions.

3.9.6.11. Undocumented Environment Variables

GCC 3 documents the SUNPRO_DEPENDENCIES environment variable GCC 2 did not. (I do not know why this environment variable is needed.)

3.9.6.12. Other Problems

GCC 3 implements following #pragmas:

#pragma GCC poison
#pragma GCC dependency
#pragma GCC system_header

Of these, GCC 3.2 sources use poison and system_header. mcpp does not support these #pragmas because I do not think them necessary. (I omit explanation of their specifications.) *1

GCC 3 deprecates assertion directives, such as #assert, although gcc, by default, specifies the -A option.

In GCC 2, the -traditional option is implemented in one and the same cpp, result in a strange mixture of very old specifications and C99 ones. In GCC 3, its preprocessor was divided into two: non-traditional cpp0 and tradcpp0. The -traditional option is valid only for gcc. cpp0 does not provides it. gcc -traditional invokes tradcpp0 for preprocessing.

tradcpp0 is getting closer to a true traditional preprocessor before C90. They say that they no longer maintain tradcpp0 except for serious bugs.

The strange specifications of GCC 2/cpp seem to have been significantly revised.

Note:

*1 mcpp V.2.7 onward supports #pragma GCC system_header on GCC-specific-build.

3.9.7. To Use mcpp with GCC 3 or 4

As seen above, as far as preprocessing is concerned, GCC 3.2 sources have been much improved than glibc 2.1.3 sources in that the traditional way of writing has been almost eliminated and that meaningless options are no longer used.

GCC 3.2/cpp0 itself is also much superior to GCC 2/cpp in that it regards traditional specifications as obsolete and articulates the token-based principle. Undocumented specifications have been significantly reduced. Although these improvements are not still sufficient, GCC is certainly moving toward the right direction.

However, GNU / Linux system headers become so complex that it is difficult to grasp their entire structure, which may one of the biggest causes of problems in the GNU / Linux system.

Another pitiful fact is that the preprocessor is absorbed into the compiler-proper. Therefore, to use mcpp, the -no-integrated-cpp option must be specified when invoking gcc or g++. If you compile a large amount of source files with complicated or many makefiles, or if some program automatically invoke gcc, you should create a shell-script that invokes gcc or g++ with the -no-integrated-cpp option automatically specified.

Let me take an example of this. Place the following shell-scripts in the directory where gcc and g++ reside (on my Linux, /usr/local/gcc-3.2/bin), under the names of gcc.sh and g++.sh, respectively.

#!/bin/sh
/usr/local/gcc-3.2/bin/gcc_proper -no-integrated-cpp "$@"

#!/bin/sh
/usr/local/gcc-3.2/bin/g++_proper -no-integrated-cpp "$@"

Move to this directory and enter the following commands:

chmod a+x gcc.sh g++.sh
mv gcc gcc_proper
mv g++ g++_proper
ln -sf gcc.sh gcc
ln -sf g++.sh g++

In the directory where cpp is located (on my Linux, /usr/local/gcc-3.2/lib/gcc-lib/i686-pc-linux-gnu/3.2), create a script that executes mcpp when cpp0 is invoked, as you did for GCC 2 (See 3.9.5). By doing this, gcc or g++ first invokes mcpp and then invokes cc1 or cc1plus with the -fpreprocessed option appended. -fpreprocessed indicates the source has been preprocessed already. *1

Note that when a GCC version other than the system standard one is installed, additional include directory settings may be required. mcpp embeds these settings when mcpp itself is compiled, thus eliminating the need to set them with environment variables.

If possible, I want to replace the cpplib source, the preprocessing part of cc1 or cc1plus, with mcpp. The source files that define the internal interface between cpplib and ccl or cc1plus, as well as the external interface between cpplib and user programs that use it, amount to as much as 46KB. It is impossible to replace. Why is the interfaces so complex? It is a pity.

Note:

*1 mcpp gets all the necessary informations by 'configure' and sets these scripts by 'make install'.

3.9.7.1. To Use mcpp with GCC 3.3 and 3.4-4.1

Although GCC 3.2 seemed to go in the direction of better portability, GCC turned its direction to a different goal on 3.3 and 3.4. V.3.3 and 3.4 differ from 3.2 in the following points.

  1. Independent preprocessor cpp0 was abolished. The execution option '-no-integrated-cpp' changed its meaning, gcc invokes cc1 (cc1plus) instead of cpp0 as a preprocessor even if this option is specified, and gcc passes to the preprocessor some options which are irrelevant to preprocessing. (What a dirty implementation!)
  2. Many (several dozen of) macros are predefined. The relationship between the system headers and GCC became more complicated.
  3. Tradcpp was also abolished and absorbed to an execution option of cc1. Some old specifications, which were obsoleted or deprecated in V.3.2, were restored.

GCC / cc1 is becoming one huge and complex compiler absorbing preprocessor and some system header's contents. I doubt whether this is a better way of compiler construction, especially of developing open source one.

As regards mcpp, it is a nuisance that gcc arbitrarily hands to preprocessor some irrelevant options. Since it is risky to ignore all the options unrecognized by mcpp, I didn't adopt this. Although mcpp ignores the wrong options such as -c or -m* which are frequently handed from gcc, it will get an error if other unexpected options are passed on.

In order to avoid conflicts with those wrong options, mcpp V.2.5 changed some options, -c to -@compat, -m to -e, and some others.

To use mcpp with GCC 3.2 or former, it is necessary only to replace invoking of cpp0 by mcpp. To use mcpp with GCC 3.3 or later, it is necessary to divide invoking of cc1 to mcpp and cc1. src/set_mcpp.sh will write shell-scripts for this purpose in the GCC libexec directory on mcpp installation. The 'make install' command will also get GCC predefined macros using -dM option and set those for mcpp. *1, *2, *3

In addition, GCC 3.4 changed processing of multi-byte characters. Its document says as: *4

  1. It converts every encodings of multi-byte characters to UTF-8 at the first phase of preprocessing.
  2. It uses libiconv functions for the conversion, therefore it can handle all the encodings iconv can do.
  3. It has '-finput-charset=<encoding>' option to specify the source file's encoding. (In other words, the encoding is not converted without this option.)
  4. It has also '-fexec-charset=<encoding>' option to specify the output encoding which defaults to UTF-8. *5

There is a trend to identify "internationalization" with "unicodization", especially in the Western people who do not use multi-byte characters. It seems that this trend has reached to GCC.

What is worse, GCC 3.4 or later does not implement their specification sufficiently. In actual, it behaves as:

  1. As for EUC-JP, GB2312, KSC-5601 and Big5, it converts these encodings to UTF-8 correctly with -finput-charset option, and it passes them as they are without this option. *6
  2. The -fexec-charset option has no effect on V.3.4 nor V.4.0. On V.4.1-4.3, the option has effect, and works correctly.
  3. With ISO2022-JP, GCC cannot preprocess on V.3.4 or 4.0, whereas on V.4.1-4.3 it can preprocess the encoding.
  4. As for shift-JIS, all the versions confuse in preprocessing when -finput-charset is specified.

mcpp takes -e <encoding> option to specify an encoding, and the GCC-specific-build inserts <backslash> to the byte in multi-byte character which has the same value with <backslash>, '"' or '\'', when the encoding is one of BIG-5, shift-JIS or ISO2022-JP, in order to complement GCC's inability. However, it does not convert the encoding to UTF-8. mcpp also treats -finput-charset as the same option as -e. I adopted these specifications because: *7

  1. As for shift-JIS, GCC of any version cannot process it if -f*-charset options are specified. But, as for shift-JIS, ISO2022-JP and Big5, if the encodings are not converted but supplemented with <backslash>es, the multi-byte characters are output as they are by cc1 on any version of GCC. Also EUC-JP, GB2312, KSC-5601 and UTF-8 are passed as they are, if -f*-charset are not specified. That is to say, the multi-byte characters are treated as single-byte character sequences.
  2. GCC up to V.4.0 / cc1 does not convert back from UTF-8 to the original encodings.
  3. I hope that GCC will change the multi-byte character handling in the near future.

Note:

*1 The output of -dM option, however, slightly differs each other depending on other options. What is worse, most of the predefined macros are undocumented ones. As a result, the whole picture cannot be grasped easily.

*2 MinGW does not support symbolic link. Though the 'ln -s' command exists, it does not link but only copy. Moreover, MinGW's GCC rejects to invoke a shell-script even if it is named cc1. To cope with this, mcpp's MinGW GCC-specific-build generates a binary executable named cc1.exe (copied also to cc1plus.exe) which invokes mcpp.exe or GCC's cc1.exe/cc1plus.exe.

*3 CygWIN / GCC has -mno-cygwin option which alters system include directory and alters GCC's predefined macros. mcpp V.2.6.1 onward, CygWIN GCC-specific-build supports this option and generates two sets of header files for the predefined macros.

*4 On GCC in my FreeBSD 6.3, multi-byte character conversion to UTF-8 does not work at all, though libiconv seems to be linked to them. It was the same with FreeBSD 5.3 and 6.2, too.

*5 This conversion seems not to be done in preprocessing phase, but in compilation phase. Output of -E option is still UTF-8.

*6 GCC V.4.1-4.3 fail to compile due to a bug of GCC, if -save-temps or -no-integrated-cpp option is specified at the same time with -f*-charset option.

*7 When you pass the output of mcpp to cc1, you should not specify -fexec-charset option nor -finput-charset option.

3.9.8. Preprocessing Linux/glibc 2.4

I compiled glibc 2.4 (March, 2006) source, and checked preprocessing problems in it. As a compiler system, I used GCC 4.1.1 with mcpp 2.6.3. Since my machine is x86 type, I did not check the codes for other CPUs.

This is a six years newer version than glibc 2.1.3 (February, 2000) which I checked formerly, so it has naturally some parts largely changed from the old version. However, It has remarkably many parts unchanged. On the whole, most of the problems I noticed in the old version have not been revised, on the contrary, unportable sources have increased.

3.9.8.1. Multi-Line String Literal

The old-fashioned "multi-line string literal" has disappeared.

3.9.8.2. #include_next, #warning

#include_next is found in the following source files. Its occurrence has increased as compared with the six years older version.

catgets/config.h, elf/tls-macros.h, include/bits/dlfcn.h, include/bits/ipc.h, include/fpu_control.h, include/limits.h, include/net/if.h, include/pthread.h, include/sys/sysctl.h, include/sys/sysinfo.h, include/tls.h, locale/programs/config.h, nptl/sysdeps/pthread/aio_misc.h, nptl/sysdeps/unix/sysv/linux/aio_misc.h, nptl/sysdeps/unix/sysv/linux/i386/clone.S, nptl/sysdeps/unix/sysv/linux/i386/vfork.S, nptl/sysdeps/unix/sysv/linux/sleep.c, sysdeps/unix/sysv/linux/ldsodefs.h, sysdeps/unix/sysv/linux/siglist.h

Though the following is not a part of glibc itself but a testcase file to test glibc by 'make check', #include_next is found also in it.

sysdeps/i386/i686/tst-stack-align.h

#warning appears in sysvipc/sys/ipc.h. This directive is in a block to be skipped in normal processing, and does not cause any problem.

3.9.8.3. Variable Argument Macros

There are definitions of variable argument macros in the following files. All of these are that of the old spec since GCC2. There is not any macro of C99 spec, nor even GCC3 spec one.

elf/dl-lookup.c, elf/dl-version.c, include/libc-symbols.h, include/stdio.h, locale/loadlocale.c, locale/programs/ld-time.c, locale/programs/linereader.h, locale/programs/locale.c, locale/programs/locfile.h, nptl/sysdeps/pthread/setxid.h, nss/nss_files/files-XXX.c, nss/nss_files/files-hosts.c, sysdeps/generic/ldsodefs.h, sysdeps/i386/fpu/bits/mathinline.h, sysdeps/unix/sysdep.h, sysdeps/unix/sysv/linux/i386/sysdep.h

The following testcase files also have variadic macro definitions of GCC2 spec.

localedata/tst-ctype.c, posix/bug-glob2.c, posix/tst-gnuglob.c, stdio-common/bug13.c

Moreover, many of the calls of these macros lack actual argument for variable argument. As much as 142 files have such macro calls lacking variable argument, and 120 files of them have such unusual macro calls as the replacement list of which have ", ##" sequence immediately preceding variable argument and hence removal of the ',' happen.

As a variable argument macro specification, C99 one is portable and is recommendable. However, it is not so easy to rewrite GCC specs macro to C99 one. Both of GCC2 spec and GCC3 spec variadic macros do not necessarily correspond to C99 spec one-to-one, because GCC specs cause removal of the preceding comma in case of absence of variable argument. If you rewrite GCC spec macro definition to C99 one, you also need to rewrite macro calls of absent variable argument and supplement an argument.

In glibc 2.1.3, GCC2 spec macros were not so many, and it was not a heavy work for a user to rewrite them with an editor. In glibc 2.4, however, such macro definitions increased and especially their calls vastly increased. As a consequence, it is impossible now for a user to rewrite them.

To cope with this situation, mcpp V.2.6.3 onward implemented GCC3 spec variadic macro for GCC-specific-build only. Furthermore, mcpp V.2.7 implemented GCC2 spec one, too. However, you should not write GCC2 spec macro in your sources, because the spec is too deviant from token-based principle. Since GCC2 spec corresponds to GCC3 spec one-to-one, it is easy to rewrite a macro definition to GCC3 spec, and call of that macro need not be rewritten. The already written macros with GCC2 spec will become a little clearer, if rewritten this way. *1

To rewrite a GCC2 spec variadic macro to GCC3 spec one, for example, change:

#define libc_hidden_proto(name, attrs...)   hidden_proto (name, ##attrs)

to:

#define libc_hidden_proto(name, ...)    hidden_proto (name, ## __VA_ARGS__)

That is, change the parameter attrs... to ..., and change attrs in the replacement-list to __VA_ARGS__.

Note:

*1 As for variadic macro of GCC2 spec and GCC3 spec, see 3.9.1.6, 3.9.6.3 respectively.

3.9.8.4. Empty Argument During Macro Calls

The macro calls with any empty argument are found in as many as 488 source files. They have greatly increased since the old version. C99 approval of empty macro argument may have influenced the tendency.

In particular, math/bits/mathcalls.h has as many as 79 macro calls with empty argument. That is the same with the old version.

3.9.8.5. Object-Like Macros Replaced with Function-like Macro Name

The following files have object-like macro definitions replaced to function-like macro names:

argp/argp-fmtstream.h, hesiod/nss_hesiod/hesiod-proto.c, intl/plural.c, libio/iopopen.c, nis/nss_nis/nis-hosts.c, nss/nss_files/files-hosts.c, nss/nss_files/files-network.c, nss/nss_files/files-proto.c, nss/nss_files/files-rpc.c, nss/nss_files/files-service.c, resolv/arpa/nameser_compat.h, stdlib/gmp-impl.h, string/strcoll_l.c, sysdeps/unix/sysv/linux/clock_getres.c, sysdeps/unix/sysv/linux/clock_gettime.c

elf/link.h has function-like macro definitions replaced to function-like macro names. For example,:

#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
                                        /* sysdeps/generic/ldsodefs.h:46    */
#define _ElfW(e,w,t)    _ElfW_1 (e, w, _##t)            /* elf/link.h:32    */
#define _ElfW_1(e,w,t)  e##w##t                         /* elf/link.h:33    */
#define __ELF_NATIVE_CLASS __WORDSIZE               /* bits/elfclass.h:11   */
#define __WORDSIZE 32           /* sysdeps/wordsize-32/bits/wordsize.h:19   */
#define ELF32_ST_TYPE(val) ((val) & 0xf)                /* elf/elf.h:429    */

with the above macro definitions,

    && ELFW(ST_TYPE) (sym->st_info) != STT_TLS      /* elf/do-lookup.h:81   */

in this macro call, ELFW(ST_TYPE) is expanded with the following steps:

    ELFW(ST_TYPE)
    _ElfW(ELF, __ELF_NATIVE_CLASS, ST_TYPE)
    _ElfW_1(ELF, 32, _ST_TYPE)
    ELF32_ST_TYPE

Then, ELF32_ST_TYPE with the subsequent sequence (sym->st_info) is expanded to ((sym->st_info) & 0xf). That is to say, a function-like macro call of _ElfW_1(ELF, 32, _ST_TYPE) is expanded to name of another function-like macro ELF32_ST_TYPE.

These macros become more clear, if the 3 definitions of above 6 are written as:

#define ELFW( type, val)        _ElfW( ELF, __ELF_NATIVE_CLASS, type, val)
#define _ElfW( e, w, t, val)    _ElfW_1( e, w, _##t, val)
#define _ElfW_1( e, w, t, val)  e##w##t( val)

and if they are used as:

    && ELFW(ST_TYPE, sym->st_info) != STT_TLS

Although these arguments may seem to be a little redundant, these are more natural than the original ones, if we think of function call syntax.

3.9.8.6. Macros Expanded to 'defined'

The following files contain macro definitions whose replacement-lists have the 'defined' token. *1

iconv/skeleton.c, sysdeps/generic/_G_config.h, sysdeps/gnu/_G_config.h, sysdeps/i386/dl-machine.h, sysdeps/i386/i686/memset.S, sysdeps/mach/hurd/_G_config.h, sysdeps/posix/sysconf.c

Those macros are used in some #if lines of the following files, and also some of the above files themselves.

elf/dl-conflict.c, elf/dl-runtime.c, elf/dynamic-link.h

In glibc 2.1.3, malloc/malloc.c had a macro definition of HAVE_MREMAP whose replacement-list contained the 'defined' token. In glibc 2.4, that macro definition has been revised to portable one, nevertheless the unportable macros of the same sort have increased in other source files.

In a #if expression, the result of a macro expansion whose replacement-list has the 'defined' token is undefined according to the Standards, and it is only self-satisfaction of GCC to preprocess the expression plausibly and arbitrarily. In order to make these sources portable among other preprocessors, at least the definitions of these macros should be rewritten, and in some cases the calls of the macros should be rewritten, too. *2

In most cases, the simple rewriting is sufficient as seen in 3.9.4.6. In some cases, however, this method does not work. Those are the cases where evaluation result of 'defined MACRO' differs depending on its timing. For example, sysdeps/i386/dl-machine.h has the following macro definition, which is used in some #if expressions on other files.

#define ELF_MACHINE_NO_RELA defined RTLD_BOOTSTRAP

Rewriting the definition as follows will not do.

#if defined RTLD_BOOTSTRAP
#define ELF_MACHINE_NO_RELA 1
#endif

The macro RTLD_BOOTSTRAP is defined in elf/rtld.c, if and only that file is included before dl-machine.h. In other words, the evaluation result of 'defined RTLD_BOOTSTRAP' depends on the order of including the two files. In order to rewrite these sources portable, the macro ELF_MACHINE_NO_RELA should be abandoned since it is useless macro found only in #if lines, and the #if line:

#if ELF_MACHINE_NO_RELA

should be rewritten as:

#if defined RTLD_BOOTSTRAP

In glibc, this portable style of #if lines are found on many places, at the same time, the undefined style as above example are also found on some places.

Note:

*1 On Linux, /usr/include/_G_config.h is the header file installed from glibc's sysdeps/gnu/_G_config.h, therefore it has the same macro definition as:

#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)

This should be rewritten to:

#if defined (_STATBUF_ST_BLKSIZE)
#define _G_HAVE_ST_BLKSIZE 1
#endif

*2 mcpp V.2.7 and later in STD mode on GCC-specific-build handles 'defined' token generated by macro expansion in #if line like GCC. Yet, such a bug-to-bug handling should not be depended on.

3.9.8.7. Preprocessing .S File

*.S files are provided for each CPU type, so their number is very large and amounts to more than 1000. The files for one CPU type as x86 are some portion of them.

*.S file is an assembler source with inserted preprocessing directives such as #if or #include, comments or macros of C. Since assembler source is not consisted of C token sequence, it accompanies some risks to preprocess it by C preprocessor. To process an assembler source, the preprocessor must pass such characters as % or $ (which are not used in C except in string literal or in character constant) as they are, and retain existence or non-existence of spaces as they are. Furthermore, the preprocessor must relax syntax checking to pass a sequence which would be an error if it was in C source. On the other hand, it must process #if lines or macros like C, and must do some sort of error checking, too. What a nuisance! These specifications have not any logical basis at all, these are GCC's local and mostly undocumented behaviors and no more.

To illustrate the problems, let me take an example of the following fragment from nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S.

    .byte   8               # Return address register
                            # column.
#ifdef SHARED
    .uleb128 7              # Augmentation value length.
    .byte   0x9b            # Personality: DW_EH_PE_pcrel
                            # + DW_EH_PE_sdata4

'#ifdef SHARED' intends to be a directive of C. On the other hand, the latter part of each line starting with # are supposed to be comments. '# column.' is, however, syntactically indistinguishable from invalid directive, since the # is the first non-white-space-character of the line. '# + DW_EH_PE_sdata4' causes even syntax error in C.
Another file has the following line, where a single character appears singly. In C, a pair of the single quote is used to quote a character constant, and unmatched single quote causes a tokenization error.

    movl 12(%esp), %eax     # that `fixup' takes its parameters in regs.

The above pthread_cond_wait.S also has the following line which is a macro call.

versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
          GLIBC_2_3_2)

The macros are defined as:

# define versioned_symbol(lib, local, symbol, version) \
  versioned_symbol_1 (local, symbol, VERSION_##lib##_##version)
                                    /* include/shlib-compat.h:65    */
# define versioned_symbol_1(local, symbol, name) \
  default_symbol_version (local, symbol, name)
                                    /* include/shlib-compat.h:67    */
# define default_symbol_version(real, name, version) \
     _default_symbol_version(real, name, version)
                                    /* include/libc-symbols.h:398   */
#   define _default_symbol_version(real, name, version) \
     .symver real, name##@##@##version
                                    /* include/libc-symbols.h:411   */
#define VERSION_libpthread_GLIBC_2_3_2  GLIBC_2.3.2
                            /* Created by make: abi-versions.h:145  */

The line is expected to be expanded as:

.symver __pthread_cond_wait, pthread_cond_wait@@GLIBC_2.3.2

The problem is the definition of _default_symbol_version. There is no C token containing '@' (except string-literal or character-constant). Though pthread_cond_wait@@GLIBC_2.3.2 is a sequence generated by concatenating some parts with ## operator, this is not a C token. The concatenation generates illegal tokens also in midst of its processing. The macro uses ## operator of C, nevertheless its syntax is far from C.

In order to do a sort of preprocessing on an assembler source, essentially an assembler macro processor should be used. To process assembler codes with C, it is recommended that the asm() or __asm__() function should be used whenever possible, to embed the assembler code in a string literal, and that not *.S but *.c should be used as a file name.
libc-symbols.h has another version of the above macro as follows which is used for *.c. This macro can be processed by Standard-conforming C preprocessor without problem.

#   define _default_symbol_version(real, name, version) \
     __asm__ (".symver " #real "," #name "@@" #version)

glibc also has many *.c or *.h files which use asm() or __asm()__. Nevertheless, it has much more *.S files.

If you process an assembler source by C preprocessor in any way, at least you should use /* */ or // as comment notation instead of #. In actual, many sources of glibc use /* */ or //, whereas some sources use #.

Having said so, mcpp V.2.6.3 onward relaxed grammar checking largely in lang-asm mode to process these unusual sources, considering that glibc 2.4 has too many *.S files and out-of-C-grammar-sources has increased since 2.1.3.

3.9.8.8. Problems of versions.awk, rpcgen and -dM Option

The problem of stdlib/isomac.c which I referred to at 3.9.4.8 is the same in glibc 2.4.

Also the problem of rpcgen is unchanged.

In addition, glibc 2.4 has scripts/versions.awk file, which presupposes GCC's peculiar behavior about the number of line top spaces of preprocessed output. In order to use mcpp or other preprocessors, this file should be revised as follows.

$ diff -c versions.awk*
*** versions.awk        2006-12-13 00:59:56.000000000 +0900
--- versions.awk.orig   2005-03-23 10:46:29.000000000 +0900
***************
*** 50,56 ****
  }

  # This matches the beginning of a new version for the current library.
! /^ *[A-Z]/ {
    if (renamed[actlib "::" $1])
      actver = renamed[actlib "::" $1];
    else if (!versions[actlib "::" $1] && $1 != "GLIBC_PRIVATE") {
--- 50,56 ----
  }

  # This matches the beginning of a new version for the current library.
! /^  [A-Za-z_]/ {
    if (renamed[actlib "::" $1])
      actver = renamed[actlib "::" $1];
    else if (!versions[actlib "::" $1] && $1 != "GLIBC_PRIVATE") {
***************
*** 65,71 ****
  # This matches lines with names to be added to the current version in the
  # current library.  This is the only place where we print something to
  # the intermediate file.
! /^ *[a-z_]/ {
    sortver=actver
    # Ensure GLIBC_ versions come always first
    sub(/^GLIBC_/," GLIBC_",sortver)
--- 65,71 ----
  # This matches lines with names to be added to the current version in the
  # current library.  This is the only place where we print something to
  # the intermediate file.
! /^   / {
    sortver=actver
    # Ensure GLIBC_ versions come always first
    sub(/^GLIBC_/," GLIBC_",sortver)

3.9.8.9. -include, -isystem, -I- Options

-isystem and -I- options are no longer used.

On the other hand, -include option is used extremely frequently. A header file include/libc-symbols.h is included by this option as many as 7000 times. This -include is an option to push out a #include line from source to makefile. It makes source incomplete, and is not recommendable.

3.9.8.10. Undocumented Predefined Macros

This is not a problem of glibc but of GCC. While a few important predefined macros were undocumented in GCC 2, they got documented in GCC 3. On the other hand, GCC 3.3 and later predefines many macros, and most of them are undocumented.

3.9.8.11. Other Problems

debug/tst-chk1.c has a queer part which is not processed as its intension by other preprocessor than GCC, unless revised as follows.

$ diff -cw tst-chk1.c*
*** tst-chk1.c  2007-01-11 00:31:45.000000000 +0900
--- tst-chk1.c.orig     2005-08-23 00:12:34.000000000 +0900
***************
*** 113,119 ****
  static int
  do_test (void)
  {
-   int   arg;
    struct sigaction sa;
    sa.sa_handler = handler;
    sa.sa_flags = 0;
--- 113,118 ----
***************
*** 135,146 ****
    struct A { char buf1[9]; char buf2[1]; } a;
    struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa;

  #ifdef __USE_FORTIFY_LEVEL
!   arg = (int) __USE_FORTIFY_LEVEL;
  #else
!   arg = 0;
  #endif
!   printf ("Test checking routines at fortify level %d\n", arg);

    /* These ops can be done without runtime checking of object size.  */
    memcpy (buf, "abcdefghij", 10);
--- 134,146 ----
    struct A { char buf1[9]; char buf2[1]; } a;
    struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa;

+   printf ("Test checking routines at fortify level %d\n",
  #ifdef __USE_FORTIFY_LEVEL
!         (int) __USE_FORTIFY_LEVEL
  #else
!         0
  #endif
!         );

    /* These ops can be done without runtime checking of object size.  */
    memcpy (buf, "abcdefghij", 10);

Contrary to its innocent looking, the original source defines printf() as a macro, and as its consequence, #ifdef and other directive-like lines are usually eaten as an argument of the macro call. According to the Standards, the result is undefined when there is a line in an argument of a macro which would otherwise act as a directive. Since directive processing and macro expansion should be done in the same translation phase, it is an arbitrariness of GCC to process directive first. In the first place, processing of #ifdef __USE_FORTIFY_LEVEL line also contains macro processing, therefore it is extremely arbitrary to process this line and the other directive-like lines first then expand printf() macro. C preprocessing should be done sequentially from the top.

The configure script of glibc also has a portion to use GCC's peculiar help message. The script searches help message of compiler for "-z relro" option. If you use mcpp as a preprocessor, this portion does not yield the expected result. In spite of this problem, fortunately, compiling and test of glibc is done normally.

By the way, while GCC up to 3.2 appended many useless -A options by default on its invocation, GCC 3.3 onward ceased to do it.

3.9.8.12. Increasing Dependency on GCC

Most of the portability problems I had found in glibc 2.1.3 have not been cleared in glibc 2.4 the six years newer version. On the contrary, number of sources lacking portability has increased.

There have been a few improvements such as disappearance of multi-line-string-literal, -isystem, -I- options and -A options on GCC side.

Meanwhile, sources with such unportable features have largely increased as #include_next, variadic macro of GCC2 spec, its call without variable argument, macro definition with 'defined' token in its replacement-list, *.S file and -include option. Macro calls with an empty argument have also increased. Above all it is most annoying that the writings which do not correspond to Standard C one-to-one, and hence cannot be easily converted to portable one, have increased.

All of these are problems of dependency on GCC's local specification and undocumented behavior. In a large scale software as glibc, once such unportable sources are created, it becomes difficult to revise them because many source files are interrelated. As a consequence, the same writings tend to be inherited for years, and even new sources are written so as to suit the old interfaces. For example, it shows this relationship directly that only the variadic macros of GCC2 spec are used, and neither of C99 spec nor GCC3 spec are not used at all. Besides, even if some unportable parts in a few sources are revised, at the same time the old unportable codings often appear newly in other sources. The old style writings are not easily cleared.

On the other hand, change of GCC behavior breaks many sources, and the possible influence becomes greater with time, therefore GCC becomes difficult to change its behavior. I think that both of GCC and glibc need to tidy up their old local specifications and old interfaces drastically in the near future.

3.9.9. The Problems of Linux / stddef.h, limits.h and #include_next

On Linux, the system compiler is GCC, and the standard library is glibc. In these circumstances, there are some system headers which presuppose only GCC. Those are the obstacles to use other compiling tools than GCC such as mcpp of compiler-independent-build. For example, stddef.h and some other Standard header files are located only in GCC's version specific include directory, and are not found in /usr/include. These are rude deficiencies of the system header structure, and mcpp needs some workarounds for them.

On Linux, GCC installs a version specific include directory such as /usr/lib/gcc-lib/SYSTEM/VERSION/include where the Standard headers stddef.h, limits.h and some others are located. These headers and GCC behavior on them are queer. The problems are the same on CygWIN as on Linux. Mac OS X also has a few problems on some Standard headers.

3.9.9.1. /usr/include Lacks Standard Headers

In the first place, on Linux, five of the Standard C header files float.h, iso646.h, stdarg.h, stdbool.h, stddef.h are located only in the GCC version specific directory, not in /usr/include nor /usr/local/include. The system headers on Linux seem to more or less intend that compiler systems other than GCC use only /usr/include and GCC uses its version specific directory in addition to /usr/include. In fact, /usr/include lacks some Standard headers, that is the problem for non-GCC compilers or preprocessors.

If non-GCC preprocessor uses also GCC version specific directory, then on limits.h in this directory, the preprocessor encounters #include_next which is a GCC specific directive. If that is the case, why doesn't the preprocessor implement #include_next? Then, the limits.h causes a problem, because it is not cleanly written. What is worse, GCC V.3.3 or later predefines practically by itself the macros to be defined by limits.h, hence the header is useless for other preprocessors.

Besides, as for GCC itself, it shows queer behavior with #include_next in this header.

Although these problems are complicated to explain, I will describe them here, because they have been neglected for years for some reason.

Note that only mcpp of compiler-independent-build suffers this problem. GCC-specific-build is not affected.

3.9.9.2. Queer Handling of #include_next

The include directories for GCC are typically set as:

/usr/local/include
/usr/lib/gcc-lib/SYSTEM/VERSION/include
/usr/include

These are searched from upper to lower. The second is the GCC specific include directory. SYSTEM is i386-vine-linux, i368-redhat-linux or such, VERSION is 3.3.2, 3.4.3 or such. If you install another version of GCC into /usr/local, the /usr/lib/gcc-lib part above will become /usr/local/lib/gcc. In C++, some other directories are set with higher priority than /usr/local/include. For GCC V.3.* and 4.*, those are:

/usr/include/c++/VERSION
/usr/include/c++/VERSION/SYSTEM
/usr/include/c++/VERSION/backward

The name of these directories seem GCC specific, nevertheless no other C++ standard directories do not exist, so the other preprocessors can use no directories but these. For GCC 2.95, the include directory in C++ was:

/usr/include/g++-3

In addition, the directories specified by -I option or by environment variables are prepended to the list.

Let me take an example of limits.h in C on GCC V.3.3 or later focusing on definition of LONG_MAX, in order to make the explanations below simple. There are two limits.h: one in /usr/include and another in the version specific directory.

#include <limits.h>

By this line, GCC includes /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h. This header file starts as:

#ifndef _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#ifndef _LIBC_LIMITS_H_
#include "syslimits.h"
#endif

Then, GCC includes /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h which is a short file as:

#define _GCC_NEXT_LIMITS_H
#include_next <limits.h>
#undef _GCC_NEXT_LIMITS_H

Now, limits.h is included again. Which limits.h? Since this directive is #include_next, it would skip the /usr/lib/gcc-lib/SYSTEM/VERSION/include, and would search /usr/include. GCC's cpp.info says:

This directive works like `#include' except in searching for the specified file: it starts searching the list of header file directories _after_ the directory in which the current file was found.

In fact, however, GCC does not include /usr/include/limits.h, but includes /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h again somehow.
This time _GCC_LIMITS_H_ has been defined already, so the block beginning with the line:

#ifndef _GCC_LIMITS_H_

is skipped, and the next block is evaluated:

#else
#ifdef _GCC_NEXT_LIMITS_H
#include_next <limits.h>
#endif
#endif

Again, just the same #include_next <limits.h> which were found in /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h. Does GCC include /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h again as the previous time, which is the current file, and run into infinite recursion? No, it does not, but it includes /usr/include/limits.h this time. The behavior of GCC is beyond my understanding.

In /usr/include/limits.h, <features.h> and some other headers are included. Also, /usr/include/limits.h has a block beginning with the line:

#if !defined __GNUC__ || __GNUC__ < 2

In this block, <bits/wordsize.h> is included, and the Standard required macros are defined depending whether wordsize is 32 bit or 64 bit. For example, if wordsize is 32 bit, LONG_MAX is defined as:

#define LONG_MAX     2147483647L

Of course, GCC skips this block. Then, going to the end of this file, it returns to /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h. Then, ending this file of the second inclusion, it returns to /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h. Then, this file ends too, and GCC returns to the first inclusion of /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h. In this file, after the above cited part, there are definitions of the Standard required macros. For instance, LONG_MAX is defined as:

#undef LONG_MAX
#define LONG_MAX __LONG_MAX__

Then, the file ends.

#include <limits.h>

The processing of this line has ended. After all, LONG_MAX is defined to __LONG_MAX__ and it is the end. What is __LONG_MAX__? As a matter of fact, GCC V.3.3 or later predefines many macros including __LONG_MAX__ which is predefined to 2147483647L for 32 bit system. As with the other Standard required macros, the situations are almost the same as LONG_MAX, because they are defined using the predefined ones. If so, what is the purpose of these complicated header files and #include_next handling at all?

The behavior of GCC V.2.95, V.3.2, V.3.4, V.4.0 and V.4.1 on #include_next is the same as V.3.3. That is to say:

#include_next <limits.h>

by this line in /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h, GCC includes /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h, and by the same line in this file:

#include_next <limits.h>

it includes /usr/include/limits.h. As a result, in processing the line:

#include <limits.h>

/usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h is included twice. This duplicate inclusion happens to produce the same result, nevertheless it is redundant, and first of all, the behavior differs from the specification and is not consistent. In addition, this part of the file is redundant if the behavior accords to the specification.

#else
#ifdef _GCC_NEXT_LIMITS_H
#include_next <limits.h>
#endif

3.9.9.3. Standard Headers not Available for Preprocessors other than GCC

Now, what happens to compiler or preprocessor other than GCC using Linux standard headers? stddef.h and some other Standard headers are not found in /usr/include nor /usr/local/include. If so, how about using also GCC version specific directory?

#include <limits.h>

By this line, the preprocessor includes /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h, and from this file it includes /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h, and in this file, it sees the line:

#include_next <limits.h>

Then, how about implementing #include_next? If the #include_next is implemented as its specification, the preprocessor searches by this line the "next" include directory /usr/include, and includes /usr/include/limits.h. Then, this non-GCC preprocessor processes the block beginning with this line:

#if !defined __GNUC__ || __GNUC__ < 2

In this block it defines LONG_MAX as:

#define LONG_MAX     2147483647L

and defines also the other macros appropriately. Then, it ends this file, and returns to /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h. Then, it ends this file, and returns to /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h. And it encounters these lines:

#undef LONG_MAX
#define LONG_MAX __LONG_MAX__

At the end of the long run, all the correct definitions are canceled, and they become the undefined name __LONG_MAX__ or such!

Up to GCC V.3.2, the corresponding part of version specific limits.h had the lines like:

#define __LONG_MAX__ 2147483647L

Hence, the canceled macros are redefined correctly. Although the most part of the processing is useless, the results were correct. With the header files of V.3.3 or later, a non-GCC preprocessor is taken around here and there to get vain results.

3.9.9.4. Workarounds for the Present

The problems are summarized as below: *1, *2, *3, *4

  1. /usr/include lacks Standard C headers float.h, iso646.h, stdarg.h, stdbool.h and stddef.h which are necessary to make Linux system headers usable to non-GCC compiler system.
  2. C++ include directories do not exist other than /usr/include/c++/VERSION/*. In order to make C++ standard include directories independent on GCC version, /usr/include/c++ should be used instead of /usr/include/c++/VERSION which should be limited to GCC specific headers. Though, having said that, this is a difficult task, since the C++ standard library is libstdc++ distributed with GCC on all of FreeBSD, Linux and Mac OS X.
  3. The behavior of GCC on #include_next differs from its specification and is inconsistent.
  4. It is meaningless to process the complicated limits.h headers, since GCC predefines the Standard required macros by itself in effect. It is doubly meaningless, since /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h does #undef all. As far as Linux and CygWIN are concerned, there seems to be no necessity for splitting limits.h to two. Since these headers in this directory are auto-generated ones by GCC installation, some redundancies are inevitable. Yet, these are too dirty to install as system headers.

Under these problems lies the excessively complicated system header structure. The extension directive #include_next enhances the complication. The use of this directive is very limited. Though GCC and glibc use it in compiling and installing of themselves, it does not exist in the installed system headers except for limits.h. The rare example in limits.h causes GCC above mentioned confusion. This presents a question on the reason of its existence.

Anyway, the compiler-independent-build of mcpp needs the following workarounds for the present. In order to avoid confusion, the compiler-independent-build does not implement #include_next nor uses GCC specific include directories.

  1. Link /usr/include/stddef.h to /usr/lib/gcc-lib/SYSTEM/VERSION/include/stddef.h. In case of multiple versions of GCC have been installed, a link to any of them will work for mere preprocessing. This setting does no harm on GCC nor GCC-specific-build of mcpp. The same can be said about stdarg.h, though it expands macros to GCC built-in functions.
  2. Copy or move iso646.h and stdbool.h from one of the GCC specific directories to /usr/include, since these are quite simple headers and independent on any system. As for limits.h, the existing /usr/include/limits.h is enough for non-GCC preprocessor.
  3. float.h is useless for other preprocessor, such as DBL_MAX_EXP is defined to __DBL_MAX_EXP__. If required, you must write the header referring to the internal setting of GCC or some other source. *5
  4. Do not set GCC specific include directory in C include directories list by environment variable.
  5. Set C++ include directories by environment variable CPLUS_INCLUDE as /usr/include/c++/VERSION:/usr/include/c++/VERSION/SYSTEM:/usr/include/c++/VERSION/backward.

For the GCC-specific-build of mcpp, no special setting is required, because it has GCC specific include directories list, implements #include_next as its specification, and predefines the macros as GCC does.

Note:

*1 I have checked the descriptions of this 3.9.9 section on Linux / GCC 2.95.3, 3.2, 3.3.2, 3.4.3, 4.0.2, 4.1.1, 4.3.0 and on CygWIN / GCC 2.95.3, 3.4.4. As with CygWIN, the behavior on #include_next was as its specification on GCC 2.95.3, but on 3.4.4 it changed to the same behavior as Linux. The C++ include directories in CygWIN was /usr/include/g++-3 on 2.95.3, while they are /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++ and its sub-directories on 3.4.4.

*2 On FreeBSD 6.2 or 6.3 and its bundled GCC 3.4.6, all the Standard C headers are present in /usr/include, #include_next is not used in any system headers, and GCC specific C include directory does not exist. However, C++ include directories are GCC version dependent as /usr/include/c++/3.4, /usr/include/c++/3.4/backward.
Even on FreeBSD, an installation of another version of GCC makes GCC-version-specific include directory. Most of the headers in the directory are redundant. However, the headers in /usr/include remain unchanged.

*3 On Mac OS X Leopard / Apple-GCC 4.0.1, as on Linux, there is a GCC-version-specific include directory, #include_next is used in limits.h and a few other headers, also two limits.h are found. However, #include_next in syslimits.h has been deleted by Apple. float.h, iso646.h, stdarg.h, stdbool.h, stddef.h are all found in /usr/include, hence so much special settings are not necessary for mcpp. But, float.h, stdarg.h are only for GCC and Metrowerks (for powerpc), so if you use them with mcpp, you must rewrite float.h yourself and make stdarg.h to include GCC-version-specific one. Note that some definitions in float.h are different between x86 and powerpc.

*4 On MinGW / GCC 3.4.*, though the include directories and their precedence differ from the other systems, the behavior of GCC on #include_next is the same, and also some Standard headers are not in the standard include directory /mingw/include but in its version-specific-directory.

*5 float.h for i386 system can be written as follows referring to GCC's setting:

/* float.h  */

#ifndef _FLOAT_H___
#define _FLOAT_H___

#define FLT_ROUNDS      1
#define FLT_RADIX       2

#define FLT_MANT_DIG    24
#define DBL_MANT_DIG    53
#define LDBL_MANT_DIG   64

#define FLT_DIG         6
#define DBL_DIG         15
#define LDBL_DIG        18

#define FLT_MIN_EXP     (-125)
#define DBL_MIN_EXP     (-1021)
#define LDBL_MIN_EXP    (-16381)

#define FLT_MIN_10_EXP  (-37)
#define DBL_MIN_10_EXP  (-307)
#define LDBL_MIN_10_EXP (-4931)

#define FLT_MAX_EXP     128
#define DBL_MAX_EXP     1024
#define LDBL_MAX_EXP    16384

#define FLT_MAX_10_EXP  38
#define DBL_MAX_10_EXP  308
#define LDBL_MAX_10_EXP 4932

#define FLT_MAX         3.40282347e+38F
#define DBL_MAX         1.7976931348623157e+308
#define LDBL_MAX        1.18973149535723176502e+4932L

#define FLT_EPSILON     1.19209290e-7F
#define DBL_EPSILON     2.2204460492503131e-16
#define LDBL_EPSILON    1.08420217248550443401e-19L

#define FLT_MIN         1.17549435e-38F
#define DBL_MIN         2.2250738585072014e-308
#define LDBL_MIN        3.36210314311209350626e-4932L

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define FLT_EVAL_METHOD 2
#define DECIMAL_DIG     21
#endif /* C99 */

#endif /* _FLOAT_H___ */

3.9.10. Problems of Mac OS X / Apple-GCC and its System Headers

On V.2.7, mcpp began to support Max OS X / GCC. This section describes the problems of the system found by mcpp. The author, however, does not know the system so much yet. He has only compiled mcpp itself and firefox on the system. He knows nothing about Objective C nor Objective C++.

Since GCC is practically the only compiler on this system now, some dependencies on GCC-local specs are found in some of its system headers. Such dependencies are not so much as Linux, maybe because its standard library is not glibc. But, they are not so few as FreeBSD. Some tidy-ups are desirable.

Another characteristic of this system is that the system compiler is a GCC largely modified and extended by Apple. In the system headers and some sources of Apple on Max OS X, dependencies on Apple-GCC-local specs are more conspicuous than those on general-GCC-local specs. In particular, the extended specs to support both of Intel-Mac and PowerPC-Mac on a machine are the most characteristic.

Here, we refer to the system of Mac OS X Leopard / Apple-GCC 4.0.1.

3.9.10.1. #include_next, #warning

The GCC-local directive #include_next are not many, but found in float.h, stdarg.h, varargs.h in /usr/include/ and the files of the same name in /Developer/SDKs/MacOSX10.*.sdk/usr/include/. All of them are to include different real header files depending on whether the compiler is GCC or Metrowerks. When the compiler is GCC, stdarg.h, for example, does '#include_next <stdarg.h>'.
The limits.h in GCC-version-specific include directory has #include_next as Linux, but the one in syslimits.h has been removed and a bit tidied up.

Though this directive is used modestly, it is a problem that float.h, stdarg.h presuppose only GCC and Metrowerks. Those can be written more portable as on FreeBSD. *1
In addition, #include_next for GCC on a header in /usr/include is a nonsense, because the priority of that include directory is lower than GCC-version-specific one. Consequently this #include_next is never executed.

Another GCC-local directive #warning is sometimes found in objc/, wx-2.8/wx/ and a few other directories in /usr/include/, and their corresponding directories in /Developer/SDKs/MacOSX*.sdk/usr/include/. Most of the directives are warnings against obsolete or deprecated files or usages.
backward_warning.h in /usr/include/c++/VERSION/backward/ and its corresponding file in /Developer/SDKs/MacOSX*.sdk/ are to execute #warning against these deprecated headers. And all the headers in the directories include this header. This is the same with Linux or FreeBSD.

Note:

*1 About how to use these headers with compiler-independent-build of mcpp, refer 3.9.9.4 and its note 3.

3.9.10.2. A Macro Expanded to 'defined'

/usr/include/sys/cdefs.h and its corresponding file of the same name in /Developer/SDKs/MacOSX*.sdk/ have a macro definition as:

#define __DARWIN_NO_LONG_LONG   (defined(__STRICT_ANSI__) \
                && (__STDC_VERSION__-0 < 199901L) \
                && !defined(__GNUG__))

And it is used in stdlib.h and a few others as:

#if __DARWIN_NO_LONG_LONG

This macro should be defined as: *1

#if     defined(__STRICT_ANSI__) \
                && (__STDC_VERSION__-0 < 199901L) \
                && !defined(__GNUG__)
#define __DARWIN_NO_LONG_LONG   1
#endif

Note:

*1 As for its reason, see 3.9.4.6 and 3.9.8.6.

3.9.10.3. Tokens in #endif line

gssapi.h, krb5.h, profile.h in /System/Library/Frameworks/Kerberos.framework/Headers have queer #endif lines like:

#endif \* __KERBEROS5__ */

This \* __KERBEROS5__ */ seems to intend to be a comment. I cannot understand why they must invent such a writing. Though GCC usually warns at it, Apple-GCC does not issue any warning even if -pedantic or any other options are specified. Apple-GCC does not warn at the following case, too. It still trails a sense of pre-C90.

#endif __KERBEROS5__

3.9.10.4. Some Special Usages of Macro

As far as a compilation of firefox 3.0b3pre source is concerned, any of the following special usages of macro, which are frequently found in glibc sources and Linux system headers, is not found in the Mac OS X system headers included from the firefox source.

3.9.10.5. Apple-GCC's Peculiar Specifications

Apple-GCC has some peculiar specifications different from the general GCC.

3.9.11. Preprocessing firefox 3.0b3pre

I compiled source of firefox developing version 3.0b3pre (January, 2008), or 3.0-beta3-prerelease, by GCC replacing its preprocessor with mcpp V.2.7 on Linux/x86 + GCC 4.1.2 and Mac OS X + GCC 4.0.1. mcpp were executed with -Kv option passing its output to cc1 (cc1plus). As its results, the compilations successfully completed, and the firefox binaries were generated. *1

The preprocessing portability of firefox source on the whole is rather high. The dependencies on GCC-local specifications, such as frequently found in glibc sources, are not found so many. It is portable enough to officially support both of GCC on Linux, Mac OS X and Visual C++ on Windows.

Preprocessing portability of a source is, however, not necessarily sufficient, even if GCC and Visual C pass it. In the sections below, I will check some problems, sometimes comparing them with glibc sources. I omit explanations on GCC's problems here to avoid duplication. For GCC's problems, refer to 3.9.4, 3.9.8 , which also comment on glibc sources. *2

Note:

*1 I checked out the sources from CVS repository of mozilla.org. One of the motivations to compile firefox source was to test -K option of mcpp. This option was proposed by Taras Glek, and he was working on refactoring of C/C++ source at mozilla.com. So, I also used firefox source to test -K option and other behaviors of mcpp. About -K (-Kv) option, refer to 2.4.

*2 There is a list of coding-guidelines for firefox as below. But, its content is too old.
portable-cpp

3.9.11.1. GCC-local specifications are rarely used

The following GCC-local-specs, which are sometimes used in glibc sources, are not used in firefox sources. Though compiling firefox on Linux includes system headers, and some of which contain such as GCC2-spec variadic macros, they are not firefox sources themselves.

The following features are not used even in recent glibc, and not used in firefox at all.

3.9.11.2. #include_next

However, a lot of #include_next are found only in one directory: config/system_wrappers/, which is generated by configure. All of the 900 files generated in the directory are short header files of the same pattern. For example, stdio.h is:

#pragma GCC system_header
#pragma GCC visibility push(default)
#include_next <stdio.h>
#pragma GCC visibility pop

This is a code to utilize '#pragma GCC visibility *' directive implemented in GCC 4.*. At the same time, there is a file 'config/gcc_hidden.h' as below. The file is specified by -include option for most of the translation units, and read in at the start of the units.

#pragma GCC visibility push(hidden)

system_wrappers directory should be the include directory with the highest priority, so you should specify it as a first argument of -I option. In spite of such a constraint, this usage of #include_next is simple and seems to has no problem.

On the other hand, for many sources in nsprpub directory, '-fvisibility=hidden' option is used instead of '-include gcc_hidden.h', and the headers in system_wrappers are not used. This nsprpub directory seems still to be reorganized.

3.9.11.3. Using C99 specs without specifying C99

Many sources use C99 specifications without specifying C99. GCC use "gnu89" spec by default on *.c source, which is a compromising spec of C90 plus some of C99 specs and GCC-local specs. Some of firefox sources use the following C99 specs implicitly, depending on GCC's default behavior.

Above specifications are also available on Visual C 2005, 2008. Since GCC has -std=c99 option, we might use this to specify C99 explicitly. Visual C, however, has no option to specify a version of Standard. We cannot help to use C99 specs implicitly. Therefore, firefox sources cannot be blamed for using C99 specs implicitly, in the current states of the major compiler-systems. *1

By the way, firefox sources do not use variadic macro for some reason, in spite of using some other C99 specs implicitly. Visual C up to 2003 did not implement variadic macro. Is that why firefox did not use the feature? The circumstances has changed since Visual C 2005 implemented it.

Note:

*1 On C++, GCC defaults to "gnu++98" spec, which is explained as "C++98 plus GCC extensions". It has in actual, however, some C99 specs mixed. Meanwhile, Visual C says that it is based on C90 and C++98 for C and C++ respectively. In actual, both of C and C++ of Visual C have C99 features mixed in it as well as a few Visual C extensions, especially in Visual C 2005 and 2008. Both of GCC and Visual C have such mixture of versions of Standard and their own extensions and modifications, thus bring about some ambiguities. The absence of option in Visual C to specify a version of Standard is the most inconvenient problem.

3.9.11.4. Object-like macro replaced with function-like macro name

Object-like macro replaced with function-like macro name is found sometimes in many other programs, and is found also in firefox sources below, though not frequently.

content/base/src/nsTextFragment.h, modules/libimg/png/mozpngconf.h, modules/libjar/zipstub.h, modules/libpr0n/src/imgLoader.h, nsprpub/pr/include/obsolete/protypes.h, nsprpub/pr/include/private/primpl.h, nsprpub/pr/include/prtypes.h, parser/expat/lib/xmlparse.c, security/nss/lib/jar/jarver.c security/nss/lib/util/secport.h, xpcom/glue/nsISupportsImpl.h

In addition, building of firefox creates, in a directory for developing environment, many links to header files, which are copied into /usr/include/firefox-VERSION/ when you install developing environment for firefox. Some of these header files have symbolic links to the above files. mozilla-confic.h, that is created by configure, has a macro definition of this kind, too.

These macros should be written as function-like macro to improve readability. In actual, many other macros in firefox sources are defined as function-like macro replacing to another function-like macro with the same arguments. There are coding style differences among the authors. It would be better to set a coding guideline on this matter.

3.9.11.5. Macro expanded to 'defined'

A Macro with 'defined' token in its replacement text, sometimes found in glibc, is found in firefox only once.

modules/oji/src/nsJVMConfigManagerUnix.cpp defines a macro as:

#define NS_COMPILER_GNUC3 defined(__GXX_ABI_VERSION) && \
                          (__GXX_ABI_VERSION >= 102) /* G++ V3 ABI */
and uses it in itself as:

#if (NS_COMPILER_GNUC3)

This macro should be removed and the #if line should be rewritten as:

#if defined(__GXX_ABI_VERSION) && (__GXX_ABI_VERSION >= 102) /* G++ V3 ABI */

Maybe this file is to be compiled only by GCC, nevertheless it is not good practice to depend on preprocessor's wrong implementation.

Note:

*1 GCC-specific-build of mcpp V.2.7 enabled GCC-like handling of 'defined' in macro on #if line. But mcpp warns at it, and you would better to revise the code.

3.9.11.6. Tokens in #endif line

The following files in jpeg directory have #endif lines with comments without comment mark. All of the lines has appeared by some recent updates.

jmorecfg.h, jconfig.h, jdapimin.c, jdcolor.c, jdmaster.c

Though this style of writing was frequently seen in some sources for UNIX-like systems up until middle of 1990s, it has almost completely disappeared nowadays, and cannot be found even in that glibc sources. GCC usually warns at it as expected. For all that, these sources take such a writing style. Only Apple-GCC does not warn at it. Have these sources been edited on Mac OS?

3.9.11.7. Assembler Source Which Needs Preprocessing

The assembler sources are written as *.s (*.asm) files, and some of which contain macros, but in principle, they do not call for preprocessor.

On Mac OS X / ppc, however, there is only one exception. xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s calls for preprocessor, because it has a #if block containing only one line. The block seems to be unnecessary already.

3.9.11.8. -include option

Compilation of firefox begins with configure, which generates mozilla-config.h. In compilation of most of the sources, this header file is specified by -include option. config/gcc_hidden.h is also specified similarly. Why don't the sources #include these headers at their top?

3.9.11.9. Redefinition of macro

Some silent redefinition of macros are found, though they are rare.

3.9.11.10. Too long comments

The following files have too long comments crossing over several hundred lines or more.

extensions/universalchardet/src/base/Big5Freq.tab, extensions/universalchardet/src/base/EUCKRFreq.tab,intl/unicharutil/src/ignorables_abjadpoints.x-ccmap, layout/generic/punct_marks.ccmap

Especially, in the directories intl/uconv/ucv*/, there are many files with too long comments. There is even a case of single comment crossing over 8000 lines! All of these files have name of *.uf or *.ut, and are mapping tables between Unicode and each Asian encodings, generated automatically by some tool. They do not seem to be source of C/C++, but they are included from other C++ sources. Most part of these files are comments, which seem to be a sort of document or table for some other tool.

It is not recommendable to include long documents or tables in source files. They should be separated from source files, even if placed in source tree.

Though these files are used in Linux, they are not used in Mac OS X. On the other hand, on Mac OS X, system headers in framework directories are frequently used, and some of them are queer files mostly occupied with comments.

3.9.11.11. Mixed encodings of newline

The encoding of newline in firefox source is [LF]. A few files, however, have a small block of lines ending with [CR][LF]. All of these [CR][LF] lines seem to be fragments inserted as patches. Some conversion tools should be used when one edit source file on Windows.


3.10. Visual C++ System Header Problems

I used mcpp to preprocess some sample programs provided by Visual C++ 2003, 2005 and 2008. The system headers seem to have only a few compatibility problems shown below. These problems are often seen in other compile systems and do not have a serious impact on preprocessing.

  1. Since when Visual C++ scarcely implemented the C99 specifications, // comments have often been used in C source code.
  2. Object-like macro definitions that are expanded into function-like macro names are sometimes found.
  3. On Visual C++ 2003, there was one wrong macro definition in limits.h. (It was revised on Visual C++ 2005. See Note 2 in cpp-test.html#5.1.3.1)

Although the Linux system-headers and glibc sources often contain GCC local specification based coding, Visual C++ system headers has only a few Visual C++ local coding.

3.10.1. Comment Generating Macro?

I found only one outrageous macro in Visual C++. Vc7/PlatformSDK/Include/WTypes.h has the following macro definition: *1

#define _VARIANT_BOOL   /##/

This macro definition is used in oaidl.h and propidl.h in Vc7/PlatformSDK/Include/ as follows:

_VARIANT_BOOL bool;

What does this macro aim at?

This macro seems to expect _VARIANT_BOOL to be expanded into // and the line to be commented out. Actually, this expectation is met in Visual C cl.exe !

In the first place, // is not a token (preprocessing-token). Macro definitions should be processed and expanded after source are parsed into tokens and a comment is converted into one space. Therefore, it is irrational for a macro to generate comments. When this macro is expanded into //, the result is undefined because // is not a valid preprocessing-token.

In order to use these header files with mcpp, comment out these macro definitions and change many _VARIANT_BOOL occurrences as follows:

#if !__STDC__ && (_MSC_VER <= 1000)
    _VARIANT_BOOL bool;
#endif

If you use only Visual C 5.0 or later, this line can be simply commented out as follows:

// _VARIANT_BOOL bool;

This macro is, indeed, out of question, however, it is Visual C/cl.exe, which allows such an outrageous macro to be preprocessed as a comment, should be blamed. This example reveals the following serious problems this preprocessor has:

  1. Preprocessing is not token-based but character-based at least in this example.
  2. The macro expansion result is treated as comment, which indicates the translation phases are confusing.

Probably, the cl.exe preprocessor was developed based on a very old somewhat character-based preprocessor. It is easy to presume that the preprocessor has been upgraded by repeating partial revision to the old preprocessor.

There are many preprocessors which presumably have a very old program structure. GCC 2/cpp, shown in 3.9, is one of such preprocessors. Repeated partial revision of such a preprocessor will only makes its program structure more complicated. However much such revision may be made, there are limits to quality such preprocessor can achieve. Unless a old source is given up and completely rewritten, a clear and well-structured preprocessor cannot be obtained.

At GCC 3/cpp0, a total revision was made to GCC 2; the entire source code was rewritten. So, GCC 3/cpp0 has become quite different from GCC 2. Although mcpp was initially developed based on the source of an old preprocessor, DECUS cpp, the source code was totally rewritten soon.

Note:

*1 Visual C++ 2005 Express Edition does not contain Platform SDK. However, you can download "Platform SDK for Windows 2003", and use it with VC2005. wtypes.h, oaidl.h, propidl.h in this PlatformSDK/Include directory also have the same macro definition and its usage as VC2003 Platform SDK.
Also on Visual C++ 2008, in the header files of the same name in 'Microsoft SDKs/Windows/v6.0A/Include' directory, that macro definition and its usage are quite the same.

3.10.2. '$' in Identifiers

Another problem is use of '$' in identifiers. Its use in macro names suddenly increased in the system headers on Visual C++ 2008. Though such macros were also found on Visual C++ 2005, they were rare. But, on Visual C++ 2008, they are found here and there.

'Microsoft Visual Studio 9.0/VC/include/sal.h' is the most conspicuous one. This header defines macros for so-called SAL (standard source code annotation language) of Microsoft, and has many names containing '$'. This file is included from many standard headers via 'Microsoft Visual Studio 9.0/VC/include/crtdefs.h', so most sources are compiled with these macros without knowing it.

If you specify -Za option to invoke the compiler cl, the SAL is disabled and all of the names with '$' in the sal.h disappear. The necessity of this notation is, however, hard to understand. Though GCC also enables '$' in identifiers by default, its actual use is rarely found nowadays.

This kind of names are also found in the system headers named specstrings*.h in 'Microsoft SDKs/Windows/v6.0A/Include' directory. They are included from Windows.h via WinDef.h, and the names with '$' do not disappear even -Za option is specified. The option causes only errors. So, you cannot use the -Za option to compile a source which includes Windows.h.


4. Implementation-defined Behaviors

This chapter does not contain all the C preprocessor specifications. For details on Standard C preprocessing, refer to cpp-test.html. For mcpp behaviors in each mode, refer to 2.1. This chapter covers several preprocessor-related specifications, including those called implementation-defined by Standards. For more details on mcpp implementation-defined-behaviors, see Chapter 5, "Diagnostic Messages".


4.1. Status Value on Exit

The header file internal.H defines values returned by mcpp to a parent process. mcpp returns 0 on success, and errno for errno != 0 and 1 for errno == 0 on error. Success means that no error has occurred.


4.2. Include Directory Search Path

This section explains the order in which mcpp searches directories for an include file when it encounters a #include directive.

  1. If a #include directive argument takes A Form of neither "file-name" nor <file-name>, and is a macro, the macro is expanded. The resulting filename must take a form of either "file-name" or <file-name>. Otherwise, it causes an error.

  2. If the resulting filename, either in form of "file-name" or <file-name>, is a full path name, mcpp tries to open it. If it fails, it causes an error.

  3. If the resulting filename is not a full path but takes a form of "file-name", mcpp regards it as a filename relative from the current directory or source file directory, and begins searching from that directory. The former is a directory from which mcpp was invoked and the latter is a directory where the source file that includes the "file-name" resides. Depending on the specified options and compiler systems, mcpp begins searching directories as follows:

    1. If -I1 is specified, search begins from current directory.
    2. If -I2 is specified, source file directory.
    3. If -I3 is specified, current first and then source file directory.

    By default, the compiler-specific-builds for UNIX compiler systems, GCC or Visual C begin searching from the source file directory. The other compiler-specific-builds begin searching at the current directory. However, Borland C-specific-build searches current first and then source file directory. The compiler-independent-build of mcpp begins search from the source file directory.
    For GCC, the directories specified by -iqoute option are searched next. For Visual C, also the directories of each ancestor file of source file are searched one by one.
    If mcpp fails to find the desired file, it begins searching as shown in step 4.

    In case of a nested #include, if search begins at current directory, the base directory is always the same. If search begins at a source file directory, the base directory changes each time a header file resides in other directory.

  4. If the resulting filename is not a full path name but takes a form of <file-name>, mcpp searches directories in the following order. If any of these directories are specified as a relative path, then mcpp regards it as a relative directory from the current directory at mcpp startup. If mcpp fails to find or open the desired file after searching all the directories in these order, it causes an error.

    1. Directory(s) specified with the -I <directory> option on mcpp invocation. If several directories are specified, they are searched in the order in which specified (with the left first).
    2. For GCC-specific-build, directories specified with the -isystem option. If several directories are specified, they are searched in the order specified (from the left).
    3. Directories specified with an environment variable. ENV_C_INCLUDE_DIR in noconfig.H (configed.H) defines environment variable names. In C++, ENV_CPLUS_INCLUDE_DIR, if defined, takes precedence over ENV_C_INCLUDE_DIR. GCC-specific-build uses C_INCLUDE_PATH (and also CPLUS_INCLUDE_PATH for C++) as default environment variable. Other mcpp uses INCLUDE (and also CPLUS_INCLUDE for C++) as default. If an environment variable specifies several directories with each separated with a delimiter, they are searched in the order in which specified. Windows and other OSs use ";" and ":" as delimiter, respectively.
    4. Implementation-specific directories for C++ defined by the CPLUS_INCLUDE_DIR? macros in noconfig.H (configed.H).
    5. Site-specific directories defined by setsysdirs() in system.c (For UNIX systems, /usr/local/include).
    6. Implementation-specific directories defined by the C_INCLUDE_DIR? macros in noconfig.H (configed.H).
    7. System-specific directories defined by setsysdirs() in system.c (For UNIX systems, /usr/include).

With the -I- option (-nostdinc option for GCC-specific-build and -X for Visual C-specific-build), the directories specified in 4.4 and later are not searched.

ANSI C Rationale says the ANSI committee intends to define a current directory as base directory. I think this is acceptable, in that the base directory is always constant and that the specification is clearer. However, some implementations, such as UNIX, seem to define a source file directory as base one at least for #include "header". The compiler-independent-build of mcpp also takes source file directory as base, according to the majority.


4.3. How to Construct Header Name

This section explains how to construct a header-name pp-token and extract a file name from it.

  1. If source code contains a header file name in the string literal format, mcpp regards it as a header-name and removes the " at the both ends to construct a filename. This can be applied to a string literal resulting from macro expansion in source code.

  2. If source code contains a header file name in the <filename> format, mcpp regards it as a header-name and removes the < and > at the both ends to construct a filename. This can be applied to a <filename> format sequence resulting from macro expansion. The spaces in the macro are retained squeezing multiple spaces into one space.

  3. In any case, mcpp converts \ to /, although both of "\" and "/" can be used as path delimiters on Windows.


4.4. Evaluation of #if Expression

Evaluation of #if expression depends on the largest integer type of the host compiler (by which mcpp was compiled) and that of the target compiler (which uses mcpp). Since the compiler-independent-build has no target compiler, the type depends only on the host compiler.

mcpp in Standard mode evaluates #if expression in the common largest integer type of the host and target compiler. Nevertheless, mcpp in pre-Standard mode evaluates it in (signed) long.

In the compiler-systems having type "long long", if __STDC_VERSION__ is set to 199901L or higher using the -V199901L option, mcpp evaluates a #if expression in "long long" or "unsigned long long", according to the C99 specification. Although C90 and C++98 stipulate that #if expression is evaluated in long / unsigned long, mcpp evaluate it in long long / unsigned long long even in C90 or C++98 mode, and issues a warning in case of the value overflows the range of long / unsigned long. *1

Visual C and Borland C 5.5 do not have a "long long" type, but have an __int64 type of the same length. So, a #if expression is evaluated as __int64 / unsigned __int64. (However, since LL and ULL suffixes cannot be used in Visual C++ 2002 or earlier and Borland C 5.5, these suffixes must not be used in coding other than #if lines.)

In addition, when you invoke with the -+ option for C++ preprocessing, mcpp evaluates pp-tokens 'true' and 'false' in a #if expression to 1LL (or 1L) and 0LL (or 0L), respectively.

mcpp in Standard mode evaluates #if expression as follows. For a compiler without long long, please read "long long" and "unsigned long long" hereinafter, until the end of 4.5, as "long" and "unsigned long", respectively. For pre-Standard mode read all of them as "long".

  1. An integer constant token with a U suffix, including character constants, is evaluated in unsigned long long. (Note that pre-Standard mode does not recognize the U suffix).
  2. Otherwise, a token within the range of non-negative long long is evaluated in long long.
  3. Otherwise, a token within the range of unsigned long long is evaluated in unsigned long long.
  4. Otherwise, it is diagnosed as an out of range error.
  5. In a binary operation, if either operand is unsigned long long, both are converted to unsigned long long. Otherwise, an operation is performed in signed long long.

Anyway, an integer constant token always has a non-negative value.
In pre-Standard mode, an integer constant token is evaluated within the range of non-negative long. A token beyond that range is diagnosed as an out of range error. All the operations are performed within the range of long.

If both of host and target compilers have type unsigned long long and the range of unsigned long long of the host is narrower than that of the target, a beyond that host range is evaluated to an out of range error.

If an operation using constant tokens produces a result out of range of long long, an out of range error occurs. If it produces a result out of range of unsigned long long, a warning is issued. This can be applied to intermediate operation results.

Since a bitwise right shift of a negative value or a division operation using it does not provide portability, mcpp issues a warning. If an operation using a mixture of unsigned and signed operands converts a signed negative value to an unsigned positive value, a warning is also issued. How these values are evaluated depends on the specification of the compiler-proper of the host system.

C90 and C++98 makes it a rule that a preprocessor evaluates a #if expression in long/unsigned long (in C99, the maximum integer type is used). These specifications are rougher than those of compiler-propers. A (#)if expression is often evaluated differently between preprocessor and compiler-proper, especially when sign extension is involved.

In addition, since keywords are not used during Standard C preprocessing, sizeof or cast cannot be used in a #if expression. Of course, neither variables, enumeration constants, nor floating point numbers can be used there. Standard mode allows the "defined" operator in a #if expression as well as the #elif directive. Except for these differences, mcpp evaluates a #if expression in accordance with priority of and the associative law among operators, just as compiler-propers do. In a binary operation, an arithmetic conversion often takes place to equalize the types on both-hand sides; If one operand is unsigned long long and the other is long long, the both are converted to unsigned long long.

Note:

*1 mcpp up to V.2.5 evaluated #if expression in C90 and C++98 by long long / unsigned long long internally, and issued an error on overflow of long / unsigned long. From V.2.6 onward, mcpp degraded the error to warning for compatibility with GCC or Visual C.


4.5. Character Constant Evaluation in #if Expression

Constant tokens in a #if expression includes identifiers (macros and non-macros), integer tokens and character constants. How to evaluate character constants is implementation-defined and lacks of portability. Even (#)if 'const' is sometimes evaluated differently between preprocessor and compiler-proper. Note that Standards does not even guarantee that (#)if 'const' is evaluated to the same.

mcpp in POSTSTD mode does not evaluate a character constant in a #if expression, which is almost meaningless, and makes it an error.

Like other integer constant tokens, mcpp evaluates a character constant in a #if expression within the range of long long or unsigned long long. (In pre-Standard mode, long only.)

A multi-byte character or a wide character is generally evaluated with 2-bytes type, except for the UTF-8 encoding, which is evaluated with 4-bytes type. Since UTF-8 has a variable length, mcpp evaluates it with 4-byte type. mcpp does not support EUC's 3 byte encoding scheme. (A 3-byte character is recognized as 1 byte + 2 bytes. As a consequence, its value is evaluated correctly.) Although there are some implementations using the 2-byte encoding scheme that define wchar_t as 4-byte, mcpp has no relevance to wchar_t. The following paragraphs describe two-byte multi-byte character encodings.

Multi-byte character constants, such as 'X', are evaluated to ((First byte value << 8) + Second byte value). (8 is the value of CHAR_BIT in <limits.h>.) Note that 'X' is used here to designate a multi-byte character. Though 'X' itself is not a multi-byte character, it is used here to avoid character garbling.

Let me take an example of multi-character character constants, such as 'ab', '\x12\x3', and '\x123\x45'. 'a', 'b', '\x12', '\x3' and '\x123' are regarded as one byte. When a multi-character character constant is evaluated, each one byte, starting from the highest one, is evaluated within the range of [0, 0xFF] and combined by shifting it to left by 8. (0xFF is the value of UCHAR_MAX in <limits.h>.) If the value of one escape sequence exceeds 0xFF, an out of range error occurs. Therefore, in the implementation of the ASCII character set, the above three tokens are evaluated to 0x6162, 0x1203 and error, respectively.

L'X' is evaluated to the same value as 'X'. Let me take an example of multi-character wide character constants, such as L'ab', L'\x12\x3', and L'\x123\x45'. L'a', L'b', L'\x12', L'\x3', L'\x123', and L'\x45' are regarded as one wide character. When a multi-character wide character constant is evaluated, each wide character, starting from the highest one, is evaluated within the range of [0, 0xFFFF] and combined by shifting it to left by 16. If the value of one escape sequence exceeds the maximum value of an unsigned 2-byte integer, an out of range error occurs. Therefore, in the implementation of the ASCII character set, the above three tokens are evaluated to 0x00610062, 0x00120003, and 0x01230045, respectively.

If the values of a multi-character character constant and a multi-character wide character constant exceed the range of unsigned long long, an out of range error occurs.

With __STDC_VERSION__ or __cplusplus set to 199901L or higher, mcpp evaluates a Universal Character Name (UCN) in the form of \uxxxx and \Uxxxxxxxx as a hex escape sequence. (I know this evaluation is nonsense but no other way.)

If the compiler-proper of the target compiler system uses a signed char or signed wchar_t, a character constant in a (#)if expression may be evaluated differently between mcpp and compiler-proper. The range that causes a range error may also differ between them. In addition, evaluation of multi-character character constants and multi-byte character constants varies even among preprocessors and among compilers. Standard C does not define whether, with CHAR_BIT set to 8, 'ab' is evaluated to 'a' * 256 +'b' or 'a' + 'b' * 256.

In general, character constants should not be used in an #if expression, as long as you have an alternative method. I think an alternative method always exists.


4.6. #if sizeof (type)

Standard C stipulates that preprocessing is a process independent of run-time environments or compiler-proper specifications, thus prohibiting it from using sizeof and cast in an #if expression. However, pre-Standard mode allows sizeof (type) in a #if expression. This was done as a part of my effort to add necessary modifications to DECUS cpp, such as adding long long and long double processing, while retaining its original functionality. As to cast, I neither implemented nor had a will to do so because it would require troublesome work.

A series of macros beginning with S_, such as S_CHAR, in eval.c define the size of each type. Under cross implementation, these macros must be modified to specify size of the types, in integer values, used in the target system.

I have to admit that mcpp does not provide the full functionality of #if sizeof. mcpp just ignores the letter of "signed" or "unsigned" preceding char, short, int, long, and long long when it appears in a #if sizeof. Also mcpp does not support sizeof (void *). I know this is a half-hearted implementation but I do not want to increase the number of flags in system.H in vain for this non-conforming function. I initially thought of removing the sizeof code from the original version because I did not intend to support cast at all, but on the second thought, I decided to make a small amount of modifications to make use of the existing code.


4.7. How to Handle White-Space Sequence

mcpp in principle compresses a white-space sequence, excluding <newline>, as a token separator into one space character during tokenization in the translation phase 3. If -k or -K option is specified in STD mode, however, it outputs horizontal white spaces as they are without compressing. It also deletes a white-space sequence at the end of a line.

A white-space sequence at the beginning of a line is deleted in POSTSTD mode, and putout as they are in other modes. The latter is special treatment for convenience of human reading. *1

This compression and deletion occurs during the intermediate phase. The next phase 4 involves macro expansion and preprocess-directive-line processing. Macro expansion may sometimes produce several space characters before and after the macro. Of course, the number of space characters does not affect compilation results.

Standard C says that whether implementation compresses a white-space sequence into one space character during the translation phase 3 is implementation-defined, but you usually do not have to worry about this. <Vertical-tab> or <form-feed> in a preprocessor directive line may adversely affect portability, since this is undefined in Standard C. mcpp converts it to one space character.

Note:

*1 Up to V.2.6.3 mcpp squeezed line top white spaces into one space. In V.2.6.4, it changed the behavior.


4.8. Default Specifications for mcpp Executables

This section describes the specifications of mcpp executables generated when DIFfile and makefile for each compiler system in the noconfig directory are used to compile mcpp with default settings. When a configure script is used to compile mcpp, the generated mcpp may differ, depending on configure's results, however, as long as OS and compiler system versions are same, generated mcpps would be same except for include directories.

The compiler-independent-build of mcpp has the constant specifications regardless of the compiler system with which mcpp was compiled, except a few features dependent on OS and CPU.

There are compiler-independent-build and compiler-specific-build for mcpp executables, and each executable has several behavioral modes. For those, refer to 2.1. This section describes the settings centering on STD mode.

DIFfiles and makefiles are for the following compiler systems:

FreeBSD 6.3 GCC V.3.4
Vine Linux 4.2 / x86 GCC V.2.95, V.3.2, V.3.3, V.3.4, V.4.1
Debian GNU/Linux 4.0 / x86 GCC V.4.1
Ubuntu Linux 8.04 / x86_64 GCC V.4.2
Fedora Linux 9 / x86 GCC V.4.3
Mac OS X Leopard / x86 GCC V.4.0
CygWIN 1.3.10 (GCC V.2.95), 1.5.18 (GCC 3.4)
MinGW & MSYS GCC 3.4
WIN32 LCC-Win32 2003-08, 2006-03
WIN32 Visual C++ 2003, 2005, 2008
WIN32 Borland C++ V.5.5

In addition, for the following compilers which I don't have, the difference files contributed from some users are contained here.

WIN32 Visual C++ V.6.0, 2002
WIN32 Borland C++ V.5.9 (C++Builder 2007)

Of all the macros defined in noconfig.H and system.H, the settings of those mentioned below are identical among every mcpp executable, regardless of their compiler systems.

Each mcpp is compiled with DIGRAPHS_INIT == FALSE, so enables digraph when the -2 (-digraphs) option is specified.
With TRIGRAPHS_INIT == FALSE, trigraph is enabled with the -3 (-trigraphs) option.
With OK_UCN set to TRUE, Universal Character Name (UCN) can be used in C99 and C++.
With OK_MBIDENT set to FALSE, multi-byte-characters cannot be used in identifiers.

With STDC set to 1, the initial value of __STDC__ is 1.

The translation limits are set as follows.

NMACPARS (Maximum number of macro arguments) 255
NEXP (Maximum number of nested levels of #if expressions) 256
BLK_NEST (Maximum number of nested levels of #if section) 256
RESCAN_LIMIT (Maximum number of nested levels of macro rescans)64
IDMAX (Valid length of identifier) 1024
INCLUDE_NEST (Maximum number of #include nest level) 256
NBUFF (Maximum length of a source line) *1 65536
NWORK (Maximum length of an output line) 65536
NMACWORK (Size of internal buffers used for macro expansion) 262144

On GCC-specific-build and Visual C-specific-build, however, NMACWORK is used as the maximum length of an output line.

This macro differs on OS regardless of build types.

MBCHAR (Default encoding of multibyte character):

Linux, FreeBSD, Mac OS X EUC-JP
WIN32, CygWIN, MinGW SJIS

The settings of the macros below are different among compiler systems.

STDC_VERSION (Initial value of __STDC_VERSION__):

Compiler-independent, GCC 2199409L
Others 0L

HAVE_DIGRAPHS (Is digraphs output as it is?):

Compiler-independent, GCC, Visual CTRUE
Others FALSE

EXPAND_PRAGMA (Is a #pragma line macro-expanded in C99?):

Visual C, Borland CTRUE
Others FALSE

GCC 2.7-2.95 defines __STDC_VERSION__ to 199409L. However, in GCC V.3.*,V.4.*, __STDC_VERSION__ is no longer predefined by default and is now defined in accordance with an execution option. mcpp setting for GCC follows these variations.

If STDC_VERSION is set to 0L, mcpp predefines __STDC_VERSION__ as 0L. So, specifying the -V199409L option sets __STDC__ and __STDC_VERSION__ to 1 and 199409L, respectively and allows only predefined macros that begin with '_', resulting in mcpp in the strictly C95 conforming mode. The -V199901L option specifies C99 mode.

In C99 mode, mcpp predefines __STDC_HOSTED__ as 1.

mcpp itself predefines neither __STDC_ISO_10646__, __STDC_IEC_559__ nor __STDC_IEC_559_COMPLEX__. These values are compiler-system-specific. In glibc 2 / x86, the system header defines __STDC_IEC_559__ and __STDC_IEC_559_COMPLEX__ as 1. Other compiler systems do not define them.

If HAVE_DIGRAPHS is set to FALSE, digraph is output after converting to usual token.

The argument of #pragma line beginning with STDC, MCPP or GCC is never macro-expanded even if EXPAND_PRAGMA == TRUE.

Include directories are set as follows:

System-specific or site-specific directories under UNIX-like OSs are as follows (common to compiler-independent-build and compiler-specific-build):

FreeBSD, Linux, Mac OS X, CygWIN/usr/include, /usr/local/include

Mac OS X has also the framework directories set to /System/Library/Frameworks and /Library/Frameworks by default.

On MinGW, /mingw/include is the default include directory.

CygWIN GCC-specific-build changes /usr/include to /usr/include/mingw by -mno-cygwin option.

For the implementation-specific directories that vary among compiler systems and their versions, see the DIFfiles. The compiler-independent-build does not set implementation-specific directories. mcpp for the compiler systems on Windows does not preset any directory but uses the environment variables: INCLUDE, CPLUS_INCLUDE. These environment variables are used by the compiler-independent-build too.

If these default settings do not suit you, change settings to recompile mcpp, or use environment variables or the -I option.

When the length of a preprocessed line exceeds NWORK-1, mcpp generally divides it into several lines so that each line length becomes equal to or less than NWORK-1. A string literal length must be equal to or less than NWORK-2. mcpp of GCC-specific-build and Visual C-specific-build, however, do not divide output line.

Again for confirmation, the macros mentioned above in italics are used only to compile mcpp, and are not built-in macros in a mcpp executable.

If you invoke mcpp without an input file and enter '#pragma MCPP put_defines', the built-in macros will be displayed.

With __STDC__ set to 1 or higher, the macros that do not begin with '_' are deleted. The -N (-undef) option deletes all the macros other than __MCPP. After -N, you can use -D to defines macro symbols over again. When you use a different compiler system version from those specified here, -N and -D allow you to redefine your version macro without recompiling mcpp. The -D option allows you to redefine a particular macro without using -N or -U.

When you use the -+ (-lang-c++) option to specify C++ preprocessing, __cplusplus is predefined with its initial value of 1L. In addition, some other macros are also predefined:

Although there are some predefined macros in GCC, those predefined by GCC were few, until GCC V.3.2. Most of them are passed from gcc to cpp by the -D option. So, it is not necessary for mcpp to define them for compatibility. However, mcpp predefines these macros for being used in a stand alone manner, such as pre-preprocessing.

GCC V.3.3 and later predefines 60 or 70 macros (suddenly). GCC-specific-build of mcpp V.2.5 and later for GCC V.3.3 or later also includes these predefined macros other than the above ones. These GCC-specific predefined macros are written in mcpp_g*.h header files, which is generated by installation of mcpp.

Since FreeBSD, Linux, CygWIN, MinGW / GCC and LCC-Win32, Visual C 2008 have a type long long, an #if expression is evaluated in long long or unsigned long long. Visual C 6.0, 2002, 2003, 2005 and Borland C 5.5 do not have a "long long" type but __int64 and unsigned __int64 instead. These types are used.

In the above compiler systems with type long ranges:

[-2147483647-1, 2147483647] ([-0x7fffffff-1, 0x7fffffff])

and unsigned long ranges:

[0, 4294967295] ([0, 0xffffffff]).

In the compiler systems with type long long ranges:

[-9223372036854775807-1, 9223372036854775807]
([-0x7fffffffffffffff-1, 0x7fffffffffffffff]),

and unsigned long long ranges:

[0, 18446744073709551615] ([0, 0xffffffffffffffff]).

All the compiler-propers of the above compiler systems internally represent a signed integer as two's complement number. So do bit operations. This can be applied to mcpp's #if expression.

Right shift of a negative integer is an arithmetic shift. This can be applied to mcpp's #if expression. (Right shifting an integer by one bit halves the value with the sign retained)

In an integer division or modulus operation, if either or both operands are negative values, an algebraic operation like Standard C's ldiv() function is performed. This can be applied to mcpp's #if expression.

These OSs use the ASCII basic character set. So does mcpp.

There is a memory management routine, kmmalloc, that I developed. This routine has malloc(), free(), realloc() and other memory handling functions. If kmmalloc is installed in systems other than CygWIN or Visual C 2005 or 2008, kmmalloc is linked when the MALLOC=KMMALLOC (or -DKMMALLOC=1) option is specified in make. Also its heap memory debugging routine is linked. mcpp for Linux and LCC-Win32 uses EFREEP, EFREEBLK, EALLOCBLK, EFREEWRT and ETRAILWRT with an errno of 2120, 2121,2122, 2123 and 2124 assigned, and other mcpp uses 120, 121, 122, 123, and 124. (Refer to mcpp-porting.html#4.extra.) *2

On the systems other than GNU and Visual C, you should preset the environment variable TZ, for example JST-9 in Japan. Or, the __DATE__ and __TIME__ macros are not set correctly.

Note:

*1 This limit applies also to the line spliced by <backslash><newline> deletion. Moreover, it applies to the line after converting a comment into a space and possibly concatenated multiple logical lines by a comment spreading across the lines.

*2 CygWIN 1.3.10 and 1.5.18 provides malloc() that has an internal routine named _malloc_r() which is called by a few other library functions. So this malloc() cannot be replaced with other malloc(). Also in Visual C 2005 and 2008, the program terminating routine calls an internal routine of resident malloc(), hence other malloc() cannot be used.


5. Diagnostic Messages

5.1. Diagnostic Messages Format

This section covers diagnostic messages issued by mcpp, as well as their meaning. By default, these messages are output to stderr. With the -Q option, they are redirected to the mcpp.err file in the current directory. A diagnostic message is output in the following manner:

  1. "filename: line: " is followed by "fatal error: ", "error: " or "warning: " and then by any of the diagnostic messages shown in sections 5.3 to 5.9. Although the specification that a diagnostic message has to fit in one line that begins with "filename: line:" seems to lack of flexibility, I followed because it is a traditional way of implementing messages in C on UNIX and because various tools have already assumed that. Some mcpp messages do not fit in a line of usual terminal.

  2. If an error occurs during macro expansion, the macro invocation is displayed. For nested macro invocation, mcpp shows each macro names and its definitions, as well as the source filename and line number where the macro is defined.

  3. The source file name, the line number and the line at which an error has occurred are displayed. If an error has occurred in an included file, the names, line numbers and the #include lines of all the including files are displayed. Usually, a logical line with comments replaced with a space character is displayed. The logical line is constructed from one or more physical lines with '\' at the line end. If a comment spreads over several lines, several logical lines are concatenated into one, which is displayed as the line. In this case, the line number of the last concatenated physical line is displayed. Note that if an error occurs during the translation phase before processing a comment, the line in the phase is displayed.

If the -j option is specified, mcpp outputs neither the above 2 nor 3.

Diagnostic messages are divided into three levels:

fatal errorIndicates an error is so serious that it is no longer meaningful to continue preprocessing.
error Indicates there is a syntax or usage error.
warning Indicates code lacks of portability or may contain a bug.

Warnings are further divided into five classes:

Class 1 Source code may contain a bug or at least lack portability.
Class 2 Probably, source code will present no problem in practical use, but is problematic in terms of Standard conformance.
Class 4 Probably, source code will present no problem in practical use, but is problematic in terms of portability.
Class 8 Rather surplus warnings to #if groups skipped, sub-expression in #if expression whose evaluation is skipped, and etc.
Class 16Warning to trigraphs and digraphs.

Warnings other than Class 1 or 2 are rather specific to mcpp.

mcpp has various types of diagnostic messages. For example, STD mode provides the following types of diagnostics for each level and class.

fatal error 17 types
error 76 types
warning class 1 49 types
warning class 2 15 types
warning class 4 17 types
warning class 8 30 types
warning class 16 2 types

Principally, these messages point the coding in question. The diagnostic messages below have a sample value embedded in a token or a numeric value from source code. For the messages with a macro name embedded, a value the macro is expanded into is shown in real messages.

Depending on cases, a same message is issued as warning or error, in which case, this manual gives the first occurrence a detailed description. For the subsequent occurrences, the message is only listed.


5.2. Translation Limits

Of all the errors shown below, some errors, such as a buffer overflow, occur due to mcpp specification restrictions. Some macros in system.H define translation limits, such as a buffer size. Enlarge the buffer size and recompile mcpp if necessary, however, be careful not to increase it too much. A large buffer in a system with a small amount of memory may cause an "out of memory" error frequently.


5.3. Fatal Errors

A fatal error occurs and preprocessing is terminated when it is no longer possible to continue preprocessing due to an I/O error or a shortage of memory, or it is no longer meaningful to do so due to a buffer overflow. A status value of failure is returned to a parent process.

5.3.1. mcpp's Own Bugs

5.3.2. Physical Errors

5.3.3. Translation Limits and Internal Buffer Errors

The following four errors may also be caused by a buffer overflow at a token that is not so particularly long during macro expansion, in which case, you should divide the macro invocation.

5.3.4. #pragma MCPP preprocessed Related Errors


5.4. Errors

mcpp issues an error message when it found a grammatical error. Standard C stipulates that a compiler system should issue a diagnostic message when they encounter a violation of syntax rules or constraints. Principally, Standard mode issues an error message to this type of violation, but sometimes issues a warning.

mcpp issues an error message or warning to most of undefined items in Standard C. However, mcpp issues neither an error nor a warning to the following undefined items:

  1. ' or /* in a header name in the form of a string literal: mcpp regards them as characters, resulting in a file open error. (' or /* in a header name enclosed with < and > is regarded as the beginning of a character constant or a comment, resulting in some errors.) Although how to treat \ in a header name is undefined in Standard C, mcpp does not check it because it may eventually cause an error when mcpp actually tries to open the file. mcpp on Windows issues a class 2 warning to \ and converts it to /.

  2. #undef defined: Although #undef-ing a name "defined" yields an undefined result, mcpp does not issue a message because, in the first place, mcpp does not allow definition of a macro named "defined", so the macro to be undefined never exists.
  3. Illegal multi-byte character sequence in a comment: Although how to deal with such character sequence is undefined in Standard C, mcpp does not issue a message because it does no harm. (mcpp issues a warning to an illegal multi-byte character sequence in string literals, character constants and header names.)

  4. Identifiers that begin with _ (Reserved for compiler systems): Although using these identifiers in a user program will cause an undefined result, mcpp does not check it because mcpp does not always have a means to decide whether these identifiers are used in a user program or the compiler-system.

  5. __STDC_ISO_10646__, __STDC_IEC_559__, and __STDC_IEC_559_COMPLEX__: Although #defining or #undef-ing these optional C99 predefined macros yields an undefined result, mcpp does not check it because mcpp does not always have a means to determine whether these macros appear in a user program or the compiler-system. (These macros are most likely to be defined in a header file of a compiler system.)

  6. UCN equivalent sequence: Although it is undefined in C99 how to deal with a UCN equivalent sequence generated by deleting <backslash><newline> during the translation phase 2 or by concatenating string literals, mcpp does not issue a message and regards it as a UCN.

For details on what is a violation of syntax rule or constraint, undefined, unspecified or implementation-defined in Standard C preprocessing, refer to cpp-test.html.

Even if an error occurs, mcpp continues preprocessing as long as they are not fatal one. mcpp shows the number of errors and returns the status of failure to the parent process when it exits.

5.4.1. Character and Token Related Errors

The following several messages are all token-related errors. For the first four, mcpp skips the line in question and continues preprocessing. The first three are string literal or other token-related errors, indicating that a closing quotation mark is not found by the end of the logical line. This type of error occurs when you write a text that does not take a form of a preprocessing-token sequence in neither a string literal nor comment, as shown below:

#error I can't understand.

As processing-tokens are not so strictly defined as C tokens in the compiler-proper, most character sequences are regarded as pp-token sequences, as long as they belong to a source character set. Therefore, it is only this type of coding that causes a preprocessing-token error. Pp-token errors may occur in a skipped #if group.

5.4.2. Unterminated Source File Related Errors

This section covers messages issued when a source file ends with an unterminated #if section or macro invocation. If the file (not included file) marks the end of input, the message "End of input", not "End of file", is issued.

These diagnostic messages are issued as an error or warning, depending on mcpp modes.

Standard mode issues these messages as error, in which case mcpp skips the macro invocation in question and restores relationship between paired directives in a #if section to that of when the file is initially included.

On the other hand, pre-Standard mode issues warnings. OLDPREP mode does not even issue warning except on unterminated macro call.

5.4.3. Ill-Balanced Preprocessing Group Related Errors

This section covers errors caused by ill balanced directives of #if, #else and etc. Even if mcpp finds ill balance among these directives, it continues processing, assuming that the processing group so far still continues. mcpp checks to see whether directives are balanced even in a skipped #if group.

The #if (#ifdef) section is a block between #if (#ifdef or #ifndef) and #endif. The #if (#elif, #else) group is a smaller block, say, between #if (#ifdef or #ifndef) and #elif, between #elif and #else, or between #else and #endif within the #if (#ifdef) section.

The following two errors occur when #asm and #endasm are not balanced. These messages are issued only by compiler-specific-build for a particular compiler system and in pre-Standard mode.

5.4.4. Simple Syntax Errors on Directive Lines

This section covers simple syntax errors on directive lines that begin with #. The errors hereinafter discussed until 5.4.12 do not occur within a skipped #if group. (mcpp invoked with the -W8 option issues a warning to an unknown directive.)

When mcpp finds a directive line with a syntax error, it ignores the line and continues processing, in which case, it neither regards #if as the beginning of a section nor changes line numbers even with a #line. If a #include or #line line has a macro argument, Standard mode expands the macro and checks the syntax. Pre-Standard mode does not expand the macro.

Although the messages below do not show the directive name in question, the source line that follows the message show it. (A directive line with a comment converted to a space character always becomes one line, which is called "preprocessed line" here.)

The following error occurs only in Standard mode and this directive is ignored. OLDPREP mode issues neither an error nor a warning. KR mode issues a warning and continues preprocessing as if there had been no "junk" text.

5.4.5. Syntax Errors in #if Expressions

This section covers syntax-related errors in #if, #elif and #assert directives. If a #if (#elif) line has these errors, mcpp evaluates it to false, skips the #if (#elif) group, and continues processing.

For a skipped #if (#ifdef, #ifndef, #elif or #else) group, mcpp checks validity of C preprocessing tokens and balance of these directives, but not other grammatical errors.

A #if line has a sub-expression whose evaluation is skipped. For example, in case of #if a || b, if "a" is evaluated to true, "b" is not evaluated at all. However, the following 14 types of syntax errors or translation limit errors are checked, even if they are located in a sub-expression whose evaluation is skipped.

The following error messages are relevant to #if sizeof. Only pre-Standard mode issues this error.

5.4.6. #if Expression Evaluation Errors

The following errors do not occur in a sub-expression whose evaluation is skipped. (mcpp invoked with the -W8 option issues a warning.)

The Standards say that #if expression is evaluated by the largest integer type in C99 and long / unsigned long in C90 and in C++98. mcpp evaluate it by long long / unsigned long long even if in C90 or C++98, and issues a warning on the value outside of long / unsigned long in C90 and in C++98. In this subsection, please read the following long long / unsigned long long as long / unsigned long for the compiler without long long, and as long in pre-Standard mode. In POSTSTD mode, character constant in #if expression is not available and causes a different error.

The following errors are relevant to sizeof. They are not issued in a sub-expression whose evaluation is skipped (The -W8 option issues a warning). Only in pre-Standard mode.

5.4.7. #define Related Errors

This section covers #define related errors. A macro will not be defined if an error occurs at #define. The # and ## operator related errors occurs in Standard mode. __VA_ARGS__ related errors also occur in Standard mode. Although variable argument macro is a C99 specification, mcpp allows these macros to be used in C90 and C++ modes for compatibility with GCC and Visual C++ 2005, 2008. (A warning is issued.)

In STD mode of GCC-specific-build, if you write GCC2-spec variadic using __VA_ARGS__, you will get this error. __VA_ARGS__ should be used only in GCC3-spec or C99-spec variadic.

5.4.8. #undef Related Errors

This section covers #undef related errors.

5.4.9. Macro Expansion Errors

This section covers macro expansion errors. mcpp displays a macro definition, as well as the source filename and line number where it is found. The errors related to # or ## operator can occur only in Standard mode.

When the following errors occur, the macro invocation will be skipped.

The following errors can occur only with -K option in STD mode. These errors mean that the macro is extremely complex and buffer for macro notification ran short. Almost impossible to happen in real life.

5.4.10. #error and #assert

5.4.11. Failure of #include

5.4.12. Other Errors

The following two are checked when mcpp is invoked with the -V199901L option. The same thing can be said when mcpp is invoked with the -V199901L option in C++ mode.


5.5. Warnings (Class 1)

A warning is issued when source, although syntactically correct, possibly contains some coding mistakes or has a portability problem. Warnings are divided into five classes: 1, 2, 4, 8, and 16. These classes are enabled when the -W <n> option is specified on mcpp invocation. <n> specifies a ORed value of any of 1, 2, 4, 8, and 16. Class 4, for example, can be specified explicitly with -W4, and implicitly with -W<n>, where <n> is 1|4, 1|2|4, 2|4, 1|4|8, 4|8, 4|16, etc., because the AND-ed value of <n> and 4 is 4 (non-0).

Standard mode issues an error message to most of the source code that causes a Standard C undefined behavior, but a warning to some.

Likewise, Standard mode always issues a warning to the source code which uses Standard C unspecified specifications, except for the following:

  1. Evaluation order of sub-expressions in a #if expression: Although the evaluation order of the operands of operators other than ||, &&, ? , and : is unspecified in Standard C, mcpp does not issue a warning because #if expression does not cause side-effects and therefore the evaluation order does not affect results. mcpp always evaluates integer constant tokens from left to right in the order they appear and performs an operation in accordance with an operator grouping rule when their values are needed.

Standard mode issues a warning to many implementation-defined behaviors, except for the following:

  1. Directories the #include directive searches for a file to include and how to construct a header-name pp-token from #include's argument: mcpp does not issue a warning because there will be too many warnings if it actually does. Unless a header name is a macro, the source token sequence, including spaces, are used as it is. If it is a macro, the expanded result, including spaces, is used. (In POSTSTD mode, a space character is inserted between pp-tokens during macro expansion. A header-name is constructed by concatenating the resulting pp-tokens from < to > and then by removing space characters. Anyway, in POSTSTD, a header-name enclosed with < and > is obsolete.) When mcpp encounters '#pragma MCPP debug path' or '#debug path', it displays a search path, instead of issuing a warning.

  2. Evaluation of a single byte character constant, such as 'a', and of a wide character constant that consists of only one multi-byte character, such as L'X', in a #if expression.: mcpp does not issue a warning because even with the same basic character set used, there are an unlimited number of factors that limits the portability, such as single byte Katakana, presence or absence of a sign, encoding scheme of Kanji, and etc. The same thing can be said with UCN.

  3. Bit operations using negative numbers in a #if expression: Although bit operation results depend on internal representation of an integer on a machine, most of the machines use two's complement representation, thus causing no portability problem. However, mcpp issues a warning to a right bit shift operation of a negative value and a division operation involving either or both of negative operands because they lack of portability.

  4. A sequence of several white space characters as a token separator: Standard C states that it is implementation-defined whether a sequence of white space characters is replaced by one space character in the translation phase 3, but you do not have to worry about this. Portability becomes an issue only when a preprocessing directive line has <vertical-tab> or <form-feed>. mcpp converts it into one space character and issues a warning. For a sequence of several space characters and tabs, mcpp compresses it into one space character without a warning.

  5. Compiler system's own built-in macros will not cause warning.

  6. #pragma sub-directive: Principally, mcpp does not issue a warning to #pragma sub-directive, however, for #pragma once, #pragma __setlocale, #pragma MCPP * which mcpp itself processes, it issues a warning if they have an invalid argument. In addition, mcpp issues a warning to GCC V.3's #pragmas, such as #pragma GCC poison (dependency), that resident preprocessor processes but mcpp does not.

  7. Doubled \: Although it is implementation-defined in C99 whether a single \ is changed into double \ (\\) when the # operator converts a UCN sequence into a string, mcpp does not issue a warning to this. mcpp does not double \.

As you see, mcpp can perform almost all the portability checks necessary at a preprocessing level.

POSTSTD mode is identical with STD mode except for some specification differences described in section 2.1.

Regardless of the number of warnings, mcpp always returns a status of success. mcpp invoked with the -W0 option does not issue a warning.

5.5.1. Character, Token and Comment Related Warnings

5.5.2. Unterminated Source File Related Warnings

On unterminated line or comments, the following messages are issued. OLDPREP mode does not issue warning.

The following warning messages are issued in pre-Standard mode. Pre-Standard mode ignores these warnings to continue processing until it reaches the end of input, causing many unexpected results. Standard mode issues an error. OLDPREP mode does not issue even warning, except on unterminated macro.

5.5.3. Directive Line Related Warnings

The following message is issued only in Standard mode.

The following message is issued only in STD mode.

The following warnings are issued only in lang-asm mode.

The following warnings on #pragma line are issued only in Standard mode. The lines are outputted in principle in spite of the warnings. However, the lines to be processed by preprocessor such as most of the lines starting with #pragma MCPP or #pragma GCC are not outputted. The pragmas for compiler or linker such as #pragma GCC visibility * are outputted without warning.

The GCC-specific-build issues the following warnings:

GCC-specific-build issues a Class 2 warning to a line with #pragma GCC followed by either poison or dependency and does not output the line. GCC V.3 resident preprocessor process the line but mcpp does not.

The following warnings are issued only in pre-Standard mode. Standard mode regards them as errors.

KR mode issues the following warning. Standard mode issues the same warning only to #pragma once, #pragma MCPP put_defines, #pragma MCPP push_macro, #pragma MCPP pop_macro, #pragma push_macro, #pragma pop_macro, #pragma MCPP debug, #pragma MCPP end_debug, and #endif for GCC-specific-build on STD mode; for other directives, Standard mode issues an error. OLDPREP mode issues neither an error nor a warning.

5.5.4. #if Expression Related Warnings

The following three warnings are relevant to an argument of #if, #elif, or #assert:

The followings warnings are also relevant to an argument of #if, #elif or #assert. They are not issued in a sub-expression whose evaluation is skipped. (mcpp invoked with the -W8 option issues them.)

The followings warnings are relevant to operations and types in a constant expression on #if, #elif or #assert lines. No warnings are also issued in a skipped sub-expression. (mcpp invoked with -W8 issues them.)

mcpp evaluate #if expression by long long / unsigned long long even if in C90 or C++98, and issues a warning on the value outside of long / unsigned long in C90 and in C++98. Also on LL suffix in other than C99, mcpp issues a warning. These warnings are of class 1 in compiler-independent-build and class 2 in compiler-specific-build. In POSTSTD mode, character constants are not used in #if expression, hence no warning is issued. (Those make errors.)

5.5.5. Macro Expansion Related Warnings

In these warnings, mcpp displays a macro definition followed by the source filename and line number where the macro is defined.

The following two are issued only in OLDPREP mode. (In other mode it causes an error.)

5.5.6. Line Number Related Warnings

This section covers line number related warnings.

In C90, when you use #line to specify a value slightly below 32767, you won't receive an error, but sooner or later, the line number will exceed 32767, in which case, mcpp continues to increase the line number while issuing a warning. Some compiler-proper may not accept this large line number. It is not desirable to specify a large number with #line.

5.5.7. #pragma MCPP warning, #warning


5.6. Warnings (Class 2)

This section covers warnings to code that does not contains a bug but causes a portability problem.

mcpp evaluate #if expression by long long / unsigned long long even if in C90 or C++98, and issues a warning on the value outside of long / unsigned long in C90 and in C++98. Also LL suffix in other than C99 mode gets a warning as well as i64 suffix of compiler-specific-builds for Visual C and Borland C. These warnings are of class 1 in compiler-independent-build and class 2 in compiler-specific-build.

Only the Standard mode issues the following five warnings:

The following warning is issued only in POSTSTD mode.

The following two warnings are issued only in some compiler systems. Of course, the coding in question is valid in those particular systems, but it lacks of portability, so a warning is issued to remind users of it.


5.7. Warnings (Class 4)

Standard C guarantees some minimum translation limits. It is desirable that a preprocessor imposes translation limits that exceed these values, but source programs that uses preprocessor' own translation limits will restrict portability. mcpp provides some macros in "system.H" that allows you to set translation limits to any values you like. mcpp in Standard mode issues a warning to source code that exceeds a Standard C guaranteed limit. However, these messages are excluded from Class 1 and 2 because they may be issued frequently, depending on standard headers of compiler systems or source programs.

The following warnings are not issued in a skipped #if group.

With __STDC_VERSION__ >= 199901L, the Standard specified translation limits are as follows:

Length of logical source line 4095 bytes
Length of string literal, character constant, or header name4095 bytes
Identifier length 63 characters
Depth of nested #includes 15
Depth of nested #ifs, #ifdefs, or #ifndefs 63
Depth of nested parentheses in #if expression 63
Number of macro parameters 127
Number of definable macros 4095

Note that the length of a UCN or multi-byte-character in an identifier is counted as the number of characters, not bytes. (A queer stipulation)

When mcpp is invoked with the -+ option to specify C++ preprocessing, the Standard guideline of translation limits are as follows:

Length of logical source line 65536 bytes
Length of string literal, character constant, or header name65536 bytes
Identifier length 1024 characters
Depth of nested #includes 256
Depth of nested #ifs, #ifdefs, or #ifndefs 256
Depth of nested parentheses in #if expression 256
Number of macro parameters 256
Number of definable macros 65536

Note that mcpp allows the maximum number of macro parameters of 255. So, when it reaches 256, mcpp issues an error.

The following warnings are excluded from class 1 and 2 because they are issued too frequently.

The following two warnings are issued only in Standard mode.

This warning is only with -K option in STD mode.


5.8. Warnings (Class 8)

There is little chance that the indicated source code contains a bug, but these messages are issued to call attention to it. mcpp invoked with the -W8 option issues these warnings.

In a skipped #if group, whether preprocessing directives, such as #ifdef, #ifndef, #elif, #else, and #endif, are balanced or not is checked. However, mcpp invoked with the -W8 option also checks non-conforming or unknown directives. Standard mode issues a warning when the depth of nested #ifs exceeds 8.

The following warnings are related to #if expression. Given an expression of #if a || b, for example, if "a" is true, "b" is not evaluated. However, mcpp invoked with -W8 issues a warning to non-evaluated sub-expressions, in which case, the note saying "in non-evaluated sub-expression" is appended.


5.9. Warnings (Class 16)

Trigraphs and digraphs are not used at all in an environment where they are not need to. If they are found in such an environment, attention needs to be paid. The purpose of the -W16 option is to find such trigraphs and digraphs. On the other hand, these warnings are very bothersome in an environment where trigraphs or digraphs are used on a regular basis because they are issued very frequently. For this reason, I set up a separate class for these warnings. Anyway, mcpp issues these messages only in the state where the trigraphs or digraphs are enabled. Digraph is for Standard mode only, and trigraph is for STD mode only.


5.10. Diagnostic Messages Index

Diagnostic MessageFatal
error
ErrorWarning class
124816
"..." isn't the last parameter5.4.7
"/*" in comment5.5.1
"and" is defined as macro5.5.3
"defined" shouldn't be defined5.4.7
"MACRO" has not been defined5.5.3
"MACRO" has not been pushed5.5.3
"MACRO" is already pushed5.5.3
"MACRO" wasn't defined5.8
"op" of negative number isn't portable5.5.45.8
"__STDC__" shouldn't be redefined5.4.7
"__STDC__" shouldn't be undefined5.4.8
"__VA_ARGS__" without corresponding "..."5.4.7
"__VA_ARGS__" cannot be used in GCC2-spec variadic macro5.4.7
## after ##5.4.7
#error5.4.10
#include_next is not allowed by Standard5.65.8
#warning5.5.7
'$' in identifier "THIS$AND$THAT"5.6
16 bits can't represent escape sequence L'\x12345'5.4.65.8
2 digraph(s) converted5.9
2 trigraph(s) converted5.9
8 bits can't represent escape sequence '\x123'5.4.65.8
_Pragma operator found in directive line5.4.12
Already seen #else at line 1235.4.3
Bad defined syntax5.4.5
Bad pop_macro syntax5.5.3
Bad push_macro syntax5.5.3
Buffer overflow expanding macro "macro" at "something"5.4.9
Buffer overflow scanning token "token"5.3.3
Bug:5.3.1
Can't open include file "file-name"5.4.11
Can't use a character constant 'a'5.4.5
Can't use a string literal "string"5.4.5
Can't use the character 0x245.4.5
Can't use the operator "++"5.4.5
Constant "123456789012" is out of range of (unsigned) long5.5.45.65.8
Constant "1234567890123456789012" is out of range5.4.65.8
Converted 0x0c to a space5.7
Converted [CR+LF] to [LF]5.5.15.6
Converted \ to /5.6
Division by zero5.4.65.8
Duplicate parameter names "a"5.4.7
Empty argument in macro call "MACRO( a, ,"5.6
Empty character constant ''5.4.15.5.1
Empty parameter5.4.7
End of file with no newline, supplemented the newline5.5.2
End of file with unterminated #asm block started at line 1235.4.25.5.2
End of file with unterminated comment, terminated the comment5.5.2
End of file with \, deleted the \5.5.2
End of file within #if (#ifdef) section started at line 1235.4.25.5.2
End of file within macro call started at line 1235.4.25.5.2
Excessive ")"5.4.5
Excessive token sequence "junk"5.4.45.5.3
File read error5.3.2
File write error5.3.2
GCC2-spec variadic macro is defined5.6
Header-name enclosed by <, > is an obsolescent feature 5.6
I64 suffix is used in other than C99 mode "123i64"5.65.8
Identifier longer than 31 bytes "very_very_long_name"5.7
Ignored #ident5.5.35.8
Ignored #sccs5.5.35.8
Illegal #directive "123"5.4.45.5.35.8
Illegal control character 0x1b in quotation5.5.1
Illegal control character 0x1b, skipped the character5.4.1
Illegal digit in octal number "089"5.5.1
Illegal multi-byte character sequence "XY" in quotation5.5.1
Illegal multi-byte character sequence "XY"5.4.1
Illegal parameter "123"5.4.7
Illegal shift count "-1"5.5.45.8
Illegal UCN sequence5.4.1
In #asm block started at line 1235.4.3
Integer character constant 'abcde' is out of range of unsigned long5.5.45.65.8
Integer character constant 'abcdefghi' is out of range5.4.65.8
Less than necessary N argument(s) in macro call "macro( a)"5.4.95.5.5
Line number "0x123" isn't a decimal digits sequence5.4.45.5.6
Line number "2147483648" is out of range of 1,21474836475.4.4
Line number "32768" got beyond range5.5.6
Line number "32768" is out of range of 1,327675.5.6
Line number "32769" is out of range5.5.6
LL suffix is used in other than C99 mode "123LL"5.5.45.65.8
Logical source line longer than 509 bytes5.7
Macro "MACRO" is expanded to "defined"5.5.4
Macro "MACRO" is expanded to "sizeof"5.5.4
Macro "MACRO" is expanded to 0 token5.5.4
Macro "macro" needs arguments5.8
Macro started at line 123 swallowed directive-like line5.5.5
Macro with mixing of ## and # operators isn't portable5.7
Macro with multiple ## operators isn't portable5.7
Misplaced ":", previous operator is "+"5.4.5
Misplaced constant "12"5.4.5
Missing ")"5.4.5
Missing "," or ")" in parameter list "(a,b"5.4.7
More than 1024 macros defined5.7
More than 31 parameters5.7
More than 32 nesting of parens in #if expression5.7
More than 8 nesting of #if (#ifdef) sections5.75.8
More than 8 nesting of #include5.7
More than BLK_NEST nesting of #if (#ifdef) sections5.3.3
More than INCLUDE_NEST nesting of #include5.3.3
More than necessary N argument(s) in macro call "macro( a, b, c)5.4.9
More than NEXP*2-1 constants stacked at "12"5.4.5
More than NEXP*3-1 operators and parens stacked at "+"5.4.5
More than NMACPARS parameters5.4.7
Multi-character or multi-byte character constant 'XY' isn't portable5.75.8
Multi-character wide character constant L'ab' isn't portable5.75.8
Negative value "-1" is converted to positive "18446744073709551615"5.5.45.8
No argument5.4.45.5.3
No header name5.4.4
No identifier5.4.4
No line number5.4.4
No space between macro name "MACRO" and repl-text5.5.3
No sub-directive5.5.3
No token after ##5.4.7
No token before ##5.4.7
Not a file name "name"5.4.4
Not a formal parameter "id"5.4.7
Not a header name "UNDEFINED_MACRO"5.4.4
Not a line number "name"5.4.4
Not a valid preprocessing token "+12"5.4.95.6
Not a valid string literal5.4.9
Not an identifier "123"5.4.45.5.3
Not an integer "1.23"5.4.5
Not in a #if (#ifdef) section5.4.3
Not in a #if (#ifdef) section in a source file5.4.35.5.3
Operand of _Pragma() is not a string literal5.4.12
Operator ">" in incorrect context5.4.5
Old style predefined macro "linux" is used5.5.5
Out of memory (required size is 0x1234 bytes)5.3.2
Parsed "//" as comment5.6
Preprocessing assertion failed5.4.10
Quotation longer than 509 bytes "very_very_long_string"5.7
Recursive macro definition of "macro" to "macro"5.4.9
Removed ',' preceding the absent variable argument5.5.5
Replacement text "sub(" of macro "head" involved subsequent text5.5.55.8
Rescanning macro "macro" more than RESCAN_LIMIT times at "something"5.4.9
Result of "op" is out of range5.4.65.8
Result of "op" is out of range of (unsigned) long5.5.45.65.8
Shift count "40" is larger than bit count of long5.5.45.65.8
sizeof is disallowed in C Standard5.8
sizeof: Illegal type combination with "type"5.4.65.8
sizeof: No type specified5.4.5
sizeof: Syntax error5.4.5
sizeof: Unknown type "type"5.4.65.8
Skipped the #pragma line5.6
String literal longer than 509 bytes "very_very_long_string"5.7
The macro is redefined5.5.4
This is not a preprocessed source5.3.4
This preprocessed file is corrupted5.3.4
Too long comment, discarded up to here5.7
Too long header name "long-file-name"5.3.3
Too long identifier, truncated to "very_long_identifier"5.5.1
Too long line spliced by comments5.3.3
Too long logical line5.3.3
Too long number token "12345678901234"5.3.3
Too long pp-number token "1234toolong"5.3.3
Too long quotation "long-string"5.3.3
Too long source line5.3.3
Too long token5.3.3
Too many magics nested in macro argument5.4.9
Too many nested macros in tracing MACRO5.4.9
UCN cannot specify the value "0000007f"5.4.15.8
Undefined escape sequence '\x'5.5.45.8
Undefined symbol "name", evaluated to 05.75.8
Unknown #directive "pseudo-directive"5.4.45.5.45.8
Unknown argument "name"5.5.3
Unterminated character constant 't understand.5.4.1
Unterminated expression5.4.5
Unterminated header name 5.4.1
Unterminated macro call "macro( a, (b,c)"5.4.9
Unterminated string literal5.4.1
Unterminated string literal, catenated to the next line5.5.1
Variable argument macro is defined5.6
Wide character constant L'abc' is out of range of unsigned long5.5.45.65.8
Wide character constant L'abc' is out of range5.4.65.8


6. Reporting on Bugs and Others

I have developed the Validation Suite to verify conformance of preprocessing to Standard C/C++, and released it along with mcpp source. The Validation Suite is intended to allow you to verify all the Standard C preprocessing specifications. Of course, I used the Validation Suite to check mcpp. And what is more, I have compiled mcpp in many compiler systems to verify its behavior. Therefore, I am confident that mcpp is now almost flawless, free of bugs and misinterpretation of specifications, however, I cannot deny the possibility that it still contains some bugs.

If you find a strange behavior, do not hesitate to let me know. If you receive a diagnostic message saying "Bug: ...", it is undoubtedly a bug of mcpp or a compiler system. (Probably, it's mcpp's.) How illegal a user program may be, should mcpp lose control, it is mcpp that is to be blamed for it.

When you report a bug, please be sure to provide the following information:

  1. Compiler system mcpp is ported to.
  2. A sample source (shorter is better) that allows reproduction of what looks like a bug.
  3. Preprocessing results.

Other than bugs, I would appreciate if you give me feedback on mcpp usage, diagnostic messages or this manual.

For your feedback or information, please post to "Open Discussion Forum" at:

http://mcpp.sourceforge.net/

or send via e-mail.

mcpp-2.7.2/doc/cpp-test.html0000644000175000017500000131222411113256232012575 00000000000000

CPP-TEST

== Validation Suite for Standard C Conformance of Preprocessing ==

for V.1.5.5 (2008/11)
Kiyoshi Matsui (kmatsui@t3.rim.or.jp)

Contents

1. Standard C and Validation Suite
1.1. History
1.2. The Standards
1.3. Notations in this document

2. Standard C Preprocessing Features
2.1. K&R 1st and Standard C Preprocessing
2.2. Translation Phases
2.2.1. Line Splicing Before Tokenization
2.3. Preprocessing Token
2.3.1. No Keyword
2.3.2. Preprocessing-number
2.3.3. Token-based Operations and Token Concatenation
2.4. Evaluation Type of #if Expression
2.5. Portable Preprocessor
2.6. Function-like Macro Expansion
2.6.1. Analogous to Function Call
2.6.2. Argument Expansion Before Substitution
2.6.2.1. No Expansion for the Operand of the # or ## Operator
2.6.3. Rescanning
2.6.4. Prevention of Recursive Macro Expansion
2.7. Issues
2.7.1. Header Name in the <stdio.h> Format
2.7.2. # Operator Specification with Legacy from Character-based Preprocessing
2.7.3. White Space Handling at Macro Re-definition
2.7.4. Parameter Name at Function-like Macro Re-definition
2.7.5. Unpredictable Evaluation of Character Constant in #if Expression
2.7.6. Non-Function-like Rescanning of Function-like Macro
2.7.7. C90 Corrigendum 1, 2 and Amendment 1
2.7.8. Redundant Specifications
2.8. Preprocessing Specification in C99
2.9. Toward Clear Preprocessing Specifications

3. Validation Suite Explanation
3.1. Validation Suite for Conformance of Preprocessing
3.2. Testing Method
3.2.1. Manual Testing
3.2.2. Automatic Testing by cpp_test
3.2.3. Automatic Testing by GCC / testsuite
3.2.3.1. TestSuite
3.2.3.2. Installation to TestSuite and Testing
3.2.3.3. mcpp Automatic Testing
3.2.3.4. TestSuite and Validation Suite
3.3. Violation of syntax rules or Constraints and Diagnostic Messages
3.4. Details
3.4.1. Trigraphs
3.4.2. Line Splicing by <backslash><newline>
3.4.3. Comments
3.4.4. Special Tokens (digraphs) and Characters (UCN)
3.4.5. Spaces and Tabs on a Preprocessing Directive Line
3.4.6. #include
3.4.7. #line
3.4.8. #error
3.4.9. #pragma, _Pragma() operator
3.4.10. #if, #elif, #else, and #endif
3.4.11. #if defined
3.4.12. #if Expression Type
3.4.13. #if Expression Evaluation
3.4.14. #if Expression Error
3.4.15. #ifdef and #ifndef
3.4.16. #else and #endif Errors
3.4.17. #if, #elif, #else, and #endif Mismatching Errors
3.4.18. #define
3.4.19. Macro Re-definition
3.4.20. Macro Names Same as Keywords
3.4.21. Macro Expansion Requiring Pp-token Separation
3.4.22. Macro-like Sequence in a Pp-number
3.4.23. Macros Using the ## Operator
3.4.24. Macros Using the # Operator
3.4.25. Macro Expansion in a Macro Argument
3.4.26. Macros of a Same Name during Macro Rescanning
3.4.27. Macro Rescanning
3.4.28. Predefined Macros
3.4.29. #undef
3.4.30. Macro Calls
3.4.31. Macro Call Error
3.4.32. Character Constant in #if Expression
3.4.33. Wide Character Constant in #if Expression
3.4.35. Multi-Character Character Constant in #if Expression
3.4.37. Translation limits
3.5. Documentation of Implementation-Defined Items

4. Evaluation of Aspects Unspecified by Standard
4.1. Multi-byte Character Encoding
4.2. Undefined Behavior
4.3. Unspecified Behavior
4.4. Other Cases Where a Warning is Preferable
4.5. Other Quality Matters
4.5.1. Qualities regarding Behaviors
4.5.2. Options and Extended Functionalities
4.5.3. Efficiency and others
4.5.4. Quality of Documents
4.6. C++ Preprocessing

5. Issues Around C Preprocessing
5.1. Standard Header Files
5.1.1. General Rules
5.1.2. <assert.h>
5.1.3. <limits.h>
5.1.4. <iso646.h>

6. Preprocessor Test Results
6.1. Preprocessors Tested
6.2. Lists of Marks
6.3. Characteristics of Each Preprocessor
6.4. Overall Review
6.5. Test Reports and Comments

1. Standard C and Validation Suite

I completely rewrote DECUS cpp by Martin Minow to create a portable C preprocessor called mcpp V.2. mcpp stands for 'Matsui cpp'. This preprocessor is provided as source code and can be ported for various compiler systems by modifying some macros in header files on compilation. In addition, execution programs has various behavioral modes such as Standard C (ISO/ANSI/JIS C) and others. Among those modes, the Standard C mode literally implements strict Standard C preprocessing.

While implementing this preprocessor, I also created a testing tool called "Validation Suite for Standard C Conformance of Preprocessing". This suite also covers C++. This document explains the Validation Suite. The Validation Suite is open to the public as an open-source-software along with this documentation under the BSD-style-license.


1.1. History

The Validation Suite became available to the public on NIFTY SERVE/FC/LIB 2 in August 1998, and also later on http://www.vector.co.jp/pack. It did not have a version number, however, and so is assumed to be version 1.0.

V.1.1 supports the C99 draft in August 1997 and is an update to V.1.0. V.1.1 was also made public on NIFTY SERVE/FC/LIB 2 and vector/software pack in September, 1998.

V.1.2 supports the official C++ Standard release and is a small update to V.1.1. It also became available on NIFTY SERVE/FC/LIB 2 and vector/software pack in November 1998.

V.1.3 supports the official C99 release and is an update to V.1.2. In addition, behavioral test samples were rewritten so that they can be used by the GCC / testsuite.

V.1.3, while it was under development, was adopted as the year 2002's "Exploratory Software Project" at the Information-technology Promotion Agency, Japan (IPA) by Yutaka Niibe Project Manager. From July 2002 to February 2003, the development continued under the grants-in-aid from IPA and Niibe PM's advice. The English version of the document was created under my supervision with the translation work outsourced to HighWell, Inc. In February 2003, mcpp V.2.3 and Validation Suite V.1.3 were released on m17n.org.

In addition, mcpp and Validation Suite were adopted as the year 2003's "Exploratory Software Project" by Hiroshi Ichiji Project Manager. This allowed an update to V.2.4 and V.1.4. *1

mcpp and Validation Suite have been kept on updating after the project. V.2.5 and V.1.5 were released in March 2005. Validation Suite V.1.5 changed allocation of points and some other matters. In July 2006, mcpp V.2.6 and Validation Suite V.1.5.1 are released. Validation Suite V.1.5.1 updated the test result of the preprocessors. In November 2006, mcpp V.2.6.2 and Validation Suite V.1.5.2 were released. In April 2007, mcpp V.2.6.3 and Validation Suite V.1.5.3 were released. V.1.5.2 and V.1.5.3 of Validation Suite have no substantial change. They have only small updates of this document. In May 2007, mcpp V.2.6.4 was released, and in March 2008, mcpp V.2.7 and Validation Suite V.1.5.4 were released. Validation Suite V.1.5.4 updated a few testcases and added test data on Visual C++ 2008. In May 2008, mcpp V.2.7.1 was released, and in November 2008, mcpp V.2.7.2 and Validation Suite V.1.5.5 were released. Validation Suite V.1.5.5 added test data on Wave V.2.0.

Note:

*1 The overview of the Exploratory Software Project can be found below (in Japanese only).

http://www.ipa.go.jp/jinzai/esp/

mcpp from V.2.3 through V.2.5 had been located at:

http://www.m17n.org/mcpp/

In April 2006, mcpp project moved to:

http://mcpp.sourceforge.net/

mcpp V.2.2 and Validation Suite V.1.2 are located in the following Vector's web site. They are in the directory called dos/prog/c, but they are not for MS-DOS exclusively. Sources are for UNIX, WIN32, MS-DOS. The documents are Japanese only.

http://www.vector.co.jp/soft/dos/prog/se081188.html
http://www.vector.co.jp/soft/dos/prog/se081189.html
http://www.vector.co.jp/soft/dos/prog/se081186.html

The text files in these archive files available at Vector use [CR]+[LF] as a <newline> and encode Kanji in shift-JIS for DOS/Windows. On the other hand, those from V.2.3 through V.2.5 available at SourceForge use [LF] as a <newline> and encode Kanji in EUC-JP for UNIX. From V.2.6 on two types of archive, .tar.gz file with [LF]/EUC-JP and .zip file with [CR]+[LF]/shift-JIS, are provided.


1.2. The Standards

ISO/IEC 9899:1990 (JIS X 3010-1993) had been used as C Standard, but in 1999, ISO/IEC 9899:1999 was adopted as a new Standard. This document calls the former C90 and latter C99. The former is generally called ANSI C or C89 because it migrated from ANSI X3.159-1989. ISO/IEC 9899:1990 plus its Amendment 1995 is sometimes called C95. C++ Standards are ISO/IEC 14882:1998 and its corrigendum version ISO/IEC 14882:2003. This document calls both of them C++98.

The Standards referred in this explanation are below.

  C90:
    ANSI X3. 159-1989       (ANSI, New York, 1989)
    ISO/IEC 9899:1990(E)    (ISO/IEC, Switzerland, 1990)
        ibid.   Technical Corrigendum 1     (ibid., 1994)
        ibid.   Amendment 1: C Integrity    (ibid., 1995)
        ibid.   Technical Corrigendum 2     (ibid., 1996)
    JIS X 3010-1993         (JIS Handbook 59-1994, Tokyo, 1994, Japanese Standards Association)
  C99:
    ISO/IEC 9899:1999(E)
        ibid.   Technical Corrigendum 1 (2001)
        ibid.   Technical Corrigendum 2 (2004)
  C++:
    ISO/IEC 14882:1998(E)

ANSI X3.159 contained "Rationale." It was not adopted by ISO C90 for some reason, but reappeared in ISO C99. This "Rationale" is also referred to from time to time.

PDF versions of C99 and C++ Standards can be obtained online on the following sites. (The open-std.org site provides drafts which can be freely downloaded.)

C99, C++98, C++03:

http://webstore.ansi.org/ansidocstore/default.asp

C99+TC1+TC2:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf

C99 Rationale final draft in October, 1999:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n897.pdf


1.3. Notations in this document

Though this document was text-file in the older versions, it has changed to html-file at V.1.5.2. This document uses the following typographical conventions:


2. Standard C Preprocessing Features

Before explaining the Validation Suite, I will talk about the overall characteristics of Standard C (ANSI/ISO/JIS C) preprocessing. This is not text bookish, but intended to point out the concepts and issues of Standard C by comparing with K&R 1st.

As I explain, I will concentrate on the differences between K&R 1st and C90 first, C90 and C99, then C90 and C++ in this order. C99 is currently available as a Standard, however, it has not been implemented on actual compiler systems very much. Therefore, it is more realistic to center on C90.

This chapter shows few samples, please refer to the Validation Suite since it is a sample itself.


2.1. K&R 1st and Standard C Preprocessing

There were endless varieties of dialects amongst pre-Standard C language implementations. Above all, there were almost no standards for preprocessing. The reason was because the preprocessing specification was too simplistic and ambiguous in the 1st edition of "The C Programming Language" by Kernighan & Ritchie as a reference. In addition, it seems that preprocessing was thought to be a bonus to the language proper. However, many features were added to preprocessing by each implementation since K&R 1st. Some supplemented flaws in the language proper while others tried to maintain portability among different implementations. However, there were too many differences among implementations in any case. The truth was it was nowhere close to being portable.

C90 provided a clear specification on preprocessing which had been a cause of the confusion for many years. There are some new features added which are well known. What is more important, however, is that C90 provides virtually the first overall specification on preprocessing. You can see a basic point of view, "what is preprocessing?", which had been vague thus far, everywhere in this specification. Preprocessing in C90 is not just K&R 1st + alpha. In order to understand this, I believe we need to grasp not only "new features", but also such basics clearly. Unfortunately, however, the basics of preprocessing are not summarized together in the body of the Standard and just mentioned briefly in "Rationale", a commentary on the Standard. Even more unfortunately, it contains incoherent parts which seem to be the results of making a compromise with conventional preprocessing. Therefore, I will summarize basic characteristics of C90 preprocessing and examine their issues.

Characteristics different from pre-Standard processing or newly defined are summarized as the following four points.

  1. Literal "pre-processing" independent of implementation-specific parts in the language proper (execution environment, so to speak.) It is extremely rare for preprocessing to end in an unexpected result depending on implementation. This allows us to write portable source code for a preprocessor itself. Also, only one preprocessor executable program suffices for each OS.

  2. The translation phase specification clearly defines a procedure for tokenizing source. A token is handled in an interim form as a preprocessing token until preprocessing completes. Specifying preprocessing tokens and tokens themselves separately helps preprocessing getting independent of implementation-dependent parts in the language proper.

  3. Preprocessing takes place in the unit of preprocessing token and is token-oriented in principle. On the contrary, pre-Standard preprocessing was supposedly token-oriented but contained parts for character-oriented processing to no small extent based on its historical background; it was neither one thing nor the other.

  4. Function-like macro expansion is modeled after a function call to organize grammar. Function-like macro calls can be used anywhere function calls can. Processing for a macro call in an argument parallels the evaluation for a function call in a function argument and is substituted for a parameter in the replacement list after the macro in the argument is completely expanded. At this expansion, the macro call in the argument must be completed within the argument.

These principles are examined below in turn.


2.2. Translation Phases

No preprocessing procedure was described in K&R 1st, which caused much confusion. C90 specifies and defines translation phases. It can be summarized as follows. *1

  1. Map the characters in source files to the source character set if necessary. Replace trigraphs. *2

  2. Delete <backslash><newline>. By doing so, splice physical lines to form logical lines.

  3. Decompose source files into preprocessing tokens and white spaces. Comments are replaced by one space character. <newline> is retained.

  4. Execute preprocessing directives and expand macro calls. If #include directive exists, files specified are processed for phase 1 to phase 4 recursively.

  5. Convert characters in the source character set into the execution character set. Convert escape sequences in character constant and string literals similarly.

  6. Concatenate adjacent string literals and concatenate adjacent wide character string literals.

  7. Convert preprocessing tokens into tokens and compile.

  8. Link.

Needless to say, these steps do not actually have to be in separate phases as long as they are processed to lead the same result.

Among these phases, phase 1 to 4 or to 6 belong to the range of preprocessing. It is usually handled up to phase 4 since token separators such as <newline> need to be retained if a preprocessor is an independent program and outputs the preprocessing result as an intermediate file (if escape sequences such as \n are converted in phase 5, they cannot be distinguished from <newline> and other token separators.) This Validation Suite also tests up to phase 4.

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases
C99 added _Pragma() operator processing at phase 4. Some words have been added to the description, but no changes to the meanings in particular.

*2 In the C99 draft in November, 1997, a multi-byte character not included in the basic source character set before trigraphs replacement was, by a specification, to be converted into a Unicode hexadecimal sequence of the \Uxxxxxxxx format, that is, a universal character name. This sequence is re-converted into the execution character set in phase 6. This is similar to the C++ Standard.

This specification is vague, furthermore, the load is great on implementations. Fortunately, the processing at phase 1 was deleted in the draft in January, 1999 and remained as is in C99 official version.

2.2.1. Line Splicing Before Tokenization

K&R 1st described only 2 cases below regarding line splicing by <backslash><newline>, no others were defined.

  1. In the middle of a long #define line
  2. In the middle of a long string literal

C90 clearly defines that <backslash><newline> is deleted in phase 2 before decomposing lines into preprocessing tokens and token separators in phase 3. This allows any lines or any tokens to be spliced.

Also, as trigraph processing is done in phase 1, the ??/<newline> sequence is similarly deleted. On the other hand, 0x5c code in the second byte of Kanji characters is not a <backslash> for the implementation with ASCII as its basic character set and Shift-JIS Kanji Characters as the multi-byte character encoding since one Kanji character is one multi-byte character.

It is good that the translation phases became clear, but I am wondering if it is necessary to support line splicing in the middle of a token. Although this was the only way to write a long string literal which cannot fit on one line on the screen in K&R 1st, it is not necessary to start a new line in the middle of a token on purpose since adjacent string literals are concatenated in C90. Line splicing is required only when you write a long control line. If that were the only issue, it would have been better to reverse phase 2 and 3.

Still, the current specification seems to be adopted for backward compatibility so that the source written assuming the specification of the concatenation by line splicing for string literals in K&R 1st can be processed. The specification is almost meaningless for new source in practical use, however, it is probably appropriate since it is simple, comprehensible, and easiest to implement.


2.3. Preprocessing Token

The concept of preprocessing token (pp-token, for short) was also introduced for the first time in C90. Since it does not seem to be known very much, however, I will summarize the content at first. Below are specified as pp-tokens. *1

header-name
identifier
preprocessing-number
character-constant
string-literal
operator
punctuator
Non-white-space character other than above

These look nothing special at a casual glance, but they are quite different from the token proper. Tokens are below.

keyword
identifier
constant (floating-constant, integer-constant, enumeration-constant, character-constant)
string-literal
operator
punctuator

Pp-tokens differ from tokens in the following points.

  1. No keywords. A name the same as a keyword is handled as an identifier.
  2. For constants, character-constant is same while floating-constants, integer-constants, and enumeration constants do not exist and preprocessing-numbers replace floating-constants and integer-constants.
  3. Header-name exists only as a pp-token.
  4. Operator and punctuator are almost the same, but # and ## operators and # punctuator exist only as a pp-token. (All are valid only in preprocessing directive lines.)

Surprisingly, only string-literal and character-constants are the same. The most important of all are no keywords and the existence of a preprocessing-number instead of a numeric token. We will discuss these 2 items further.

Note:

*1 C90 6.1 Lexical elements
   C99 6.4 Lexical elements

In C99, an operator was absorbed by a punctuator whether it is a pp-token or token. Operator became the term simply for an "operator" functionality, not as a token type. The same punctuator token (punctuator pp-token) may function as a punctuator or operator depending on the context. Also, _Pragma was added as a pp-token operator.

2.3.1. No Keyword

A keyword is recognized for the first time in phase 7. A keyword is handled as an identifier in preprocessing phases. For preprocessing, an identifier is a macro name or an identifier which has not been defined as a macro. That means that even a macro with a same name as a keyword can be used. *1

This specification is indispensable in order to separate preprocessing from implementation-dependencies. This, for example, prohibits using a cast or sizeof in #if expressions. *2

Note:

*1 To be more precise, a parameter name in a macro definition is also an identifier. In addition, a preprocessing directive name is a special identifier and has a similar characteristic to a keyword. Whether this is a directive, however, is judged by syntax. If it is not in a valid place for directives, it is simply an identifier, which may be subject to macro expansion.

*2 Refer to 3.4.14.7 and 3.4.14.8.

2.3.2. Preprocessing-number

Preprocessing-numbers (pp-number, for short) are specified as below. *1, *2

digit
.digit
pp-number digit
pp-number nondigit
pp-number e sign
pp-number E sign
pp-number .

Non-digits are letters and underscores.

Summarized as below.

  1. Starts with a digit or .digit.
  2. The rest is sequences of letters (alphabets), underscores, digits, periods, and e+, e-, E+, or E- in any order.

Pp-number includes all floating-constants and integer-constants, and even non-numerical sequences, 3E+xy, for example. Pp-number was adopted to make preprocessing simple and is considered to be helpful for the tokenization of this type of sequence which precedes semantic interpretation. *3

It is correct that tokenization becomes simple, however, a non-numeric pp-numbers is not a valid token. Therefore, it must disappear before completing preprocessing. Use of non-numeric pp-numbers deliberately in source is highly unlikely. The only case I can think of is that a numeric pp-number and another type of pp-token are concatenated to become a non-numeric pp-number in the macro defined by using a ## operator and it is stringized by a macro defined by a # operator. Any pp-token becomes a valid token if it is put in a string literal. However, without accepting the existence of non-numeric pp-number, the one generated by concatenation will not become a valid pp-token (the result becomes undefined.)

Although this type of usage is extremely special and need not to be examined in detail, pp-numbers provide an interesting subject matter in terms of token-oriented preprocessing.

Note:

*1 C90 6.1.8 Preprocessing numbers
   C99 6.4.8 Preprocessing numbers

*2 In C99, pp-number p sign and pp-number P sign sequences were added to enable hexadecimal expression for floating point numbers. In addition, the nondigit above was replaced by the identifier-nondigit. This is a change accompanied by the approval of using an UCN (universal character name) and implementation-defined multi-byte characters in an identifier. (Refer to 2.8.) In other words, an UCN can be used in a pp-number and an implementation using multi-byte characters is supported. This is allowed in case of stringizing by ## and # operators though no UCN or multi-byte characters are included in a numerical value token.

*3 C89 Rationale 3.1.8 Preprocessing numbers
   C99 Rationale 6.4.8 Preprocessing numbers

2.3.3. Token-based Operations and Token Concatenation

C90 acquired pp-token concatenation capability with the ## binary operator in a macro definition. This is known as a "new feature" in C90. This, however, is something introduced to replace a hack rather than a new feature. What I would like to pay attention here is that this is essential for token-oriented preprocessing.

The traditional token concatenation method, uses a specification of replacement of a comment with 0 character, known as the so-called "Reiser type cpp." On other occasions, token concatenation occurs unintentionally in the preprocessor with character-oriented operations. And, there were hacks taking advantage of it. I can say all took advantage of flaws in character-oriented preprocessing.

On the other hand, C90 allows explicit token concatenation by token-oriented operations. Source file is decomposed into sequences of pp-tokens and white spaces in translation phase 3. The only cases of combining pp-tokens later is ## operator concatenation and # operator stringizing, header-name construction, and the concatenation of string literals or wide character string literals next to each other. The handling of non-numeric pp-numbers is clear if its existence is considered in this context. That is to say, there are the following principles of C90 tokenization.

Pp-tokens are not concatenated implicitly. Concatenation must be done explicitly by ## operators. Pp-tokens concatenated once will never be separated again.

In pre-Standard character-oriented preprocessing, macro call expansion sometimes caused unintended concatenation with tokens before and after with the token sequence as its result. However, this can be thought as something which must not occur in token-oriented C90 preprocessing. *1

Note:

*1 Refer to 3.4.21.


2.4. Evaluation Type of #if Expression

In C90, the #if expression was evaluated with one type of size, either long or unsigned long. This also simplified preprocessing and helped reducing implementation-dependent parts at the same time. Compared with the int size, which varies greatly depending on implementations, long/unsigned long are 32 bits for the most part and sometimes 64 or 36 bit. This assures considerable portability in general #if expressions. *1, *2, *3

Note:

*1 C90 6.8.1 Conditional inclusion -- Semantics

*2 C99 6.10.1 Conditional inclusion

In C99, the #if expression type was specified as the maximum integer type for the compiler system. Since C99 requires long long/unsigned long long, this would be long long/unsigned long long or wider. This, however, reduces the portability of #if expressions.

*3 There will be more implementations with 64 bit long in the future, but I am not sure if that is good... By the way, I personally believe that the integer type size should be defined as below.

  1. short as 2 bytes and long as 4 bytes.
  2. longlong (not long long) or quadra as 8 bytes.
  3. int should be CPU dependent. In other words, either short, long, or longlong.
  4. Stop using the usage of short int and long int by modifying int with short or long.

In other words, there has been a constraint of sizeof (short) <= sizeof (int) <= sizeof (long) since the arrival of 64 bit compiler systems which made everything constrained and caused no type to maintain portability. It will be better to remove this constraint and to decide types by absolute size.


2.5. Portable Preprocessor

Standard C preprocessing specifications above allow writing the source code for a preprocessor itself portably. That is because the preprocessor needs to know nothing about the implementation-dependent parts of compiler proper. Only peripheral parts as below become problems when you actually try to write preprocessors portably in Standard C compiler systems.

  1. Path list description format of OS for #include processing. Where standard header files exist.
  2. Format to pass filename and line number information to a compiler proper.
  3. Runtime options.
  4. Character set.
  5. The size of long/unsigned long in C90 or the maximum integer type in C99 must not go below that of the target implementation in cross implementations.

2 and 3 above are necessary only if they are implemented for existing implementations. I expect that 2 will be standardized in the #line 123 "filename" format same as a source file. 3 is not necessary (logically, leaving convenience aside) for Standard C preprocessing. 4 can be written in the form such that special implementations are not required depending the source code (though implementations are easier for a basic character set if a table is used in the source code.) 5 will not be a problem since the integer type size for a host implementation is seldom smaller than that of target one in reality.

Needless to say, mcpp was also created with a motive that these Standard C preprocessing specifications are independent of compiler proper (though there are many #if sections in order to assure the portability since this mcpp is intended to be ported to many compiler systems.)


2.6. Function-like Macro Expansion

Macro expansion method with arguments is specified modeling after function calls in C90 and called a function-like macro. If macros are contained in an argument, they are expanded before substitution for a parameter in principle.

This point was not clear for pre-Standard implementations. I suspect that most used the method that an argument was substituted for a parameter without the macro within it being expanded and was expanded at rescanning. So to speak, the editor-like text replacement repetition is speculated to be behind this type of expansion. In general, text replacement repetitions for editors are fine for macro expansion without arguments, but I wonder if they were extended to the macro expansion with arguments for many preprocessors.

However, this method causes a strange way of using macros totally different from function call-like appearance in source. When calling a nested macro with arguments, the situation where it is not clear which argument is which occurs. Given these points, implementation-specific features will increase. In short, I can say that it became too heavy a load for the editor-like text replacement repetition as macro expansion of C grew to take on advanced features.

2.6.1. Analogous to Function Call

In consideration of this confusion, the grammar was organized in Standard C by positioning function-like macro calls as replacements for function calls. The Rationale states the following principles for which the Standard C specifications of macros are grounded. *1

- Allow macros to be used wherever functions can be.
- Define macro expansion such that it produces the same token sequence whether the macro calls appear in open text, in macro arguments, or in macro definitions.

This stands to reason for function calls, but not for macros with arguments. It is obvious that this is not for editor-like text replacement repetition.

Note:

*1 C89 Rationale 3.8.3 Macro replacement
   C99 Rationale 6.10.3 Macro replacement

2.6.2. Argument Expansion Before Substitution

What is essential for achieving the principle of macro expansion parallel to function calls is to expand macros in an argument first before substituting a parameter with the argument. And, the macro call within an argument must have been completed within that argument (it causes an error if not completed.) A macro within an argument must not absorb the text right after it. Thus, nested function-like macro calls can maintain logical clarity. *1

Note:

*1 Refer to 3.4.25.

2.6.2.1. No Expansion for the Operand of the # or ## Operator

Operands for the # operator, however, are not supposed to be macro-expanded. Operands for the ## operator are not macro-expanded, either. The pp-token generated by concatenation becomes subject to macro expansion at rescanning. Why do we need this specification?

This specification is meaningful when an argument includes macros indeed. It is helpful if you want to stringize or concatenate token sequences including macros as they are. On the contrary, to expand a macro before stringizing and concatenation, it needs wrapping another macro which does not use # and ## operators. In order for a programmer to be able to choose either of these, a specification is needed so that no macro-expansion is performed for the operands of # and ## operators. *1

Note:

*1 Refer to 3.4.25, misc.t/PART 3 and 5. A typical example where the specification of no macro expansion for the operand of the # operator helps is the assert() macro. Refer to 5.1.2.

2.6.3. Rescanning

Now, after macro calls are replaced with a replacement list and function-like macro arguments are substituted for parameters in the replacement list after being expanded, the replacement list is rescanned searching for more macro calls.

This rescanning is a specification since K&R 1st. And there seems to have been an "editor-like text replacement repetition" approach in the background. In Standard C, however, function-like macro arguments have been completely expanded already except for operands of ## operators. What on earth is expanded at rescanning?

Rescanning is necessary for macros in replacement list other than parameters, and for macros with ## operators. What is needed rescanning other than those is so-called cascaded macros, where macro "definitions" are nested. If "arguments" for macro calls are nested, they usually do not get expanded again at rescanning since they have been expanded in the nesting structure before rescanning (though there are exceptions. Refer to 2.7.6 and 3.4.27.)

2.6.4. Prevention of Recursive Macro Expansion

Although cascaded macros are expanded one after another, it may be a problem sometimes. That is the case the macro definition itself is recursive. If this is expanded as is, it will fall into infinite recursion. The same problems occur in not only the direct recursive case where a macro is included in the definition itself, but also the indirect recursion of 2 or more definitions. In order to avoid this situation, Standard C adds a specification of "If the name of the macro being replaced is found during the rescan of the replacement list, it is not replaced." The phrases are difficult, but its intention is easy to understand.

This is a point where a function-like macro has different grammar from the function. It is also different from the editor-like replacement. Since it is a macro specific specification and has been used as a convenient processing, which is used only in macros, I think it is appropriate to keep this specification by clearly defining it.


2.7. Issues

I have covered above only good aspects or simple and clear aspects of Standard C preprocessing specifications. If I go into more detail, however, there are parts that are irregular or lacking in their utility or portability for their implementation overhead. Most of these are there without being able to settle traditional or implicit pre-Standard preprocessing methods. The existence of this type of useless area like an appendix which confuses the specification and makes implementation troublesome. Standard C also includes a few parts which caused new unnecessary complications. Those problems are sorted out below.

2.7.1. Header Name in the <stdio.h> Format

Although header-names enclosed by < and > have been used traditionally since K&R 1st, they are extremely exceptional and irregular as tokens. Because of this, Standard C has many undefined and implementation-defined parts regarding header-name pp-token. For example, it is undefined if the /* sequence is included. Also, if it is not a header-name as in <stdio.h>, the part which is divided into multiple pp-tokens as in <, stdio, . , h, and > must be combined to one pp-token as far as the #include line goes. That method is implementation-defined. Tokenization is performed in translation phase 3. However, if the line turns out to be a #include directive in phase 4, tokenization needs to be redone. I would have to say it is a very illogical specification. The processing in case a space exists between (temporary) pp-tokens, which were once tokenized in phase 3, is also implementation-defined. Directives such as #include <stdio.h> appear to have most portability, but have low portability in respect of preprocessing implementations. Irregularity increases more if the argument of the #include line is a macro.

Header-names enclosed by " and " have no problems like these. However, \ is not handled as an escape character as in header-names enclosed by < and > and this is the difference from string literals. It is not illogical that no escape sequence exists in a header-name which is processed in phase 4 since escape sequences are processed in phase 6 (\ within a header-name is undefined by the Standard. This must be a consideration to ease implementation. In reality, no problem occurs unless \ comes right before " inside of " and ". It is a little more complicated inside of < and >.) *1

Also, the difference between #include <stdio.h> and #include "stdio.h" is only that the former searches a specific implementation-defined location while the latter first searches (a relative path from) the current directory and the same location as <stdio.h> if it is not found (as Standard C does not assume an OS, it does not use the term, "current directory." But it is interpreted for most operating systems.) Therefore, #include <stdio.h> can be simply written as #include "stdio.h".

By having two kinds of header-name formats, there is a readability advantage of spotting at a glance the distinction between user defined and system provided headers. But it does not have to go to the trouble of providing an irregular token for that purpose. All it needs is to distinguish one from another by using different suffixes as in "stdio.h" and "usr.H" (if I add just in case, it is acceptable if a system does not distinguish uppercase and lowercase of a filename since this is a readability issue. Naturally, they can be "usr.hdr", "usr.usr", "usr.u", and etc.)

I believe that header-names enclosed by < and > should be abolished since it serves no use as a language specification and complicates preprocessing tokenization. It cannot be abolished out of the blue, but I would like it to be specified as an obsolescent feature.

Note:

*1 UCN starting with \ was introduced by C99, which is a little troublesome.

2.7.2. # Operator Specification with Legacy from Character-based Preprocessing

The next problem is the handling of white spaces as token separators between operands of # operators. One or more white spaces are compressed into one space and no space is inserted if there is no white space.

This is half-defined specification. In order to ensure token-based operations, the existence of token separators must not have an influence. For that reason, it should have been defined so that all token separators are deleted or a space is placed between every pp-token. C89 Rationale 3.8.3.2 (C99 Rationale 6.10.3.2) states that the # operator was decided "as a compromise between token-based and character-based preprocessing discipline" within this specification.

This compromise led to an extra burden rather than easing preprocessor implementation and brought ambiguity to complicated macro expansion as well. There is an example shown below in Example 4 of C90 6.8.3, C99 6.10.3 Macro replacement -- Examples.

#define str(s)      # s
#define xstr(s)     str(s)
#define INCFILE(n)  vers ## n

#include xstr(INCFILE(2).h)

This #include line is expanded as:

#include "vers2.h"

This example is filled with many problems. There is no vagueness in INCFILE(2) being replaced with vers2. However, the expansion result of INCFILE(2).h, an argument for xstr(), is a sequence of 3 pp-tokens, vers2, ., and h. The expansion example in the Standard is handled with no white spaces among 3 pp-tokens. This involves issues as below.

  1. vers2 is not a pp-token which was in source, but generated by macro replacement. To guarantee there are no white spaces after vers2, macro replacement must not generate white spaces before or after. However, pp-tokens may implicitly merge as a result of macro expansion at least for the preprocessors which are independent of the compiler if macro replacement is always such. This is against token-based preprocessing principles.

  2. Without generating white space before and after the macro replacement, which can be the operands of # operators and to avoid the implicit concatenation of pp-tokens, a little trick is necessary; for the macro replacement which exists in an argument for a function-like macro call, wrap the replacement result with temporary white spaces internally, delete them if it becomes an operand for a # operator, and replace only the temporary white spaces left after all replacement is complete with real spaces (*1.) This is quite a burden for a preprocessing implementation. And there is no merit. Furthermore, it is not clear from the Standard text that this type of processing is necessary and it is unclear what is the right process.

All these ambiguity and complexity come from the incompleteness of token separator handling in operands for # operators.

I think it is better to have the specification such that # operators are stringized after each pp-token is separated with a single space in order to avoid implicit concatenation of pp-tokens and causing complicated problems and to show what kind of pp-token sequence the argument stringized is. If defined that way, this macro will be expanded as "vers2 . h". Needless to say, this is not an appropriate macro.

As this example shows, the only case where it will be troublesome to insert a space where none exists is the macro for the #include line using # or ## operator. The #include line to be processed in translation phase 4 cannot use the concatenation of the string literals to be processed in phase 6. However, the macro for the #include line can be simply defined as a string literal without bothering to be parameterized using # and ## operators. Sacrificing token-based principles just because of this parameterization is a great loss in the balance.

In the Standard C preprocessing specification, the syntax is token-based while the semantics specification of # operators is suddenly character-based, losing logical consistency.

Moreover, this example of the Standard assumes the specification, which is not necessarily clear from the Standard text. It is an inappropriate example and should be deleted.

Note:

*1 mcpp was compelled to be implemented in the same way.

2.7.3. White Space Handling at Macro Re-definition

There is a similar specification to white space handling in operand of # operators with regards macro re-definition. It is defined; "A macro re-definition must be equivalent to the original macro. In order to be equivalent, the number and name of parameters must be the same and the replacement list must have the same spellings. However, in the case of white spaces in the replacement list, their existence must be the same though the number can be different."

If the specification of the # operators are as above, this is an obvious conclusion since same handling is necessary for white spaces in the replacement list. Still, the cause of the problem is the specification of the # operators.

If the # operator is handled in such a way that one space exists between every pp-token in operands, there will be no issue regarding the existence of white spaces for macro re-definition.

Moreover, this can be generalized in the preprocessor implementation, by replacing with one space between every pp-token in source as a principle. By doing so, tokenization for macro expansion can be done easily and accurately. However, there are two exceptions to this principle. One is <newline> in the preprocessing directive line and another is whether there are white spaces between a macro name and the subsequent '(' in macro definition. This traditionally has been the basis of preprocessing in C and cannot be changed after all these years.

2.7.4. Parameter Name at Function-like Macro Re-definition

I have mentioned in 2.7.3 that parameter names must match regarding macro re-definition in the specification, but I believe this is an excessive specification. Parameter names, of course, do not make any difference to macro expansion. However, in order to check for re-definition, a preprocessor needs to store parameter names of all macro definitions. Even so, its usage is nothing other than re-definition checking within the specification. It is not such a great idea to give overhead to implementations only for almost meaningless checking.

I think it is better to remove the specification that parameter names must match at macro re-definition.

2.7.5. Unpredictable Evaluation of Character Constant in #if Expression

#if expression as an argument for the #if line is a constant expression in the integer type. Its evaluation must be independent of the execution environment since it is done in preprocessing. Because of that, a cast, the sizeof operator, and enum constants, which require references to the execution environment (these are first evaluated in translation phase 7) are excluded from #if expression compared to standard integer constant expressions. Character constants (and wide character constants), however, are not excluded.

Character constant evaluation is implementation-defined with many factors as shown below and has little portability.

  1. Even the value of a basic character differs depending on the basic character set (ASCII, EBCDIC, and others.)

  2. Even a single-character character constant, within the same basic character set, has implementation-defined sign handling (depending on whether char is signed in the compiler proper.)

  3. Multi-character character constant evaluation is implementation-defined and the value may not be the same even if the sign handling is the same as basic character set. It is not defined whether 'ab' is 'a' * 256 + 'b' or 'a' + 'b' * 256 when CHAR_BIT is 8 and char is unsigned.

  4. Multi-byte character encoding is implementation-defined. Wide character encoding is same as multi-byte character encoding. The size of wchar_t and whether it is signed or unsigned is implementation-defined.

  5. Even if multi-byte character encoding is the same, the evaluation of a character may not. There is an issue same as 3.

  6. All above are common problems with character constant evaluation in compiler proper. In addition, the character set in preprocessing can differ from the one the compiler proper sees.
    A source character set is applicable up to translation phase 4 and an execution character set is applicable at phase 6 and after. Phase 5 converts the characters in character constants and string literals from the source character set into the execution character set. That is to say, either or both basic character sets and multi-byte character encodings also may differ between source and runtime.
    Character constants in the #if expression are evaluated in phase 4. This can be either the value of the source character set or simulated value of the execution character set. It is not defined as a source character set either.

  7. Even if the character set evaluated in a #if and the execution character set are the same, the methods of evaluation can differ. That is to say, sign handling and the byte order of multi-character character constant and multi-byte character constant evaluation may differ between phase 4 and phase 7.

  8. Furthermore, while the character constants including multi-byte character constants are evaluated in int and wide character constants in wchar_t in phase 7, they are all evaluated in long or unsigned long in phase 4. In other words, int is handled as if it has the same internal representation as long and unsigned int as if it has the same internal representation as unsigned long in phase 4. Therefore, for the implementation of INT_MAX < LONG_MAX, even if character sets, sign handling, evaluation byte orders are totally identical between phase 4 and 7, the character constant which does not overflow in phase 4 can overflow in phase 7. As a negative number in phase 7 may be a long positive number in phase 4, even whether it is positive or negative is not always the same. The integer constant token, which is not a character constant, does not become a negative number, however, whether positive or negative can hardly be predicted in general for character constants.

  9. In C99, the #if expression type became the maximum integer type of its implementation. In other words, the evaluation type may vary depending on the implementation.

  10. In addition, multi-byte characters have an encoding problem though it exists in compilation as well as preprocessing. For example, UTF-8 encodes a two byte Unicode character in between one byte and three bytes, however, what is the "value" of its character constant? Is a Kanji value the "value" which results from evaluating the three byte UTF-8 code or the "value" of the original Unicode? It will be implementation-defined, however, it is not even clear what sort of specification is reasonable.

  11. Though this is also a common problem with compilation, UCN was also introduced in C99 and C++98. Is a character expressed in UCN and one written in multi-byte characters the same "character"? They should be the same in nature, however, their "value" will be different depending on the encoding of multi-byte characters.

As above, little can be predicted how evaluation is done since the character constant values for the #if expressions have no portability among implementations and may differ even within the same implementation depending on the compilation phases.

In general, the specification of the C language integer type has few ambiguous parts. Although negative value handling is implementation-defined with respect to computation, they are CPU-dependent and there are few parts implementers can decide optionally with character constant evaluation as an only exception. Many aspects are determined at the discretion of implementers other than the CPU specification, basic character set, and multi-byte character encoding.

The range of discretion for implementations increases immensely for the character constants of the #if expressions and no matching is guaranteed among compilation phases. Little of what is evaluated is understood even if this is evaluated. Character constant evaluation can be thought to require a reference to the execution environment under normal conditions. Standard C preprocessing removed this process of requiring a reference, but not character constants only somehow. And, it seems that the specification, which does not require a reference, was forced to be created, which created ambiguity.

How are this type of character constants for #if expressions used? The value of a char type variable is often compared with a character constant in the compilation phase, but there is no usage in the preprocessing phase in which no variables are used. I cannot think of any appropriate examples for the use of a character constant in a #if expression. This is a useless thing and should be removed from the #if expression subject just as cast and sizeof. There will be less source with issues if this is removed compared even with cast or sizeof removal.

2.7.6. Non-Function-like Rescanning of Function-like Macro

Macro calls are once replaced with the replacement list, and then rescanned. The messiest thing in the rescanning specification in Standard C is that the token sequence after the macro call is rescanned continuously to the replacement list as if the sequence is following the replacement list. This is completely deviated from the principle of function-like macro specification modeled after function calls and becomes the most outstanding factor to make macro expansion incomprehensible. I think that this specification of the subsequent token sequence as a rescanning subject should be removed and that the rescanning subject should be limited to the replacement list only.

Actually, rescanning subsequent token sequence seems to have been a long time implicit specification since around K&R 1st. This specification is no longer necessary in Standard C, but remained in an appendix as a legacy. Since this issue concerns the basis of macro expansion, I will study it further in detail below.

It is not an easy thing to describe the macro rescanning method in writing. The text in the Standard or in K&R 2nd is not easy to understand, either. For example, K&R 2nd A.12 says "the replacement list is repeatedly rescanned." However, the Standard does not state "repeatedly". It can be read as one rescanning. It can also be read as recursive rescanning, but not clearly described as such either.

This cannot be explained accurately without using an actual example. Furthermore, it cannot be understood intuitively without explaining the implementation method. That is how close macro rescanning is to the traditional implementation of macro expansion.

First, we will take a silly example. To simplify the problem, assume x and y are not a macro. How can this macro call be expanded?

#define FUNC1( a, b)    ((a) + (b))
#define FUNC2( a, b)    FUNC1 OP_LPA a OP_CMA b OP_RPA
#define OP_LPA          (
#define OP_RPA          )
#define OP_CMA          ,

FUNC2( x, y)

1:  FUNC2( x, y)
2:  FUNC1 OP_LPA x OP_CMA y OP_RPA
3:  FUNC1 ( x , y )

It becomes clear at once that 1: is replaced with 2: and 3: is generated by rescanning in 2:. Then, is 3: a macro call? More specifically, should this be rescanned again from the beginning?

Is rescanning something repeated many times from the beginning or whose applicable range is gradually narrowed down recursively? The truth is neither.

As a matter of fact, rescanning seems to have been performed in a certain type of exceptional recursion or in a certain type of repetition resulting in the same. Its classical example is the one in the Macro Processing chapter in "Software Tools" by Kernighan & Plauger. This is something to be developed into the M4 macro processor later and this itself is not a C preprocessor. It is indicated that the macro processor was originally designed and implemented in C by Ritchie. The prototype of the preprocessor implementation is available.

In this macro processor, rescanning is realized by sending back the replacement list to the input for re-reading when there is a macro call. When there is another macro call in the replacement list, the new macro replacement list is sent back and re-read as if "it had been in the input originally." As it is written; "it provides an elegant way to implement the rescanning of macro replacement text", "This is how we handle the recursion implicit in nested sources of input", and others, this method greatly helps macro processor program to be structured and understood easily.

Many of C preprocessors perform rescanning by putting the replacement list in pseudo inputs, a type of stack, and re-reading it.

In the example above, if FUNC1 turns out not to be a macro call at this point when 2: is being rescanned, this token is established at the same time and the replacement hereafter will be for OP_LPA and after whether repetition or recursion. If OP_LPA is replaced with ( and turns out not to be a macro, x and later will be applicable next. This way, establishing a token is done sequentially starting with the beginning and 3: becomes the last result. This is no longer a macro call.

This method since "Software Tools" (or even before that) is certainly a concise implementation method. Though not mentioned in "Software Tools", there is also a pitfall. The problem is that there is a chance that rescanning may scan the part after the original macro call beyond the replacement list since the replacement list sent back to the input is read-in consecutively with source. In nested macros, the nesting level may get shifted; unnoticed while rescanning. A macro without arguments expanded into the name of the macro with arguments and a abnormal macro where the replacement list comprises the first half of another macro call with arguments causes this situation.

#define add( x, y)      ((x) + (y))
#define head            add(

head a, b)

This is the example. This strange macro call is expanded as ((a) + (b)). This for some reasons ended up with being officially acknowledged by Standard C. In fact, this macro is legal rather than undefined.

I cannot think that C preprocessors were intended for abnormal macros like this. However, I wonder perhaps whether the original C preprocessor implementation was as above, which resulted in expanding these macros somehow in silence, and some programs consciously took advantage of these holes to the point where this became a de facto standard specification and finally approved in Standard C. That is to say, a small defect in the original C preprocessor implementation led to a strange de facto standard and left a trail even in Standard C. This is the reason an appendix is an appendix.

Now, returning to the topic of whether rescanning is recursive or repetitive, I believe that it is not necessarily wrong to say this is either an irregular recursion or repetition. It is recursion, but it has the strange characteristic that it is not always narrowed down its applicable range as in ordinary recursion, but rather the range is gradually shifted. This is repetition. However, the repetition is not from the beginning, but from the middle by including following parts gradually.

Therefore, it is possible to process the text, after all comments and preprocessor directives are processed, from the beginning until the end with this shifted rescanning only. In fact, such method is used in "Software Tools" and there is some using a similar way in the current C preprocessor source. In other words, rescanning is a synonymous with macro expansion and also the macro expansion for all text.

The fact that rescanning subjects are shifted gradually causes many problems. The next example was listed in C89 Rationale 3.8.3.4 (C99 Rationale 6.10.3.4) as an example of a macro, which is unclear how to be expanded. It is stated that the reason why this process was not defined as a specification was that "as the Committee saw no useful purpose in specifying all the quirks of preprocessing for such questionably useful constructs." However, this example is suggestive. Rather, this was not possible to be defined as a specification.

#define f(a)    a*g
#define g(a)    f(a)

f(2)(9)

In this example, f(2) is replaced with 2*g at first. If the "subsequent preprocessing tokens" is not to be rescanned, macro expansion is completed and f(2)(9) becomes the token sequence of 2*g(9). However, as the "subsequent token sequence" is applicable, this g(9) forms a macro call and replaced with f(9). Here, it is not clear whether this f(9) should be replaced with 9*g again or not by applying the rule of no re-replacement for the macro with a same name. The token sequence of f(9) is generated by rescanning the continuation of g, that is the end of the first replacement result of f(2), and (9) of the "subsequent token sequence" and it is unclear whether this is inside or outside the f(2) call nest.

This problem was corrected in C90 Corrigendum 1, which adds the next example to Annex G.2 Undefined behavior.

-- A fully expanded macro replacement list contains a function-like macro name as its last preprocessing token (6.8.3).

This correction, however, only causes more confusion.

First of all, the wording, "fully expanded macro replacement list", is not clear in meaning. This can be only interpreted as "the replacement list after the macro within the argument is expanded if there is an argument." In that case, in the example of f(2)(9), f(2) is replaced with 2*g before considering the re-replacement of the macro with a same name and it becomes undefined already when g is a function-like macro name by rescanning it. In other words, if f is called, it always becomes undefined in this f and g macro definition.

If this "correction" is applied, the following example for macro rescanning in ISO/IEC 9899:1990 6.8.3 Examples will be undefined to begin with.

#define f(a)    f(x * (a))
#define x       2
#define g       f
#define w       0,1
#define t(a)    a

t(t(g)(0) + t)(1);      /* f(2 * (0)) + t(1);   */
g(x+(3,4)-w)            /* f(2 * (2+(3,4)-0,1)) */

The Standard states that these macro calls will be expanded as in the comments, but this is not the case if the Corrigendum is applied. In these macro definitions of f and g, they will be always undefined when the g identifier appears. It is because f, a function-like macro name, is the only and last pp-token in the replacement list for g.

t(t(g)(0) + t)(1)

At first, the argument of the first t call will be expanded.

    t(g)(0) + t

Since there is another macro call, t(g), it will be expanded, but the argument must be expanded first for that.

        g

And if this is replaced with f, it will become undefined here.

Even if replacements are continued as is, it will become:

    t(f)
    f

And it will be undefined again since the last pp-token of the t(f) expansion result is f. If replacements continue further, it will become:

    f(0) + t
        f(x * (0))
        f(2 * (0))
    f(2 * (0)) + t
t(f(2 * (0)) + t)
f(2 * (0)) + t

This ends the expansion of the first t call in any case, but it will be undefined for the third time since the end of this replacement list is a function-like macro name, t.

How about the following?

g(x+(3,4)-w)

This will be undefined by the time g is replaced with f.

This results in confusion by contradicting Examples with G.2.

If the examples in the Examples are omitted, the correction in the Corrigendum does not relieve confusion. First of all, G.2 is not a part of the Standard and this addition does not have grounds in the text of Standard proper. In the text of Standard, it is only written that the "subsequent token sequence" is also to be rescanned. Secondly, even if this Corrigendum is included in the Standard proper,

#define head            add(

in the previous example, add is correct since it is not in the end of the replacement list.

#define head            add

is undefined, however. This is too unbalanced. Also, there is an issue of the wording, "fully expanded", being unclear in meaning. *1, *2

It goes without saying that these are quirks brought by the specification on "subsequent token sequence" as rescanning subject. The more plausible they try to make it sound, the more confusing it gets. The Standard states the specification forbidding the replacement of the macro with a same name in extremely difficult sentences. A reason for this difficulty comes also from these quirks.

On the other hand, Standard C defines that macro expansion in an argument must be performed only within the argument for function-like macro calls. Since it will be turmoil if the macro expansion in an argument eats up the text behind it, this is no wonder.

As a result of this, however, an imbalance occurs between the macro within an argument and not so.

#define add( x, y)      ((x) + (y))
#define head            add(
#define quirk1( w, x, y)    w x, y)
#define quirk2( x, y)       head x, y)

head a, b);
quirk1( head, a, b);
quirk2( a, b);

In this quirk1() call, it will be a violation of constraint as an incomplete macro call at rescanning after the first argument, head, is replaced with add(. Put simply, it is an error. However, quirk2() and head a, b) will not be an error, but expanded as:

((a) + (b))

It may sound repetitious, but this type of absurdity all comes from the fact that even the "subsequent token sequence" is applicable for macro rescanning in general. As a matter of implementation, the nesting level information needs to be added in order for the argument expansion to be performed independent of other text parts even using the method of sending the replacement list back to input. By using that method, it will be easy not to have the "subsequent token sequence" rescanned in general. Rather, in the current half-baked specification, it is necessary to change the process depending on whether it is inside an argument or not, resulting in extra load for implementations.

Macro expansion in C has been traditionally influenced by editor-like string replacement. We can say that pre-Standard macro expansion is something that has been added to string replacement for editors and become complicated to excess.

By contrast, Standard C took the trouble to name the macro with arguments a function-like macro. I can guess that it tried to bring the call syntax closer to a function call. The specification that the macro in an argument is replaced with a parameter after being fully expanded and the one that the expansion is performed only within the argument conform this principle. However, this principle is spoiled by the specification that macro rescanning in general includes the subsequent token sequence. It is an inheritance of text replacement repetition from its ancestor.

If the subsequent token sequence was removed from the rescanning subject, it could have been defined that macro expansion is completely recursive, and that the applicable range is narrowed or (at least not extended) forward or backward on every recursion. And, it would have been clear as an appropriate macro for the name, function-like macro. I cannot think there is much source code which would have had problems by this decision. I can only think that ANSI C committee could not make a decision on cutting an appendix inherited from an ancestor. *3

I wished C99 would cut it off cleanly, but the appendix has survived again.

Note:

*1 The object-like macro which is expanded into a function-like macro name is sometimes seen in actual programs. It is as below.

    #define add( x, y)      ((x) + (y))
    #define sub( x, y)      ((x) - (y))
    #define OP  add
        OP( x, y);

This is not as abnormal as an expansion into the first half of the function-like macro call as the former, but there is no reason why it must be this way. It is good to define a function-like macro nesting in a function-like macro as below.

    #define OP( x, y)       add( x, y)

*2 The reason for this correction by Corrigendum is in "Record of Responses to Defect Reports" by C90 ISO C committee (SC 22 / WG 14) (#017 / Question 19.) The question on the macro expansion in f(2)(9) of ANSI C Rationale 3.8.3.4 was brought up again. The direct issue in this example must have been the application range of the specification on "prohibiting the re-replacement of macros with a same name", but the committee has answered as a common problem unlimited to macros with a same name. They did not realize that this interpretation might cause contradictions in the Examples.

In addition, this wording, "fully expanded", is strange. When f(2) is replaced with 2*g and rescanned up to g, is it fully expanded? If so, no more replacements will be performed. Therefore, it will not be undefined, either. If not fully expanded yet, g is rescanned with the succeeding (9) and replaced by f(9). If this is fully expanded, the last pp-token of 2*f(9) is not a function-like macro name. Therefore, this answer does not apply. In other words, it says "after macro expansion is completed" where the issue is when macro expansion ends. Thus, when macro expansion ends became more confusing.

In C99 draft in November, 1997, this item in the Corrigendum was included in Annex K.2 Undefined behavior but deleted in the draft in August, 1998 replaced by a following paragraph below in Annex J.1 Unspecified behavior. This eventually was adopted in C99.

When a fully expanded macro replacement list contains a function- like macro name as its last preprocessing token and the next preprocessing token from the source file is a (, and the fully expanded replacement of that macro ends with the name of the first macro and the next preprocessing token from the source file is again a (, whether that is considered a nested replacement.

It seems that the committee finally realized the contradiction in the Corrigendum. Fundamental problems in the text proper of the Standard, however, still remain. Also, when macro expansion ends is unspecified in the end. Furthermore, the distinction by the presence of '(' in the source means the difference in the result when the same macro exists in the source and when it exists in the replacement list of another macro. This is an inconsistent specification.

On this issue, refer also to section 3.4.26.

Also, the specification of macro expansion in C++ Standard is same as C90 without an equivalent of Corrigendum 1 in C90 nor the specification added in Annex J.1 of C99.

*3 Even with this decision, FUNC2( x, y) in the previous example will be FUNC1 (x, y) in argument expansion if this is in the argument of another macro call and again expanded into ((x) + (y)) at the original macro rescanning. In other words, the final expansion results differ depending whether in an argument or not so. However, this is another level of problem and not an inconvenience.

2.7.7. C90 Corrigendum 1, 2 and Amendment 1

With respect to ISO/IEC 9899:1990, Corrigendum 1 was released in 1994, Amendment 1 in 1995, and finally Corrigendum 2 in 1996.

Corrigendum 1 contains trivial corrections in wording mostly but only 2 impacts preprocessing. One is regarding macro rescanning of 2.7.6 described above.

Another is a specification extremely special regarding the case that a macro name in macro definition includes $ and others.

In Standard C, '$' is not accepted as a character in an identifier though there are implementations allowing this traditionally. In an example of 18.9 in test-t/e_18_4.t, $ is a character and interpreted as a pp-token in Standard C. The macro name is THIS and $ and after becomes the replacement list of an object-like macro, which is totally different result from the intention of the program which is a function-like macro with the name, THIS$AND$THAT.

In Corrigendum 1, an exception specification was added regarding this type of example; "if object-like macro replacement list starts with a non-basic character, a macro name and a replacement list must be separated by white-space." Standard C must output a diagnostic message to this example in 18.9. It is supposed to preventing the situation where the source with $ or @ used in macro names is silently preprocessed into an unintended result. It is a painstaking specification, but it is annoying that this type of exception increases. In implementations not accepting $ and/or @ as an identifier, macros like this always become an error in the compilation phase even if they are not an error in preprocessing. So, it does not seem to be necessary to define this exception specification. *1

In addition, ISO 9899:1990 had an ambiguous constraint that a pp-token, header-name, can be appear only in #include directives. However, it was corrected in Corrigendum 1 so that a header-name is recognized only in a #include directive.

In Amendment 1, the core is multi-byte characters, wide characters, and the library functions operating those strings. Accompanied by those, <wchar.h> and <wctype.h> standard headers were added. In addition, the <iso646.h> standard header and the specification on digraphs are added as alternatives to trigraphs as characters not included in ISO 646 character set or a notation method for token and pp-token using those characters. <iso646.h> is a quite easy header which define some operators as macros and it does not have any special problems. *2

The problem is a digraph. This is very similar to a trigraph and the usage is almost the same though the positioning in preprocessing is completely different. A trigraph is a character and converted into a regular character in translation phase 1 while a digraph is a token and pp-token. If a digraph sequence is stringized by the # operator, it must be stringized as is without conversion (though this # itself is also written as %: in a digraph.) Because of this, and only this, implementations need to retain this as a pp-token at least until phase 4 completes. If it were to be converted, it is later (convert the digraph sequence left as a token, not in string literal.)

This imposes an unnecessary burden on implementations. Implementations are more concise recognizing a digraph as a character just as a trigraph and to convert it in phase 1. There is no benefit to keep this as a pp-token. The Amendment also notes that the difference between a digraph and a usual token occurs only when they are stringized. It might be seen that it would be troublesome in writing a string literal like "%:" if a conversion is done in phase 1. But this is similar in trigraphs and too special of a problem to consider. If it must be written, just "%" ":" is enough. Digraphs should be re-positioned so that they are converted in phase 1 as an alternative to trigraphs.

Corrigendum 2 has no corrections regarding preprocessing.

Note:

*1 This specification disappeared in C99 and C++ Standard.

In C99, the following generalized specification was added to 6.10.3 Macro replacement/Constraints instead.

There shall be white space between the identifier and the replacement list in the definition of an object-like macro.

As this is also a tokenization exception specification, it is not praiseworthy.

*3 In C++ Standard, these identifier-like operators are tokens, not macros. Though it is difficult to understand why it is so (could it be an idea to cut down what preprocessing must do?), it is troublesome for implementations in any case.

2.7.8. Redundant Specifications

In C90 5.1.1.2, C99 5.1.1.2 Translation phases 3, there are redundant specifications though they are harmless.

A source file shall not end in a partial preprocessing token or comment.

Since translation phase 2 specifies that source files must not end without a <new-line> or with <backslash><newline>, the source file that passes phase 2 always end with a <newline> without a <backslash>. It never ends with a partial preprocessing token. Within Partial preprocessing token categories, there are ", ', <, and >, which are unmatched in logical lines, which are considered to be undefined in C90 6.1 Lexical Elements/Semantics and not problems limited to the source ending. "Partial preprocessing token or" is unnecessary wording.

C90 6.8.1, C99 6.10.1 Conditional inclusion/Constraints contains expressions, which cause a misunderstanding.

it shall not contain a cast; identifiers (including those lexically identical to keywords) are interpreted as described below;

This "it shall not contain a cast; " is superfluous. In the succeeding parts and Semantics, it is made clear that all identifiers including an identifier the same as a keyword are expanded if macro and remaining identifiers are evaluated as 0. A cast does not need to be considered. In the (type) syntax, it is clear that type is handled as a simple identifier.

On the contrary, if this is in a constraint, it can be interpreted that the implementation recognizes the cast syntax and must output a diagnostic message. That is not the intention of the Standard. There is no keyword in translation phase 4, cast has no way to be recognized. As far as this is concerned, sizeof is also the same. It is strange that only cast is mentioned without mentioning sizeof. This type of wording is called "superfluous."


2.8. Preprocessing Specification in C99

The following specification regarding preprocessing was added to C99.

  1. The hexadecimal sequence in the \uxxxx or \Uxxxxxxxx format in identifiers, string literals, character constants, or pp-numbers is called UCN (universal-character-name) and means a Unicode character value. This must specify extended characters not included in the basic source character set. Whether a \ should be inserted when a UCN is stringized by the # operator is implementation-defined.

  2. Implementation-defined characters can be used in identifiers. Therefore, implementations that allow the use of multi-byte-characters such as Kanji characters in identifiers became possible.

  3. Handle // to the end of the line as a comment.

  4. As e+, E+, e-, and E-, the sequence of p+, P+, p-, and P- is accepted in a pp-number. This is for writing the bit pattern of a floating-point number hexadecimal such as 0x1.FFFFFEp+128.

  5. The type of the #if expression is a maximum integer type in the implementation. As long long/unsigned long long is required, the type of the #if expression has the size of long long or wider.

  6. Variable argument macros can be used.

  7. An empty argument of a macro call is a valid argument.

  8. Add a predefined macro, __STDC_HOSTED__. This is defined as 1 on a hosted implementation, 0 otherwise. A predefined macro, __STDC_VERSION__, is defined in 199901L.

  9. Add predefined macros, __STDC_ISO_10646__, __STDC_IEC_559__, and __STDC_IEC_559_COMPLEX__ as options.

  10. The new _Pragma operator.

  11. Reserve the directive name starting with #pragma STDC for the Standard and implementation and add three #pragma STDC directives which show floating point operation methods. Directives starting with #pragma STDC are not to be macro-expanded, but other #pragma lines not so are implementation-defined.

  12. When a wide-character-string-literal and a character-string-literal are side by side, it was considered to be undefined in C90. However, they are concatenated as a wide character string literal.

  13. Extend the range of the line number used as an argument for #line to [1,2147483647].

  14. Raise translation limits as below.
    Length of a source logical line 4095 bytes
    Length of a string literal, character constant, and header name4095 bytes
    Length of an internal identifier 63 characters
    Number of #include nesting 15 levels
    Number of #if, #ifdef, #ifndef nesting 63 levels
    Number of parenthesis nesting in an expression 63 levels
    Number of parameters of a macro 127
    Number of macros definable 4095
  15. Header name was guaranteed up to 6 characters + . + 1 character. This is changed to 8 characters + . + 1 character.

Variable argument macros are as below. If there is a macro definition,

#define debug(...)  fprintf(stderr, __VA_ARGS__)

a macro call,

debug( "X = %d\n", x);

is expanded as:

fprintf(stderr, "X = %d\n", x);

In other words, ... in the parameter list means one or more parameters and __VA_ARGS__ in the replacement list corresponds to it. Even if there are multiple arguments which correspond to ... in a macro call, the result of merging those including ',' is handled as one argument.

Among undefined behaviors in C90, there are some in which adequately meaningful interpretations are possible. An empty argument in macro calls is one of them and there is a case that it is useful to interpret this as 0 pp-token. This became a valid argument in C99.

C99 mentions an extension operator called _Pragma which is converted into #pragma foo bar if written as _Pragma( "foo bar"). In C90, the argument for the #pragma line does not get macro-expanded and the line similar to a #pragma directive as a result of macro expansion is not handled as a directive and cannot write #pragma in the replacement list of macro definition. On the other hand, the _Pragma expression can be written in the macro replacement list and #pragma which came from its result is handled as a directive. The extension by _Pragma tries to improve the portability of cumbersome #pragma.

It is simpler to make a modification that the argument of #pragma is subject to macro expansion, without this type of irregular extension. It will largely achieve the intention of portability improvement. However, in that case, there still remains a constraint that #pragma cannot be written in a macro and there will be an issue that the argument of #pragma which must not be macro-expanded has to have its name changed to start with __ in order to separate from the user name space. Though _Pragma() operator is irregular, its implementation is not so troublesome and it is a reasonable specification.

There are too many issues on the introduction of Unicode. First of all, implementations must prepare a huge table for multi-byte characters and Unicode conversion, causing large overheads. It is virtually impossible to implement it on the systems with 16 bits and less. There are systems that do not handle Unicode. In addition, there are many cases that a Unicode and a multi-byte character do not have a one-on-one mapping. It seems too aggressive to place Unicode in a C language standard in the name of programming language internationalization.

In C99, UCN handling drastically reduced compared with the draft in November, 1997 and C++ Standard. The preprocessing load became small relatively. Therefore, a certain implementation became possible in mcpp as well. *1

However, there are still some large loads on compiler proper. Also, since these are unreadable expressions, I expect that they will end up not being used much as trigraphs. *2

Note:

*1 In the draft in November, 1997, almost same as C++ Standard, it was supposed to be that the extended characters which are not in the basic source character set are all converted into UCN in translation phase 1 and converted again into the execution character set at phase 5.

In case of implementing this, it is speculated that a tool will be called to convert these before and after processing. As the conversion is OS-dependent, separate tools will be realistic.

*2 According to C99 Rationale 5.2.1 Character sets, this specification assumes that unreadable expressions are converted between the source in multi-byte characters by a tool included in the compiler system to be used. This must mean separating multi-byte character string literal parts in a separate file to process. I wonder how practical that is.


2.9. Toward Clear Preprocessing Specifications

Problems in Standard C preprocessing specifications and what I think mentioned above are also requests for Standard C in the future. In summary, there are following items.

  1. Header-names in the <stdio.h> format should be an obsolescent feature. In the next version after the next, header-names should be only in the string literal format.

  2. Stick to the token-based preprocessing principle. The # operator should be stringized after a single space is inserted between each pp-token even without a token separator so that whether a token separator exists in an argument does not influence.

  3. Similarly, macro re-definition is not influenced by whether a token separator exists in the replacement list.

  4. Parameter name differences should not be an issue at macro re-definition, since checking parameter name differences just increases the overheads in implementation and has no value.

  5. Character constant evaluation normally requires a reference to the execution environment and has no use in the #if expression. Therefore, this should be removed from the #if expression subject.

  6. Function-like handling of function-like macros should be consistent. Whether a macro call is in an argument or replacement list, macro rescanning should be applicable only for the replacement list and not for the succeeding pp-token sequence of a macro call so that the same pp-token sequence is generated in principle.

  7. A digraph should not be a token, but an alternate spelling of a character similar to a trigraph. It should be converted in translation phase 1.

  8. Remove "partial preprocessing token or" from translation phase 3.

  9. Remove a description regarding the #if expression, "it shall not contain a cast; ", from the constraint and move it to footnote 140 in C99.

  10. Trigraphs should be abolished as they are not used in Europe.

These are all intended to reorganize irregular rules and make preprocessing specifications simple and clear. There is no doubt that these will make preprocessing easier to understand. On the contrary, there should be little annoyance.

I believe that mcpp V.2 implemented all preprocessing specifications in Standard C in the Standard mode including the parts I do not think highly of. In the 'post-Standard' mode, preprocessing with modifications above is implemented (also excluding UCN, the use of multi-byte characters in an identifier.)

Amendment 1 and Corrigendum 1 in C90 took the direction of increasing the irregularity of preprocessing rather than cleaning it up.

C99 added various new features, but did not clean up the confusion of logic above either, unfortunately. *1

Regarding the specifications added in C99, I have the following request.

  1. The introduction of Unicode (UCN) should be limited to an option.

In addition, there is an issue other than the problems described above regarding evaluation rules for the integer type applicable to #if expressions.

  1. There is a constraint that the constant expression shall evaluate to a constant in the range of representable values for its type. It is not clear if this applies to all constant expressions. Since there are no exceptions described, I can only interpret that all constant expressions are applicable, but I expect that the intention of Standard C is something like "where a constant expression is necessary." It should be clear. On the other hand, there is a specification, "computation involving unsigned operands can never overflow." It is vague as to whether a diagnostic message should be output in case that the result of unsigned type constant evaluation goes beyond its range (since a constant expression can be evaluated at compilation, it seems appropriate to output a diagnostic message.)

Since this is not a preprocessing specific issue, it will not be discussed further.

Also, in C90 it was defined that the result of / or % when one or both operands are negative is implementation-defined, which was a terrible specification. This became the same specification as div() and ldiv() in C99.

Note:

*1 Various defect reports regarding C99, responses to them, and corrigendum drafts are on the ftp site below. This is the official ftp server for ISO/SC22/WG14 and you can ftp as anonymous at least for now (SC stands for a steering committee and WG means a working group. SC22 deliberates programming language Standards and WG14 handles C Standards.)

http://www.open-std.org/jtc1/sc22/wg14/


3. Validation Suite Explanation

3.1. Validation Suite for Conformance of Preprocessing

Items in the test-t, test-c, test-l, and tool directories and this cpp-test.html itself are "Validation Suite for Standard C Conformance of Preprocessing" developed by myself. It tests the level of Standard C (ANSI/ISO/JIS C) conformance for preprocessing in optional compiler systems in detail. It is intended to cover all preprocessing specifications defined in Standard C. It also covers C++ preprocessing. There are many additions addressing issues outside the specification.

As Standard C conformance requirements, not only that compiler systems shall behave correctly, but also that documents shall contain necessary items mentioned accurately. I will explain this in 3.5.

3.1.1. Testcases in test-t Directory

The test-t directory contains 183 sample text files. Out of 183, 30 are header files, 145 sample text files, and 8 are files gathering small pieces of sample text. All but header files have a name in the *.t format, except some of *.cc. These have nothing to do with compilation phases, but test preprocessing phases. Therefore, they are not necessarily in the correct C programming format. They are rather sample text files for testing preprocessing.

As Standard C implementations can compress preprocessing and compilation to a single process, it is not possible to test preprocessing separately, depending on the implementation. You can say that these *.t samples themselves do not conform Standard C. However, there are many implementations that can be tested by separating preprocessing only. In fact, specifications and problems are clear if they can be separated. The *.t sample files are for those.

*.cc files are samples for C++ preprocessing, provided for some preprocessors which do not accept the files named *.c or *.t as C++ source. Those have the same content with corresponding *.t files.

Among sample text files, there are ones with names starting with n_ (meaning normal), i_ (meaning implementation-dependent), m_ (meaning multi-byte character) and e_ (meaning erroneous.)

Files starting with n_ are samples that do not contain errors, something causing undefined behavior, or implementation-defined parts. Preprocessors conforming to Standard C must be able to process these properly.

Files starting with i_ are samples dependent on implementation-defined specifications regarding character sets assuming the ASCII basic character set. (*) Preprocessors for the implementations with ASCII character set conforming to Standard C must be able to process these properly without errors.

Files starting with e_ are samples that contain some sort of violation of syntax rules or constraints, in other words, errors. Preprocessors conforming to Standard C must be able to diagnose these, but not overlook these.

Files with a number succeeding n_, i_, m_ or e_ are samples that test preprocessing in C90 and common preprocessing specifications in C90 and C99. Among header files, pragmas.h, ifdef15.h, ifdef31.h, ifdef63.h, long4095.h and nest9.h to nest15.h are samples to test C99 preprocessing specifications and others are for common specifications in C90 and C99.

Files with alphabetics other than std or post after n_, i_, e_, or u_, are samples for C99 and C++. n_dslcom.t, n_ucn1.t, e_ucn.t and u_concat.t are samples to test preprocessing specifications common in C99 and C++98, n_bool.t, n_cnvucn.t, n_cplus.t, e_operat.t and u_cplus.t for C++, and the rest for C99.

The file named ?_std.t combines pieces of files in C90 together.
?_std99.t is an equivalent for C99. ?_post.t and ?_post99.t files are bonus files and used for testing mcpp in the 'post-Standard ' mode.

The files named u_*.t are bonus files and the pieces of files to test undefined behaviors. undefs.t combines those as one file. unbal?.h is a header file used in those. unspcs.t tests unspecified behaviors and warns.t does not belong to any of the above, but is the file describing texts for which warnings are desirable. unspcs.t and warns.t are also bonus. Files named m_*.t are samples for several encodings as multi-byte character and wide character sets. It is desirable to process many encodings properly. m_*.t belong to quality test items like u_*.t.

misc.t, recurs.t and trad.t are real bonuses. misc.t is a collection of what is in Standards and other documentation, tests with different results depending on the internal representation of the integer type, tests related to translation phase 5 or 6, tests for enhanced functions, and others. recurs.t is a special case of recursive macro, and trad.t is a sample for the old "Reiser model cpp".

3.1.2. Testcases in test-c Directory

There are 133 files in the directory called test-c. 26 of those are header files (24 files are same as the ones in test-t), 102 of them are pieces of sample source files, 3 of them are files which combine pieces of sample source, and the other 2 are files used for automatic testing. Among these, 32 files are bonus sample source files. Source files other than header files are named *.c. This is in the C program format.

Naturally, file names start with n_, i_, m_ or e_. Ones starting with n_ are strictly conforming programs (which does not have any errors nor implementation-dependent portions) in Standard C. Implementations must be able to compile these files correctly without errors and execute them correctly. In case of correct execution, the messages below are displayed.

started
success

With exceptions of n_std.c and i_std.c, these messages are not displayed. However, only the end message,

<End of "n_std.c">

, is displayed. Otherwise, some sort of error message is displayed. Some files starting with i_ are samples of character constant assuming ASCII. Implementations with ASCII character set must be able to compiles these files correctly and execute them correctly as ones starting with n_. Files starting with e_ must be correctly diagnosed by compiler systems at compilation (preprocessing.)

Testing by compilation or execution is the most proper testing method. However, the method detects the existence of error in an implementation, but there are cases it is not clear where errors are. You can give more accurate evaluation by applying *.c files only to a preprocessor and performing testing by looking through the results as far as the implementation allows (*.t files are even more straightforward.)

The files called ?_std.c combines pieces of files.

Files named u_*.c are bonus and pieces of files which test undefined behaviors. undefs.c collects them in one file. unspcs.c tests unspecified behaviors while warns.c does not belong to any of the above, but is the file of texts for which warnings are desirable. unspcs.c and warns.c are a bonus. Those starting with m_ are samples of several multi-byte character encodings.

C99 tests are not included in the test-c directory since there is no compiler proper supporting C99 fully. C++ tests are only in the test-t directory.

3.1.3. Testcases in test-l Directory

The test-l directory contains samples for testing translation limits that exceed specifications. All 144 files are bonus. They are a mix of *.c, *.t, and *.h files.

Many *.h files overlap in each directory, test-t, test-c, and test-l. If the duplicate header files are gathered in one directory, the following way of including method is necessary, for example.

#include "../test-t/nest1.h"

However, the method of searching this type of path list format or files (where to locate the base directory etc.) is all implementation-defined and the compatibility is not guaranteed. In order to avoid this problem, those header files are placed in each directory regardless of duplication (Even the concept of "directory" is excluded from C Standard.)

3.1.4. Tools in tool Directory

The tool directory includes tools necessary for automatic testing.

3.1.5. Testcases for GCC/testsuite in cpp-test Directory

The files in cpp-test directory are the testcases for GCC/testsuite. They are rewrites of the samples in test-t and test-l directories.


3.2. Testing Method

When performing tests using the Validation Suite and if a compiler system has options to make closer to Standard C, all should be set (refer to 6.1 for a concrete example.)

3.2.1. Manual Testing

Each of test-t and test-c directories contain 2 kinds of samples, big files with multiple pieces put together and small files divided into pieces. If a preprocessor conforms to Standard C well, only big files with multiple pieces put together are necessary to test n_*. However, if the level of conformance is not high, a preprocessor will fall into confusion in the middle with these files and the rest of the items cannot be tested. Therefore, small pieces of files are also provided. Since the number of files gets too large and it is a lot of trouble to do testing if I divide the pieces into too many files, I made a reasonable compromise. Depending on the implementation, even these small pieces of files cannot be processed till the end. In such event, please divide the sample into even smaller pieces to continue testing.

As the #error directive terminates a process depending on implementations, samples testing #error are not included in big files with pieces put together. The #include error also often terminates a process, it is not included in big files with pieces put together.

3.2.1.1. Viewing the preprocessing result directly

The *.t samples are used in case a preprocessor is an independent program or that a compiler has an option to output the text after preprocessing. By checking the result of preprocessing these files directly, you can compare if they match correct results written in comments. Since it is possible to view preprocessing results directly, it is possible to make more accurate judgment this way as long as implementations permit.

Many *.c programs include the "defs.h" header. As 2 kinds of assert macro definitions are written in "defs.h", set 0 to 1 in #if 0 for any of these. The first one only includes <assert.h>. The second one is the assert macro which does not abort on an assertion failure. This, of course, is not a correct assert macro, but more convenient in this test.

In multi-byte character processing, behavioral specifications of implementations may differ depending on the runtime environment, thus testing m_* requires attention (refer to 4.1.)

3.2.1.2. Target item to test

This type of testing has a difficult issue since testing an item may be caught by another failure in an implementation. For example, if <limits.h> has an error and is included to test #if, it is not clear whether <limits.h> or #if is tested. The test which compiles and execute *.c files are more troublesome than one for preprocessing *.t files. If the last result is wrong, it will make it appear that there is some sort of error in the implementation, but not necessarily in the item tested.

I tried to contrive ways to aim the target item in this Validation Suite. However, there is a restriction that the Validation Suite itself has to be portable. In addition, in order to test an item, the correct implementation of other language specification must be assumed. Therefore, the preprocessing item used as this "assumption" is implicitly tested in areas other than the test item that was targeted for the item. Please note such implicit allocation of points also exist in the "allocation of points" which will be described next. It may not be possible to judge whether the sample failed in the test item that it really targeted or by another factor in case an implementation fails a sample process without looking at another test.

3.2.1.3. Scoring

Each test item is set by each allocation of points. Marking criteria are also written. Standard C does not have subsets, therefore unless all items match specifications, an implementation cannot be said to be Standard C conforming, strictly speaking. In reality, there are not many such implementations and we cannot help using the measure of Standard C conformance level to evaluate implementations. In addition, as there are large differences in the importance of items, counting the number of passed items will not do, rather a weighting depending on the importance should be applied.

However, this weighting does not have objective criteria, of course. The marking of this Validation Suite was decided by myself and does not have a grounded base. Still, it will be a guideline in evaluating compliance levels for implementations objectively.

n_*, i_*, e_*, and d_* are tests related to Standard conformance and marking for these is in 2 point unit in general. In testing outside of Standards and quality evaluation, marking for q_* is in 2 point and the rest is in 1 point units. Where a diagnostic message should be displayed, no points will be scored in case it is wide of the mark although it is displayed. A partial score may be given to a diagnostic message not absolutely incorrect but rather off the point. An implementation is free to issue diagnostics on correct program if it correctly processes the program, however, wrong diagnostics will be subject to subtraction.

3.2.2. Automatic Testing by cpp_test

If you compile the cpp_test.c program in the tool directory and run it in the test-c directory, you can test n_*.c and i_*.c for C90 automatically. However, this only scores pass or fail and it does not provide any detail. It does not include tests such as e_*.?. It just takes aim at the conformance level of preprocessors for C90 briefly. No tests regarding C99 are included. That is because most compilers do not support C99 sufficiently yet. *1, *2, *3

How to use cpp_test is, in an example of Visual C++ 2005, as follows.

cpp_test VC2005 "cl -Za -TC -Fe%s %s.c" "del %s.exe" < n_i_.lst

The second argument and on need to be enclosed by " and " respectively (in case the shell removes ", ", it is necessary to take the measure to enclose the second argument to the last one all together in ' and '.) %s will be replaced by a sample program name without .c such as n_* and i_*.

The first argument: Specifies the name of a compiler system. This must be within 8 bytes and must not include '.'. Files with this name plus .out, .err, or .sum are created.

The second argument: Writes the command to compile.

The third argument and later: Writes the command to delete the files no longer necessary. Multiple of these are allowed.

n_i_.lst is in the test-c directory. It includes the list of n_*.c and i_*.c without .c respectively.

Depending on the implementation, they may start runaway processing some source files. In such an event, change the source name in n_i_.lst to a name which does not exist, none, for example, then run the test again.

By running cpp_test this way, n_*.c and i_*.c are compiled and executed sequentially. The outputs to stderr for sample programs are recorded in the n_*.err and i_*.err files. In addition, the score results are written on a column in VC2005.sum. However, there are only 3 kinds of marking below.

*: Pass
o: Compiles, but the execution result failed.
-: Could not be compiled.

In VC2005.out, the command line that called cpp_test is recorded and so is the message which was output to stdout by the compiler system if any. Messages output to stderr by a compiler system are recorded in VC2005.err if any.

Look at these for more information.

Now, use the following command.

paste -d'\0' side_cpp *.sum > cpp_test.sum

By doing so, the *.sum files which are test results for each compiler system are combined horizontally to create one table to be recorded in cpp_test.sum. side_cpp is the table side portion where test item titles are written and exists in the test-c directory.

cpp_test.sum that I created this way is located in the doc directory. In 6.2, the detail results of manual testing are written. They test more preprocessors than cpp_test.sum. Among those preprocessors, there are some that do not support compiler drivers for any compiler systems. They cannot be tested automatically by cpp_test.

Note:

*1 This cpp_test.c was written based on runtest.c and summtest.c in "Plum-Hall Validation Sampler."

*2 cpp_test.c does not operate with expected behavior if it is compiled on Borland C / bcc32. This is because cpp_test calls system() to redirect stdout and stderr but standard I/O path does not seem to get inherited by the descendant process in bcc32. If cpp_test.c is compiled in Visual C or LCC-Win32, it operates without problems.

*3 m_36_*.c are the tests of encoding which has a byte of 0x5C ('\\') value. cpp-test does not use them, since some systems do not use these encodings.

3.2.3. Automatic Testing by GCC / testsuite

3.2.3.1. TestSuite

GCC source contains something called testsuite. Do 'make check' after compiling the GCC source files, testcases of this testsuite are checked one after another and the results are reported.

My Validation Suite, since V.1.3, was appended the edition which is rewritten so that it could be used as testsuite of GCC. Putting this in testsuite allows automatic checking by 'make check'. While the cpp_test tool in 3.2.2 can test only samples with n_* or i_* as a name, testsuite allows samples which require diagnostic messages such as e_*, w_*, and u_* to be tested automatically. This set of testcases is applicable to cpp0 (cc1, cc1plus) of GCC 2.9x and later and mcpp.

Here, I will explain how to use the Validation Suite in GCC / testsuite.

The cpp-test directory of the Validation Suite is the edition for GCC / testsuite created by rewriting the test-t and test-l directories and cpp-test contains each directory of test-t and test-l.

GCC / testsuite, however, cannot change the execution environment. The files named m_* or u_1_7_* are the testcases for several multi-byte character encodings. Since those testcases need different environments each other for at least GCC 3.3 or former, those are excluded from this testsuite edition. *1

GCC and testsuite specifications have been changed many times thus far and are expected to be changed in the future as well. It may require a partial fix to the Validation Suite accordingly, especially in case of addition or change of diagnostics. However, no extensive fix seems to be necessary so far unless the version of GCC is extremely old. The testcases in cpp-test have been verified in each cpp0 (cc1, cc1plus) of GCC 2.95.3, 3.2, 3.3.2, 3.4.3, 4.0.2 and 4.1.1, and mcpp.

Runtime options cannot be changed in the testsuite depending on the target implementation. As a matter of fact, multiple standards coexist and it is necessary to specify a version of the standard using the 'std=' option. However, this option does not exist in older versions of GCC. Therefore, my testsuite applies to GCC 2.9x and later and mcpp V.2.3 and later.

Testsuite is executed by interpreting the comments in the following format written in the testcase. This is a comment which does not affect tests in other compiler systems.

/* { dg-do preprocess } */
/* { dg-error "out of range" "" }  */

The samples with the comment, dg-error or dg-warning, written test diagnostic messages. Testing multiple compiler systems is supported by writing diagnostic messages of each compiler system with '|' (OR) in-between.

This is executed by the tool called DejaGnu and it is directly a shell-script called runtest. The setup of DejaGnu is written in some files named *.exp. *.exp are the scripts for the tool called Expect. And, Expect is a program written in the command language called Tcl.

Therefore, using testsuite requires these many tools of appropriate versions according to the testsuite. This is same when my Validation Suite is used.

Note:

*1 In fact, GCC does not work properly even if the environment variable is set.

3.2.3.2. Installation to TestSuite and Testing

My Validation Suite is used in GCC / testsuite in the following manner.

First, copy the cpp-test directory to an appropriate directory in testsuite of GCC.

The cpp-test directory is the one created by copying necessary files in each directory of test-t and test-l and adding the configuration file cpp-test.exp. The suffix of the files named *.t is mostly changed to .c, the suffix of the files for C++ is changed to .C.

Most samples test the preprocessor only. Since two samples cannot test the preprocessor due to the problems in DejaGnu and Tcl, they are for compiling and running (named *_run.c). These two samples contain the line:

{ dg-options "-ansi -no-integrated-cpp" }

where -no-integrated-cpp is an option for GCC 3 and 4. GCC 2 does not support the option, which need to be removed in order to test in GCC 2. To accommodate both GCC 2 and GCC 3 or 4, there are two types of files, *_run.c.gcc2 and *_run.c.gcc3, for these two testcases. Link the appropriate one to *_run.c.

Below, I will take an example of GCC 3.4.3 on my Linux. Suppose the source files of GCC 3.4.3 are located in /usr/local/gcc-3.4.3-src. Also, the GCC compilation is done by /usr/local/gcc-3.4.3-objs.

cp -r cpp-test /usr/local/gcc-3.4.3-src/gcc/testsuite/gcc.dg

This copies files under cpp-test to the gcc.dg directory.

By doing this, if you

make bootstrap

in /usr/local/gcc-3.4.3-objs to compile the GCC source files and you

make -k check

then the entire testsuite including testcases in cpp-test will be tested.

Also, testing by using cpp-test only is done as below in the /usr/local/gcc-3.4.3-objs/gcc directory.

make check-gcc RUNTESTFLAGS=cpp-test.exp

The testsuite logs are recorded in gcc.log and gcc.sum under the ./testsuite directory.

When you do 'make check', depending on the environment, you need to set up the environment variable called DEJAGNULIBS, TCL_LIBRARY as explained in INSTALL/test.html of the GCC source files.

In addition, the environment variable, LANG and LC_ALL, should be C to set the environment to English.

Please note that it is xgcc, cc1, cc1plus, cpp0 etc. generated in the gcc directory that are used in make check at compiling GCC, not gcc, cc1 and such that have already been installed.

Tests can be executed in any directory as follows.

runtest --tool gcc --srcdir /usr/local/gcc-3.4.3-src/gcc/testsuite cpp-test.exp

Logs are output to the current directory. In this case, what is to be tested is gcc, cc1, and cpp0 which have already been installed. cpp-test requires testsuite as it contains various configuration files for GCC (config.*, *.exp).

The argument 'gcc' of "runtest --tool gcc" should be exactly 'gcc'. If the name of the compiler to be tested is not 'gcc', for example 'cc' or 'gcc-3.4.3', you should make symbolic link so that the compiler is invoked by the name of 'gcc'.

Also, cpp-test contains the testcases for warnings in the cases where it is thought to be desirable for a preprocessor to issue a warning. The GCC preprocessor passes less than a half of those cases, however, not passing does not mean that the behavior is wrong or that the preprocessor was not compiled properly. This is not the issue of being right or wrong, but rather of the "quality" of the preprocessor.

3.2.3.3. mcpp Automatic Testing

This cpp-test can test mcpp also. Therefore, substituting the GCC preprocessing with mcpp and calling

make check-gcc RUNTESTFLAGS=cpp-test.exp

in the gcc directory checks mcpp of Standard mode automatically. Tests can be done also using runtest command in any directory.

runtest --tool gcc --srcdir /usr/local/gcc-3.4.3-src/gcc/testsuite cpp-test.exp

If mcpp is executed in GCC 3 or 4, all testcases for cpp-test except one should pass. There is another testcase which does not pass when executed in GCC 2. However, it is because gcc calls mcpp with the -D__cplusplus=1 option and not mcpp's fault.

Please refer to mcpp-manual.html#3.9.5 and mcpp-manual.html#3.9.7 for how to substitute the preprocessing with mcpp. To apply the testsuite, mcpp startup needs the -23j options to be set. -2 is an option to enable digraph and -3 is one to enable trigraphs. -j is an option for not adding information such as source lines to diagnostic message output. Do not use other options. Additionally, testsuite can test mcpp in standard mode only, no other.

The method above is done after the make with GCC, however, automatic testing can be done by 'configure' and 'make' of mcpp itself as long as GCC / testsuite is installed and is ready to execute. This case is the easiest as 'make check' automatically performs necessary settings. See the INSTALL in mcpp for this method.

3.2.3.4. TestSuite and Validation Suite

GCC has had testsuite for a long time, but very few samples about preprocessing up to V.2.9x. You can see how little attention preprocessing was paid to. The number of testcases for preprocessing increased quite a lot in V.3.x. You can tell preprocessing was given more importance as it was completely changed with up-to-date preprocessor source and documents.

However, these testcases are still quite unbalanced. The causes seem to come from the following nature of testsuite.

  1. Collection of bug reports submitted by users. In other words, concentrate on the areas to correct bugs actually detected and to prevent reappearance.
  2. The testcases added for debugging when developers implement new functionalities there.

This is the way of debugging special to the open source project and became possible as GCC has been used by many excellent programmers in the world. However, this method might have brought the randomness and imbalance of testcases at the same time.

In addition, most of these testcases are valid only in GCC and cannot be used in other compiler systems. Also, testcases for GCC 3 contain many testcases which cannot be applied to even GCC 2 / cpp. The reason is the differences in preprocessing output spacing and diagnostic messages.

On the other hand, my Validation Suite was originally written by myself only in order to debug my preprocessor and rewritten so that the entire preprocessing specifications are tested. Many samples are organized systematically on the whole.

It will have considerable meaning to add these systematic testcases to GCC / testsuite.

Also, my testsuite edition of Validation Suite is written so that it can test three preprocessors, GCC 2.9x / cpp, GCC 3.x, 4.x / cc1 (cc1plus), and mcpp. In other words, the use of the regular expression facility in DejaGnu and Tcl can absorb the implementation differences in preprocessing output spacing and diagnostic messages. *1

Below are the results of applying the testsuite edition of the Validation Suite to these three preprocessors (tested mcpp in March, 2007, others in October, 2006).

Below is the case where the preprocessor is replaced by mcpp V.2.6.3 in GCC 4.1.1.

            === gcc Summary ===

# of expected passes            264
# of unexpected failures        1
# of expected failures          4
/usr/local/bin/gcc version 4.1.1

There is one failure due to a lack of the universal-character-name <=> multi-byte character conversion implementation in C++98.

Here is the GCC 3.2 / cc1 case.

            === gcc Summary ===

# of expected passes            216
# of unexpected failures        51
# of unexpected successes       2
# of expected failures          2
/usr/local/bin/gcc version 3.2

Most of failures are due to a missing warning.

GCC 4.1.1 / cc1 is almost the same.

            === gcc Summary ===

# of expected passes            214
# of unexpected failures        53
# of unexpected successes       2
# of expected failures          2
/usr/local/bin/gcc  version 4.1.1

Here is the GCC 2.95.3 / cpp0 case.

            === gcc Summary ===

# of expected passes            181
# of unexpected failures        87
# of unexpected successes       3
# of expected failures          1
gcc version 2.95.3 20010315 (release)

There are less warnings than GCC 3, 4 / cc1. There are also some diagnostic messages that are off the point. Half of new C99 and C++98 specifications have not been implemented yet, either.

The number of items differ among different versions of GCC, since multiple failures can occur in one testcase.

Note:

*1 This makes dg script in my testcases difficult to read with frequent use of \ and symbols. The regular expression processing in DejaGnu and Tcl has a considerable number of peculiarities and flaws requiring ingenuity to perform all the automatic testing achieved on multiple compiler systems. Currently, however, runtime options used in testcases for those compiler systems have to be common.


3.3. Violation of syntax rules or Constraints and Diagnostic Messages

Standard C implementations must certainly process correct source correctly, but they also must issue diagnostic messages for erroneous source. Standard C also contains portions where behavior specifications are up to the implementation or not defined. They are as below in summary. *1

  1. Correct programs and data whose outcomes are the same in every implementation.

  2. Correct programs and data whose process methods are not specified. These do not need to be described in documents and the results are called unspecified behavior.

  3. Correct programs and data whose processing is up to implementations. These specifications must be mentioned in documents by each implementation. These results are called implementation-defined behavior.

  4. Programs or data that are erroneous or not portable and their processing is not defined as specifications at all. Implementations may or may not output diagnostic messages. They may process them as some sort of valid programs. These results are called undefined behavior.

  5. Erroneous programs or data for which implementations must issue diagnostic messages. There are violations of syntax rules and violations of constraint among these. *2

Among these, programs and data in 1 only are called strictly conforming (it is interpreted that 2 and 3 may be included if their results do not differ depending on implementation or special cases.)

Programs and data in 1, 2, and 3 only are called conforming programs.

How to issue diagnostic messages is implementation-defined. Supposedly, one or multiple diagnostic messages of some sort are issued for one translation unit that includes some sort of violations of syntax rules or constraints. It is up to the implementation whether diagnostic messages should be issued for the programs with no violation of syntax rules or constraint. However, strictly conforming programs or conforming programs matching implementation-defined or unspecified specifications for the implementation must be able to be processed correctly until the end.

Violations of syntax rules or constraints are called an "error" in this document. Among e_* files in this Validation Suite, there are many which include multiple errors. In scoring below, it is expected that a compiler system issues one or more diagnostic messages. However, there may be compiler systems that issue just one diagnostic message (such as "violation of syntax rules or constraints") for one translation unit no matter how many errors there are. In addition, there may be compiler systems that get confused after an error. These types of problems are of "quality", but not of Standard conformance level. Please make samples into pieces and test them again as needed. The problems of quality will be discussed in 4 separately.

Note:

*1 C90 3 Definitions of Terms
   C90 4 Compliance
   C90 5.1.1.3 Diagnostics
   C99 3 Terms, definitions, and symbols
   C99 4 Conformance
   C99 5.1.1.3 Diagnostics

*2 Although C++98 differs from C90 or C99 in these terms, it does not much differ in the meanings.


3.4. Details

Each test item is explained one by one below. This is also a description of Standard C preprocessing itself. The specifications in common with K&R 1st are not explained again. Item numbers are common in *.t and *.c files.

3.4.1. Trigraphs

n.1.1. 9 trigraph sequences

As there are 9 characters not included in the Invariant Code Set of ISO 646:1983 among the basic character set in C, these can be written in source using 3 character sequence below. This is a new specification introduced in C90. *1

??=#
??([
??/\
??)]
??'^
??<{
??!|
??>}
??-~

Equivalent characters replace these 9 trigraph sequences in translation phase 1. On systems where you can type in these 9 characters on keyboard, it is not necessary to use trigraphs, of course. However, it is necessary for preprocessing conforming Standard C to be able to do trigraph conversion on even those systems.

Scoring: 6. 6 points if all 9 are processed correctly. Each trigraph which cannot be processed properly, 2 points are reduced with 0 at the lowest limit.

Note:

*1 C90 5.2.1.1 Trigraph sequences
   C90 5.1.1.2 Translation phases
   C99 5.2.1.1 Trigraph sequences
   C99 5.1.1.2 Translation phases

n.1.2. Trigraph sequences in control lines

Since trigraph conversion is performed prior to tokenization in translation phase 3 or control line processing in phase 4, trigraphs can be written wherever on a control line.

Scoring: 2.

n.1.3. Only 9 trigraphs

There are only 9 trigraphs mentioned above, therefore sequences starting with ?? other than those are never translated into another character nor ?? can be skipped. Preprocessing must be able to handle the case of sequences with a trigraph and ?'s which are not trigraphs.

Scoring: 2.

3.4.2. Line Splicing by <backslash><newline>

In case there is a \ at the end of a line and a <newline> immediately afterward, this sequence of <backslash><newline> is deleted in translation phase 2 unconditionally. As a result, 2 lines are connected. In Standards, the line on a source file is called a physical line to distinguish it while the line connected by removing <backslash><newline> (if any) is called a logical line. Processing in translation phase 3 is performed with this logical line as subject. *1

In K&R 1st, the #define line and string constants can continue on the next source line using <backslash><newline>, but other cases are not mentioned. Actual implementations allow other control lines may connected, not only #define.

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases

n.2.1. Between a parameter list and replacement list on the #define line

The #define line connections are accepted in K&R 1st and most of implementations.

Scoring: 4. 4 points for processing correctly and 0 point otherwise.

n.2.2. Inside a parameter list on the #define line

There are some implementations which cannot handle <backslash><newline> in unusual places such as inside a parameter list even on the #define line.

Scoring: 2.

n.2.3. Inside a string literal

<backslash><newline> inside a string literal has been supported since K&R 1st.

Scoring: 2.

n.2.4. Inside an identifier

In Standard C, <backslash><newline> must be removed unconditionally even if it is inside an identifier or anywhere.

Scoring: 2.

n.2.5. <backslash> as a trigraph

<backslash> is not only \, but also ??/ as a trigraph. ??/ in source is converted into \ in translation phase 1, it is obviously \ itself in phase 2.

Scoring: 2.

3.4.3. Comments

In translation phase 3, a logical line is broken into pp-tokens and white spaces. A comment is converted into a single space at that time. *1

Here, implementations may convert consecutive white spaces (including comments) into a single space. However, <newline> is not converted and stays as is in any case. That's because the process of preprocessing directive in the next phase 4 is subject to this "line."

In case the comment expands over lines, line splicing is performed virtually by a comment.

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases

n.3.1. Conversion into one space

In the old cpp so-called Reiser type, comments functioned as token separators only internally in cpp and were removed before output. By taking advantage of it, there was a method of using comments for token concatenation. However, this specification derailed K&R 1st and was clearly rejected by Standard C. In Standard C, the ## operator is used for token concatenation.

Scoring: 6.

n.dslcom. Comment by //

From K&R 1st to C90, comments started with /* and ended with */. *1

However, C99 started supporting C++ style of comment, //. *2

Scoring: 4.

In C90, this should be processed as just a sequence of pp-token '/' and '/', not a comment. However, as implementations which handle // as comments even prior to C99 were common, mcpp treats this as a comment and issues a warning in C90 mode.

Note:

*1 C90 6.1.9 Comments

*2 C99 6.4.9 Comments

n.3.3. Comment processing prior to pp-directive processing

The preprocessing directive starting with # is for a "line", but this "line" is not necessarily a physical line in source. It could be a logical line combined by <backslash><newline> or the "line" which extend over multiple physical and logical lines by a comment. This is not surprising if you think about the order of translation phase 1 through 4.

Scoring: 4.

n.3.4. Comments and <backslash><newline>

There are pp-directive lines that extend over some physical lines by both <backslash><newline> and a comment. Preprocessors that do not implement translation phases properly cannot handle this correctly.

Scoring: 2.

3.4.4. Special Tokens (digraphs) and Characters (UCN)

In C90/Amendment 1 (1994), alternative spelling called digraph was added for some of operators and punctuators. *1

In C99, a character code called UCN (universal character sequence) was added. *2

In e.4.?, token errors are covered.

Note:

*1 Amendment 1/3.1 Operators, 3.2 Punctuators (added to ISO 9899/6.1.5, 6.1.6)
   C99 6.4.6 Punctuators

*2 C99 6.4.3 Universal character names

n.4.1. Digraph spelling in a preprocessing directive line

Digraphs are handled as tokens (pp-tokens.) '%:' is another spelling for '#'. It can certainly be used as the first pp-token of a preprocessing directive line or as a string operator.

Scoring: 6.

n.4.2. Digraph spelling stringizing

Different from trigraphs, as digraphs are tokens (pp-tokens), they are stringized as they are in spelling without being converted (meaningless specification.)

Scoring: 2.

n.ucn1. UCN recognition 1

UCN is recognized in string literals, character constants, and identifiers.

Scoring: 8. 4 points if UCN in a string literal passes preprocessing as is. 2 points each if UCN is processed correctly in a character constant or identifier. No good if UCN is not recognized and output as is.

n.ucn2. UCN recognition 2

UCN can be used inside a pp-number as well. However, it has to disappear from a number-token by the end of preprocessing. This specification exists in C99, not in C++.

Scoring: 2.

e.ucn. UCN errors

UCN must be 8 digit hexadecimal if it starts with \U or 4 digit hexadecimal if it starts with \u.

UCN must not be in the range between [0..9F] and [D800..DFFF]. However, 24($), 40(@), and 60(`) are valid.

Scoring: 4. 1 point each for each correct diagnosis regarding 4 samples.

e.4.3. Empty character constants

Even sequences not in C token format are also recognized as pp-tokens. Therefore, there are not many error cases in tokenization of preprocessing.

However, there are some cases other than this which become undefined behavior (refer to 4.2.)

Empty character constants are violations of syntax rules in a preprocessing #if line or compiling. *1

Scoring: 2.

Note:

*1 C90 6.1.3.4 Character constants -- Syntax
   C99 6.4.4.4 Character constants -- Syntax

3.4.5. Spaces and Tabs on a Preprocessing Directive Line

Spaces, tabs, vertical-tabs, form-feeds, carriage-returns, and new-lines are all white spaces. White spaces that are not in string literals, character constants, header names, or comments usually have a meaning as a token separator. However, new lines that remain until translation phase 4 are special and become a pp-directive separator. There are slight restrictions in white spaces that can be used in pp-directive lines.

n.5.1. Spaces and tabs before and after #

In Standard C, spaces and tabs before and after the #, which is the first pp-token on a preprocessing directive line are guaranteed to end in the same results whether they exist or not (*1.) In K&R 1st, this is not clear and there were actually implementations which do not accept spaces and tabs before and after #.

In K&R 1st, it is interpreted that spaces and tabs after that in the line are accepted as just a token separator as in Standard C.

However, in the case where there are white spaces other than spaces and tabs on the pp-directive line, it is undefined (refer to u.1.6 of 4.2.)

Scoring: 6.

Note:

*1 C90 6.8  Preprocessing directives -- Description, Constraints
   C99 6.10 Preprocessing directives -- Description, Constraints

3.4.6. #include

#include is the most basic pp-directive since K&R 1st. However, the specifications on this directive in Standard C have more undefined and implementation-defined portions (*1.) The reasons are below.

  1. A pp-token called header-name which is an argument for this directive is dependent on OS file systems and difficult to standardize.
  2. "Standard" location to search files depends on implementations.
  3. Even the header-name in the format similar to the string literal enclosed by ", " is another pp-token different from a string literal as \ is not an escape character. Furthermore, a header-name enclosed by < and > is the most irregular pp-token.

In n.6.*, the most basic test below is not performed by different categories. This is included with other test items on the premise that not being able to process this is out of the question since many tests will not be able to be performed.

#include    <ctype.h>
#include    "header.h"

Note:

*1 C90 6.8.2 Source file inclusion
   C99 6.10.2 Source file inclusion

n.6.1. Standard header include in 2 formats

There are 2 formats in header-names. The difference is only that the format enclosed by < and > searches the header from a implementation-defined specific location (may be multiple locations) while the one enclosed by " and " searches the source file first in implementation-defined method and performs the same process as the one enclosed by < and > upon failure. Therefore, the format enclosed by " and " can include standard headers as well. This point was the same in K&R 1st.

In Standard C, same standard headers can be included many times. Either way, however, this is not a preprocessor issue, but on how to write standard headers (refer to 5.1.1.)

Scoring: 10. 4 scores if only one of 2 samples is processed.

n.6.2. Header-name by a macro - Part 1

In K&R 1st, no macro could be used on the #include line, however, it was officially permitted in Standard C. In case the #include argument does not match either of the 2 formats, the macro included there is expanded. The result must match either one of the 2 formats.

This specification has something subtle. For example, how should the following source be handled?

#define MACRO   header.h>
#include    <MACRO

Should MACRO be expanded first as below?

#include    <header.h>

Or, should this be an error as > matching < does not exist prior to macro expansion?

I cannot think that Standards are written with this level of detail in mind. Therefore, I believe it is more straightforward to handle < and > as quotation delimiters similar to " and ". Though, expanding macros first cannot be said to be against Standards. This Validation Suite does not include tests which dig holes of this type of specifications.

Scoring: 6.

n.6.3. Header-name by a macro - Part 2

This is not so interesting, but it does not have to be a single macro.

Scoring: 2.

3.4.7. #line

The #line pp-directive is not usually used by a user, but used to pass along the filename of the original source and line numbers occasionally in case another tool or something pre-preprocesses source (not necessarily C.) As this has been around since K&R 1st, it must have some purpose in its own way traditionally.

In addition, #line or its variant is used to pass along a filename and line number information to a compiler proper for preprocessor output in general. However, this is not defined as a specification.

The filename and line number specified in #line become the value of predefined macro, __FILE__ and __LINE__ (in addition, __LINE__ will be incremented for every physical line.) *1

Note:

*1 C90 6.8.4 Line control
   C99 6.10.4 Line control
   C90 6.8.8 Predefined macro names
   C99 6.10.8 Predefined macro names

n.7.1. Line number and filename specification

#line specifying a line number and a filename was in K&R 1st, but the filename was not surrounded by " and ".

A filename is a string literal in Standard C, but a different token from the header-name for #include. Strictly speaking, it has subtle problems in \ handling and the like. However, no problems will arise for valid source (it is fortunate that the filename for #line are not in the <stdio.h> format.)

Scoring: 6.

n.7.2. No filename may be specified

The filename argument is optional and it does not have to exist. This is same as K&R 1st (undefined if no line number is specified.)

Scoring: 4.

n.7.3. Line number and filename specification by a macro

In K&R 1st, the #line argument could not use a macro. This is permitted in Standard C.

Scoring: 4.

n.line. Line number range

The line number range for the #line directive was [1.32767] in C90, but was extended to [1.2147483647] in C99.

Scoring: 2.

e.7.4. Filename in wide string literal

The filename argument must be a string literal. This is not so interesting, but wide string literals become a violation of constraint (pp-tokens other than that are undefined for some reasons. This is an imbalanced specification.)

Scoring: 2.

3.4.8. #error

#error is a directive newly introduced in Standard C. It displays an error message that includes an argument as a part at preprocessing. In old implementations, there were some with directives such as #assert. However, these were not standard.

It is not specified that #error should end a process. According to the Rationale, it was not specified since the Standard cannot make requirements to that extent. However, it says that ending a process is the ANSI C committee's intention. *1

Note:

*1 C90 6.8.5 Error directive
   ANSI C Rationale 3.8.5
   C99 6.10.5 Error directive
   C99 Rationale 6.10.5

n.8.1. No macro expansion

Macros on the #error line are not expanded. Macros which are expanded on control lines are only for #if (#elif), #include, and #line. *1

Scoring: 8. 2 points for processing by expanding macros. Whether to terminate the process does not matter.

Note:

*1 C90 6.8  Preprocessing directives -- Semantics
   C99 6.10 Preprocessing directives -- Semantics

n.8.2. Optional message

This is not so interesting, but the #error line argument is optional and it does not have to exist.

Scoring: 2.

3.4.9. #pragma, _Pragma() operator

#pragma was also introduced in Standard C. Extended directives which are unique to an implementation are all supposed to be implemented by #pragma sub-directives. *1

Note:

*1 C90 6.8.6 Pragma directive
   C99 6.10.6 Pragma directive

n.9.1. No error for unrecognized #pragma

Different #pragma sub-directives are recognized for each implementation. As it is not possible to write portable programs if each unrecognized #pragma becomes an error, #pragma which cannot be recognized by implementations is ignored. In preprocessing, only the #pragma recognizably regarding preprocessing is processed while the rest of #pragma is all passed to compiler proper as is.

Scoring: 10. #pragma must not be an error, however, it is acceptable to issue a warning. 10 points for the case that preprocessing does not issue an error but the compiler proper does, which should not occur, though it is not a mistake in preprocessing even if it does. 0 points as a matter of convenience in case this distinction does not exist in the implementation where preprocessors are not independent.

n.pragma. _Pragma() operator

C99 introduced the _Pragma() operator which has the same effect as #pragma but can be written in a macro definition as opposed to #pragma.

In addition, when a pp-token following a pragma has a standard feature if it is STDC and macro expansion is prohibited in this case. In other cases, however, whether macro expansion is applicable is implementation-defined.

Scoring: 6.

e.pragma. _Pragma() argument is string literal

The _Pragma() operator argument must be a string literal.

Scoring: 2.

3.4.10. #if, #elif, #else, and #endif

#if, #else, and #endif have been supported since K&R 1st. (*1) In the implementations which cannot use #if, none of n.10.1, n.11.*, n.12.*, n.13.*, e.12.*, and e.14.* can be processed as well as many other tests.

Note:

*1 C90 6.8.1 Conditional inclusion
   C99 6.10.1 Conditional inclusion

n.10.1. #elif support

#elif was added in Standard C. By using this, we can avoid illegibility of multiple #if nesting.

Macros can be used in the #if expression. The identifier not defined as a macro is evaluated as 0.

In Standards, #if to the corresponding #endif is called a #if section and a block divided by #if (#ifdef, #ifndef), #elif, #else, or #endif in the section is called a #if group. The #if and #elif line expressions are called a #if expression.

Scoring: 10.

n.10.2. pp-token processing in the #if group which is skipped

In the #if group skipped, preprocessing directives are not processed other than checking #if, #ifdef, #ifndef, #elif, #else, and #endif in order to trace the correspondence of #if group and macros are not expanded, either.

However, tokenization takes place. First of all, that is because C source is a sequence of comments and pp-tokens from the beginning till the end. Secondly, it is necessary to process comments at least in order to check the corresponding relation of #if and others, and in order to check if /* and others are comment symbols, they must be made sure that they are not in a string literal or character constant.

Scoring: 6.

3.4.11. #if defined

An operator, defined, was introduced for #if expressions in Standard C. This integrates #ifdef and #ifndef into #if (#elif) and prevents illegibility of multiple #ifdef nesting.

n.11.1. #if defined

The operand for the defined operator is an identifier. Both enclosing it by ( and ) and not doing so are supported as a writing style. Both mean the same and are evaluated as 1 if an operand is defined as a macro, 0 otherwise.

Scoring: 8. 2 scores if only one of 2 #if sections is processed.

n.11.2. defined is an unary operator

defined is one of the operators and provides either value of 1 or 0. Therefore, it is possible to do an operation on its result and another expression.

Scoring: 2.

3.4.12. #if Expression Type

The #if expressions were vaguely defined as constant expressions in K&R 1st and their types were not clear. In C90, the #if expressions are integer constant expressions and it was made clear that int and unsigned int have the same internal representation as long and unsigned long respectively. In other words, the #if expressions including sub-expressions in them are all evaluated in long and unsigned long. To restate, they are handled as if constant tokens all had L or UL suffix. *1

In addition, the #if expression type became the maximum integer type for each implementation in C99. typedef to the type names, intmax_t and uintmax_t, is applied to this type in the standard header called <stdint.h>. As long long is required in C99, the #if expression type is long long or a wider size. Suffixes, LL (ll)/ULL (ull), are used to write long long/unsigned long long constants. *2

A length modifier, %ll, and an appropriate conversion specifier (such as %lld, %llu, and %llx) are used to display the value of long long/unsigned long long in printf(). The length modifier to display the value of intmax_t or uintmax_t is %j (%jd, %ju, %jx and others.) *3

Note:

*1 C90 6.8.1 Conditional inclusion -- Semantics

*2 C99 6.10.1 Conditional inclusion -- Semantics

*3 C99 7.19. 6.1 The fprintf function -- Description

n.12.1. long type #if expressions

In C90, constant expressions of the long type in the #if expressions must be evaluated.

Scoring: 6.

n.12.2. unsigned long type #if expressions

In C90, constant expressions of the unsigned long type in the #if expressions must be evaluated.

Scoring: 4.

n.12.3. Octal numbers

Octal numbers must be evaluated in the #if expressions. It is similar in K&R 1st, however the constant exceeding the maximum value of long was evaluated as a negative value of long in K&R 1st while it is evaluated as unsigned long in C90. *1

Scoring: 4. 2 points when recognized as an octal number but evaluated as a negative number or overflow. 0 points for not recognized as an octal number.

Note:

*1 C90 6.1.3.2 Integer constants
   C99 6.4.4.1 Integer constants

n.12.4. Hexadecimal numbers

Hexadecimal numbers must be also evaluated in the #if expressions. It is similar in K&R 1st, however the difference is that the constant exceeding the maximum value of long was evaluated as a negative value of long in K&R 1st while it is evaluated as unsigned long in C90.

Scoring: 4. 2 points when recognized as a hexadecimal number but evaluated as a negative number or overflow. 0 points for not recognized as a hexadecimal number.

n.12.5. Suffixes L and l

Constant tokens with a suffix, L or l, must be also evaluated in the #if expressions. The constants not exceeding the maximum value of long are the same in K&R 1st also. This suffix does not matter in preprocessing for evaluation.

Scoring: 2.

n.12.6. Suffixes U and u

Constant tokens with a suffix, U or u, must be also evaluated in the #if expressions. This was the notation not supported in K&R 1st and was officially accepted in C90.

Scoring: 6.

n.12.7. Negative numbers

Negative numbers must be also handled in the #if expressions. This is a specification since K&R 1st.

Scoring: 4.

e.12.8. Constant token value out of range to represent

In C90, it is an violation of constraint or error, to put it simply, if the integer constant token value which appears in the #if expression is not in the range which can be represented in long or unsigned long. This is not something directly defined as a specification for the #if expressions, however, there is a specification regarding constant expressions in general. The #if expressions are not exceptions, either. *1

The character constant overflow is tested in e.32.5, e.33.2, and e.35.2.

Scoring: 2.

Note:

*1 C90 6.4  Constant expressions -- Constraints
   C99 6.6 Constant expressions -- Constraints

n.llong. long long/unsigned long long evaluation

At least, constant expressions in long long/unsigned long long must be evaluated in the #if expressions in C99.

The constant exceeding the maximum value of long long is evaluated as unsigned long long.

Suffixes, LL, ll, ULL, and ull, are added in C99. *1

Scoring: 10. 2 points each for processing each of 5 samples correctly.

Note:

*1 C99 6.4.4.1 Integer constants
   C99 6.6 Constant expressions -- Constraints

e.intmax. Operation result out of intmax_t range

The constant or constant expression which exceeds the intmax_t or uintmax_t range is a violation of constraint in the #if expression for C99.

Scoring: 2. In case there is no <stdint.h>, it is acceptable to write a macro appropriately.

3.4.13. #if Expression Evaluation

The #if expressions are a kind of integer constant expressions. Compared with usual integer constant expressions, there are differences below.

  1. In C90, int and unsigned int are evaluated as if they have the same internal representation as long and unsigned long respectively. In C99, int and long are evaluated as if they have the same internal representation as intmax_t. unsigned int and unsigned long are evaluated as if they have the same internal representation as uintmax_t.

  2. The 'defined' operator is supported.

  3. All identifiers remained after macro expansion are evaluated as 0. *1

  4. As there exists no keywords in preprocessing, identifiers with same name as a keyword are treated as just an identifier. Therefore, neither cast nor sizeof can be used.

Function calls and comma operators cannot be used in integer constant expressions. Since constant expressions are not variables, no assignments, increments, decrements, nor arrays can be used.

In n.13, evaluation rules common with generic integer constant expressions are tested. Among these, n.13.5 is different from K&R 1st. n.13.6 is the area which was all different in pre-Standard #if expressions. n.13.13 and n.13.14 were not clear in K&R 1st. The rest is unchanged since K&R 1st. *2

The n.13.* uses only small values so that this rule can be tested in the implementations where only int values can be evaluated in the #if expressions. The defined operator and >= are not in n.13, but somewhere else.

Note:

*1 In C++ Standard, 'true' and 'false' are treated differently and evaluated as 1 and 0 respectively. These are not macros, but keywords; however, they are treated as boolean literals in preprocessing.

*2 C90 6.3 Expressions
   C90 6.4 Constant expressions
   C99 6.5 Expressions
   C99 6.6 Constant expressions

n.13.1. << and >>

Bit shift operations have no troublesome issues regarding positive numbers, at least.

Scoring: 2.

n.13.2. ^, |, and &

Since the bit pattern of the same value is same despite of CPUs or implementations in positive integers as long as it is in the type range, operations such as ^, |, and & which may appear to be dependent on CPU specifications have the exact same results in that range on any implementation.

Scoring: 2.

n.13.3. || and &&

All implementations should be able to process these.

Scoring: 4.

n.13.4. ? :

All implementations should be able to process these, too (it seemed so, but not so in reality.)

Scoring: 2.

n.13.5. No usual arithmetic conversion in << and >>

Usual arithmetic conversions are performed in many binary operators in order to match types on both sides. In K&R 1st, usual arithmetic conversions were performed in shift operators while this is not the case in Standard C. This is an adequate specification considering that the right side value is always small positive number and that a bit pattern changes also if a negative number is converted into a positive number in internal representation other than 2's complement which creates a confusion. *1

Scoring: 2.

Note:

*1 C90 6.3.7 Bitwise shift operators -- Semantics
   C99 6.5.7 Bitwise shift operators -- Semantics

It says point by point, "If both operands have arithmetic type, the usual arithmetic conversions are performed on them.", regarding many binary operators. However, this is not mentioned as far as << and >> are concerned. There is an explanation regarding this in C89 Rationale 3.3.7 (C99 Rationale 6.5.7.)

n.13.6. Conversion from a negative number into a positive number by usual arithmetic conversion

Usual arithmetic conversions are applied to operands on both sides for binary operators such as *, /, %, +, -, <, >, <=, >=, ==, !=, &, ^, and |, in order to match types on both sides. Same for the second and third operands for tertiary operator, ? :. Therefore, if one side is an unsigned type, the other is converted into an unsigned type that causes a negative value to be converted into a positive number.

In standard integer constant expressions, the integer promotion is applied to the operand before the usual arithmetic conversion if each operand is in the integer type shorter than int. However, in the #if expressions, no integer promotion occurs since all operands are handled as the same size type.

Scoring: 6. 2 points each for processing one of 3 tests correctly.

This evaluation rule is same in K&R 1st, however, this sample cannot be processed in K&R 1st based implementations since the constant token, 0U, uses the U suffix.

n.13.7. Evaluation short-circuit in ||, &&, and ? :

The order of evaluation is defined for the || and && operators and the right side is not evaluated if the result is determined by the left side evaluation. In ? :, either the second or third is evaluated but not the other as a result of the first operand evaluation. *1

Therefore, even division by 0 is not an error in the term not evaluated.

Scoring: 6. Subtract 2 points each from 6 if one of the 5 samples fails. 0 point for failure of 3 or more samples. Subtract 2 points for wrong diagnostics, even if an implementation succeeds to process.

Note:

*1 In the ? : operator, however, the usual arithmetic conversion is performed between the second operand and the third one. It is strange to perform a conversion even when no evaluation is done. Especially, as the type for an integer constant token used in the #if expression is not determined until a value is evaluated, the value cannot be helped being evaluated in order for the type (though it is just if signed or unsigned) to be determined. However, no division by 0 is allowed. This is rather messy.

n.13.8. Grouping of unary operators, -, +, !, and ~

From n.13.8 to n.13.12 are tests for grouping sub-expressions in the #if expressions. Sub-expressions are grouped according to the precedence and associativity of operators. Though there are parts decided by the syntax prior to the precedence in standard integer constant expressions, the #if expressions do not have areas with syntax problems other than ( and ) of grouping. n.13.8 to n.13.10 are tests for associativity and n.13.8 is a test for the associativity for unary operators, -, +, !, and ~. All unary operators associate from right to left.

Scoring: 2.

n.13.9. Grouping of ? :

The conditional operator, ? :, is associated from right to left.

Scoring: 2.

n.13.10. Grouping << and >>

All binary operators are associated from left to right. n.13.10 tests << and >>.

Scoring: 2.

n.13.11. Grouping of operators with different precedence - Part 1

Here, we test expressions including unary operators, -, +, and !, and binary operators, *, /, and >>, which have different precedence and associativity.

Scoring: 2.

n.13.12. Grouping of operators with different precedence - Part 2

Here, we test grouping of even more complex expressions including unary operators, -, +, ~, and !, binary operators, -, *, %, >>, &, | ^, ==, and !=, and tertiary operator, ? :.

Scoring: 2.

n.13.13. Macros expanded into operators

The use of macros are allowed in the #if expressions. These macros are usually expanded into integer constants, however, we do not test these here since they are included in n.10.1, n.12.1, n_12.2, and n.13.7 tests.

Though macros expanded into operators are not ordinary, they should be handled as operators in principle. A standard header called <iso646.h> was defined as a specification in ISO C 1990/Amendment 1 which defines some operators using macros (*1.) The purpose seems to be that source can be written without using characters such as &, |, !, ^, and ~. Preprocessing is required to expand these macros in #if and handle them as operators.

On the other hand, there is a specification in which it is undefined if macros in the #if expressions are expanded to 'defined'. I suspect that defined is handled separately since it is similar to an identifier (refer to u.1.19.)

Scoring: 4.

Note:

*1 In C++ Standard, these identifier-like operators are not macros but tokens for some reasons.

n.13.14. Macro expanded into 0 piece of token

The #if expression including a macro which expands into 0 piece of token is not ordinary, either. This should be evaluated after the macro is removed (expanded.)

Scoring: 2.

3.4.14. #if Expression Error

From e.14.1 to e.14.10 are tests for violations of syntax rules and violations of constraint in the #if expressions. Compiler systems must issue diagnostic messages for all source including one of these. *1

Note:

*1 C90 6.8.1 Conditional inclusion
   C90 6.4 Constant expressions
   C99 6.10.1 Conditional inclusion
   C99 6.6 Constant expressions

e.14.1. String literals

As the #if expressions are integer constant expressions and pointers cannot be used, string literals cannot be used.

Scoring: 2.

e.14.2. Operators such as =, ++, --, and .

As the #if expressions are constant expressions, operators and variables with side effects cannot be used. A --B is different from A - -B and a violation of constraint.

Scoring: 4. 2 points if one of 4 samples cannot be correctly diagnosed. 0 point if 2 or more.

e.14.3. Incomplete expressions

Missing one operand in a binary operator or parenthesis is also a violation of syntax rules.

Scoring: 2.

e.14.4. Missing #if defined parenthesis

An argument for defined operator on the #if line may or may not be enclosed by ( and ), however, it is a violation of constrains if only one of the parenthesis pair exists.

Scoring: 2.

e.14.5. No expressions

Only #if without any expression is certainly a violation of syntax rules.

Scoring: 2.

e.14.6. No expression after macro expansion

The identifier not defined as a macro is evaluated as 0, however, the argument of the #if line which disappears after macro expansion is a violation of syntax rules.

Scoring: 2.

e.14.7. Unrecognized keyword - sizeof

sizeof, a pp-token, is simply treated as an identifier and evaluated as 0 in the #if expression if it is not defined as a macro. A pp-token called int is the same. Therefore, sizeof (int) becomes 0 (0) and it is a violation of syntax rules.

Scoring: 2.

e.14.8. Unrecognized keyword - type name

Just as e.14.7, (int)0x8000 becomes (0)0x8000 and it is a violation of syntax rules.

Scoring: 2.

e.14.9. Division by 0

This e.14.9 and the next e.14.10 admit of several interpretations regarding a diagnostic message should be issued and specifications are ambiguous. There are following specifications in the Standards.

C90 6.4 Constant expressions -- Constraints
C99 6.6 Constant expressions -- Constraints

Each constant expression shall evaluate to a constant that is in the range of representable values for its type.

The applicable range in this specification is not clear, however, it is clear that this is applied to at least where constant expressions are necessary. The #if expressions must be constant expressions. On the other hand, there are specifications below.

C90 6.3.5 Multiplicative operators -- Semantics
C99 6.5.5 Multiplicative operators -- Semantics

if the value of the second operand is zero, the behavior is undefined.

C90 6.1.2.5 Types
C99 6.2.5 Types

A computation involving unsigned operands can never overflow,

Which specification should be applied between division by 0 and unsigned operation? It seems either interpretation is possible.

However, we will make an interpretation this way here -- include division by 0 where a constant expression is required and a diagnostic message must be issued in case it does not fit in the range of the type --. That is because it seems appropriate to issue a diagnostic since only an error in program can cause this type of result and constant expressions are something evaluated at compilation rather than execution. In addition, that is also because it is unnatural to treat only division by 0 as an exception. However, since the specification gets doubly vague in case the result of an unsigned operation is out of range, we do not include it here, but interpret it as undefined.

ISO 9899:1990/Corrigendum 1 added a specification, "A conforming implementation shall produce at least one diagnostic message .. if .. translation unit contains a violation of any syntax rule or constraint, even if the behavior is also explicitly specified as undefined or implementation-defined." This was carried on by C99. *1

Scoring: 2.

Note:

*1 C99 5.1.1.3 Diagnostics

e.14.10. Operation results out of representable range

In C90, values of the #if expressions must be in the range representable as long/unsigned long.

Scoring: 4. 4 points for correctly diagnosing all 4 tests. 2 points for correctly diagnosing 2 or 3 tests. 0 points if only 1 or none is correctly diagnosed.

3.4.15. #ifdef and #ifndef

The n.15.* test #ifdef and #ifndef. These are exactly same between K&R 1st and Standard C. e.15 tests the violation of syntax rules for that. *1

Note:

*1 C90 6.8 Preprocessing directives -- Syntax
   C90 6.8.1 Conditional inclusion
   C99 6.10 Preprocessing directives -- Syntax
   C99 6.10.1 Conditional inclusion

n.15.1. #ifdef macro testing

Scoring: 6.

n.15.2. #ifndef macro testing

Scoring: 6.

e.15.3. Argument which is not an identifier

Arguments on the #ifdef and #ifndef lines must be identifiers.

Scoring: 2.

e.15.4. Extra argument

Arguments on the #ifdef and #ifndef lines must not have extra tokens other than identifiers.

Scoring: 2.

e.15.5. Missing argument

It is a violation of syntax rules not to have any arguments.

Scoring: 2.

3.4.16. #else and #endif Errors

Next is a test of violations of syntax rules for #else and #endif. This syntax has not changed since K&R 1st. (However, Standard C introduced a new specification that a diagnostic message must be issued for a violation of syntax rules or constraints.) *1

Note:

*1 C90 6.8 Preprocessing directives -- Syntax
   C99 6.10 Preprocessing directives -- Syntax

e.16.1. Extra token in #else

The #else line must not have any other tokens.

Scoring: 2.

e.16.2. Extra token in #endif

The #endif line must not have any other tokens.

Do not write below.

#if     MACRO
#else   ! MACRO
#endif  MACRO

Use below instead.

#if     MACRO
#else   /* ! MACRO  */
#endif  /* MACRO    */

Scoring: 2.

3.4.17. #if, #elif, #else, and #endif Mismatching Errors

Next tests violations of syntax rules for matching #if (#ifdef, #ifndef), #elif, #else, and #endif. This syntax is almost the same since K&R 1st except that #elif was added to Standard C. In addition, K&R 1st was not clear in the point that these must match within the source file unit. *1

Note:

*1 C90 6.8 Preprocessing directives -- Syntax
   C99 6.10 Preprocessing directives -- Syntax

e.17.1. #endif without #if

#endif without a preceding #if is obviously a violation of syntax rule.

Scoring: 2.

e.17.2. #else without #if

#else without a corresponding #if is also an error.

Scoring: 2.

e.17.3. Another #else after #else

Having another #else after a #else is also prohibited.

Scoring: 2.

e.17.4. #elif after #else

#elif after #else is not allowed.

Scoring: 2.

e.17.5. #endif without #if in the file included

#if, #else, and #endif must be matched in the source file (preprocessing file) unit. It is not acceptable for the file included to be treated as if it existed from the beginning or in the original file.

Scoring: 2.

e.17.6. #if without #endif in the file included

Scoring: 2.

e.17.7. #if without #endif

Forgetting #endif actually happens quite often, however, compiler systems must issue a diagnostic message for that.

Scoring: 2.

3.4.18. #define

For the #define syntax, the # and ## operators were added in C90 whereas they did not exit in K&R. The rest is unchanged. *1

In C99, variable argument macros were added (refer to 2.8.) *2

Note:

*1 C90 6.8 Preprocessing directives -- Syntax
   C90 6.8.3 Macro replacement

*2 C99 6.10 Preprocessing directives -- Syntax
   C99 6.10.3 Macro replacement

n.18.1. Object-like macro definition

The first token on the #define line is a macro name. However, in case there are white spaces immediately after, the second token is considered to be the beginning of the replacement list even if it is '(' and not considered as a function-like macro definition. If there is no token after a macro name, the macro is defined as 0 pieces of token.

Scoring: 30. 10 points if only one of 2 macros are defined correctly.

n.18.2. Function-like macro definition

If '(' is immediately after a macro name without having white spaces between, it is considered to be the beginning of the function-like macro parameter list. This specification has been around since K&R 1st and has a trace of character-oriented preprocessing which is influenced by the existence of white spaces. Nothing can be done at this point.

Scoring: 20.

n.18.3. No replacement applicable inside string literals

In a so-called "Reiser" model preprocessor, the same spelling as a parameter in string literals or character constants in the replacement list, that portion was substituted for an argument by macro expansion. However, this was not accepted by Standard C nor K&R 1st. This replacement is a specification characterized well by character-oriented preprocessing, however, it is out of the question in token-oriented processing.

Scoring: 10.

n.vargs. Variable argument macros

Variable argument macros were introduced in C99.

Scoring: 10.

e.18.4. Missing name

The first token on the #define line must be an identifier.

Scoring: 2.

e.18.5. Missing argument

If there is not a single token on the #define line, it is a violation of syntax rules.

Scoring: 2.

e.18.6. Empty parameter

Empty parameter is also a violation of syntax rules. *1

Scoring: 2.

Note:

*1 C90 6.5.4 Declarators -- Syntax
   C99 6.7.5 Declarators -- Syntax

e.18.7. Duplicate parameter names

Duplicate parameter names in the parameter list for one macro definition is a violation of constraints. *1

Scoring: 2.

Note:

*1 C90 6.8.3 Macro replacement -- Constraints
   C99 6.10.3 Macro replacement -- Constraints

e.18.8. Parameter which is not an identifier

A parameter in a macro definition must be an identifier. *1

Scoring: 2.

Note:

*1 The ... parameter was added in C99. __VA_ARGS__ in the replacement list is a special parameter name that corresponds to it.

e.18.9. Special combination of a macro name and a replacement list

Though '$' is not accepted as a character within an identifier in Standard C, there are compiler systems which accept it. This sample is the kind that can be seen in the source compiled by those compiler systems. Since this example interprets $ as one character and one pp-token in Standard C, the macro name is THIS and $ and after becomes a replacement list for an object-like macro which is totally different from the program purpose of a function-like macro named THIS$AND$THAT.

In the Corrigendum 1 of ISO 9899:1990, an exceptional specification was added to this type of example. A conforming implementation must issue a diagnostic message regarding this example. *1

Conversely, C99 defined that white spaces must exist between a macro name a replacement list in object-like macro definition in general. *2

Scoring: 2.

Note:

*1 Addition to Constraints in C90 6.8 by Corrigendum 1.
This specification, however, has disappeared in C++ Standard.

*2 C99 6.10.3 Macro replacement -- Constraints

e.vargs1. __VA_ARGS__ not in the replacement list

Variable argument macros in C99 use __VA_ARGS__ in the replacement list corresponding to a parameter ... in the parameter list of the macro definition. This identifier must not be used anywhere else.

Scoring: 2. 2 points if 2 samples are correctly diagnosed. 0 points if only one is diagnosed correctly.

3.4.19. Macro Re-definition

Macro re-definition was not mentioned in K&R 1st and implementations were all different as well. In Standard C, some re-definition of the original definition is allowed, but not a different one. Macros are virtually not re-defined (unless they are voided by #undef). *1, *2

Note:

*1 C90 6.8.3 Macro replacement -- Constraints
   C99 6.10.3 Macro replacement -- Constraints
*2 However, many compiler systems issue a warning and accept redefinition. So does mcpp starting with V.2.4, to maintain compatibility with existing compiler systems.

n.19.1. Differences in white spaces before and after a replacement list

Re-definition where only the number of white spaces are different, is allowed.

Scoring: 4.

n.19.2. Differences in white spaces in a parameter list and differences in white spaces extending over lines

White spaces include ones extending over source lines by <backslash><newline> sequence or comments.

Scoring: 4.

e.19.3. Differences in token sequence in a replacement list

Re-definition where token sequences in a replacement list are different is a violation of constraint.

Scoring: 4.

e.19.4. Differences in the existence of white spaces in a replacement list

Re-definition where the existence of white spaces in a replacement list is different is a violation of constraints. This has a trace of character-oriented preprocessing.

Scoring: 4.

e.19.5. Different parameter usage

As re-definition of different parameter usage is essentially a different definition, it is a violation of constraints.

Scoring: 4.

e.19.6. Differences in parameter names

Re-definition where only parameter names are different but which is essentially the same is a violation of constraints. This seems to be an excessive constraint.

Scoring: 2.

e.19.7. Sharing function-like and object-like macro names

As a macro name belongs to one name space, a function-like macro and an object-like macro cannot use the same name.

Scoring: 2.

3.4.20. Macro Names Same as Keywords

Since no keyword exists in preprocessing, an identifier with same name as a keyword can be defined as a macro and expanded. *1

Note:

*1 C90 6.1 Lexical elements -- Syntax
   C99 6.4 Lexical elements -- Syntax
   C89 Rationale 3.8.3 (C99 Rationale 6.10.3) Macro replacement

n.20.1. Names are all subject to macro expansion

Scoring: 6.

3.4.21. Macro Expansion Requiring Pp-token Separation

Tokenizing a source file into pp-tokens is performed in translation phase 3. And the case where multiple pp-tokens are concatenated into 1 pp-token later is defined only by the case where the concatenation is done by expanding the macro defined using the ## operator, the case where stringizing takes place by macro expansion defined by the # operator, and the case of concatenating adjacent string literals. Therefore, it is interpreted that implicit concatenation of multiple pp-tokens must not happen. This is obvious in the principle of token-oriented preprocessing. *1

Note:

*1 C90 5.1.1.2 Translation phases
   C90 6.8.3 Macro replacement
   C99 5.1.1.2 Translation phases
   C99 6.10.3 Macro replacement

n.21.1. Pp-tokens are not concatenated implicitly

In case preprocessing is done in an independent program, it is necessary to separate and pass 3 -'s in the output of this sample by some sort of token separator so that compiler proper can figure out 3 are separate pp-tokens.

Scoring: 4.

n.21.2. Separation of macro in outer macro's argument

Even if a macro is invoked in an argument of outer macro, expansion result of the macro should not be merged with its surrounding pp-tokens in outer macro's replacement list.

Scoring: 2.

3.4.22. Macro-like Sequence in a Pp-number

Preprocessing-numbers were introduced by Standard C for the first time. They have a wider range than integer constant tokens and floating point constant tokens put together and may include identifier-like portion. They were defined as a specification in order to simplify tokenization in preprocessing. However, in case there is a macro-like sequence in a pp-number, a wrong result may occur unless this simple tokenization is done exactly. *1

Note:

*1 C90 6.1.8 Preprocessing numbers
   C99 6.4.8 Preprocessing numbers

n.22.1. Macro-like Sequence in a Pp-number - Part 1

Since the sequence, 12E+EXP, is one pp-number, it will not be expanded even if a macro, EXP, is defined.

Scoring: 4.

n.22.2. Macro-like Sequence in a Pp-number - Part 2

A pp-number starts with a digit or .

Scoring: 2.

n.22.3. Macros outside of a pp-number are expanded

In C90, + or - can appear inside a pp-number only if it immediately follows E or e. 12+EXP is different from 12E+EXP and is divided into 3 pp-tokens, 12, +, and EXP. These are a pp-number, an operator, and an identifier, respectively. EXP is expanded if it is a macro.

Scoring: 2.

n.ppnum. [Pp][+-] sequence

In C99, the sequence of + or - following P or p in a pp-number was added to write a floating point number in hexadecimal.

In order to display a floating point number in printf(), conversion specifiers such as %a and %A are used. *1

Scoring: 4.

Note:

*1 C99 7.19. 6.1 The fprintf function -- Description

3.4.23. Macros Using the ## Operator

## is an operator newly introduced in Standard C and used only in the replacement list on the #define line. The pp-tokens before and after a ## are concatenated into one pp-token. If pp-tokens before and after ## are parameters, they are first replaced by actual arguments at macro expansion and concatenated. *1

Note:

*1 C90 6.8.3.3 The ## operator
   C99 6.10.3.3 The ## operator

n.23.1. Token concatenation

This is an example of the most simple function-like macro using the ## operator.

Scoring: 6.

n.23.2. Pp-number generation

Since operands of the ## operator are not macro-expanded, using another macro which appears to be meaningless together such as xglue() in this example often takes place. This is for expanding a macro in an argument, then concatenating the result. The 12e+2 sequence which was generated by a macro call in this sample is a valid pp-number.

Scoring: 2.

e.23.3. Missing tokens before or after ## - object-like macros

There must be some pp-tokens before and after the ## operator in a replacement list. This is an example of an object-like macro. It is meaningless to use ## in an object-like macro, but not an error.

Scoring: 2.

e.23.4. Missing tokens before or after ## - function-like macros

This is an example of a function-like macro definition without pp-tokens before or after the ## operator in a replacement list.

Scoring: 2.

3.4.24. Macros Using the # Operator

The # operator was introduced in Standard C. It is used only in the replacement list for the #define line which defines a function-like macro. The operands of the # operator are parameters and corresponding actual arguments at those macro expansion are converted to string literals. *1

Note:

*1 C90 6.8.3.2 The # operator
   C99 6.10.3.2 The # operator

n.24.1. Argument stringizing

The argument corresponding to the operand for the # operator is enclosed by " and " on both ends and stringized.

Scoring: 6. 2 points if a space is inserted between token as "a + b".

n.24.2. White space handling between argument tokens

In case the argument corresponding to the operand for the # operator comprise of multiple pp-token sequence, white spaces between those pp-tokens are converted into a space and stringized. No space is inserted if there are no white spaces. That is to say, the results differ by the existence of white spaces though they are not influenced by the number of white spaces (this still has a trace of character-oriented preprocessing.) White spaces before and after an argument are deleted.

Scoring: 4.

n.24.3. \ insertion

In case a string literal or character constant is in the argument corresponding to the operand for the # operator, \ is inserted immediately prior to the \ or " in it and the " which encloses a string literal. This is same as the method of writing string literals to display string literals or character constants as they are.

Scoring: 6.

n.24.4. Calling macro including <backslash><newline>

As the <backslash><newline> sequences are removed in translation phase 2, they do not exist at macro expansion.

Scoring: 2.

n.24.5. Token separator inserted by macro expansion should not remain

Macro expansion routine generally guards the expansion result with token separators in order to avoid token-merging with surrounding tokens. (See 3.4.21.) In case of stringization, however, the inserted token-separators should not remain.

These cumbersome issues arise from character-oriented portion of the Standard mixed into token-based principle.

Scoring: 2.

e.24.6. Operand for the # operator is not a parameter name

The operand for the # operator must be a parameter name.

Scoring: 2.

3.4.25. Macro Expansion in a Macro Argument

When macros in an argument should be expanded in a function-like macro call was not mentioned in K&R 1st. Implementations were all different in pre-C90 preprocessors. More might have expanded at rescanning a replacement list. In Standard C, it was defined as a specification that this was expanded after an argument was identified first, then before substituted for a parameter. The order is similar to the argument evaluation of function calls, which is easy to understand. However, in case the argument corresponds the parameter which is an operand for the # or ## operator, a macro is not considered as a macro call and is not get expanded even if the macro name is included. *1

Note:

*1 C90 6.8.3.1 Argument substitution
   C99 6.10.3.1 Argument substitution

n.25.1. Macro in an argument is expanded first

A macro in an argument is expanded after the argument is identified, then substituted for a parameter in the replacement list. Therefore, the one identified as one argument is one argument even if it appears multiple arguments after expansion.

Scoring: 4.

n.25.2. Argument expanded into 0 piece of token

Similarly, arguments which become 0 piece of token after expansion are legitimate.

Scoring: 2.

n.25.3. Calling macro using the ## operator in an argument

In case the operand for the ## operator is a parameter, the argument corresponding to it does not get macro-expanded. Therefore, it is necessary to nest another macro in order to do macro expansion.

Since xglue() does not use the ## operator in this example, glue( a, b), which is an argument for it, gets macro-expanded and becomes 'ab' and the replacement for xglue() becomes glue(ab, c). This is rescanned and 'abc' is the final result.

Scoring: 2.

n.25.4. No expansion for the operand for the ## operator

Since glue() is directly called, a macro does not get expanded even if a macro name is in the argument.

Scoring: 6.

n.25.5. No expansion for the operand for the # operator

The argument corresponding to the parameter which is an operand for the # operator is not macro-expanded.

Scoring: 4.

e.25.6. Macro expansion in an argument incomplete in the argument

Macro expansion in an argument is done only in that argument. Incomplete macro is a violation of constraints. Though a function-like macro name is not a macro call by itself, it becomes the beginning of a macro call sequence if it is followed by '('. Once it begins, ')' corresponding to this '(' must exist. *1

Scoring: 4.

Note:

*1 C90 6.8.3 Macro replacement -- Constraints
   C99 6.10.3 Macro replacement -- Constraints

3.4.26. Macros of a Same Name during Macro Rescanning

In case macro definition is recursive, expanding the macro as is causes infinite recursion. Because of this, recursive macros could not be used in K&R 1st. Standard C introduced a new specification that the macro name replaced once does not get replaced again in order to allow recursive macro expansion, preventing infinite recursion. This specification is quite difficult, but can be paraphrased as below. *1

  1. While rescanning the replacement list of macro A, the name, A, even if found, will not be replaced again.

  2. In case of nested replacement which has the name, A, in the middle of macro B replacement when there is a macro B call in the replacement list of macro A, the A will not be replaced again.

  3. However, in case of macro B replacement included the token sequence after the replacement list of the original macro A, A at this part included is replaced, if and only this A is in the source file (not in replacement list of any macro).

  4. 1 to 3 are recursively applied to macro B replacement. In other words, if B appears again in the middle of macro B replacement and it is on the token sequence after the replacement list of the original B, and this B is not in the source file, this B will not be replaced.

  5. In case there is macro C call in the argument for the original macro A call and C which appeared in the middle of replacement of C applies 1 through 3 and is forbidden from replacement, this C will not be replaced again even when the replacement list of the original macro A is rescanned.

After all these paraphrasing, it is still difficult. Especially, 3 comes from a traditional macro rescan specification of including subsequent token sequence and this complicates the problem unnecessarily. The Standard has issued a corrigendum and made corrections concerning this subject, however, it just gets more confusing. Furthermore, the Standard changes macro expansion depending whether the subsequent token sequence is in the source file or not. This is an inconsistent specification. *2

Not only that the macro expansion involving the succeeding token sequence is uncommon, but also it is doubly uncommon that the macro, whose re-replacement at that part has been prohibited, appears again. The Validation Suite does not have this type of macro as a test item other than n.27.6. I hope this abnormal specification regarding macro expansion of "including a succeeding token sequence" will be removed. *3

Note:

*1 C90 6.8.3.4 Rescanning and further replacement
   C99 6.10.3.4 Rescanning and further replacement

*2 Refer to 2.7.6.

*3 At the newsgroup comp.std.c, there has been some controversy on the Standard's specification about recursive macro expansion. Mainly two interpretations have been insisted on this subject. recurs.t is one of the samples used in the discussion. Refer to the comment in recurs.t. This Validation Suite does not evaluate preprocessors behavior on this sample.

mcpp V.2.4.1 or later in Standard mode implements the two ways of recursive macro expansion. mcpp sets, by default, the range of non-re-replacing of the same name as wide as the explanation above 1-5, and expands this sample as 'NIL(42)'. mcpp sets, by '-@compat' option, the range narrower, and expands this sample as '42'. The difference of these two specifications appears, in 3 above, when the first half of a function-like macro call of A is in the replacement list of B. mcpp, by default, prohibit re-replacing of A even if only the name of A is in the replacement list of B. On the other hand, mcpp, by -@compat option, prohibit re-replacing if and only the name of A and the arguments list with '(', ')' surrounding it are all in the replacement list of B, and does not distinguish whether the name is in the source file or not.

n.26.1. No re-expansion for direct recursive object-like macros

This is an example of direct recursion for object-like macros.

Scoring: 2.

n.26.2. No re-expansion for indirect recursive object-like macros

This is an example of indirect recursion for object-like macros.

Scoring: 2.

n.26.3. No re-expansion for direct recursive function-like macros

This is an example of direct recursion for function-like macros.

Scoring: 2.

n.26.4. No re-expansion for indirect recursive function-like macros

This is an example of indirect recursion for function-like macros.

Scoring: 2.

n.26.5. Recursive macros in arguments

In Standard C, there is a difficult specification meaning "the macro whose re-replacement has been prohibited will not be replaced at rescan in another context." What applies to this in concrete is the handling at rescanning the parent macro for the macro in the argument. When there is a recursive macro in an argument, it is replaced only once. It is not replaced at the rescan of the parent macro, either.

Scoring: 2.

3.4.27. Macro Rescanning

Rescanning of macro replacement lists has been a specification since K&R 1st. Macros found at rescan are replaced as long as they are not recursive macros. This takes care of nested macro definitions. There was no special change in Standard C, though what was not obvious in K&R 1st became somewhat clearer. *1

Note:

*1 C90 6.8.3.4  Rescanning and further replacement
   C99 6.10.3.4 Rescanning and further replacement

n.27.1. Nested object-like macro

This is same in K&R 1st as well.

Scoring: 6.

n.27.2. Nested function-like macro

This is same in K&R 1st as well.

Scoring: 4.

n.27.3. Name generated by the ## operator is subject to expansion

The argument corresponding to the operand for the ## operator is not macro-expanded, however, the pp-token newly generated by pp-token concatenation is subject to macro expansion at rescan.

Scoring: 2.

n.27.4. Function-like macros formed in replacement list

In case a function-like macro name, even if any, does not follow (, it is not considered to be a macro call. If a function-like macro name is obtained from an argument and a function-like macro call is formed by using the name in the replacement list, it will be expanded.

Scoring: 6.

n.27.5. Replacement list forming the first half of a function-like macro

The unusual macro that a replacement list forms the first half of a function-like macro call was an unspoken specification in pre-Standard, but was officially accepted in Standard C. The pp-token sequence subsequent to the replacement list is included to complete a macro call.

Scoring: 2.

n.27.6. Same name macro to be re-replaced

In general, the same name macro is not re-replaced while rescanning. Some unusual cases are, however, re-replaced. In case of nested macro call, when the replacement list involves the subsequent pp-tokens and finds the same name in source file, the name is re-replaced.

Scoring: 2.

e.27.7. Mismatched number of arguments at rescan

The number of arguments must match that of parameters in function-like macro calls. It is also the same in the function-like macros found at the rescan of the replacement list. However, the number of arguments may not be easy to recognize intuitively in tricky macros since arguments are separated by ,.

Scoring: 2.

3.4.28. Predefined Macros

C90 introduced a specification that 5 special macros are predefined by implementations. *1, *2

Furthermore, a macro named __STDC_VERSION__ was introduced in C90/Amendment 1.

__FILE__ and __LINE__ are extremely special macros that change definitions dynamically. It is used in the assert(), debug tools, and others. The rest of Standard predefined macros do not change during the processing of one translation unit.

Note:

*1 C90 6.8.8 Predefined macro names

*2 C99 6.10.8 Predefined macro names

n.28.1. __FILE__

This is defined to be the string literal for the source file name being preprocessed. As the file name is used for the source file included by #include, it changes in the same translation unit also.

Scoring: 4. 0 points for just a name as in n_28.t, rather than a string literal as in "n_28.t".

n.28.2. __LINE__

This is defined to the decimal constant for the line number in the source file being preprocessed. The line number starts with 1.

Scoring: 4. 2 points if the line number starts with 0.

n.28.3. __DATE__

This is defined to the string literal for the date on which preprocessing is performed. The format is "Mmm dd yyyy" and almost the same as the one generated by the asctime() function with an exception that the 1st digit of dd is a space, not 0, in case the day is prior to the 10th.

Scoring: 4. 2 points if the 1st digit of dd is 0 in case the day is prior to the 10th.

n.28.4. __TIME__

This is defined to the string literal for the time at which preprocessing is performed. The format is "hh:mm:ss", same as the one generated by the asctime() function.

Scoring: 4.

n.28.5. __STDC__

This is defined to a constant, 1, in C90 or C99 compliant implementations.

Scoring: 4.

n.28.6. __STDC_VERSION__

This is defined to 199409L in implementations supporting C90/Amendment 1:1995. *1

Scoring: 4.

Note:

*1 Amendment 1/3.3 Version macro (addition to ISO 9899:1990 / 6.8.8)

n.stdmac. C99 predefined macros

In C99, the value of __STDC_VERSION__ is 199901L.

Also, a predefined macro, __STDC_HOSTED__, was added. This is defined to 1 for a hosted implementation, 0 otherwise.

Scoring: 4. 2 points each.

n.28.7. __LINE__ and others in files included

Since __FILE__ and __LINE__ are subject to the source files, not translation units, they are the name of file included and a line number in the source included.

Scoring: 4. 2 points if the line number starts with 0.

3.4.29. #undef

#undef has been supported since K&R 1st and there are no major changes. It cancels the macro definition previously defined. The valid range for the macro is from when it is defined by #define until when it is canceled by #undef. *1

Note:

*1 C90 6.8.3.5 Scope of macro definitions
   C99 6.10.3.5 Scope of macro definitions

n.29.1. Macro cancellation by #undef

The macro name is no longer a macro after #undef.

Scoring: 10.

n.29.2. #undef for the macro without being defined

Applying #undef to the name which has not been defined as a macro is allowed. Compiler systems must not reject this as an error.

Scoring: 4.

e.29.3. Missing name

An identifier is required on the #undef line.

Scoring: 2.

e.29.4. Extra token

The #undef line must not have other than one identifier.

Scoring: 2.

e.29. 5. Missing argument

Missing an argument on the #undef line is a violation of syntax rules.

Scoring: 2.

3.4.30. Macro Calls

In a macro call, a <newline> is treated as simply one of white spaces. Therefore, a macro call can extend over multiple lines, which was not clear in K&R 1st. *1

Arguments for function-like macro calls are separated by ','. However, the , inside of a pair of ( and ) is not considered to be a separator for arguments. This is not tested here directly, however, it is implicitly tested throughout the Suite, in n.25 as an example. Since many of *.c samples use the assert() macro, quite complicated testing regarding this is performed.

Note:

*1 C90 6.8.3 Macro replacement -- Semantics
   C99 6.10.3 Macro replacement -- Semantics

n.30.1. Macro call extending over multiple lines

Scoring: 6.

n.nularg. Empty arguments in macro calls

In C99, an empty argument in macro calls was accepted. This is different from insufficient arguments. The ',' to separate arguments cannot be omitted (though both cannot be identified in case of one parameter.)

Scoring: 6.

3.4.31. Macro Call Error

The next are some errors regarding macro calls.

e.31.1. Too many arguments

Different number of arguments and parameters is a violation of constraint, not undefined. *1

Scoring: 2.

Note:

*1 C90 6.8.3 Macro replacement -- Constraints
   C99 6.10.3 Macro replacement -- Constraints

e.31.2. Insufficient arguments

The number of arguments less than that of parameters is a violation of constraints.

In C99, an empty argument was accepted. This is different from insufficient arguments. The ',' to separate arguments must exist.

Scoring: 2.

e.31.3. Incomplete macro call on the control line

In general, a macro call can extend over multiple lines. However, since the preprocessing directive line starting with # completes in the line (possibly spliced by multi-line comment), a macro call in it must complete in the line as well.

Scoring: 2.

e.vargs2. No Arguments for Variable Argument Macros

Variable argument macros in C99 need at least one actual argument for __VA_ARGS__.

Scoring: 2.

3.4.32. Character Constant in #if Expression

The #if expressions can use character constants. However, the evaluation is mostly implementation-defined and does not have much portability. 32.? Covers the most simple single byte character constants. *1

Note:

*1 C90 6.1.3.4 Character constants
   C90 6.8.1 Conditional inclusion -- Semantics
   C99 6.4.4.4 Character constants
   C99 6.10.1 Conditional inclusion -- Semantics

Below, the sources of the Standards for the 33, 34, and 35 tests are also the same.

n.32.1. Character octal escape sequences

In character constants, octal escape sequences are supported. These are same in any implementation and there are no implementation-defined areas.

Scoring: 2.

n.32.2. Character hexadecimal escape sequences

In character constants, hexadecimal escape sequences are also supported. There are no implementation-defined areas here either. Hexadecimal escape sequences did not exist in K&R 1st.

Scoring: 2.

i.32.3. Single-byte character constants

Single byte character constants not in an escape sequence are simple, however, values depend on basic character sets. In a cross compiler whose basic character set varies at compilation and at runtime, it is acceptable to use either of them in the #if expression evaluation.

Even the same basic character sets are implementation-defined in terms of sign handling. Moreover, handling can be different between the compiler proper (translation phase 7) and preprocessing (phase 4.)

Therefore, judging a basic character set from the value of a character constant in the #if expression is not a guaranteed method.

Scoring: 2.

i.32.4. '\a' and '\v'

Standard C added new escape sequences, '\a' and '\v'.

Scoring: 2.

e.32.5. Escape sequence value out of the unsigned char range

As an escape sequence in a character constant represents a single-byte character value, it must be in the unsigned char range.

Scoring: 2.

3.4.33. Wide Character Constant in #if Expression

Wide character constants were introduced in Standard C. The value evaluation is even more implementation-defined than a single-byte character constant and even byte evaluation order is not specified.

Although there are various encodings of wide character, only the wide character corresponding to ASCII character is tested here. For the other encodings, see 4.1.

e.33.2. Wide character constant value out of range

Hexadecimal or octal escape sequences can be used in wide character constant values as well, however, the values must be in the range representing one wide character value unsigned.

Scoring: 2.

3.4.35. Multi-Character Character Constant in #if Expressions

Character constants include something called multi-character character constants. They appear similar to multi-byte character constants and confusing, however they are different concept and means character constants comprising of multiple characters. Among these characters, there are single-byte characters, multi-byte characters, and wide characters and the multi-character character constants corresponding to each exist (in Standards, the term, character, is used as a single-byte character, but it refers to 3 kinds of characters here.)

There seems to be no usage for multi-character character constants. The reason why these has been accepted since K&R 1st seems to be simply because whatever is in the int range is fine as the character constant type is int.

i.35.1. Multi-character character constant evaluation

Multi-character character constants for single-byte characters have been around since K&R 1st. (A.16.) However, the evaluation byte order is not defined in K&R 1st or Standard C.

Scoring: 2.

e.35.2. Multi-character character constant value out of range

Multi-character character constant values in a hexadecimal or octal escape sequence must be in the int or unsigned int range. However, since int/unsigned int are treated as if they have the same internal representation as long/unsigned long in the #if expressions in C90, checking if values are in the long or unsigned long range seems enough. This point is not clear in the Standards. It can be interpreted that range checking is implementation-defined since the method of value evaluation itself is implementation-defined.

In any case, it is appropriate for this sample to issue a diagnostic message since this sample exceeds the unsigned long range in the 64-bit long or lower compiler systems no matter how evaluation is performed.

In C99, the #if type became the maximum integer type in the implementation.

Scoring: 2.

i.35.3. Multi-character wide character constant evaluation

There exists something called wide character multi-character constants. The evaluation method is also implementation-defined overall, however, a wide character multi-character constant needs to match the multi-character constant for corresponding multi-byte character.

Scoring: 0.

3.4.37. Translation limits

Standard C specified the minimum for each translation limit that can be handled by compiler systems. However, this specification is quite lenient. Regarding 22 kinds of limitation values, each program including one or more examples meeting each limitation value must be processed and executed. As you can see in this Validation Suite sample, it is possible to write this program extremely simple and impractically with the minimum load for a compiler system. Please note that these translation limits are not guaranteed all the time. The translation limit specification is only an indication. These samples test only 8 kinds of translation limits regarding preprocessing. *1, *2, *3

A part of these test samples has lines wrapped to fit on a screen. These tests may fail in the compiler system that cannot process line splicing correctly (for example, Borland C.) Since line splicing testing is not the purpose here, please concatenate lines with an editor to re-test the sample if it fails.

Note:

*1 C90 5.2.4.1 Translation limits

*2 C99 5.2.4.1 Translation limits

In C99, translation limits are expanded to a large extent. They are even more so in the C++ Standard (refer to 4.6.)

n.37.1. 31 parameters in a macro definition

In C90, up to 31 parameters in a macro definition are guaranteed in any case.

Scoring: 2.

n.37.2. 31 arguments in a macro call

Similarly, up to 31 arguments in a macro call are guaranteed in C90 in any case.

Scoring: 2.

n.37.3. 31 characters in an identifier

In C90, the top 31 characters of the internal identifier (including macro names) in a translation unit are guaranteed to be significant. Preprocessing goes without saying, but 31 byte names also need to be passed. *1

Scoring: 4.

Note:

*1 C90 6.1.2 Identifiers - Implementation limits

n.37.4. 8 levels of nested conditional inclusion

In C90, 8 levels of #if (#ifdef, #ifndef) section nesting is guaranteed in any case.

Scoring: 2.

n.37.5. 8 levels of nested #include

In C90, 8 levels of #include nesting is guaranteed in any case.

Scoring: 4.

n.37.6. #if expression with 32 levels of parentheses

In C90, 32 nesting levels of parentheses are guaranteed in an expression in any case. This seems to apply to the #if expressions as well (Different from generic expressions, it does not seem to be necessary to guarantee to that extent for the #if expressions. The only specifications which are defined as an exception are the #if expressions are integer constant expressions, which are evaluated only in long/unsigned long, do not require a query to execution environment, and that same evaluation methods as runtime or phase 7 are not required. Since the rest receive no special treatment, there are some parts where the specification seems somewhat extreme.)

Scoring: 2.

n.37.7. 509 byte string literal

In C90, the length of string literals is guaranteed up to 509 bytes. This length is that of a token and not the number of elements in a char array. It includes " in both ends and \n is counted as 2 bytes. In a wide string literal, the L prefix is included in the number.

Scoring: 2.

n.37.8. 509 byte logical line

In C90, the length of a logical line is guaranteed up to 509 bytes in any case.

Scoring: 2.

n.37.9. 1024 macro definitions

In C90, 1024 macro definitions are guaranteed in any case. This is the most ambiguous among specifications regarding translation limits. The amount of memory required by compiler systems for the simplest macros in this sample are totally different from that for many long macros. Also, test programs vary depending predefined macros are included in the 1024 macros. In an actual program, many macros are defined in standard headers before they are defined in a user program. This specification is truly only rough indication. The real limitations shall be determined by the memory amount, which can be provided by the system.

Scoring: 4.

n.tlimit. C99 translation limits

In C99, translation limits were extended to a large extent.

Scoring: 2 for each of below.

n.37.1.L. 127 parameters in a macro definition

n.37.2.L. 127 arguments in a macro call

n.37.3.L. 63 characters in an identifier

n.37.4.L. 63 levels of nested conditional inclusion

n.37.5.L. 15 levels of nested #include

n.37.6.L. #if expression with 63 levels of parentheses

n.37.7.L. 4095 byte string literal

n.37.8.L. 4095 byte logical line

n.37.9.L. 4095 macro definitions


3.5. Documentation of Implementation-Defined Items

Standard C has items called implementation-defined. Specifications in these items vary depending on implementations. However, it is required that implementations describe specifications in a document. *1

Among the specifications that are implementation-defined, there are ones determined by CPU and OS in addition to the ones by compiler systems themselves. In case of cross compilers, CPU and OS may differ at translation and runtime.

The items below check if the implementation-defined items in preprocessing are described in a document. Since this is for preprocessing, it is for translation time as far as CPU and OS are concerned. d.1.* are for preprocessing specific specifications and d.2.* are related to compiler proper specifications. However, the #if expression evaluation can have different specifications from compiler proper.

Other than items below, there are some implementation-defined aspects in the #if expression evaluation. The first one is character sets (basic character set is ASCII or EBCDIC and such.) The integer representation (2's complement, 1's complement, or sign+absolute value) is another one. Same as a result converted from a signed integer into an unsigned by usual arithmetic conversion. However, since these are all machine and OS dependent, just those documents should be enough and they do not need to be described in the preprocessor documents. Therefore, these are not subject to scoring.

Note:

*1 C90 3 Definitions of Terms
   C99 3 Terms, definitions, and symbols

d.1.1. Header-name construction method

A header-name is a special pp-token. How to combine sequences enclosed by < and > or " and " into one pp-token called a header-name is implementation-defined. It is easy since what is enclosed by " and " is treated as a pp-token called a string literal as far as implementation is concerned, however, what is enclosed by < and > has extremely special problems. That is because <stdio.h> is divided into 5 pp-tokens, <, stdio, ., h, and >, in translation phase 3 and composed into 1 pp-token in phase 4. In case this part is written using macros, even more delicate issues arise. *1

Scoring: 2. 2 points if this specification is described in implementation documents, 0 points otherwise.

Case-sensitivity in header-names and file name rules are also implementation-defined, however they do not necessarily need describing in implementation documents since these are OS dependent.

Note:

*1 C90 6.8.2 Source file inclusion -- Semantics
   C99 6.10.2 Source file inclusion

d.1.2. Header search method in #include

How to search the header file after a header-name is taken out of the #include line is also implementation-defined. In case of the header-name enclosed by " and ", the files is searched in an implementation-defined method first and searched in the same way as the header-name enclosed by < and > if not found. However, the latter is also implementation-defined. This specification does not make any sense at all, however, it cannot be helped since Standard C cannot make assumptions regarding the OS.

In the OS with directory structures, the former searches the relative path to the current directory while the latter searches the directory specified by the implementation. However, some implementations search the relative path to the file that is the source of include. This cannot be said wrong, either, since it is implementation-defined. This is explained by the Rationale that the committee's intention is the specification of the search in the relative path to the current directory, but that it could not be officially defined since the OS cannot be assumed. *1

Also, the former search does not have to be supported (it is acceptable to treat the header-name enclosed by " and " in the same way as one enclosed by < and >.) The latter does not necessarily have to be a file, either. There may be a header built in implementations. *2

Scoring: 4. 4 points if these header search methods are fully described in documents, 2 points if not fully, and 0 point if almost no description.

Note:

*1 ANSI C Rationale 3.8.2 Source file inclusion
   C99 Rationale 6.10.2 Source file inclusion

*2 C90 6.8.2 Source file inclusion -- Semantics
   C99 6.10.2 Source file inclusion

d.1.3. #include nesting limitation

The number of the #include nesting level is implementation-defined. Though, at least 8 levels for C90 and 15 levels for C99 must be guaranteed. *1, *2

Scoring: 2.

Note:

*1 C90 5.2.4.1 Translation limits
   C99 5.2.4.1 Translation limits
*2 C90 6.8.2 Source file inclusion -- Semantics
   C99 6.10.2 Source file inclusion

d.1.4. #pragma sub-directives that are implemented

The #pragma preprocessing directive is a directive to specify enhanced functionalities specific to implementations. Enhanced functionalities must be all implemented as #pragma sub-directives in preprocessing as well. *1

Scoring: 4. 4 points if enough description is in documents regarding the #pragma sub-directives valid in the implementation (at least all #pragma sub-directives for preprocessing in preprocessing documents), 2 points if the descriptions are not enough, and 0 points if almost no description. Deduct 2 points if there is a directive specific to the implementation other than #pragma sub-directives (0 point is the lowest limit. The directives, which are prohibited by options specifying the closest specification to Standard C, are not included.)

Note:

*1 C90 6.8.6 Pragma directive
   C99 6.10.6 Pragma directive

d.pragma. Macro expansion in #pragma

In C90, pp-tokens on the #pragma line was not subject to macro expansion. In C99, however, the line with the STDC token following #pragma is not subject to macro expansion and the macro expansion for the rest of #pragma sub-directives became implementation-defined.

Scoring: 2.

d.1.5. Predefined macros

Predefined macros other than __FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ (also __STDC_HOSTED__ in C99) are implementation-defined. They must have a name with one _ followed by uppercase letters or starting with 2 _'s. *1

Scoring: 4. 2 points if the description is not enough. Deduct 2 points in case there is a predefined macro with the name which does not follow the specification restrictions (0 point is the lowest limit. The directives, which are prohibited by options specifying the closest specification to Standard C, are not included.)

Note:

*1 C90 6.8.8 Predefined macro names
   C99 6.10.8 Predefined macro names

d.predef. C99 predefined macros

C99 added the macros, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__, and __STDC_ISO_10646__, which are predefined conditionally.

__STDC_IEC_559__ and __STDC_IEC_559_COMPLEX__ are defined as 1 respectively in the implementation matching IEC 60559 floating point specification. These 2 are determined by the floating point operation library and it may be appropriate to define these in <fenv.h> or another actually. They do not necessarily have to be predefined in a preprocessor.

__STDC_ISO_10646__ is defined as a constant in the format such as 199712L which represents the year and month of the specification including amendments and corrigenda in complying ISO/IEC 10646 in case values of characters in the wchar_t type are all some sort of coded implementations of ISO/IEC 10646 (Universal Character Set of Unicode system.) This may also be defined in <wchar.h> or another and it does not seem to have to be predefined in a preprocessor.

In any case, the explanation is required in documents.

Scoring: 6. 2 points each for each of 3.

d.1.6. Whether white-spaces should be compressed in phase 3

In Standard C, tokenization is performed in translation phase 3. Whether a white-space sequence other than <newline> should be compressed into one space at that time is implementation-defined. *1

However, as this is an internal behavior that does not usually influence the compilation result, it is not a user concern. White-spaces in the beginning and end of a line may be removed.

If you are wondering this specification is unnecessary, it is not so, but there is one case necessary. That is in case the preprocessing directive line has [VT] and [FF]. This is defined as a specification in an incomprehensible way in Standard C. On one hand, this is treated as a violation of constraints; the specification above is established on the other hand. In other words, [VT] and [FF] can be compressed into one space together with spaces or tabs before and after in phase 3. In that case, [VT] and [FF] do not remain in phase 4, but they do remain in case they are not compressed to cause a violation of constraints.

I think it is enough if [VT] and [FF] handlings are described in documents.

Scoring: 2.

Note:

*1 C90 5.1.1.2 Translation phases 3
   C90 6.8 Preprocessing directive -- Constraints
   C99 5.1.1.2 Translation phases 3
   C99 6.10 Preprocessing directive -- Constraints

d.ucn. Whether UCN's \ should be repeated in stringizing

In case stringizing pp-tokens including UCN by the # operator, whether UCN's \ should be repeated is implementation-defined. *1

Scoring: 2.

Note:

*1 C99 6.10.3.2 The # operator

d.2.1. #if: Single-character character constant evaluation

In general, the evaluation of character constant values is implementation-defined. This has several levels.

  1. What is the basic character set.
  2. What are multi-byte character and wide character encodings.
  3. How is sign handled.
  4. What is the byte order for multi-byte character constant evaluation.

Among these, 1 is not subject to scoring since they are OS dependent. The problems are 2, 3 and 4.

Even single byte single-character character constants are implementation-defined in terms of sign handling. Moreover, different evaluation between preprocessing and compilation is permitted. *1

Scoring: 2. 2 points if a document includes descriptions or if it has descriptions regarding the evaluation in the compilation phase and the same evaluation is performed in the #if expression. 0 points if no accurate description is written.

Note:

*1 C90 6.1.3.4 Character constants
   C90 6.8.1 Conditional inclusion -- Semantics
   C99 6.4.4. 4 Character constants
   C99 6.10.1 Conditional inclusion -- Semantics

d.2.2. #if: Multi-character character constant evaluation

There is an issue of a byte order in multi-character character constant evaluation such as 'ab'. This is also implementation-defined.

Scoring: 2. The scoring method is same as d.2.1.

d.2.3. #if: Multi-byte character constant evaluation

Other than encoding, there are differences in sign handling and byte order in multi-byte character constant evaluation. These are all implementation-defined.

Scoring: 2. The scoring method is same as d.2.1.

d.2.4. #if: wide character character constant evaluation

Other than encoding, there are differences in sign handling and byte order in wide character constant evaluation. These are all implementation-defined.

Scoring: 2. The scoring method is same as d.2.1.

d.2.5. #if: right shift for a negative number

In general, how sign bits are handled in the right bit shift for a negative integer is implementation-defined. This depends on the CPU specification, but also the implementation of the compiler system. *1

Scoring: 2. The scoring method is same as d.2.1.

Note:

*1 C90 6.3.7 Bitwise shift operators -- Semantics
   C99 6.5.7 Bitwise shift operators -- Semantics

d.2.6. #if: Division and modulo of a negative number

In general, in case one or both of right-hand side and left-hand sides are negative integers, the results of division and modulo are implementation-defined. This depends on the CPU specification, but also the implementation of the compiler system. *1, *2

Scoring: 2. The scoring method is same as d.2.1.

Note:

*1 C90 6.3.5 Multiplicative operators -- Semantics
   C99 6.5.5 Multiplicative operators -- Semantics

*2 In C99, quotients are rounded off to the direction of 0 just as div() and ldiv().

d.2.7. Valid length of identifiers

Up to which byte of the identifier including a macro name from the beginning is significant is implementation-defined. For macro names and internal identifiers, 31 bytes for C90 and 63 bytes for C99 must be guaranteed. *1

Scoring: 2.

Note:

*1 C90 6.1.2 Identifiers -- Implementation limits
   C99 6.4.2.1 Identifiers -- General -- Implementation limits

d.mbident. Multi-byte characters in identifiers

In C99, implementations using multi-byte characters in identifiers are permitted. This specification is implementation-defined. *1

Scoring: 2.

Note:

*1 C99 6.4.2.1 Identifiers -- General

4. Evaluation of Aspects Unspecified by Standard

Even if something is not required to implementations by Standards, they may be important in order to evaluate the "quality" of implementations. In this chapter, quality evaluation testing is explained.


4.1. Multi-byte Character Encoding

There are various encodings for multi-byte character and wide character. The specification of encoding is implementation-defined. In this section, however, the "quality" matter of implementations are explained, that is how many encodings the implementation can handle and to what degrees can handle.

This Validation Suite provides samples supporting several encodings for m_33, m_34, and m_36. Compiler systems not only have to support the standard encoding on the system, but also must support many encodings in order to process source files supporting multiple languages. *1

However, the method of testing differs depending on the system and compiler systems and is not easy.

In GCC, use environment variables, LC_ALL, LC_CTYPE, and LANG, change behavior, but their implementations are half-finished and not reliable. Moreover, whether this feature is available depends on the configuration when GCC itself was compiled.

GCC 3.4 changed its way of multi-byte character processing entirely. It converts every encoding of source file to UTF-8 at the start of preprocessing (so to say the translation phase 1). Hence, a multi-byte character constant in #if expression cannot be evaluated in other than UTF-8 which is irrelevant to the original encoding.

The C++98 Standard has a similar problem. Since it stipulates to convert multi-byte character into UCN at translation phase 1, multi-byte character constant in #if expression cannot be evaluated in other than UCN.

Considering the rather confused status of the Standards and the implementations, and considering the lack of portability and lack of meaning of character constant in #if expression, I excluded the tests of multi-byte/wide character constants in #if expression (m.33, m.34, m.36.1) from the subject of scoring since Validation Suite V.1.5.

In Visual C++, use #pragma setlocale, which is a convenient directive. On Windows, "Regional and Language Options" is supposed to change the language to use but is ill-defined and cumbersome. #pragma setlocale is convenient for a programmer since it can be used without tampering with Windows (though how well Visual C++ itself implements it is a separate story).

As far as other compiler systems I have tested are concerned, they support only their default encoding only. Many of them support functions such as setlocale() in the library, which have nothing to do with preprocessing or compiling source files. What is necessary is a capability for a compiler system itself to recognize and process the encoding of source files.

Note:

*1 In C99, Unicode sequences starting with \u or \U were introduced which made it difficult to understand the relationship with multi-byte/wide character. The C++ Standard is even more complicated.

m.33.1. Wide character constant evaluation

For wide character constant, see 3.4.33.

Scoring: none.

m.34. Multi-byte character constant evaluation

Multiple byte multi-byte character constants are supported in the #if expressions (in Standards, the term, multi-byte characters, include single-byte characters, however, in this document, they refer to only multi-byte characters which are not single-byte to avoid confusion.) The evaluation is even more implementation-defined than single-byte character constants.

Scoring: none.
This test needs to be determined along with the test in u.1.7 described later. Simply evaluating a character value does not mean recognizing an encoding. u.1.7 tests whether a multi-byte character is in the range accepted for the encoding. The encoding of a character is properly recognized only after its value is correctly evaluated in m.34 and after an appropriate diagnostic message is displayed in u.1.7.

m.36.1. 0x5c in Multi-byte Characters is not an escape character

If the encoding of (multi-byte | wide) characters is shift-JIS, Big-5, or ISO-2022-*, cumbersome issues arise as there may be a byte with the 0x5c value in a character which is same as '\\'. Compiler systems must not interpret this as a \ (backslash) escape character. A (multi-byte | wide) character is one character and not two single-byte characters.

0x5c in the value for multi-byte character constants must not be interpreted as the beginning of an escape sequence.

Scoring: none.

m.36.2. The # operator does not insert \ in Multi-byte Characters

'\\' must not be inserted where a multi-byte character with 0x5c is included in an argument of an operand for the # operator. Though there is a method of supporting multi-byte characters, not supported in the compiler proper, in a preprocessor by inserting '\\', is at another level.

In addition, there are troublesome issues different from other literals in the tokenization for this type of character constant and string literal including multi-byte characters.

As multi-byte characters encoded in ISO-2022-* include not only '\\', but also bytes of values matching '\'' or '"', sloppy processing will end up with a tokenization failure.

Scoring: 7. 2 points each for the Shift-JIS and Big-5 encoding. 1 point each for 3 samples of ISO-2022-JP.

This item needs to test not only m_36_*.t, but also m_36_*.c. This is because the preprocessor which correctly processes stringizing may fail identifying the complex string literal including a Kanji character with 0x5c as an argument in the assert() macro. m_36.c also tests the tokenization of string literals.

GCC 3.4-4.1 converts the encodings to UTF-8, and often fails to convert back to the original encoding. Though the GCC's conversions are usually unwanted ones, these testcases do not check such conversions, they check only the handling of 0x5c byte (lenient tests.)


4.2. Undefined Behavior

In Standard C, there are many specifications of an undefined behavior. What causes an undefined behavior is incorrect programs or data or at least programs without portability. However, it is not mandatory to issue a diagnostic message, different from violation of syntax rules or constraints. Implementations can process this in any way. Some sort of reasonable processing as a valid program or handling it as an error by issuing a diagnostic message are acceptable, and it is not against Standards even if the process is canceled or run out of control without issuing a diagnostic message.

However, in order to evaluate the "quality" of an implementation, concretely what undefined behavior is a question. I think it is appropriate for an implementation to issue some sort of diagnostic message. Not to mention an error case, even in the case of handling it as a valid program, it is helpful to issue a warning in order to indicate portability issues. Runaway is out of the question.

The following tests check whether implementations issue an appropriate diagnostic message for source that causes an undefined behavior. Diagnostic messages may be an error or warning. In case of a warning, some sort of reasonable processing is necessary.

u.1.* are preprocessing specific problems and u.2.* are common in constant expressions in general.

Scoring: 1 point each for an item unless otherwise noted if an appropriate diagnostic message is issued. 0 points for an off-center or no diagnostic message.

u.1.1. Source files not ending with <newline>

Source files which are not empty and whose end is not the <newline> cause undefined behavior (Depending on OS, no newline character data exists in a file and a newline is automatically added by the implementation when a file is read.) *1

u.1.1, u.1.2, u.1.3, and u.1.4 are all ones with incomplete source files. In case the translation unit ends within the file, most implementations seem to issue a diagnostic message. However, even with such implementations, there is a possibility that the incomplete file is treated as valid source by processing the file included within another. Although this is also a type of undefined behavior and not an erroneous process, it is appropriate to issue a diagnostic message.

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases

u.1.2. Source files ending with <backslash><newline>

Source files ending with the <backslash><newline> sequence cause an undefined behavior. *1

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases

u.1.3. Source files ending in the middle of comments

Source files ending in the middle of comments cause an undefined behavior. This is actually the case of unclosed or nested comments. *1

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases

u.1.4. Source files ending in the middle of a macro call

Source files ending with an incomplete macro call is undefined. *1

This occurs in case that a parenthesis is missing to close a macro argument and it is important to have a diagnostic message.

Note:

*1 C90 6.8.3.4 Rescanning and further replacement
   C99 6.10.3.4 Rescanning and further replacement

u.1.5. Invalid character in places other than quotes

Extremely limited characters can be written in places other than string literals, character constants, header-names, and comments. They are uppercase and lowercase alphabets, numbers, 29 symbols, and 6 kinds of white space characters. It is no wonder since these are for source. *1

Here, we test the case of control codes other than white spaces. Although control codes are invalid even in string literals and elsewhere, compiler proper can check this. As there are many locale-specific or implementation-defined aspects in character sets in general and the range is not necessarily clear, we do not test those. Kanji characters are undefined in places other than above, but not tested for similar reasons.

Note:

*1 C90 5.2.1 Character sets
   C99 5.2.1 Character sets
UCN was added in C99.

u.1.6. [VT][FF] on control lines

Preprocessing directive lines starting with #, even if white space characters, cause a violation of constraints when other than [SPACE][TAB] exists. However, this is the case of translation phase 4 and it is possible to compress those with a sequence of white spaces before and after which are other than <newline> into one space in phase 3 prior to phase 4. In such event, no violation occurs. *1

So as in Standards, it is appropriate to issue a diagnostic message to this. This is not an undefined behavior test, however, it is included here as a matter of convenience since it is difficult to classify this elsewhere.

Note:

*1 C90 5.1.1.2 Translation phases
   C99 5.1.1.2 Translation phases
   C90 6.8 Preprocessing directives -- Constraints
   C99 6.10 Preprocessing directives -- Constraints

u.1.7. Invalid multi-byte character sequences in quotes

Even inside a string literal, character constant, header-name, or comment, a sequence that is not accepted as multi-byte characters causes undefined behavior. This is the case where the next byte of the first byte of a multi-byte character cannot be used as the second byte. *1

Scoring: 9. 1 point each for 6 types of encodings other than UTF-8, 3 points for UTF-8. The UTF-8 testcase has 4 testing lines: the first is normal sequence, and the rest 3 are illegal ones. Give 1 point each for the 3 illegal lines diagnosed appropriately. Give no point to a preprocessor which issues off-target message at the normal case. Also, refer to the explanation of m.34.

Note:

*1 C90 5.2.1.2 Multibyte characters
   C99 5.2.1.2 Multibyte characters

u.1.8. Logical lines ending in the middle of a character constant

The character constant pp-token must complete on that logical line. If there is a ' without corresponding ' on a logical line, it is undefined. *1

An optional message can be written on the #error line. However, it must be arranged in the pp-token sequence and a single apostrophe is not allowed. In this sample, the part intended for a comment is eaten by searching the ' which should be at the end of the character constant.

Note:

*1 C90 6.1 Lexical elements -- Semantics
   C99 6.4 Lexical elements -- Semantics

u.1.9. Logical lines ending in the middle of a string literal

String literals must complete on that logical line. A single " is undefined. *1

String literals extending over lines seem to have been accepted in many UNIX compiler systems. Source files expecting it can still be seen sometimes.

Note:

*1 C90 6.1 Lexical elements -- Semantics
   C99 6.4 Lexical elements -- Semantics

u.1.10. Logical lines ending in the middle of a header name

Incomplete header-names on the #include logical line is also undefined. *1

Note:

*1 C90 6.8.2 Source file inclusion -- Semantics
   C99 6.10.2 Source file inclusion -- Semantics

u.1.11. ', ", /*, or \ in a header name

', /*, or \ in the header-name pp-token is undefined. The case " exists in the header-name enclosed by < and > is also the same (error since " becomes the end of the pp-token from the beginning in the header-name of a string literal format.) *1

These, except for \, are all confusable with a character constants, string literal, or comment and can be interpreted either way.

\ is mistakable with an escape sequence. Though a header-name has no escape sequence, this is not determined as a header-name until phase 4 after tokenization in translation phase 3. Therefore, implementations suffer from identifying this case. Though escape sequences are processed in phase 6, it is necessary to recognize an escape sequence since \" is interpreted as an escape sequence rather than the end of a string literal in phase 3.

However, \ is a Standard path-delimiter in the OS such as DOS/Windows and implementations on those OS certainly handle this as a valid character (except for the case that the last character is \ in the header-name of a string literal format.) Many cases causing an undefined behavior are erroneous programs, but not always so. It is not recommended to write \ where / is adequate. Implementations should issue a warning. On other OS's, it will be an error when opening files; no diagnosis is necessary in preprocessing tokenization.

Note:

*1 C90 6.1.7 Header names -- Semantics
   C99 6.4.7 Header names -- Semantics

u.1.12. #include argument is not a header name

It is undefined if the argument on the #include line is not a header-name. In other words, this is the case where an argument is not in the string literal format or not enclosed by < and >, or no macro which is expanded into either of these exists. *1

Note:

*1 C90 6.8.2 Source file inclusion -- Semantics
   C99 6.10.2 Source file inclusion -- Semantics

u.1.13. Extra token in the #include argument

The argument on the #include line is one header-name only. Extra pp-token other than that is undefined. *1

Note:

*1 C90 6.8.2 Source file inclusion -- Semantics
   C99 6.10.2 Source file inclusion -- Semantics

u.1.14. Missing line number in the #line argument

It is undefined if the argument on the #line has no line number (A file name is optional. A line number must be the first argument.) *1

Note:

*1 The sources of Standards up to u.1.18 are all same below.

    C90 6.8.4 Line control -- Semantics
    C99 6.10.4 Line control -- Semantics

u.1.15. The #line file name argument is not a string literal

The file name which is the second argument of #line must be a string literal.

If this is a wide string literal, it is a violation of constraints while the rest of the #line errors are undefined. This specification lacks balance.

u.1.16. Extra token in the #line arguments

Three or more arguments on the #line line cause undefined errors.

u.1.17. The line number argument for #line is out of [1, 32767] range

In C90, the line number argument for #line must be in the range of [1, 32767]. It is undefined otherwise.

This sample tests the case where the #line specification is within this range, but the line number of the source exceeds the range afterward. Depending on implementations, the line number may silently wrap. It is appropriate to issue a warning.

Scoring: 2. 1 point if 1 or 2 out of 3 samples can be diagnosed.

u.line. C99: the line number argument for #line is out of range

In C99, this range is [1, 2147483647].

u.1.18. The line number argument for #line is not decimal

The line number argument for #line must be a decimal number. Hexadecimal and others are undefined.

u.1.19. Macro on the #if line expanded into defined

The fact that 'defined' is an operator and confusable with an identifier causes various problems. Since it is once tokenized as an identifier in translation phase 3 and recognized as an operator in phase 4 only if this exists on the #if line, defining a macro which is expanded into defined on the #define line is possible. If this macro actually appears on the #if line, it is undefined. There is no guarantee for the result of its expansion to be treated as an operator. *1

Defining a macro named defined is itself undefined (refer to u.1.21), however, such an example is not seen in reality. Although, the macro definition which has a token named defined in the replacement list can be seen from time to time. Some compiler systems treat this as legitimate by performing a special process, which is not a logical specification.

Scoring: 2. 1 point if only 1 out of 2 samples can be diagnosed.

Note:

*1 C90 6.8.1 Conditional inclusion -- Semantics
   C99 6.10.1 Conditional inclusion -- Semantics

u.1.20. defined, __LINE__, etc. for the #undef argument

It is undefined if the #undef argument is defined, __LINE__, __FILE__, __DATE__, __TIME__, __STDC__, or __STDC_VERSION__. *1, *2, *3

Note:

*1 C90 6.8.8 Predefined macro names
   C99 6.10.8 Predefined macro names
*2 Amendment 1/3.3 Version macro

*3 __STDC_HOSTED__, __STDC_ISO_10646__, __STDC_IEC_559__, and __STDC_IEC_559_COMPLEX were added in C99.

u.1.21. defined, __LINE__, etc. for the #define macro name

It is undefined if the macro name defined by #define is defined, __LINE__, __FILE__, __DATE__, __TIME__, __STDC__, or __STDC_VERSION__. *1, *2, *3

Scoring: 2. 1 point if 2 out of 3 samples are diagnosed.

Note:

*1 C90 6.8.8 Predefined macro names
*2 Amendment 1/3.3 Version macro

*3 __STDC_HOSTED__, __STDC_ISO_10646__, __STDC_IEC_559__, and __STDC_IEC_559_COMPLEX were added in C99.

u.1.22. Invalid pp-token generation by the ## operator

The result of pp-token concatenation by the ## operator must be a valid (single) pp-token. It is undefined, otherwise. *1

In this sample, the subject matter is the pp-token called a pp-number which was defined as a new specification in Standard C.

Note:

*1 C90 6.8.3.3 The ## operator -- Semantics
   C99 6.10.3.3 The ## operator -- Semantics

u.concat. C99: Invalid pp-token generation by the ## operator

The // mark is used for a comment in C99 and C++, but is not a pp-token. The result of generating this sequence with the ## operator is undefined.
A comment is converted into a space before a macro is defined or prior to expansion, thus it is not possible for a macro to generate a comment.

u.1.23. Invalid pp-token generation by the # operator

The result of pp-token concatenation by the # operator must be a valid (single) string literal. It is undefined otherwise. *1

This problem rarely occurs. As you can see in this sample, it is limited to odd cases where \ is outside of a literal and even more special cases. This sample shall be diagnosed in the compilation phase rather than preprocessing and that is enough. However, implementations should not crash or silently ignore the problem.

Note:

*1 C90 6.8.3.2 The # operator -- Semantics
   C99 6.10.3.2 The # operator -- Semantics

u.1.24. Empty argument in a macro call

Having an empty argument in a function-like macro call is undefined in C90. *1

Performing reasonable macro expansion by interpreting an empty argument as 0 pieces of token is very possible. *2

This is an example where implementations can give the undefined specification a meaningful definition. Such implementations, however, also have no portability in pre-C99 at least. It will be appropriate to issue a warning.

Scoring: 2. 1 point if 3 of 4 out of 5 samples are diagnosed.

Note:

*1 C90 6.8.3 Macro replacement -- Semantics

*2 C99 6.10.3 Macro replacement -- Semantics

u.1.25. Argument similar to the control line in a macro call

A function-like macro call can extend over multiple logical lines. Therefore, there may be a line confusable with a preprocessing directive in an argument; the result is undefined. *1

This type of "argument" will be interpreted as a preprocessing directive if it is in the #if group to be skipped.

Note:

*1 C90 6.8.3 Macro replacement -- Semantics
   C99 6.10.3 Macro replacement -- Semantics

u.1.26. Macro expansion ending with a function-like macro name

In C90, the macro expansion result ending with a function-like macro name is considered to be undefined. This is an interpretation added later, but not clear in meaning. Please refer to 2.7.6. *1

This was included as a test in this Validation Suite up to V.1.2, but omitted from V.1.3.

Note:

*1 ISO/IEC 9899:1990 / Corrigendum 1

This specification was removed in C99 and a complicated specification was added.

u.1.27. Invalid directives

In case the first pp-token on a line is # and there is another pp-token after that, what follows # must be a preprocessing directive usually. The line of # only is accepted for some reason. *1

However, # at the beginning of a line or followed by an invalid directive or other pp-token are not violations of syntax or constraint for preprocessing. As you can see in u.1.25, that is because all lines starting with # do not have to be preprocessing directive lines. Which one is a preprocessing directive line depends on the context.

Standards do not specify this as undefined, however, it is in a way undefined in the sense that "it is not defined as a specification." It is desirable for an implementation to issue some sort of diagnostic message. However, this does not necessarily have to be diagnosed by preprocessing. If preprocessing outputs this line as is, it will be an error in the compilation phase. That is acceptable as well. There is no danger as long as preprocessing avoids the case where it interprets silently #ifdefined as #if defined.

In C99, something not clear in the meaning called # non-directive was added. However, its content is not defined and I can say it is undefined, practically speaking. *2

Note:

*1 C90 6.8 Preprocessing directives -- Syntax

*2 C99 6.10 Preprocessing directives -- Syntax

u.1.28. Directive name not macro-expanded

In order for the line starting with # to be a preprocessing directive, only a directive name is allowed as the next pp-token. Directive names are never macro-expanded.

In the case where an identifier which is not a directive name comes after # and it is a macro name, there are 2 processing steps; diagnosing it as a missing directive and considering it as usual text to expand a macro for an output. Even the latter needs some sort of diagnosis. Since the latter should cause an error in the compilation phase, that is acceptable as well. Only processing what is macro-expanded as a "correct" preprocessing directive should not happen.

u.2.1. Undefined character escape sequence in the #if expression

Character escape sequences in a string literal or character constant support only \', \", \?, \\, \a, \b, \f, \n, \r, \t, and \v as a specification. Other character sequences starting with \ are undefined. Especially, sequences with \ followed by a lowercase are reserved for future use. *1

Many of these diagnoses are handled by the compilation phase, however, only preprocessing diagnoses the case where these exist in a character constant for the #if expression.

Note:

*1 C90 6.1.3.4 Character constants -- Description
   C99 6.4.4.4 Character constants -- Description
   C90 6.9.2 Character escape sequences
   C99 6.11.4 Character escape sequences

In C99, UCN (universal-character-name) escape sequences in the \uxxxx or \Uxxxxxxxx format were added.

u.2.2. Bit shift operation with invalid shift count in the #if expression

In a bit shift operation for a integer type, the case that the right operand (shift count) is a negative value or greater than or equal to the width of the left operand type is undefined. *1

If this is in the #if expression, it should be diagnosed by preprocessing.

Note:

*1 C90 6.3.7 Bitwise shift operators -- Semantics
   C99 6.5.7 Bitwise shift operators -- Semantics

4.3. Unspecified Behavior

In Standard C, there is a specification called unspecified. This is for valid programs without a processing method unspecified and whose processing method is not necessarily documented by the implementation.

There are not many examples for this. Only extremely special cases have different results according to the processing method. However, it is desirable to issue a warning even if it is a special case.

The result of a program depending on unspecified behavior is undefined.

It is unspecified in preprocessing and the ones which have different results according to processing methods are the following. In these 2 tests, 2 points are given for each, whether an invalid pp-token is generated and a diagnostic message is issued or whether a warning for no portability is issued. In case of the latter, it can be at macro definition or expansion.

Additionally, evaluation order within an #if expression is unspecified. This is not included in testing since the #if expression result does not change because of this.

s.1.1. Unspecified evaluation order of the # and ## operators

In case both the # and ## operators are in one macro definition, which is evaluated first is not specified. *1

This sample is the example of different results depending on which of # and ## is evaluated first. Furthermore, if ## is evaluated first, # is treated as a pp-token rather than an operator, causing the concatenation result to generate an invalid pp-token. As this type of macro does not have portability, it is preferable for an implementation to issue a warning.

Scoring: 2.

Note:

*1 C90 6.8.3.2 The # operator -- Semantics
   C99 6.10.3.2 The # operator -- Semantics

s.1.2. Unspecified evaluation order for multiple ## operators

In case there are multiple ## operators in one macro definition, the evaluation order is not specified. *1

In this sample, an invalid pp-token is generated on the way of evaluation depending on the evaluation order. As this type of macro does not have portability, it is preferable for an implementation to issue a warning.

Scoring: 2.

Note:

*1 C90 6.8.3.3  The ## operator -- Semantics
   C99 6.10.3.3 The ## operator -- Semantics

4.4. Other Cases Where a Warning is Preferable

Other than undefined and unspecified, there are cases for which it is preferable for implementations to issue a warning. Those are below.

The w.1.* and w.2.* are totally valid programs as far as Standards are concerned, however, they have probably some sort of errors and diagnosis is important. w.1.* are preprocessing specific problems and w.2.* are #if expression versions of the problems common with operations in the compilation phase.

The w.3.* concern a specification with implementation-defined aspects of translation limits. Implementing the translation limits beyond the minimum value guaranteed by a Standard can be said to improve the quality of the implementation. On the other hand, programs depending on it will have the problem of limited portability. Therefore, it is preferable for an implementation which implements translation limits beyond the minimum value to issue warnings.

In tests below, it is a pass if an appropriate diagnostic message is issued. w.3.* allow an error when the translation limits of an implementation match the minimum value of the Standard. It is a failure if an error occurs without meeting the minimum value (whether meeting the minimum value is determined in n.37.*.)

w.1.1. /* inside a comment

There are many nested comments and typos in source missing a comment mark. Among those, nested comments, /* /* */ */, and a comment with only */ always cause an error in the compilation phase since the */ sequence does not exist in the C language. However, when */ is missing, it may not cause an error since the part up to the end of the next comment is interpreted as a comment. This is a dangerous mistake and it is important for preprocessing to issue a warning. Even if the case some sort of error occurs in the compilation phase, the cause is no longer clear at that time.

Scoring: 4.

w.1.2. Inclusion of a subsequent token sequence by macro rescan

The case of the inclusion of a token sequence after a replacement list at macro rescan is an unwritten specification in K&R 1st and the official Standard C. However, this situation is brought about only by an unusual macro. Especially, the one where the replacement list comprises the first half part of another function-like macro call is an extremely unusual macro. In reality, the possibility of an error in a macro definition is large, it is preferable for the implementations to issue a warning. I sometimes see an object-like macro expanded into a function-like macro name though such writing style causes bad readability.

This is a problem of Standard. I think that incomplete rescan in a replacement list should be specified as an error (violation of constraints) (refer to 2.7.6.)

Scoring: 4. 1 point if only 1 out of 2 samples can be diagnosed.

w.2.1. Negative value converted into an unsigned number by the usual arithmetic conversion in the #if expression

In the mixed mode operation of signed and unsigned integers, "usual arithmetic conversion" is performed and signed numbers are converted into unsigned numbers. In case the original signed integer is positive, the value does not change. However, if it is negative, it is converted into a large positive number. This is not an error, but not normal and there is a possibility of an error. It is preferable to issue a warning. In preprocessing, this phenomenon is seen in the #if expression.

Scoring: 2.

w.2.2. Unsigned operation in the #if expression wraps round

In the case the result of an unsigned operation is out of the range, it may not be an error since it is supposed to be wrapped round. Since there is a possibility of an error, it is preferable to issue a warning.

Scoring: 1.

w.3.1. Identifier of 32 bytes or longer, 32 or more macro parameters, 32 or more macro arguments

w.3.1, w.3.2, w.3.3, w.3.4, and w.3.5 are all tests regarding the translation limits in C90. The contents are clear by themselves and no explanation is necessary. Compare these with n.37.*.

Scoring: 3. 1 point each for each of 3 items.

w.3.2. 9 or more levels of #if (#ifdef, #ifndef) nesting

Scoring: 1.

w.3.3. 9 or more levels of #include nesting

Scoring: 1.

w.3.4. 33 or more sub-expression nesting in the #if expressions

Scoring: 1.

w.3.5. 510 bytes or longer string literals

Scoring: 1.

w.3.6. 510 bytes or longer logical lines

Scoring: 1.

w.3.7. 1025 or more macro definitions

Only this is same as n.37.8. This is the most approximate one in the specification for translation limits. Whether built-in macros should be counted in 1024 macros and whether the macros defined in standard headers should be counted vary the number. The macro tested in this sample is the 1024th in header files, but there are some macros defined prior in warns.t and warns.c. In any case, this macro exceeds the 1024th. Implementations are expected to issue warnings at appropriate places.

Scoring: 1.

w.tlimit. C99 translation limits

In C99, translation limits were largely extended. It is preferable even for the implementation with the specification exceeding this to issue a warning for the source exceeding the specification for the portability.

Scoring: 9. 1 point each for the following 9 items.

Test samples are in the test-l directory. l_37_8.c is pseudo source which can be preprocessed, but not compiled.

w.3.1.L. 128 or more macro parameters

w.3.2.L. 128 or more macro arguments

w.3.3.L. 64 bytes or longer identifier

w.3.4.L. 64 or more levels of #if (#ifdef, #ifndef) nesting

w.3.5.L. 16 or more levels of #include nesting

w.3.6.L. 64 or more levels of sub-expression nesting in the #if expressions

w.3.7.L. 4096 bytes or longer string literals

w.3.8.L. 4096 bytes or longer logical lines

w.3.9.L. 4096 or more macro definitions


4.5. Other Quality Matters

Below is the items concerning the quality such as implementation's ease of use. Cases other than q.1.1 cannot be tested by sample programs.

q.1.* are regarding behaviors.
q.2.* are regarding options and extended functionalities.
q.3.* are regarding the runnable systems and the efficiency on them.
q.4.* are regarding documents.

Among these, some cannot help relying on rather subjective evaluation. Others can be evaluated objectively, but the measure may not be specified clearly. Refer to 6.2 to score them appropriately.

4.5.1. Qualities regarding Behaviors

q.1.1. Translation limits above the specification

Concerning translation limits, the minimum specification is defined leniently in Standards. However, the actual implementations should have the specification above this. Especially, the requirement of nesting levels of #if and #include are too low in C90.

In C99, translation limits were largely raised. Also, restricting identifier length to less than 255 bytes is described as an obsolescent feature.

In the q.* items, only these are prepared as test samples. l_37_?.t and l_37_?.c in the test-l directory each test the translation limits as below. These exceed the C99 specification (however, the translation limit values in the C++ Standard guideline are higher than these.)

37.1LNumber of parameters in a macro definition 255
37.2LNumber of arguments in a macro call 255
37.3LLength of an identifier 255 bytes
37.4LNesting level for #if 255
37.5LNesting level for #include 127
37.6LNesting level for sub-expressions in the #if expressions255
37.7LLength of a string literal 8191 bytes
37.8LLength of a logical line in source 16383 bytes
37.9LNumber of macro definitions 8191

l_37_8.c does not become an execution program even if it is compiled. Only preprocessing is necessary, however, make an object file by doing cc -c l_37_8.c to compile. If preprocessing is successful, you can find out how long line the compiler proper can accept.

Scoring: 9. 1 point for each of 9 kinds of samples. Compiler proper testing is not included.

q.1.2. Accuracy of diagnostic messages

Though a diagnostic message is issued, it can be difficult to understand, too vague, or not obvious about the point of the problem. Some diagnostic messages are detailed while others may lack focus. A diagnostic message should not be simply "syntax error", but should show the reason for the error. The implementation should indicate the line and point out the token of the problem.

The error message of a mismatched #if section is desired to indicate the corresponding line. Otherwise, it is not possible to detect where the error resides.

Duplicate diagnostic messages for the same error are not desirable.

Scoring: 10.

q.1.3. Accuracy of line number display

It is not acceptable for the line number that a preprocessor passes to the compiler proper to be mismatched. This appears in a diagnostic message, however, it is treated as a separate item as a matter of convenience. This scoring is done whether line numbers are accurately displayed in the sample programs thus far. There are preprocessors that do not output the line number information. These are out of the question.

Scoring: 4.

q.1.4. Runaway or abort

Scoring: 20. Deduct points as below for implementations which runaway or abort in any of the samples in this Validation Suite. A "runaway" means that the program must be aborted by ^C, must be reset, or leaves a discrepancy in the file system. An "abort" means that the damage is not done though the program ends prematurely.

  1. 0 point for a runaway in n_std.c (strictly conforming program.)

  2. 10 points (testing the part after where aborted causes another runaway, classify it as a "runway") if a processed is aborted in n_std.c.

  3. 10 points for a runaway in any of other samples.

4.5.2. Options and extended functionalities

q.2.1. Specifying the include directory

The so-called include directory where standard header files are located is fixed to one location in the most simple case. However, it is often the case that multiples exist and there are cases that users have to specify one. About user level header files, there is no problem in case those are in the current directory, however, the directory search rule is different depending on the implementation in case they are in another directory and they include another header file. In any case, it is inconvenient if the include directory cannot be specified by users explicitly by using options and environment variables (many implementations use -I option.) In addition, the option to exclude specified directories in the system is necessary in the case of searching multiple directories in sequence. The option to change the search rule itself justifies its existence.

Scoring: 4.

q.2.2. Macro definition option

It is valuable to have the option that allows an object-like macro to be defined at compilation rather than in source (many implementations use the -D option.) This makes it possible for the same source to generate objects of different specifications or to be compiled in different systems. In case of omitting a replacement list, there are some implementations defining 1 and others defining 0 piece of token, requiring a user to check documentation.

Some implementations have options to define the macro with arguments.

Scoring: 4.

q.2.3. Macro cancellation option

There should be an option to cancel implementation-specific built-in macros. There are the following types.

  1. 2. The -U option which undefines a macro.
  2. 3. The option that removes implementation-specific built-in macros all at once.
  3. 4. The option that removes built-in macros prohibited in Standard C only ('unix' and others which do not start with _) all at once.

Scoring: 2. 2 points with 1 or 2 option. 3 is not applicable as it is evaluated in d.1.5.

q.2.4. Trigraphs option

Though trigraphs are always used in the environment that needs them, they are hardly used in most environments since they are not needed. This should be enabled or disabled by an option at compilation.

Scoring: 2.

q.2.5. Digraphs options

Similarly, digraphs also should be enabled or disabled by an option at compilation.

Scoring: 2.

q.2.6. Warning specifying option

It will be more helpful to have warnings other than violations of syntax rules or constraints issued as much as possible, however, they can be annoying sometimes. The option to specify a warning level or one to enable or disable warnings by type is needed.

Scoring: 4.

q.2.7. Other options

There are other helpful options in preprocessing. Having too many options makes things complicated, however, there are some that are convenient. The option not to output the line number information (-P in most cases) is relatively common and it seems to be used for the purposes other than C language. There are some which output without deleting comments. Depending on command processors of OS, there are cases where implementations need to implement redirection of diagnostic messages. In addition, so-called one-pass compilers in which preprocessing is not an independent program should have an option to specify the output after preprocessing.

The option to identify C90 (C95), C99, and C++ is obviously necessary. Furthermore, the option to achieve the compatibility between C99 and C++ (making C++ preprocessing closer to C99's) is helpful.

There is an option to output source file dependency relations in order to generate a Makefile.

Scoring: 10.

q.2.8. Extension by #pragma

In Standard C, implementation specific directives are all implemented as sub-directives of #pragma. Preprocessing usually passes #pragma to a compiler as is and processes some of #pragma on its own. There are not many examples of the #pragma that preprocessing processes.

The header file with #pragma once written may be read only once even if #include to it is applied many times. This not only prevents multiple inclusion, but also is effective in improving processing speed. In case the whole header file is included without using #pragma once, for example, by

#ifndef __STDIO_H
#define __STDIO_H
..
#endif

some implementations automatically do not access this for a second time.

In mcpp, there is a #pragma directive which makes many header files combined as one file as a "pre-preprocess." In other words, this is the functionality to preprocess the header included by #include to output and add the #define directives which appeared there to the combined output. Including this is enough in compiling the original source. This way, the size of the header file gets smaller since comments, #if, and macro calls disappear. There is only one file to access. As a result, preprocessing speed is faster.

Some implementations are equipped with a header pre-compilation feature. This seems to have been introduced to process huge header files in C++, however, there is a tendency that the size of pre-compiled header gets larger than the total of original header files. The speed improvement cannot be seen very much in C, at least. The content of the pre-compiled header depends on the internal specification of compiler-proper. And the fact that it becomes a black box, which a user cannot see, is also a drawback.

In any case, above are all intended to speed up preprocessing and nothing else. Therefore, these features are not evaluated here, but rather in q.3.1.

Some implementations have #pragma which specifies the encoding of multi-byte characters. It is complete as a method of passing along the encoding of source files to a preprocessor or compiler.

mcpp also has #pragma which traces preprocessing and outputs debug information. As no debugging can be performed for preprocessing using a regular debugger, this is an important feature that can be done only in a preprocessor. This feature is easier to use since debug points can be restricted by using #pragma rather than specifying an option.

Some implementations implement what is normally specified as an option at compilation by #pragma such as error and warning control specification. While #pragma has merits of no portability issues in as far as Standard C compliant implementations are concerned and of being able to specify the location on source, it has the demerit that the source files have to be rewritten when making changes to it. If this were to be implemented, it should be done so in addition to the implementation of the compilation option.

There are not very many other #pragma which are processed in preprocessing.

By the way, #pragma sub-directives are implementation-defined and have a possibility of name collision between implementations. Some device to avoid name collision is desirable. GCC 3 uses the name GCC as '#pragma GCC poison'. This is a good idea. mcpp has adopted this idea as '#pragma MCPP debug' since V.2.5.

Scoring: 10.

q.2.9. Extended functionalities

Although extended functionalities should be implemented as #pragma sub-directives, some preprocessors implement directives other than #pragma as proposals of new preprocessing specifications.

In Linux system headers, GCC / #include_next directive is used. Using of this directive means, however, organization of the system headers are unnecessarily complicated, and is not praiseworthy. GCC implements also non-Standard directives such as #warning, #assert, etc. whose needs are not high.

GCC / cc1 has a "traditional" mode option other than the standard behavioral mode. mcpp has options for various behavioral specifications. Those experiments also have some meanings.

Scoring: 6.

4.5.3. Efficiency and others

q.3.1. Processing speed

Though the accuracy of processing and diagnosis is the most important thing, the faster the speed is, the better.

The #pragma and option to improve speed are called out to find out the result of the speed.

Scoring: 20. The speed of the program that does nothing but copying input to output is set as 20 points. Comparative scoring is done speed relative to this benchmark. Refer to 6.2 for concrete measurements. Since the absolute speed varies depending on hardware, comparison should be done with same level of hardware. In addition, the speed of processing same program depends on the amount of standard headers to be read. Comparison should be done with mcpp as a point of reference.

In order to measure time, the time command (built-in command in bash or tcsh) is used for UNIX systems. On the Windows systems, there is a time command in bash if CygWIN is installed. Also, WindowsNT has a similar command called TimeThis in the "resource kit." On systems where these are not available, compile tool/clock_of.c for use (though it is rather inaccurate.) *1

Since preprocessing is usually done in an instant on recent hardware, it is hard to measure the time of preprocessing. On Windows, the inclusion of Windows.h is a very heavy task, fortunately or unfortunately, and can be used to measure it. On UNIX-like systems, we have to find some relatively heavy task from glibc sources or such.

Note:

*1 Some WindowsNT resource kit programs can be used on WindowsXP while others do not. TimeThis seems to be usable.

q.3.2. Memory usage

The smaller the memory usage is, the better it is. This is a serious problem especially where there is a strict limitation in memory usage.

As preprocessing is a part of compilation, the memory usage for overall compiler system actually becomes an issue. Since the compiler proper itself eats up more memory usually in case preprocessing is performed by an independent preprocessor, memory usage by a preprocessor shall not be a problem. However, in case there are many macro definitions and such, a preprocessor may consume more memory. Memory usage includes not only the size of a program, but also data area usage.

Scoring: 20. There is no appropriate command to measure memory usage of a program. On UNIX-like systems, we can roughly know the memory usage of cc1 or mcpp by 'top' command while doing 'make' of some large software such as glibc or firefox. On Windows, memory usage of a preprocessor can be roughly known by 'task manager' about inclusion of Windows.h.

q.3.3. Portability

The portability of preprocessor source itself becomes an issue when it replaces a resident preprocessor of the compiler system or when it is being updated or customized. The following shall be subject to evaluation.

  1. Whether source is open (0 points if not open.)
  2. Whether many compiler systems - OS's are supported.
  3. What is the range of compiler systems - OS's for porting? Under what conditions?
  4. Whether the source is easy to port.
  5. Whether porting documents are provided.

Scoring: 20. I only read one and a half source. I just took a glance at the rest. So, this scoring is just a guess.

4.5.4. Quality of Documents

q.4.1. Quality of documents

In d.*, we saw only whether there are documents regarding "implementation-defined items" by Standard C. Here, we will also evaluate the quality of documents.

In addition to implementation-defined items, the following are necessary documents at minimum.

  1. Difference with Standard C.
  2. Option specifications.
  3. Meaning of diagnostic messages.

In addition, having the description of the overall preprocessing specification including the Standard C would be of course much better.

Accuracy, readability, searchability, easiness of viewing and others become subjects for evaluation. The document for porting is included in the q.3.3 evaluation.

Scoring: 10.


4.6. C++ Preprocessing

Nowadays, in most compiler systems C and C++ are provided together. In that case, the same preprocessor seems to be used in both C and C++. Since preprocessing is almost the same in both, it is not necessary to prepare separate preprocessors for each. However, it is not exactly the same in both.

If you compare C++ Standard with C90, the C++ preprocessing is the C90 preprocessing plus the specifications below.

  1. A character not included in the basic source character set is converted into a Unicode hexadecimal sequence in the \Uxxxxxxxx format in translation phase 1. And, this is converted again into an execution character set in the translation phase 5. *1

  2. // to the end of the line is a comment. *2

  3. Each of ::, .*, and ->* is treated as one pp-token. *3

  4. In the #if expression, 'true' and 'false' are evaluated as 1 and 0 respectively as a boolean literal. *4

  5. 11 kinds of identifier-like operators defined as a macro in the <iso646.h> standard header in ISO C : Amendment 1 (1995) are all tokens, not macros in C++ (pointless specification.)(*3) Similarly, 'new' and 'delete' are also operators. *5

  6. The __cplusplus macro is predefined in 199711L. *6

  7. Whether __STDC__ is defined and how it should be defined if so are implementation-defined (On the contrary, it is undefined in C99 if __cplusplus is defined.) *6

  8. Translation limits are extended to a large extent as below. However, these are just guidelines, not requirements. Implementations must explicitly document translation limits. *7
    Length of a source logical line 65536 bytes
    Length of a string literal, a character constant, and a header name65536 bytes
    Length of an identifier 1024 characters
    #include nesting 256 levels
    #if, #ifdef, and #ifndef nesting 256 levels
    #if expression parentheses nesting 256 levels
    Number of macro parameters 256
    Number of definable macros 65536
  9. The restriction (by Standards) in the length prior to '.' in a header name no longer exists. *8

In C99, only the second of these are the same and the others are different. In C99, there occurred new differences due to additions such as p+ and P+ sequences in floating point numbers, official multi-byte character support in identifiers, variable macros, legitimization of empty arguments, macro expansion for the argument on the #pragma line, _Pragma() operator, #if expression evaluation in long long and wider, concatenation of a neighboring wide-character-string-literal and a character-string-literal as a wide-character-string-literal and others. UCN became a specification only in translation phase 5 in C99. The constraint on UCN is also slightly different. Though translation limits were also largely extended in C99 compared with C90, it was not as extreme as C++ Standard and there are differences here, too.

These may not seem to be too many differences but enough not to use the same preprocessing in C and C++. In addition, in C, C90 (C95) and C99 cannot use the same preprocessing.

Besides, predefining __STDC__ in C++ is a cause of trouble and not desirable.

Although some implementations define __cplusplus using the -D option, it is inappropriate, as it becomes one of the user-defined macros.

Although whether each of ::, .*, and ->* should be treated as one token is hardly an issue in preprocessing, handling it correctly is always the best.

Therefore, in order to share a preprocessor among C90 (C95), C99, and C++, a decent implementation seems to use a runtime option and change processing to accommodate differences above.

Please note that mcpp does not support the following two points among the specifications above since implementing them is too much burden for the value. I believe what I have is almost enough in practice.

  1. The conversion to UCN in translation phase 1 is not implemented. The C++ Standard states that UCN conversion does not necessarily have to be performed as long as the same outcome is obtained. Apart from the practical use, however, no same outcome would be obtained without conversions, strictly speaking. You can see this if you think about the character constant comparison between UCNs and multi-byte characters in the #if expression. In the stringizing by the # operator also, a problem occurs in a narrow sense. *9

  2. Only up to 255 parameters at maximum for a macro.

The conformance tests for C++ specific preprocessing specifications added to C90 preprocessing specifications are shown below.

In the implementations which do not recognize file names as C++ source unless they are in the format of *.cc, copy files to *.cc to test.

Samples more than what are in the test-l directory are not provided for translation limits. In C++, translation limits are only guidelines, so they are not subjects for scoring here. In addition, the length of header names will not be tested since it is OS dependent.

Note:

*1 C++ 2.1 Phases of translation

*2 C++ 2.7 Comments

*3 C++ 2.12 Operators and punctuators

*4 C++ 2.13.5 Boolean literals

In C99, bool, true, false, and __bool_true_false_are_defined are defined in <stdbool.h> as _Bool, 1, 0, and 1 respectively as a macro.

*5 C++ 2.5 Alternative tokens

*6 C++ 16.8 Predefined macro names

*7 C++ Annex B Implementation quantities

*8 C++ 16.2 Source file inclusion

In C90 6.8.2. only up to 6 characters to the left starting with '.' in a header name were guaranteed. 8 characters in C99 6.10.2. This restriction was removed in C++.

*9 In C99, whether extra \ is inserted when UCN is stringized by the # operator is implementation-defined. C++ does not have this specification.

If extra \ is added, the UCN no longer goes back to a multi-byte character. Therefore, it is a better implementation without an extra \. However, not having the extra \ is an "wrong" implementation in the C++ specification.

4.5.n.ucn1. UCN recognition

Scoring: 4.

4.5.n.cnvucn. Conversion from a multi-byte character to UCN

Scoring: 2.

4.5.n.dslcom. // Comments

Scoring: 4.

4.5.n.bool. 'true' and 'false' are boolean literals

Scoring: 2.

4.5.n.token1. ::, .*, and ->* are tokens

Scoring: 2. Even if the test appears successful, it is invalid if token concatenation "succeeds" without any warning when processing it in C as well.

4.5.n.token2. Alternative token for operators

Scoring: 2.

4.5.n.cplus. __cplusplus predefined macro

Scoring: 4. 1 point for __cplusplus < 199711L.

4.5.u.cplus. #define, #undef __cplusplus

Scoring: 1. 1 point if a diagnostic message such as a warning is issued.

4.5.d.tlimit. Documents on the translation limits

Scoring: 2.


5. Issues Around C Preprocessing

Below are issues faced when a preprocessor is actually used other than those of C preprocessor Standard conformance level and quality.


5.1. Standard Header Files

Samples in this Validation Suite include some standard headers. Without those headers correctly written, testing a preprocessor itself cannot be performed accurately.

The followings are prone to problems in practice in the standard header implementation.

5.1.1. General Rules

The standard headers must not only include all function declarations, type definitions, and macro definitions, but also meet the conditions below.

  1. The identifier not specified by the Standard nor reserved must not be declared nor defined. The range declarable is determined for each standard header (range may be duplicate or shared between more than one standard header.) *1

  2. Therefore, it is usually not acceptable for one standard header to include another one.

  3. No matter in which order multiple standard headers are included, the results must be the same. *2

  4. No matter how many times the same standard header is included, the result must be the same for other than <assert.h>. *2

  5. Everything defined as an object-like macro which is expanded into an integer constant must be the #if expression. *3

The range of the identifier reserved is specified by the Standard and other identifiers must be open to users. Since names starting with one or two '_' are reserved for some sort of usage, they can be used in standard headers by implementations (On the other hand, they must not be defined by users.)

This is a little constrained specification. No traditional names outside of Standards can be used in Standard C unless they are changed to the names starting with '_'. In POSIX which became a starting point for libraries and standard headers in Standard C, names outside of Standard C are also enclosed by:

#ifdef  _POSIX_SOURCE
    ...
#endif

At least when this part is used, implementations are no longer Standard C.

Also, even if function names such as open(), creat(), close(), read(), write(), and lseek() do not appear in standard headers, implementing functions such as fopen(), fclose(), fread(), fgets(), fgetc(), fwrite(), fputs(), fputc(), fseek() etc. by using open() etc. violates user's name space indirectly. Therefore, dividing open() etc. in _POSIX_SOURCE or separating them in separate headers such as <unistd.h> on the surface is meaningless.

This type of "system call functions" should be changed to the names starting with '_' or ones that are essential in reality should be included in Standard C.

Although 2 is not clearly described in a specification, a standard header including another standard header usually results in the declaration of the name which the standard header cannot declare which is caught by 1. Each header including <stddef.h> is against the rule. To avoid this, non-standard header of a different name called <sys/_defs.h> or so can be provided and included by a standard header (also <stddef.h> itself.) And, names used there should all start with '_'. *4, *5

3 will not become an issue in reality.

4 had problems in old implementations but is complied by most current implementations.

The method of enclosing the whole standard header as below is common.

#ifndef _STDIO_H
#define _STDIO_H
...
#endif

In addition, there is a method of using extended directive such as #pragma once.

What becomes an issue in 5 is there are implementations where macros using sizeof or cast are written in standard headers. In Standard C, sizeof and cast are not allowed in the #if expression. Since sizeof and cast are available in the #if expression as well in the implementations actually using sizeof or cast in standard headers (Borland C 5.5), they must consider this as an extended specification.

As long as a user does not use sizeof and cast in the #if expression in his/her program, no portability problem or no other problems will arise. However, this preprocessing implementation is not an "extension" of Standard C, but rather a "deviation." That is because #if is processed in translation phase 4 in Standard C and no keyword exists in this phase. Keywords are recognized in phase 7 for the first time. In phase 4, names same as keywords are all treated as simple identifiers and identifiers not defined as macros are all evaluated as 0 on the #if line. So, sizeof (int) becomes 0 (0) and (int)0x8000 becomes (0)0x8000, causing a violation of syntax rule. Implementations must issue a diagnostic message for this. Not issuing a diagnostic message is not an "extension" but rather a "deviation" from Standard C. Recognizing only a part of keywords in phase 4 is a bit of a stretch as preprocessing logical configuration and confuses the meaning as "pre"-process phase in the compilation phase (translation phase 7.) *6

Note:

*1 C90 7.1.3 Reserved identifiers
   C99 7.1.3 Reserved identifiers
*2 C90 7.1.2 standard headers
   C99 7.1.2 standard headers
*3 C90 7.1.7 Use of library functions
   C99 7.1.4 Use of library functions

*4 This method is used in the book below. This book has many points which serve as useful references to the implementation of compiler systems especially.

P. J. Plauger "The Standard C Library", 1992, Prentice Hall

*5 In the GNU glibc system, other standard headers such as <stddef.h> are read in by a standard header itself multiple times. However, what is defined at that time seems to be only the name in the range reserved. Although this is not against Standards, it is not a good method as it loses the readability of standard headers and it makes the maintenance difficult. It is better to use the file such as <sys/_defs.h>.

*6 Refer to 2.3 and 3.4.14.

5.1.2. <assert.h>

Next, we will look at each standard header. From what I see the standard headers attached to some implementations, the ones with most problems seem to be <assert.h> and <limits.h>. Although these 2 are the most easy headers, they tend to have errors in the implementation since they are newly defined as specifications in Standard C. The usage for these 2 is covered a little here.

At first, it is <assert.h>. *1, *2

Different from other standard headers, including this file many times is not the same. Depending on the NDEBUG is defined by a user changes the results every time the file is included. In other words, as needed, this header is used as below.

#undef      NDEBUG
#include    <assert.h>
    assert( ...);

And, starting with area where debugging is complete, it becomes below.

#define     NDEBUG
#include    <assert.h>
    assert( ...);

If NDEBUG is defined, assert(...); disappears after macro expansion even if it remains in source (even if ... is the expression with side effects, the side effects do not occur since the expression is not evaluated.)

In order for <assert.h> to be used like this, it must not be enclosed by:

#ifndef _ASSERT_H
#define _ASSERT_H
    ...
#endif

#pragma once must not be written, either.

Also, as you can see from this, assert() is a macro and changes its definition. <assert.h> must apply #undef assert and the assert macro must be redefined according to NDEBUG.

In the assert(expression) call, when NDEBUG is not defined, nothing happens if the expression is true. If it is false, that is reported in the standard error output. This report displays the expression as is (not expanded even if there is a macro) and also the file name of the source and the line number. This can be easily implemented as long as the # operator and the __FILE__ and __LINE__ macros are correctly implemented.

In reality, some of the old implementations do not implement the # operator correctly or do not implement <assert.h> correctly. There are many samples in this Validation Suite which includes <assert.h>, testing the preprocessor itself cannot be correctly performed if <assert.h> is not written correctly. Since it is easy to write <assert.h> correctly, it is better to rewrite the ones that are not right among the files in an implementation. The following is an example from C89 Rationale 4.2.1.1. In this as well, the correct result cannot be obtained if the # operator is not correctly implemented. However, it is a preprocessor problem and cannot be helped.

#undef  assert
#ifndef NDEBUG
#   define  assert( ignore)     ((void) 0)
#else
extern void __gripe( char *_Expr, char *_File, int _Line);
#   define  assert( expr)   \\
    ((expr) ? (void)0 : __gripe( #expr, __FILE__, __LINE__))
#endif

The __gripe() function can be written as below (the name, __gripe, can be anything as long as it starts with '_'.)

#include    <stdio.h>
#include    <stdlib.h>

void    __gripe( char *_Expr, char *_File, int _Line)
{
    fprintf( stderr, "Assertion failed: %s, file %s, line %d\n",
        _Expr, _File, _Line);
    abort();
}

Some implementations write fprintf(), fputs(), or abort() directly in <assert.h> without using __gripe(). That is also acceptable, however, it requires declarations for these functions. The FILE and stderr declarations are also necessary. However, it is quite complicated since <stdio.h> cannot be included. There will be no mistake if a separate function is implemented.

This is not so significant, but a duplicate string literal is generated every call in case all are implemented by macros. If implementations do not perform optimization by merging duplicate string literals into one, this is not wise in terms of the code size.

Note:

*1 C90 7.2 Diagnostics <assert.h>
   C99 7.2 Diagnostics <assert.h>

*2 Starting C99, the assert() macro started displaying from which function a macro was called. The internal identifier, __func__, is defined for this type of purpose.

5.1.3. <limits.h>

This standard header is where macros representing the range of the integer type and others are written. These macros must be written so that their values match specifications and also the following conditions must be met. *1

  1. Must be an integer constant expression which can be used in the #if directive.

  2. Must be the expression of the same type as the object of the corresponding type after integer promotion.

There are implementations that use cast. We discussed that sizeof and cast in the #if expression are not in the range of Standard C in 5.1. First of all, the meaning that <limits.h> was newly specified is in that a preprocessor does not have to perform query regarding the execution environment such as cast and sizeof.

For example, instead of

#if (int)0x8000 < 0

and

#if sizeof (int) < 4

the following is used:

#include    <limits.h>
#define VALMAX  ...
#if INT_MAX < VALMAX

In #if, cast and sizeof are not necessary if <limits.h> macros are used.

Examples where the <limits.h> macros are wrong in the type can be seen from time to time. Those do not come from the preprocessor specification, but it seems that the person writing <limits.h> forgets 2 above and integer promotion, the usual arithmetic conversion rule, or the evaluation rule for integer constant tokens.

For example, there is a definition as below.

#define UCHAR_MAX   255U

The unsigned char values are all in the int range (if CHAR_BIT is 8) and the data object values in the unsigned char type becomes int by integer promotion. Therefore, UCHAR_MAX also must be evaluated as int. However, it becomes unsigned int in 255U. This must be:

#define UCHAR_MAX   255

Although either way does not seem to have any issues in practice, it is not necessarily so. Operations including unsigned type cause "usual arithmetic conversion" and force the conversion from signed type to unsigned of the same size. Therefore, the result of value comparison varies.

This is easy to see in the following:

assert( -255 < UCHAR_MAX);

This mistake is related to the circumstance that the integer promotion and usual arithmetic conversion rules were changed in Standard C from the ones adopted in many conventional implementations. The unsigned char, unsigned short, and unsigned long types were not in K&R 1st, but were implemented in many implementations later. In addition, in most of those implementations, unsigned was always converted into unsigned.

In the integer promotion in Standard C, however, unsigned char and unsigned short are promoted into int as long as all values stay in the int range and they are promoted into unsigned int otherwise. Also, in the usual arithmetic conversion between unsigned int and long, all values of unsigned int are converted into long if they are in the long range and into unsigned long otherwise. This is called the change from "unsigned preserving rules" to "value preserving rules." The reason for the specification is that this is supposed to be more predictable intuitively. A caution is necessary for this rule in <limits.h>. *2

In all examples below, short is 16 bit and long is 32 bit. The value of USHRT_MAX is 65535, but how to write depends on if int is 16 bit or 32 bit.

#define USHRT_MAX   65535U      /* if int is 16 bit   */
#define USHRT_MAX   65535       /* if int is 32 bit   */

Since unsigned short is not in the int range if int is 16 bit, it is promoted into unsigned int. Therefore, USHRT_MAX also must be evaluated as unsigned int. In 65535, it is evaluated as long. The suffix, 'U', is necessary. On the other hand, since unsigned short values are all in the int range if int is 32 bit, they are promoted into int. Therefore, USHRT_MAX also must be evaluated as int. 'U' must not be attached. However, there is an example opposite of this.

#define USHRT_MAX   0xFFFF

In this example, correct evaluation will be performed whether int is 16 bit or 32 bit. In Standard C, octal or hexadecimal integer constant tokens without U, u, L, and l suffix are evaluated in the type which can express the value non-negative in the order of int, unsigned int, long, and unsigned long. In other words, 0xFFFF is evaluated as 65535 of unsigned int if int is 16 bit and 65535 of int if int is 32 bit. On the other hand, decimal integer tokens without a suffix are evaluated in the order of int, long, and unsigned long. 65535 is evaluated as long if int is 16 bit and as int if int is 32 bit. *3

C99 added long long/unsigned long long. It also added the _Bool type which has only the 0 or 1 value. Other types of integers became implementable as well. Rules for integer promotion were extended and the integer constant tokens that cannot be expressed as unsigned long are evaluated as long long/unsigned long long.

In accordance with the increased integer types and the acceptance of the implementation-defined integer types, the size relations of types became confusing. Therefore, the concept of integer conversion rank was introduced. This concept is a little complex, but there is no need to worry in practice. In standard integer types, the size relations of the rank are as below.

long long > long > int > short > char > _Bool

Here, the point is that the rank size for the implementations of the same size, for example, long and int which are both 32 bit, are distinguished. *4, *5

Note:

*1 C90 5.2.4.2.1 Sizes of integral types <limits.h>
   C99 5.2.4.2.1 Sizes of integer types <limits.h>

*2 C90 6.2.1 Arithmetic operands
   C99 6.3.1 Arithmetic operands

*3 C90 6.1.3.2 Integer constants
   C99 6.4.4.1 Integer constants

*4 C99 6.4.4.1 Integer constants

*5 C99 added standard headers called <stdint.h> and <inttypes.h> in order to absorb the differences in integer types by implementations. These typedef some type names other than the long and short names since the number of integer types increased due to the arrival of 64 bit systems and the corresponding relations became confusing. However, there are 26 kinds of these type names, 42 kinds of macros representing the maximum and minimum values corresponding to these, 56 kinds of macros converted into the format specifier of corresponding fprintf(), and 56 kinds of macros converted into the format specifier of fscanf() similarly. Although there is no much load on implementations, too much complexity gives the impression of terminal symptoms.

5.1.3.1. INT_MIN

Among all macros in <limits.h>, the most confusing ones are INT_MIN and LONG_MIN in the system with the internal representation of 2's complement. Especially, the INT_MIN in the implementation where int is 16 bit and long is 32 bit shows all the problems above. These are specially covered in separate sections.

In this case, it is understood that the range of int is [-32768,32767]. Additionally, there are no problems by having INT_MAX as 32767 or 0x7FFF in any implementation. However, I see an example where INT_MIN is defined as below.

#define INT_MIN     (-32767)

Why is this type of definition different from the reality?

On the other hand, there are no implementations with this type of definition, as might be expected.

#define INT_MIN     (-32768)

-32768 consists of 2 tokens, - and 32768. And, 32768 is not in the range which can be expressed in int. So, this is evaluated as long. Therefore, -32768 becomes the meaning of - (long) 32768.

Some make a definition like this:

#define INT_MIN     ((int)0x8000)

No comment is repeated for the definition using cast. It is also invalid since 0x8000 only becomes the meaning of (unsigned) 32768.

Then, how can the definition be in order to make an evaluation as (int) -32768 without casting?

#define INT_MIN     (-32767-1)

This is fine. 32767 can be INT_MAX or 0x7FFF. This definition has a subtraction operation, but it is not an issue (unary - is an operator in the first place.) *1, *2

#define INT_MIN     (~INT_MAX)
#define INT_MIN     (1<<15)

These are also correct definitions.

#define INT_MIN     (-32767)

I can imagine that this gave up defining a correct value since the idea of operation did not occur.

Then, is the definition of -32767 wrong or correct?

The bottom line is that this is wrong.

INT_MIN is defined as a macro representing the minimum value of int. If INT_MIN is -32767, what does this mean? And, what is INT_MIN-1 at all? Or, what are ~INT_MAX and 1<<15?

Regarding the INT_MIN-1 in this case, there seems to be thought of as the bit pattern representing out of range such as "NaN" in floating point operation.

However, compared with the Standard C specification regarding integer type, this interpretation has no basis. First, the result of bit operations on integer types is undefined in case the value of op2 is negative or the number of bit for op1 type and above where op1 << op2 or op1 >> op2, and not undefined, returning all unique values of integer type, otherwise. The result of ~op is int if op is int and the results of op1 & op2, op1 | op2, op1 << op2, and op1 >> op2 are int if both op1 and op2 are int. Therefore, the results of ~INT_MAX and 1<<15 are both int. You may think 1<<15 will overflow, but it is not so. Since the bit operation returns the value corresponding to the bit pattern as result of the bit operation, overflow cannot occur.

In C, the integer type operations are defined well in general. There are extremely few undefined areas. Especially, the relationship between a bit pattern and a value corresponds one-on-one completely except when 2 bit patterns exist for 0 in the internal representations of 1's complement and sign+absolute value. This is consistent from K&R 1st to Standard C. C has no way to write a bit pattern itself and "Not-a-Number" can be written only as (-32767-1) etc. This is an int value itself as you can see. C89 Rationale mentions some grounds and made clear there is no room for bit patterns representing an "invalid integer" or "illegal integer" in the integer type. *3, *4

In the internal representation of 2's complement, ~INT_MAX is the value of INT_MIN and I must say that the definition bigger than that is wrong.

Note:

*1 I saw this definition in "The Standard C Library" by P. J. Plauger for the first time. This style of limits.h is getting popular in recent implementations.

However, limits.h in this book also contains a mistake. The definitions for the compiler system with 16 bit int and 32 bit long are as below.

    #define UINT_MAX    65535
    #define USHRT_MAX   65535

These will evaluate to long. The correct definitions are:

    #define UINT_MAX    65535U
    #define USHRT_MAX   65535U

*2 In recent compiler systems, *_MIN is typically defined in the form of (-*_MAX - 1) and there are few mistakes though they are still found occasionally. Vc7/include/limits.h and Vc7/crt/src/include/limits.h in Visual C++ 2003 contains:

#define LLONG_MIN   0x8000000000000000

0x8000000000000000 evaluates to unsigned long long. Since this type has the highest rank, the result of integer promotion has the same type. It never becomes a negative value. Therefore,

#if LLONG_MAX > LLONG_MIN

does not turn out as expected.

LLONG_MIN in include/limits.h of LCC-Win32 2003-08, 2006-03 is as below.

#define LLONG_MIN   -9223372036854775808LL

9223372036854775808LL is a violation of constraints as this token value overflows the range of signed long long. If LLONG_MIN is defined as:

#define LLONG_MIN   -9223372036854775808LLU

9223372036854775808LLU becomes unsigned long long. Using the unary - operator on an unsigned type does not change the result type, however, the result becomes a value which cannot be expressed in unsigned long long and ends up undefined.

In Visual C++ 2003 and LCC-Win32, all other *_MIN definitions are (-*_MAX - 1), but why is only LLONG_MIN wrong? If it is defined as below, there will be no problem.

#define LLONG_MIN   (-LLONG_MAX - 1LL)

In Visual C++ 2005, this definition was revised correctly.

*3 C89 Rationale 3.1.2.5 Types
   C99 Rationale 6.2.6.2 Integer types

*4 In C99, the handling of the specific bit pattern as "trap representation" which causes an exception is allowed in implementations.

I do not know what sort of implementations fall under this specification in reality.

5.1.4. <iso646.h>

ISO C 9899:1990/ Amendment 1 added the standard header called iso646.h. This provides the operators including &, |, ~, ^, or ! with the replacement spelling expressed only in invariant character set in ISO 646. Replacement spelling is provided for |, ~, and ^ in trigraphs as well, however, trigraphs lack in readability. Alternatively, iso646.h defines 11 types of operators in macros in the token unit.

This implementation is very easy and the following example is enough. Since macro expansion is performed in preprocessing, there is no trouble for implementations. *1

/* iso646.h     ISO 9899:1990 / Amendment 1 */

#ifndef _ISO646_H
#define _ISO646_H

#define and     &&
#define and_eq  &=
#define bitand  &
#define bitor   |
#define compl   ~
#define not     !
#define not_eq  !=
#define or      ||
#define or_eq   |=
#define xor     ^
#define xor_eq  ^=

#endif

Note:

*1 In the C++ Standard, these identifier-like operators are specified as operator-tokens rather than macros. This is a troublesome and meaningless specification for implementations.


6. Preprocessor Test Results

6.1. Preprocessors Tested

Compiler systems tested and execution methods are as below. Compiler systems are sorted in the order of release time.

Runtime options slightly vary in each of C95 (C90), C99, and C++98.

If there are problems in <assert.h> and <limits.h>, testing was done after correctly rewriting them.

Number: OS          / Compiler System       / Execution program (version)
    Runtime option
    Comment

1   :   Linux       /                       / DECUS cpp
    C95:    cpp
DECUS cpp original version by Martin Minow (June 1985.) It was ported to some systems such as various DEC systems, UNIX, and MS-DOS at that time, but what used in this test was modified by kmatsui and compiled on Linux / GCC. Macros were rewritten so that translation limits clear as many specifications as possible.
2   :   FreeBSD 2.2.7   / GCC V.2.7.2.1     / cpp (V.2.0)
    GO32            / DJGPP V.1.12          / cpp (V.2.0)
    WIN32           / BC 4.0                / cpp (V.2.0)
    MS-DOS          / BC 4.0, TC 2.0        / cpp (V.2.0)
    MS-DOS          / LSI C-86 V.3.3        / cpp (V.2.0)
    OS-9/6x09       / Microware C/09        / cpp (V.2.0)
    C95:    cpp -23 (-S1 -S199409L) -W15
            gcc -ansi -Wp,-2,-W15
    C99:    cpp -23 (-S1) -S199901L -W15
    C++:    cpp -23+ -S199711L -W15
Open-source-software by kmatsui (August, 1998.) Called mcpp. Rewrite of DECUS cpp. I have compiled with GCC on Linux and used the executable for this test.
3   :   WIN32       / Borland C++ V.5.5J    / cpp32 (August, 2000)
    C95:    cpp32 -A -w
            bcc32 -A -w
    C99:    cpp32 -A -w
    C++:    cpp32 -A -w
Trigraphs are not processed by cpp32 nor bcc32. Instead, a conversion program called trigraph.exe is provided. It just set up an alibi called "Standard conformance." In Borland C, I used this program to convert trigraphs in advance to test (lenient testing.) This trigraph.exe, however, processes even line splicing by <backslash><newline>. Therefore, the line number is out of alignment (deduct scores in q.1.2.)
4   :   Linux, CygWIN   / GCC V.2.95.3 (March, 2001)    / cpp0
    C95:    cpp0 -D__STRICT_ANSI__ -std=c89 -$ -pedantic -Wall
            gcc -ansi -pedantic -Wall
    C99:    cpp0 -std=c9x -$ -Wall
    C++:    g++ -E -trigraphs -$ -Wall
Since GCC is portable source, the person who ported it should prepare the specification for what has been ported to a specific system. However, no such document is provided. Only GNU cpp.info exists as a cpp document.
5   :  Linux        / GCC V.3.2 (August, 2002)  / cpp0
    C95:    cpp0 -D__STRICT_ANSI__  -std=iso9899:199409 -$ -pedantic
                                                            -Wall
            gcc -std=iso9899:199409 -pedantic -Wall
    C99:    cpp0 -std=c99 -$ -Wall
    C++:    g++ -E -trigraphs -$ -Wall
Compiled from the source by kmatsui. Configured with --enable-c-mbchar option.
6   :   Linux       /                       / ucpp (V.1.3)
    C95:    ucpp -wa -c90
    C99:    ucpp -wa
Open-source-software by Thomas Pornin (January, 2003.) A portable compiler-independent preprocessor. I compiled it on Linux by GCC.
7   :   WIN32       / Visual C++ 2003       / cl
    C95:    cl -Za -E -Wall -Tc
    C99:    cl -E -Wall -Tc
    C++:    cl -E -Wall -Tp
Since the -E option does not process comments and <backslash><newline> properly, a compilation testing is used together (April, 2003.)
8   :   WIN32       / LCC-Win32 2003-08     / lcc
    C95:    lcc -A -E
            lcc -A
    C99:    lcc -A -E
    C++:    lcc -A -E
An integrated development environment which Jacob Navia wrote based on open-source-software by C. W. Fraser & Dave Hanson (August, 2003.) The preprocessing part is based on source originally written for Plan9 by Dennis Ritchie.
9   :   WIN32, Linux, etc.  /                   / wave (V.1.0)
    C95:    wave
    C99:    wave --c99
    C++:    wave
Open-source-software by Hartmut Kaiser (January, 2004.) A portable compiler-independent preprocessor. Implemented using the C++ library called "Boost preprocessor library" by Paul Mensonides et al. Used a binary on Windows made by the author of wave.
10 :    FreeBSD, Linux, CygWIN   / GCC 2.95, 3.2
    WIN32, MS-DOS   / Visual C 2003, BCC, etc.  / mcpp_std (V.2.4)
    C95:    mcpp_std -23 (-S1 -V199409L) -W31
            gcc -ansi -Wp,-2,-W31
    C99:    mcpp_std -23 (-S1) -V199901L -W31
    C++:    mcpp_std -23+ -V199711L -W31
mcpp V.2.4 (February, 2004), in Standard mode. Compiled with Linux / GCC.
11  :    Linux      / GCC V.3.4.3 (November, 2004)  / cc1, cc1plus
    C95:    gcc -E -std=iso9899:199409 -pedantic -Wall
    C99:    gcc -E -std=c99 -$ -Wall
    C++:    g++ -E -std=c++98 -$ -Wall
12 :   WIN32        / Visual C++ 2005       / cl
    C95:    cl -Za -E -Wall -Tc
    C99:    cl -E -Wall -Tc
    C++:    cl -E -Wall -Tp
Since the -E option does not process comments and <backslash><newline> properly, a compilation testing is used together. (September, 2005.)
13 :    WIN32       / LCC-Win32 2006-03     / lcc
    C95:    lcc -A -E
            lcc -A
    C99:    lcc -A -E
    C++:    lcc -A -E
LCC-Win32 2006-03 (March, 2006.)
14 :    Linux       / GCC V.4.1.1 (May, 2006) / cc1, cc1plus
    C95:    gcc -E -std=iso9899:199409 -pedantic -Wall
    C99:    gcc -E -std=c99 -$ -Wall
    C++:    g++ -E -std=c++98 -$ -Wall

15 :   WIN32        / Visual C++ 2008       / cl
    C95:    cl -Za -E -Wall -Tc
    C99:    cl -E -Wall -Tc
    C++:    cl -E -Wall -Tp
Since the -E option does not process comments and <backslash><newline> properly, a compilation testing is used together. (December, 2007.)
16: Linux, WIN32, etc.  /                       / wave (V.2.0)
    C95:    wave (--c99)
    C99:    wave --c99
    C++:    wave
wave V.2.0 (2008/08) Compiled by kmatsui on Linux/GCC and Windows/Visual C++ from the source contained in Boost C++ Library V.1.36.0 with its default settings. Used with configuration files for header files of GCC and Visual C++.
17: FreeBSD, Linux, Mac OS X, CygWIN, MinGW / GCC 2.95-4.1
    WIN32  / Visual C 2003-2008, BCC, LCC-Win32     / mcpp (V.2.7.2)
    C95:    mcpp -23 (-S1 -V199409L) -W31
            gcc -ansi -Wp,-2,-W31,-fno-dollars-in-identifiers
    C99:    mcpp -23 (-S1) -V199901L -W31
    C++:    mcpp -23+ -V199711L -W31
mcpp V.2.7.2 (2008/11)

6.2. Lists of Marks

                D   M   B   G   G   u   V   L   W   M   G   V   L   G   V   W   M
                E   C   C   C   C   c   C   C   a   C   C   C   C   C   C   A   C
                C   P   C   C   C   p   2   C   v   P   C   2   C   C   2   V   P
                U   P   5   2   3   p   0   0   e   P   3   0   0   4   0   E   P
                S   2   5   9   2   1   0   3   1   2   4   0   6   1   0   2   2
                C   0   C   5       3   3   0   0   4   3   5   0   1   8   0   7
                P       P   3               8                   3               2
                P       P                                                   

        max     1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17

[K&R: Processing of sources conforming to K&R and C90] (31 items)
n.2.1     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.2.2     2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.2.3     2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.6.1    10    10  10  10  10  10  10  10  10   4  10  10  10  10  10  10  10  10
n.7.2     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.10.2    6     0   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.12.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.12.4    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.12.5    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.12.7    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.13.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.13.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.13.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.13.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.13.7    6     6   6   4   6   6   6   4   6   0   6   6   4   4   6   4   6   6
n.13.8    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.13.9    2     2   2   2   2   2   2   0   2   0   2   2   0   2   2   0   2   2
n.13.10   2     2   2   2   2   2   2   0   0   2   2   2   2   0   2   2   2   2
n.13.11   2     0   2   2   2   2   2   0   0   0   2   2   2   0   2   2   2   2
n.13.12   2     0   2   2   2   2   2   2   0   0   2   2   2   0   2   2   2   2
n.15.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.15.2    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.18.1   30    30  30  30  30  30  30  30  30  30  30  30  30  30  30  30  30  30
n.18.2   20    20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
n.18.3   10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.27.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.27.2    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.29.1   10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.32.1    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
i.32.3    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
i.35.1    2     2   2   2   2   2   2   0   0   0   2   2   0   0   2   0   1   2
stotal  166   150 166 164 166 166 166 156 158 140 166 166 160 156 166 160 165 166

[C90: Processing of strictly conforming sources] (76 items)
n.1.1     6     0   6   6   6   6   6   6   6   0   6   6   6   6   6   6   6   6
n.1.2     2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.1.3     2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.2.4     2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.2.5     2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.3.1     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.3.3     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.3.4     2     0   2   0   2   2   0   2   2   2   2   2   2   2   2   2   2   2
n.4.1     6     0   6   0   6   6   6   6   0   0   6   6   6   0   6   6   6   6
n.4.2     2     0   2   0   2   2   2   2   0   0   2   2   2   0   2   2   2   2
n.5.1     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.6.2     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.6.3     2     0   2   0   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.7.1     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.7.3     4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.8.1     8     0   8   8   8   8   8   8   8   8   8   8   8   8   8   8   2   8
n.8.2     2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.9.1    10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.10.1   10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.11.1    8     8   8   8   8   8   8   8   8   8   8   8   8   8   8   8   8   8
n.11.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.12.1    6     0   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.12.2    4     0   4   4   4   4   4   4   4   0   4   4   4   4   4   4   4   4
n.12.6    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.13.5    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.13.6    6     0   6   6   6   6   4   6   4   0   6   6   4   4   6   4   6   6
n.13.13   4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.13.14   2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.19.1    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.19.2    4     2   4   4   4   4   4   4   4   2   4   4   4   4   4   4   4   4
n.20.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.21.1    4     0   4   0   4   4   4   0   4   4   4   4   0   4   4   0   4   4
n.21.2    2     0   2   0   2   2   2   0   2   2   2   2   0   2   2   0   2   2
n.22.1    4     0   4   0   4   4   4   4   4   0   4   4   4   4   4   4   4   4
n.22.2    2     0   2   0   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.22.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   0   2
n.23.1    6     2   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.23.2    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.24.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.24.2    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.24.3    6     0   6   0   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.24.4    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.24.5    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.25.1    4     2   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.25.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.25.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.25.4    6     0   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.25.5    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.26.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.2    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.3    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.4    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.27.3    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.27.4    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   2   4
n.27.5    2     2   2   2   2   2   2   0   2   0   2   2   0   2   2   0   0   2
n.27.6    2     0   0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.28.1    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.2    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.3    4     0   4   4   4   4   2   4   4   4   4   4   4   4   4   4   4   4
n.28.4    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.5    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.6    4     0   4   0   4   4   2   0   0   4   4   4   0   0   4   0   4   4
n.28.7    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.29.2    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.30.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.32.2    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.37.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.37.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.5    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.37.6    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.7    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.8    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.9    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
stotal  286   160 284 252 286 286 278 274 272 240 286 286 272 272 286 272 274 286

[C90: Processing of implementation defined portions] (1 item)
i.32.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
stotal    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2

[C90: Diagnosing of violation of syntax rule or constraint] (50 items)
e.4.3     2     2   2   1   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.7.4     2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.12.8    2     0   2   2   2   2   2   2   0   2   2   2   2   0   2   2   2   2
e.14.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.2    4     2   4   2   4   4   2   2   4   4   4   4   4   4   4   4   4   4
e.14.3    2     2   2   2   2   2   1   2   2   2   2   2   2   2   2   2   2   2
e.14.4    2     2   2   2   2   2   1   2   2   2   2   2   2   2   2   2   2   2
e.14.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.6    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.7    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.8    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.9    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.10   4     0   4   2   0   0   0   0   0   0   4   0   0   0   0   0   4   4
e.15.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.15.4    2     2   2   1   2   2   2   1   2   2   2   2   2   2   2   2   2   2
e.15.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.16.1    2     2   2   1   2   2   2   1   2   2   2   2   2   2   2   2   2   2
e.16.2    2     2   2   1   2   2   2   1   2   2   2   2   2   2   2   2   2   2
e.17.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.17.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.17.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.17.4    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.17.5    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.17.6    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.17.7    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.5    2     2   2   2   0   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.6    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.18.7    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.8    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.18.9    2     0   2   0   2   2   2   2   0   0   2   0   2   0   2   2   0   2
e.19.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.19.4    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.19.5    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.19.6    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.19.7    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.23.3    2     0   2   2   2   2   2   2   0   0   2   2   2   0   2   2   0   2
e.23.4    2     2   2   2   2   2   2   2   0   0   2   2   2   0   2   2   0   2
e.24.6    2     2   2   2   2   2   2   2   0   0   2   2   2   0   2   2   0   2
e.25.6    4     0   4   0   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.27.7    2     0   2   2   2   2   2   0   2   2   2   2   0   2   2   0   2   2
e.29.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.29.4    2     2   2   1   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.29.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.31.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.31.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.31.3    2     2   2   0   2   2   2   1   2   2   2   2   1   2   2   1   2   2
e.32.5    2     0   2   2   2   2   0   2   0   0   2   2   2   0   2   2   2   2
e.33.2    2     0   2   0   0   2   0   2   0   0   2   2   2   0   2   2   2   2
e.35.2    2     0   2   1   2   2   0   2   0   2   2   2   2   0   2   2   2   2
stotal  112    74 112  92 104 108  98 100  92  86 112 106 105  92 108 105 104 112

[C90: Documents on implementation defined behaviors] (13 items)
d.1.1     2     0   2   0   0   2   0   0   0   0   2   2   0   0   2   0   0   2
d.1.2     4     2   4   4   4   4   0   4   0   0   4   4   4   0   4   4   2   4
d.1.3     2     0   2   0   0   2   0   0   2   2   2   2   0   0   2   0   2   2
d.1.4     4     0   4   4   4   4   0   4   4   2   4   4   4   4   4   4   2   4
d.1.5     4     2   4   4   2   4   4   4   4   4   4   2   4   4   2   4   4   4
d.1.6     2     0   2   0   0   1   0   0   0   0   2   1   0   0   1   0   0   2
d.2.1     2     0   2   2   2   2   2   0   0   0   2   2   2   0   2   2   0   2
d.2.2     2     0   2   2   0   2   0   0   0   0   2   2   2   0   2   2   0   2
d.2.3     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.2.4     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.2.5     2     0   2   0   0   0   0   2   0   0   2   0   2   0   0   2   0   2
d.2.6     2     0   2   2   0   0   0   2   0   0   2   0   2   0   0   2   0   2
d.2.7     2     0   2   2   0   2   0   2   0   0   2   2   2   0   2   2   0   2
stotal   32     4  32  20  12  23   6  18  10   8  32  21  22   8  21  22  10  32

[C90: Degree of Standard C conformance] (171 items)
mttl90  598   390 596 530 570 585 550 550 534 476 598 581 561 530 583 561 555 598

[C99: Conformance to new features] (20 items)
n.dslcom  4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.ucn1    8     0   0   0   0   6   8   2   0   2   8   6   8   0   6   8   6   8
n.ucn2    2     0   0   0   0   0   2   0   0   0   2   2   2   0   2   2   0   2
n.ppnum   4     0   4   0   4   4   4   0   0   0   4   4   0   4   4   0   0   4
n.line    2     0   2   2   2   2   2   2   0   2   2   2   2   0   2   2   2   2
n.pragma  6     0   6   0   0   6   6   0   0   2   6   6   0   0   6   0   2   6
n.llong  10     0   0   0  10  10   8  10   0   0  10  10  10   0  10  10  10  10
n.vargs  10     0  10   0  10  10  10   0   0  10  10  10  10   2  10  10  10  10
n.stdmac  4     0   2   0   0   4   4   0   0   4   4   4   0   0   4   0   4   4
n.nularg  6     0   6   0   6   6   6   2   0   6   6   6   2   0   6   2   6   6
n.tlimit 18     0  18  14  18  18  17  18  14  18  18  18  18  12  18  18  16  18
e.ucn     4     0   0   0   0   0   2   0   0   2   4   0   2   0   0   2   2   4
e.intmax  2     0   0   0   2   2   2   0   0   0   2   1   0   0   1   0   2   2
e.pragma  2     0   2   0   0   2   2   0   0   2   2   2   0   0   2   0   2   2
e.vargs1  2     0   0   0   0   2   1   0   0   1   2   2   0   0   2   0   2   2
e.vargs2  2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.pragma  2     0   2   0   0   2   2   2   0   0   2   2   2   0   2   2   2   2
d.predef  6     0   0   0   0   6   6   0   0   0   6   6   0   0   6   0   0   6
d.ucn     2     0   0   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.mbiden  2     0   0   0   0   2   2   1   0   0   2   2   1   0   2   1   0   2
mttl99   98     0  58  20  56  86  88  41  18  53  98  87  61  22  87  61  70  98

[C++: Conformance to new features not in C90] (9 items)
n.dslcom  4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.ucn1    4     0   0   0   0   4   4   2   0   2   4   4   2   0   4   2   2   4
n.cnvucn  4     0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0
n.bool    2     0   0   0   0   2   0   0   0   2   2   2   0   0   2   0   0   2
n.token1  2     0   2   0   0   2   0   0   2   2   2   2   0   2   2   0   2   2
n.token2  2     0   0   0   0   2   0   2   0   2   2   2   2   0   2   2   2   2
n.cplus   4     0   2   2   2   2   0   4   0   4   4   2   4   0   2   4   4   4
e.operat  2     0   0   0   0   2   0   0   0   2   2   2   0   0   2   0   2   2
d.tlimit  2     0   2   0   0   2   0   1   0   0   2   2   1   0   2   1   0   2
mttl++   26     0  10   6   6  20   9  13   6  18  22  20  13   6  20  13  16  22

[C90: Qualities / 1 : handling of multibyte character] (1 item)
m.36.2    7     0   2   2   0   0   0   4   0   0   7   5   2   0   5   2   0   7
stotal    7     0   2   2   0   0   0   4   0   0   7   5   2   0   5   2   0   7

[C90: Qualities / 2 : diagnosis of undefined behaviors] (29 items)
u.1.1     1     0   1   0   1   1   0   0   0   1   1   1   0   0   1   0   1   1
u.1.2     1     0   1   0   1   1   0   1   0   1   1   1   0   0   1   0   1   1
u.1.3     1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.4     1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.5     1     1   1   1   1   1   1   1   1   0   1   1   1   1   1   1   1   1
u.1.6     1     0   1   0   1   1   0   0   1   0   1   1   0   1   1   0   0   1
u.1.7     9     0   1   0   0   0   0   0   0   0   6   6   0   0   6   0   0   9
u.1.8     1     1   1   0   1   1   0   0   0   0   1   0   0   1   0   0   0   1
u.1.9     1     1   1   0   1   1   1   0   1   0   1   0   0   1   0   0   0   1
u.1.10    1     1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.11    1     1   1   1   0   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.12    1     1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.13    1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.14    1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.15    1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.16    1     0   1   1   1   1   1   1   1   0   1   1   1   1   1   1   1   1
u.1.17    2     0   2   0   1   1   0   0   1   0   2   1   0   1   1   0   1   2
u.1.18    1     0   1   0   1   1   1   0   0   0   1   1   0   0   1   0   1   1
u.1.19    2     0   2   0   0   1   1   0   0   1   2   1   0   0   1   0   1   2
u.1.20    1     0   1   1   1   1   1   1   0   1   1   1   1   1   1   1   1   1
u.1.21    2     0   2   1   0   1   2   2   2   2   2   1   2   2   1   2   2   2
u.1.22    1     0   1   0   0   1   1   0   1   1   1   1   0   1   1   0   1   1
u.1.23    1     1   1   0   1   0   0   1   1   0   1   0   1   1   0   1   0   1
u.1.24    2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   2   2
u.1.25    1     0   1   0   0   1   0   0   0   0   1   1   0   0   1   0   1   1
u.1.27    1     1   1   1   0   1   1   1   1   0   1   1   1   1   1   1   1   1
u.1.28    1     1   1   1   0   1   1   1   1   0   1   1   1   1   1   1   1   1
u.2.1     1     1   1   1   1   1   0   1   0   1   1   1   1   0   1   1   1   1
u.2.2     1     0   1   1   0   1   1   0   0   0   1   1   0   0   1   0   0   1
stotal   41    10  33  16  19  26  20  18  19  16  38  30  17  21  30  17  25  41

[C90: Qualities / 3 : Diagnosis of unspecified behaviors] (2 items)
s.1.1     2     0   2   0   0   0   2   0   0   0   2   0   0   0   0   0   0   2
s.1.2     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
stotal    4     0   4   0   0   0   2   0   0   0   4   0   0   0   0   0   0   4

[C90: Qualities / 4 : Diagnosis of suspicious cases] (12 items)
w.1.1     4     4   4   0   4   4   0   0   0   0   4   4   0   0   4   0   0   4
w.1.2     4     0   4   0   0   0   0   0   0   2   4   0   0   0   0   0   2   4
w.2.1     2     0   2   1   0   0   0   0   0   0   2   2   0   0   2   0   0   2
w.2.2     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.1     1     1   1   0   0   0   0   0   0   0   1   0   0   1   0   0   0   1
w.3.3     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.4     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.5     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.6     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.7     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.8     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.9     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
stotal   19     5  19   1   4   4   0   0   0   2  19   6   0   1   6   0   2  19

[C90: Qualities / 5 : Other features] (17 items)
q.1.1     9     0   9   6   9   9   8   7   4   9   9   9   7   5   9   7   8   9
q.1.2    10     6  10   4   8  10   4   4   4   4  10  10   4   4  10   4   4  10
q.1.3     4     4   4   2   4   4   4   4   4   4   4   4   4   4   4   4   4   4
q.1.4    20    10  20  10  20  20  20  10  20  10  20  20  10  20  20  10  10  20
q.2.1     4     2   4   2   4   4   4   4   2   4   4   4   4   2   4   4   4   4
q.2.2     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
q.2.3     2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
q.2.4     2     2   2   0   2   2   0   0   0   0   2   2   0   0   2   0   0   2
q.2.5     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
q.2.6     4     0   4   2   4   4   2   4   2   0   4   4   4   2   4   4   0   4
q.2.7    10     4   6   4   8   8   4   4   4   2   8   8   4   4   8   4   4   8
q.2.8    10     0   6   2   2   2   0   6   4   4   8   2   6   4   2   6   4   8
q.2.9     6     2   2   0   2   2   0   0   0   2   2   2   0   0   2   0   2   4
q.3.1    20    10   8   8  14  12   8  10  10   6   8  12  10  10  12  10   6   8
q.3.2    20    20  20  18  16  16  18  16  18  14  18  14  14  18  12  14  12  16
q.3.3    20    10  14   0  10  12   8   0   0   8  14  12   0   0  12   0  10  16
q.4.1    10     2   6   6   4   6   2   4   6   4   4   6   4   6   6   4   4   8
stotal  157    78 123  70 113 117  88  79  84  77 123 115  77  85 113  77  78 129

[C90: Qualities] (61 items)
mttl90  228    93 181  89 136 147 110 101 103  95 191 156  96 107 154  96 105 200

[C99: Qualities of new features] (3 items)
u.line    2     0   2   0   1   1   0   0   0   0   2   1   0   0   1   0   2   2
u.concat  1     0   1   0   0   1   0   0   0   0   1   1   0   0   1   0   0   1
w.tlimit  8     0   8   0   0   0   3   2   0   0   8   0   2   0   0   2   0   8
mttl99   11     0  11   0   1   2   3   2   0   0  11   2   2   0   2   2   2  11

[C++: Qualities of features not in C90] (1 item)
u.cplus   1     0   1   1   0   0   0   1   0   1   1   0   1   0   0   1   1   1
mttl++    1     0   1   1   0   0   0   1   0   1   1   0   1   0   0   1   1   1

[Overall] (265 items)
gtotal  962   483 857 646 769 840 760 708 661 643 921 846 734 665 846 734 749 930

                D   M   B   G   G   u   V   L   W   M   G   V   L   G   V   W   M
                E   C   C   C   C   c   C   C   a   C   C   C   C   C   C   A   C
                C   P   C   C   C   p   2   C   v   P   C   2   C   C   2   V   P
                U   P   5   2   3   p   0   0   e   P   3   0   0   4   0   E   P
                S   2   5   9   2   1   0   3   1   2   4   0   6   1   0   2   2
                C   0   C   5       3   3   0   0   4   3   5   0   1   8   0   7
                P       P   3               8                   3               2
                P       P                                                   

        max     1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17

6.3. Characteristics of Each Preprocessor

1 : Linux / / DECUS cpp

This was written around the early stage of ANSI draft and the Standard conformance level is low by now. Diagnostic messages are adequate, however, there is almost no documentation. It is a well-structured stable program.

The portability of source is high and it has been ported to some compiler systems. The source code is easy to read as if reading a textbook and you can learn a lot from by just reading it. I modeled mcpp after this source.

3 : WIN32 / Borland C++ V.5.5J / cpp32

The C90 conformance level is relatively high and troublesome shift-JIS is respectably supported. Documents are well provided. Although e_* usually issues diagnostic messages, most of them are hasty and the quality is not good.

"Quality other than Standards" is poor and there are no special extension features. Not many diagnostic messages are issued for undefined parts and the program runs away sometimes. Supporting Standards only seems to be the best it could do.

Different from Turbo C, the speed is no longer fast. Merits in one-pass compiler seem to have disappeared and only demerits seem to have remained. I wonder how long Borland continue this style.

4 : Linux, CygWIN / GCC V.2.95.3 / cpp0

The C90 and C95 Standard conformance level is quite high and diagnostic messages are accurate. The behavior is near stable and the speed is extremely fast. There are plentiful options which are almost too abundant. mcpp also modeled after some of those options.

Though there were a few painful bugs in older versions, V.2.95 has almost no bugs.

The remaining issues are that new specifications in C99 and C++98 have not been implemented, there are not enough diagnostic messages, documentation is lacking, there are many extension features against Standards which do not use #pragma, that many obsolete pre-Standard specifications are hidden, and that multi-byte character encoding support is half-finished and does not reach practical level.

The cpp.info document is excellent as the explanation of overall GCC/cpp and Standard C preprocessing. However, it is really too bad that documentation for implementation-defined areas do not exist in CygWIN, FreeBSD, or Linux. "Portability" is not only for programs.

The source is a full of patches and difficult to read, and the program structure is still dragging old macro processor structure. However, since overall GCC compiler systems are good, this is ported to many systems.

5 : Linux / GCC V.3.2 / cpp0

GCC V.3 changed the source for preprocessing completely from V.2. At the same time, it changed documentations completely. Token-based principles are fully enforced, warnings are issued while allowing pre-Standard specifications, and the number of undocumented specifications decreased. On the whole, it has improved to the direction I had hoped for to a large extent. I suspect that future improvements will be easier since the program structure has changed completely.

Diagnostic messages, documentations, C99 support, multi-byte character support are not enough yet. The speed is slightly slower than V.2, but it is still one of the faster ones.

However, it is troublesome that header files became complex and setting the search order of include directories is getting complicated. Also, while old options are no longer necessary, many new options are introduced and it is taking forever for options to get organized. It is unfortunate that the internal interface between preprocessing and compilation parts is complicated for some reasons although preprocessing become combined with the compiler proper in V.3.

6 : Linux / / ucpp (V.1.3)

The characteristics are the support for C99, open source, and portable. The Standard conformance level is rather high. This version is supposed to support UCN and UTF-8, but the support is insufficient. The diagnostic messages are somewhat poor. Documentation is not sufficient, either.

7 : WIN32 / Visual C++ 2003 / cl
12 : WIN32 / Visual C++ 2005 / cl
15 : WIN32 / Visual C++ 2008 / cl

Though in 2003 few C99 specifications are implemented, more than half of them are implemented in 2005. There remain, however, some bugs regarding the specifications for C90 and prior. The most fundamental problem is confusion in the translation phases. The upgrades must have been rework of some very old source code.

The diagnostic messages are often somewhat off the point. An error often terminates the preprocessing which makes this software bothersome to use. Updating of the manuals is sometimes far behind the implementation.

The merits are large translation limits and a relatively large number of #pragma. #pragma setlocale in particular is useful. However, it is problematic that the #pragma line is macro-expanded even in C90 but that #pragma sub-directive uses user's name space.

2008 is almost the same with 2005 as for preprocessing. The only difference is implementation of __pragma() operator which is a substitute of _Pragma() of C99. The system headers used by Visual C++ have had only a few problems on the whole up to 2005. On 2008, however, number of macros with '$' suddenly increased for some reason.

8 : WIN32 / LCC-Win32 2003-08 / lcc
13 : WIN32 / LCC-Win32 2006-03 / lcc

Jacob Navia modified the preprocessing part of the source code for Plan9 by Dennis Ritchie, but this lacks in debugging and there are quite a number of bugs in the #if expression evaluation and others. The specifications since C95 are not supported. Lack of documentation.

There are few differences of preprocessing between 2003-08 and 2006-03.

9 : WIN32, Linux, etc. / / wave (V.1.0)
16: WIN32, Linux, etc. / / wave (V.2.0)

This preprocessor has been developed for "meta-programming" of C++ STL as a primary purpose. Wave has an unique construction: it is consisted of mainly C++ libraries, and its source is consisted of mainly header files. The examples of meta-programming use recursive macros heavily, and Wave expands those macros as GCC / cpp or -@compat option of mcpp, i.e. limiting the scope of "inhibition of once-replaced macro's re-replacement" narrower than the Standard's wording. (see 3.4.26.)

Wave intends also to be used as a usual preprocessor, and intends conforming to C++98 and C99. Though the degree of perfection was not high in V.1.0, it was greatly improved in V.2.0. It was reported that a lot of bugs were fixed after V.1.0 using the validation suite of mcpp. Further improvement of diagnostics and documents are still desired. Another problem is that a few mistakes are found in the author's interpretation of the Standards expressed in wave's diagnostics and its accompanying testcases.

11 : Linux / GCC V.3.4.3 / cc1, cc1plus
14 : Linux / GCC V.4.1.1 / cc1, cc1plus

The scoring is almost the same with V.3.2. However, the construction of preprocessing has changed largely. Although V.3.2 seemed to proceed in the direction to portability, GCC has changed the direction on V.3.3 and 3.4. It has become one huge and complex compiler, removing independent preprocessor, predefining many macros and restoring some old specifications which was once obsoleted by V.3.2. It is a question whether these changes can be said improvements. It has also given a privileged place to UTF-8 among many encodings of multi-byte character. I am afraid that it might narrow the wide variety of multi-lingualization.

V.4.1 has not big differences from V.3.4 as for preprocessing.

2 : FreeBSD, DJGPP, WIN32, MS-DOS, OS-9/09 / / mcpp (V.2.0)
10 : FreeBSD, Linux, CygWIN, WIN32, MS-DOS / / mcpp (V.2.4)
17 : FreeBSD, Linux, Mac OS X, CygWIN, MinGW, WIN32 / / mcpp (V.2.7.2)

Since I created and tested this myself, the conformance level is the best, of course. It should be the world's most accurate preprocessor. The plentifulness and accuracy of diagnostic messages and the detailed documentation is also the best. Useful options and #pragma directives are provided. The C99 specification is fully supported in V.2.3 and later. The portability of source is also the best.

However, there are some features still to be implemented. So I would appreciate your contribution.


6.4. Overall Review

As we test many preprocessors, we can find that nowadays many have high level of C90 Standard conformance. However, each compiler system still has many issues. I am not going to speak for mcpp since most of the items score full.

More compiler systems can process the n_* samples correctly now. GCC 2.95 and later, BC (Borland C) 5.5, LCC-Win32 2003-08 and later, Visual C++ (VC) 2003 and later, Ucpp 1.3, and Wave 2.0 have reached the level with not so many problems in practice. However, each compiler system has unexpected bugs.

The most surprising is that compiler systems including Visual C often have the division by 0 errors in n_13_7.t (n_13_7.c.) The basic specification of C, the "short-circuit evaluation" by &&, || and a ternary operator, is not handled. Borland C issues a warning in n_13_7.c and it issues only the same warning for the real division by 0 in e_14_9.c as well. In Turbo C, the real division by 0 and partial expression with skipped evaluation caused the same error while the same diagnostic message is downgraded only to warning in Borland C. This is an example of a "hasty diagnostic message" in this compiler system.

In the C90 specification, there are some with errors in the stringizing implementation using the # operator.

The specifications added by Amendment 1, Corrigendum 1 are implemented to some extent by GCC 2.95 and later, VC 2003 and later, and Ucpp.

In the C99 specification, only GCC 3.2 and later and Ucpp implements largely but not completely. The // comments has been implemented by many compiler systems for quite some time. In addition, GCC has long long, has considerable room in translation limits, and properly processes empty arguments of macros. GCC has variable argument macro of its own specification, but the one in the C99 specification is also implemented since 2.95. _Pragma() is implemented since 3.2. UCN is implemented by Ucpp and VC 2005 and later only. GCC 3.2 and later implements UCN in string literals and character constants only. Wave 2.0 implements more than half of C99 specifications.

In C++98, GCC 3.2 and later, Wave and VC 2005 and later implements most of the specifications.

The queer specification of C++98 to convert extended-characters to UCN is not yet implemented by any preprocessor.

In processing the implementation-defined area in i_*, many cannot handle wide characters in the #if expression. Though this is specified in Standards, using not only wide characters, but also character constants in the #if expression is almost meaningless and it will not hurt even if these cannot be used. This type of meaningless specification should be removed from the Standard.

Visual C supports relatively many encodings for multi-byte characters, though not enough. Other preprocessors are poor. The implementation of GCC 2.95,3.2 are half-finished and does not reach a practical level. GCC 3.4-4.1 has begun to support many encodings, by converting all encodings to UTF-8. The actual implementation is, however, not yet practical level on some encodings.

In the systems using shift-JIS or BIG-5, tokenization of literals and stringizing using the # operator requires attention. Visual C supports these well. Also BC 5.5J support shift-JIS.

In the diagnostic messages for e_*, GCC 2.95 and later are superior. Though Visual C and Ucpp issue diagnostics to comparatively many items, they are often vague or off-target. Very few preprocessors issue diagnostic messages to the overflow in the #if expression and only BC, Ucpp and GCC do to some extent.

In documents for implementation-defined areas, GCC 3.2 and later are at adequate level and the rest are all very poor.

In the diagnostics for u_*, GCC 3.2 and later is only adequate. The rest are very poor. I don't think it is acceptable for compiler systems not to do anything just because the result is undefined.

Almost no compiler systems handle s_* and w_*. It is unexpected that very few compiler systems issue even a warning for nested comments.

In "other various quality", GCC stand out with plentiful options, accurate diagnostic messages, high speed, and portability.

Overall, GCC V.3.2 and later, excels the most in the Standard conformance level, ease of use, and stability without many big problems.

Certainly, it is understood that mcpp exceeds in most aspects though only speed is inferior.

After the huge volume of testing, what I realize is the importance of test samples. mcpp is the result of creating samples and debugging in parallel. Since you cannot notice the existence of bugs without enough samples, it is anything but debugging.

If Standards come with this type of exhaustive test samples, the quality of each compiler system will be exponentially improved. Also, creating exhaustive test samples reveals the problems in Standards at the same time. Test samples are the illustration of Standards.


6.5. Test Reports and Comments

I look forward to opinions about this Validation Suite and preprocessing test reports for various compiler systems using this tool. Please use the "Open Discussion Forum" at:

http://mcpp.sourceforge.net/

or email.

If you perform the detail testing of a preprocessor, cut out the 6.2 score table and send it. To calculate the total score, please compile and use tool/total.c. The score table is cpp_test.old and if

total 18 cpp_test.old cpp_test.new

each field of stotal (sub-total), mtotal (mid-total), and gtotal (grand-total) is written and output to cpp_test.new. Specify the compiler system number at "18".

You can test automatically GCC by the testsuite edition of Validation Suite. I am waiting for the test reports on various versions of GCC. Please send me the log files (gcc.sum and gcc.log), and I will supplement my testsuite edition with the diagnostics of various versions if any differences exist.

Also, the development of Validation Suite and mcpp are in progress in the mcpp project above in SourceForge. Please send me email if you would like to join the development.

mcpp-2.7.2/doc/mcpp-summary.pdf0000644000175000017500000051505311114175165013307 00000000000000%PDF-1.4 % 98 0 obj << /Linearized 1 /O 100 /H [ 1361 706 ] /L 170539 /E 43794 /N 16 /T 168461 >> endobj xref 98 46 0000000016 00000 n 0000001268 00000 n 0000002067 00000 n 0000002284 00000 n 0000002450 00000 n 0000003078 00000 n 0000003478 00000 n 0000009230 00000 n 0000010019 00000 n 0000018943 00000 n 0000019269 00000 n 0000019533 00000 n 0000019815 00000 n 0000020381 00000 n 0000020758 00000 n 0000021076 00000 n 0000021458 00000 n 0000022248 00000 n 0000022666 00000 n 0000022688 00000 n 0000023685 00000 n 0000023707 00000 n 0000024686 00000 n 0000024708 00000 n 0000025684 00000 n 0000026078 00000 n 0000026582 00000 n 0000026782 00000 n 0000026804 00000 n 0000027803 00000 n 0000027825 00000 n 0000028775 00000 n 0000029061 00000 n 0000029477 00000 n 0000029499 00000 n 0000030470 00000 n 0000030492 00000 n 0000031448 00000 n 0000031470 00000 n 0000032170 00000 n 0000032249 00000 n 0000034547 00000 n 0000037130 00000 n 0000042097 00000 n 0000001361 00000 n 0000002045 00000 n trailer << /Size 144 /Info 96 0 R /Root 99 0 R /Prev 168451 /ID[<37e5eec95206a42fdb51b2b11af06a93><1a2c2a3920c5e10776794727dd9e71ab>] >> startxref 0 %%EOF 99 0 obj << /Type /Catalog /Pages 94 0 R /Metadata 97 0 R /PageLabels 92 0 R >> endobj 142 0 obj << /S 537 /L 701 /Filter /FlateDecode /Length 143 0 R >> stream Hb```f`` d`c``)``@Vv9@Y6BR' E Ha``#Q$}d{M{5V2`: rz Zp0yyS`i@ bbR \3Ʌ]`C OO߳+93~o : ^&0xЙ`f]YfV3! xeb6l¦!"e> endobj 101 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 111 0 R /F3 105 0 R /F4 114 0 R /F5 123 0 R /F6 130 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 102 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 681 /Descent -207 /Flags 6 /FontBBox [ -251 -250 1009 969 ] /FontName /ADACND+CMR10 /ItalicAngle 0 /StemV 69 /XHeight 434 /StemH 31 /CharSet (/k/m/a/t/s/u/i/at/three/period/r/o/j/p/T/h/e/b/n/l/g/y/f/c/fi/C/A/comma/\ nine/zero/d/hyphen/v/S/w/M/x/F/ffi/U/I/slash/plus/W/numbersign/parenleft\ /eight/parenright/B/O/quotedblleft/quotedblright/V/two/one/N/D/E/P/J/fou\ r/five/six/seven/z/colon/fl/quoteright/q/H/G/K/X/semicolon/ampersand/R/q\ uoteleft/L/endash/Q/ff/emdash/percent/dollar/question/exclam/bracketleft\ /bracketright) /FontFile3 106 0 R >> endobj 103 0 obj << /Filter /FlateDecode /Length 325 >> stream HTQn +0 I)>Ԥ;fZ1!_T=`ϲaw'h;k<7vrkM_;`x'@}qwX3 ^aq?ρ8ޜ ۾qCƒ ^4+]N}^7\VyxÖq!l<_.}]j%i-$=ZΤ(e"$% =\H} Vdl]GbE9RDPIAMK9A?%ʇy'æ;Q;r endstream endobj 104 0 obj << /Filter /FlateDecode /Length 5659 /Subtype /Type1C >> stream HyPƻfz`{P4`eWWYbQ xDFQf9DED#xj YF♨YkTRJU췿uOA2($(ס ^4wgCqK dcN)wa5f$ƒ6i6d|}U3UA꘍E1Sc2ŋUd:1>S JIQE ud"3ӷ}uJJ!'T1NNL!i$񹔘+'•a /i@ua%_׏@.j 47"})ݙQ[4u-5 ߠl+O ߅ESS270xq}m}:^R@9~ߓhJs9LQʡӀx), %EE[e :ʥhwdlf֛3[L.D,Ó+' J6n ~? ep]sEa!ӣb-_) xN,=E{PNnev#v_<&@1J)q.o>xK`۟cqqI)֔VvNyمb{T/)YAXۢNtV0/f{ΰg~Dzoc)pFwK0D0@2#m-X욍rY<{ypl4SqT5L0KkkF`xIGC^:xo/9viqcԗ wOT3|/:c/W468i_kB#Z69ߜY+**wPA!]|D(.@d!gIB$]Gy~~4N)Rl~Z/'Qh܃Gw=0XNHO ]ͨo?mbyEzG]FDU֮ :ClwPP ފ2@Kc4Wh0'm`δ4Zk;ٸz5դ9k!B /ۭhxNjpB5(XDB"Xty2X + y|zR_!%a$DVK,̗a9ڑDwfu@SzߐVH8W$Hkty5xtWߎtն ^F'<93άlWtVe 5?n~&:"N3cjmL``zOdӝgAq ?  hCRnKF Ӳɔ9)WO݃ʛp|X?.s5=˖>7L%|EaQg&'F+1j%⬭\$`:}9ci M7Z^(&ZfhYsXģ4 % Fup!ڃ8c]z/ ]QRh" *BA Hr4 P/3ZtpTmڕw N_7הJƈ4 qoeplc0p ~8ҝa>F6یi wC62.䳅 ޹ag7 ZF[@`_+BL$O͆A-Ic[*NtPTЄ(o6L0K ~Aw qĺs}$6~D~:X+f5'9%oKady}0UFgv8$Q?׾Z/0V_e<%V1f4aJ:ű=a'Oe_Wj+z'\2{^ҭ&mMed^piP6]P״CDABYLp>>^W@Ӱ,_s#d\]gYn63Xlơm/DX7I]3|i:adK.vHBPtw<wr${J6%ʓO׆ -`&0'I@Xj1~{-6Ft2}PʯoVKͽ`w=+/A*%F(*ݫ(V"}ʦ<Å1IJzwvñ‘+kU)yD*a *TQqieD(jJr5ҽ/::$t;6$p~$ópGd<"}ܵ?iH6];RzS0?v*2KO?4AhZ}?g:Q24iHՠδ_-³! RQ:@ĴWS4_?687@WibꈥĥI^6n2c\>,D>OHF;yHI)0"J/+S2H_FZ2/hMJI BT]S!|o_o?ggp0"|MPU-QCIi ^K2QGR!\NRB3DfVphAmK,=t{Óe-GLv>-37 UǎnEڔ_v_a=uAn2>n%FhC ͼ v ] T RWJvj>{vtoa[`}z+#b+ZE$nK`ǜ1#Ph-0 M2&ѕ(/K)b(v,`'^5{iHR)U\qq5Q^uSOqDRo,l_Qlh᩠ &x୔nw)3a<]: nZ Uϓ>Hm̎%{-]识vBstʈ2 _Xhu&L 9amԢ&.*[Whwi/xwh]^T*.VZ!`08C}Boqm7ؘex&`i/ljv#pu94g⑫ Jeg%Z2,5:b|Hz &x]llN#[`nul{GXI:sldFw%36Ӹϖȫ9R7dȤ 9l#>N,s{2b%Rc>M- M[+ [?p)m1)QH]IKsuCꚊ*h(82/.ߍW{LSg[tx{UٌfnM(CL|PBׂ}@`tuB1j_,Sc}qٖݓsw~\W'ţ`zT2LrcЈ&~lak4:tRU!cKE7QPIQ?uω`PIڇ:y0g@LmlIPnQz-#tu5D7 ՎfJcIĉ]D~|^g7GTW3X\2KM_"'Z[K(/ 6lvv|bS1[X+/>$=M5bQnQn Ճ,_t1 1ؤ<GKТ^3ѭcE}'erzĦ-V2/oZLbr;0YrM0 Kh4{6 0dF`m uG>Y5+$$1u>8,* 6v};02Ct\b~Wlk`lF>#P`upwoK`9.Dn~JC [R7 )ˌzhlȉJ;3Ngh 3E6GEҺ"`)fͦGܛSSnP\}Ȋ;7$hd%z EoB SlYN endstream endobj 105 0 obj << /Type /Font /Subtype /Type1 /FirstChar 1 /LastChar 148 /Widths [ 833 583 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 278 333 833 500 833 778 333 389 389 333 778 278 333 278 500 500 500 500 500 500 500 500 500 500 500 278 278 333 333 333 472 778 750 708 722 764 681 653 785 750 361 514 778 625 917 750 778 681 778 736 556 722 750 750 1028 750 333 333 278 333 278 333 333 333 500 556 444 556 444 306 500 556 278 306 528 278 833 556 500 556 528 392 394 389 556 528 722 528 528 444 333 333 333 333 333 333 333 333 333 1000 500 333 333 333 333 333 333 333 500 500 278 278 333 333 556 556 ] /Encoding 110 0 R /BaseFont /ADACND+CMR10 /FontDescriptor 102 0 R /ToUnicode 103 0 R >> endobj 106 0 obj << /Filter /FlateDecode /Length 8831 /Subtype /Type1C >> stream HV{T!$w u}.8*j oD  yL@^BAA\@7bQ-+>A<`V ^W@{=vvs~ASEQs77K}ML5aBk&pV`u6 n果?}1y<贸$Oxt sKHOiv5n;AQt ALY³C#H Ap$Aʚp`/r 6 GvI r3AM 5vS ӕez6ہ`evi~^0}dFYKsy2n֫m86-*3_smmmloʛnvvJwgw:wdSb^*ʹs1v~gτ ,/B/^vq߽vx:S31hNl֓ݝ*:<,ՂƦ*M}3~٤s  '܃wPE&`UpI8K0/I; 'uNݴ< ^q{楓4-q2QLʄ01^o? `OZ6Fc[8߀a# (mLEB r9KpOk$9?ĉS}nNp. T#;ynb[,V<**)UA Ic VDžLu}_HObiv^*Us\BZC{W~B&8zal, S*+#sȖpnN3i''xoyO[ (/3*k H A!GbqGnsJMjjJM03GLϸ&Y5{ vQcӫ56ۥXj .0K;{{# ؊zuDQH46B꺰Oťdױlp{$*ʕyD +9!N}AyAhZLu&` |6y.=f -jK"@ ֦:o.oeѸ^nqJ]<)j^A~핲O@xxc5r{`ZIwL )MЏL.2qYl08q[決\tIqFD7 ?\i4uP֢D?mBsTWO{mu-Ol& RHj*J2ӌ42*pIgaD}c_54we{:,'aАԔ |C.4%}˾H }{uTE)etH~z|J~*[x6u6dbM+δ^LY>4C#5ڶ}T׽Р/1iա$6KM&` cJ%yΞG&!c52Ih?(.T-76&j]0LXGHRfQYt8t ڐIBiqoN&1 t. j`3  k3\6f,_lrL4% qQDjRݖ}^J"Q(ZUܻĭ(.)37o|堆/0)0aj잢cZ5=Ҽ< v@H䓖RYXV&-2㳵h0(f ~ߓBVR" ϻ.+Cu:]{8(gYo%WH0vi<* ]񍴧hy?֠(,8Nd7E ctEDEԊ **TX( :g2(#o16(.41Y5<z\R-u;|;ތ9k~w42*C(qb„+- TؐP"c!U5LJVZ u3^< >b6XEEa> qҤ(눗/$!{ K,rnFEչ$5ҨmLlv_沑.8XT"u$m" g F`{! SݺK_|yL;'㼾xvǞo01o͓^+a/ l;yPJ諒+V^PFT\>}_/]v.CW$$ϓrT [Sb ~@ŬzJ,0UEXCp|`u\OA i(*~}Q D k.SJ8_ZWRx"tϹxf0r߱k/?٢XsоGjCX{A 'oBݕC}h#Gn'r `¼RbӍ\ MᦗTg4N#:hA]Qu=/WFy J2,Za&s3؈fK1:XT:9e]EyH;YD_aC~NlI}.\m0Je[v[;Ϧ|0HQ)Vd;Ig*b΅J+b6+]mW_ix$hEEJMv>%p !i^[biO ъDuk , D J0"vwΕ490jWP /t=עt+j*eʫfܐAs>C=C|c̨ڃ;ڳIw@z\}g;>E.=G{X'ޫc:@K` R`>x=/1m]xqCPi|i}ٝ(ȷ~r[:z&[n)NA +; њxh|ӄ;m2ij8>UsyH>~ǒy5dc1;srzM3xs|6!8Su*:7B[py,Oj]a B+ɾ ?Hʚ,K=_ͽUgl@WSTlk^AMiXaڝJOk [UTVm׊"r (`%!AHM.nR^׮8:[]Wv//K;89{|{;< G( sc}fG~ѭzw\CIظyȐ?z!z#/-1׾˞m{րJƕ| BB~ dYLW9rぴSW O!59\R9yCvNϰaf~2,L^=0zEz1:[7X7d$fiYMsj!ף]'٨d[(''8^I0QJmdȐHv(=ٶsggq._j. :iQni&%mqZ;Zyr \e[x<*rw~]ol=T32k"SQ4rZb5)>O5 ^9I2Am6"xNҥobj<:\ϋ: *1sXTH!չ.ɞkvرҴ=@} "a\_I4 F L( B%[2U(cN(To( Ŭ[xGM&Iaz@k.E#UNgܥ!^88=<R-|m0C9L8𛅸W133sx H` \!H!>x4Wh=2@arwqЁ u+H!ˇnEFο<!2W#(DӚ{7xU)b {}=A܉uG>gW%GFoiyRFg&+`Wlij?nZnr6 Q I& ;' 1 nTn3pFde΢MDa}+X.ϽLK,XDJ%(cf))Wn4!*_NؚƆ\e1ѤOmyž {C>}H|o:U?\<~ oó"8Ml2ZxXI} Pq ƔX,;؇W6򦂣;.9^j!޻&,)Yzs]^ջLC6XNe!X7s:Uk`%7fZ%!6:(Ҽs.e sev-k 2!&q\{}VkلpNOk/3\o:ocT6e^J^jRәOP=Rb[SL`I^vnZ˪fJ &A۔liuD jyZTpȁD6=vp6p|I5^.^d4>r#ͧ)VefO;sPa YĈ#=7!CMi s`4\x4X ](\g{zeoYxIDzHm! iw=ؚWۣ Lv.ys\Rmg C5=hRAݶ:曰0h:%I7ԙ!\쮮Nw^X]vgkBV]P)a<0ܛ@BB# XikqZ춾˲U]sn@3;3Gr9_ni:ނs_Cl9[1 ~V^RE}Xs 1 -$~7In)91BB ' 1VI=/P2FŲX]^6/%J򱷧i]Ń]DrYڛϒ-(]겞bVuP0hZ e,> ^[ =+*i ul>7MNb[ ˏް'-o^koZ}׷}A(.89uP,Wg4: m#B^XHA(dž 7ZG/ ;{Nu p=эz:3- eQߨwWzG'y]*OereP.#Ҏ:h[N>ZRKr%,cEyj"ۤ.;V_vȈ쏥cc reh[xaZu(?J6Ż2I1qĦ`6xAߵen#e1dz{B̀q#5EkI{9eXۃ)ҹ C;)|2AQ̚:2,Bm8\ SuuYli|}v-Hi4fqScwt︯n  Y, ֽ[$gMiTFžeJ2?'酯(G+ IzDҐt648`B9Agbtj኎OK>gXbdVNDTǔ穈 ZPj l/^\^I6u2ΧUhtgWsdtNdtP{+u y8iCj{Ĵ7PXq@y8=/~0mƊ(282f_}.{?_i Ǖȳ;/` 8 >h~fY1`$m9J˺D{:k$O(b=O$h*J-KN& #\r{dP}]9O;+@~c\+US lςƠ߆hE-?<5iljU8ƾI:Y714SlfgG_syT`Dߒ0 8pJ@2bIYRE:T%F"gme;]%o_JlscpT1N#\kNv'()(AY~t?LDbVz)/s6{6OIcy٫tJ:X. ;)MJ@ilixtWE#u (YQ2a^Vc*X_-pgsI8;>lWbQA2DK@o} 6 doR,(nB'~Ozq5(ۍmL?~UC=wC< X<}A .}VPlwk{)psklim`Wzg'ᕾZp /91d$h(Wd"MƲr㔠Xh/kϸL-ވ %Q>heYBT*X V2\ =t2E2Z*K4)2Wis/>m$ٙ$$zw"e"I6Z DyFW/d/\>^ 5~jNKaW!]*Wi6 Y(QUUfYCsKA9 zQ(a endstream endobj 107 0 obj << /Type /Font /Subtype /Type1 /FirstChar 67 /LastChar 121 /Widths [ 668 0 0 0 0 693 0 0 0 0 850 0 0 628 720 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 459 0 406 0 406 0 459 511 250 0 0 250 0 0 459 511 0 354 359 354 511 0 0 0 485 ] /Encoding /WinAnsiEncoding /BaseFont /ADACMB+CMR17 /FontDescriptor 108 0 R >> endobj 108 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent -205 /Flags 34 /FontBBox [ -33 -250 945 749 ] /FontName /ADACMB+CMR17 /ItalicAngle 0 /StemV 53 /StemH 26 /CharSet (/H/i/g/h/Q/u/a/l/t/y/C/P/r/e/p/o/c/s/M) /FontFile3 138 0 R >> endobj 109 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 32 /FontBBox [ -34 -251 988 750 ] /FontName /ADACNC+CMR12 /ItalicAngle 0 /StemV 65 /StemH 29 /CharSet (/K/i/y/o/s/h/M/a/t/u/N/v/e/m/b/r/three/zero/comma/two/eight) /FontFile3 139 0 R >> endobj 110 0 obj << /Type /Encoding /Differences [ 1 /ffi /ff 33 /exclam 35 /numbersign /dollar /percent /ampersand 40 /parenleft /parenright 43 /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon 63 /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X 91 /bracketleft 93 /bracketright 97 /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z 132 /emdash /endash 141 /quotedblleft /quotedblright /quoteleft /quoteright 147 /fi /fl ] >> endobj 111 0 obj << /Type /Font /Subtype /Type1 /FirstChar 44 /LastChar 121 /Widths [ 272 0 0 0 490 0 490 490 0 0 0 0 490 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 761 0 897 734 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 490 544 0 0 435 0 0 544 272 0 0 0 816 0 490 0 0 381 386 381 544 517 0 0 517 ] /Encoding /WinAnsiEncoding /BaseFont /ADACNC+CMR12 /FontDescriptor 109 0 R >> endobj 112 0 obj << /Type /Encoding /Differences [ 1 /ff 45 /hyphen /period 49 /one /two /three /four /five /six /seven /eight /nine 63 /question 65 /A /B /C /D /E /F /G /H /I 76 /L /M 79 /O /P 82 /R /S /T /U /V /W 97 /a /b /c /d /e /f /g /h /i 107 /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y 147 /fi /fl ] >> endobj 113 0 obj << /Filter /FlateDecode /Length 307 >> stream HTMo0 >v!!P*C[UaZ!1-Q ycq ݏ3t55BB&z^N}q8n: 7{{9 ts3k01{ik3 p!xΖ£5}c/Jd5dr6%a+DTޅXP[կ>ٕ4A$1*\!5 P$PD vZ$$ LL9JQ!,`@/O#=6񘟾yF'H->6FG0 endstream endobj 114 0 obj << /Type /Font /Subtype /Type1 /FirstChar 1 /LastChar 148 /Widths [ 656 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 313 375 375 563 563 563 563 563 563 563 563 563 375 375 375 375 375 531 375 850 800 813 862 738 707 884 880 419 375 375 676 1067 375 845 769 375 839 625 782 865 850 1162 375 375 375 375 375 375 375 375 375 547 625 500 625 513 344 563 625 313 375 594 313 938 625 563 625 594 459 444 438 625 594 813 594 594 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 375 625 625 ] /Encoding 112 0 R /BaseFont /ADACNE+CMBX12 /FontDescriptor 115 0 R /ToUnicode 113 0 R >> endobj 115 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 681 /Descent -202 /Flags 262150 /FontBBox [ -53 -251 1139 750 ] /FontName /ADACNE+CMBX12 /ItalicAngle 0 /StemV 109 /XHeight 447 /StemH 43 /CharSet (/A/b/s/t/r/a/c/one/I/n/o/d/u/i/two/m/p/O/v/e/w/three/B/S/fi/f/P/period/D\ /g/four/R/l/y/V/five/E/x/C/G/M/T/h/k/fl/six/W/q/question/H/ff/F/seven/hy\ phen/L/eight/U/nine) /FontFile3 104 0 R >> endobj 116 0 obj 917 endobj 117 0 obj << /Filter /FlateDecode /Length 116 0 R >> stream HUM6WHoI)ڢ+<߂?Vk[$'}3$"(R rI̮n^`*Sm(k4~ڴNMP^6:n^h㼩ZüyqN4Ov:yXʊgY.*'UQ6i}?î(؍jcDFo7gQ]6-kjb}TpD EA p F fR vپC rNu,m@"m\Oqq wVV(j׈l)ԣd;6+d Ҳcb"r+ޣ$ d#B;N/o1άm \(V1kϋdi A엯|]]Y]mOԃQfbI&CHK9QV#/w0üsr SA<-*>_y{ϩ Cvߗ(_N ;!)7xpp;j!&m4b:I+7ȴ%W1؝-y`t)=̯)r*gR 0\uфD(]>˘E1_Ɖ|ry\*> stream H|Un8\9ErA99eÔ?< }XիχJJ)zjW[q/ҸډUڊ_*"+cN1IZCJ'[Ճ_\H]7b E?,t !fǕ|}{PtЃqsa&*+۴rG>UTc +t,ȏtO~ '!V@q>ݦ5'h! -#A"p 4B FOYȾ?eT67l8Nl>tQʗ _zHmPSuƭv!cBuw%m5DB"I{(RmoaBС*B׹= ±&#ӯoj>OO Oi3M9C L*V/?p]Qj)C9 hx2Q?{NRTsrw2ν$-!D欿ͷD;e.3CjaO@%,м4Rc19VtYP|qM> stream HUˎ8+|$×(<=,؜[2,ybScgr-nm1jnwnx#INu⧒mnv*7::Ѫ٪H)coe~/N1˦Mܿ: HG1$UZM2)/N\VS>>5e˴>Q6qNoၙn{dzT S>Tp!pt)ݝ\dA&QGfL8R}V%!m`Dl՗0]'fF`$u?ON_e\5)@_X}.LD@g+}6}>Fh+M\11ӈ_]TpOl8#$oÒ}]ի;Ir9 $^KV t7y}(?`(ˁz1u7zp:`O]礼 7ꈂSHgR<Y(-t'Y\B"oŻG%_ lp ReP:c.;Kp=}Tzhy.FO]v> endobj 123 0 obj << /Type /Font /Subtype /Type1 /FirstChar 30 /LastChar 146 /Widths [ 639 0 0 0 0 0 0 0 0 0 0 0 0 0 0 383 319 0 0 575 575 575 575 575 575 0 0 0 0 0 0 0 0 0 0 0 818 831 882 756 724 904 0 0 0 0 692 1092 0 864 786 0 863 639 800 0 869 0 0 0 0 0 0 0 0 0 0 559 639 511 639 527 351 575 639 319 351 607 319 958 639 575 639 607 474 454 447 639 607 0 607 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 319 319 ] /Encoding 124 0 R /BaseFont /ADACNF+CMBX10 /FontDescriptor 122 0 R >> endobj 124 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 19 /Lslash /lslash /minus /fraction /breve /caron /dotlessi /dotaccent /hungarumlaut /ogonek /ring /fi /fl ] >> endobj 125 0 obj 919 endobj 126 0 obj << /Filter /FlateDecode /Length 125 0 R >> stream HUˎ6Wȅ V Au}5Xr|G|oHznm~{]o6t f|]2)+ʈ~ZeWNdQzv)y鈧ΈbZ~Zp5v;<|-GV[8VL㣣 x?6-}Ig.,{Ľ i9b7=%l]xyiWEdg<[ѱt'wsp5(F.$`or)LF5#2:H0RЯ,MWJz3(cB6L%4rs1Jkaj?qd(N`<\/9`=\뱨o_龠G FhXH7~{q/WLk~xoבNnǷ@>ZP:ΤR970qגEWFf"6GIfW[U#}LZ6 ]3rr#5ߩ1Rhe‘V|yH8K3`/sݢaHq|0d}eбG H=—C,,Yf?q1N؋!6u2(j]aF.Azh?|15Kv<:uo-1|!x5vފ/C"SA"*' [-]L^hl4D\NJ1jxӓc }I]p+AyV'#+ B|F1ST5}]"!j/ڤ2;Ē>kTJr;EYFiOs1:hq⼛%OQQu.s,%}u=a/. endstream endobj 127 0 obj 870 endobj 128 0 obj << /Filter /FlateDecode /Length 127 0 R >> stream HlUr8+|R! Hƹ$gݶrFDE&UW#?P7{p==CeKV<?LiLU??jTS1)nuQ+&F ΣsхHIm< ݠ-?N)/"Blى纼w*ZJTv⟁Ҍf)d DkH*#c3+;Hc0lJ^msqM, 'HVK۳A}N./UPF$ )NY$A&M3Fv PrrDk]OQ,Q,Rt@#b*dxL 0F 26q=%3*ZoyRpA`1%.e,KV;_c`5Wլ[4alAa> endobj 130 0 obj << /Type /Font /Subtype /Type1 /FirstChar 44 /LastChar 150 /Widths [ 323 0 0 0 569 569 569 569 569 569 569 569 569 569 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 569 ] /Encoding /WinAnsiEncoding /BaseFont /ADACNG+CMR7 /FontDescriptor 129 0 R >> endobj 131 0 obj 891 endobj 132 0 obj << /Filter /FlateDecode /Length 131 0 R >> stream HlUM6WHBR%=詾=ZĖnQ fu]D7tç)q0쾨i:vebpN د񉎕cԖj6,;jזPQҫ+ϻw욪W][RB]l@n*h+Wbܕ]pӫU[V6Ro.jJjv5k҃(& Q^)c(F)]>s-%h(({J}Y!p`J`׸tNCܶyEƒU@vm="h8(iu-U:v5Wm1?C 9V,Ӭ%Cŷ35) 1LOeţ `W6`m*>bTY^ŵo$yP&/RqR܂*F"a\.dBs\fOl:N R\l 4N"f`^0$)Ζ`>,a[PhQc:4鄡)\VFW-p.YfmQiBt·ng>ȗ 7bi5II3e 4h i +O/ ϋ1ToW mbˈe*|8Ɋ1jmZޡ[hؒ*@Or벑Uتx$ɍ7 i2Fbw4P|۽v:ZJ3QsflBv!6^Qӗ2%.w-ymlgt*523Pg:;p6XBH endstream endobj 133 0 obj 876 endobj 134 0 obj << /Filter /FlateDecode /Length 133 0 R >> stream HtUM0 +h3$G.1vv3M?~3OmY8v$'I]T)MW^u٩#*qҪwq҇9QmF1m(jUVUnW=uamT< )-"=jwk]eP!2d Z3Z`d+ϩ@4@>ҏSYg@:|,X65Ϝr5-k}Q"oISW[kAi9Vz9i\ *u23dA5p2T8pEM6S8eDRUN=%j 䳑$C(F:*٬म)uރA_NCXDhNlԓ{7 JSvfVKɷ "5kک4Oq&wmHQkjdycg> stream HlTˎ0 +rZӖEhOF/yY'-ql{ٕ(r~^e+>-ۧ5eZH"U~>\ H<%%A1bQ.oou'mi>EL]X sꢫXRzHXnM`c\DQQ-YܱdM=45M1ՉANHNX|, RR[lHD~@V<%1O+|[ˤI3JtޮIpȯ yԞ`,"= ]+m\!KӉF튶x!kL:_5o/ @8oPsZ7QܑM? %akͷq?}~8 6MxgK=#}$&B]7(K *3B]-"Y]-|ny#Vyt:XeuN~hc+s endstream endobj 137 0 obj << /Type /ExtGState /SA false /SM 0.02 /TR2 /Default >> endobj 138 0 obj << /Filter /FlateDecode /Length 2205 /Subtype /Type1C >> stream H|UiTT$TRWzr4E`(Q"DVٗQ6Ͱ  ,ZP8B<46[G)9hs~ϻA nܽ}/X!_-/?ȴEG{L<>@XtR-ZtP&J~;bBer{[TgEG O $aCK ž Hb=Al 4# bI{ b@99l04ytU,,nA' 'u*uNJ8[\ٻ+alq(8e,rT@Y*K`-v UP 'X[z.CeLqW·7 p@k`&/<=XnJypbv!A.Q9Od/yq̈́ڙvRq -GwaJ W]lQOfR6 >֠SVMAOs-2 59L̉ij-P6-|S*UZ&[ .\-0JJ1?|7>0rxx$PB mT}*~B wde6ݭ$TPwPE`y8{GUͩrU|jùnP3@mSnP숶C|L04dlg4!Lw^CmU&zwОGL;-CK멩[uz"xӨ*i+z9ہ(TdgTy8@uǣC}S}ώj`ll ta!ҔK;;^0n^4 eJnL 6 rQF4|Jێ~I/lq`-xX 1WH]Y#>/Iwg\rߠn玶/od Q~;,I/˪)-OEŰ-#Wt(Pp$\֕N#qb0{bԹlTQrk i N'cc))±3Ӷ6m.Gי{ Fl9k)2R-OM*ȴ.]M @XQe9vJ5'MI>|jt>+bh=s٪#EOzy}bR<1.Q__wv::_* 7$̏3cNjYV=.L"f0&EuxwaĤPy 08 iKHNhN]_kЦ(Irk>vL`D;֑OLP="X)=#V*D,y+l}CI?ɹ/QC_[Xu %G,b/BkOEszT*^|bJJT%,Jʎ$gTKZ;"u"2ԓbl37pRfҳZ~U5| ~*L`2,"Շ, پYr[w5] '%tXumLV#QT)jUqZ]Z4[3OLbmIJJ-}+?,1T=OmU 2TP͈ 5 XaKhbMTr({At0DZ*ĸxYg3%gYG95})Ohaӫn2:o6rj{1XZU|BOz%cK/qr󠺚1PxU*4)W($ VFlD-7j|B gb#juqk) ^qFLrywu|ycnůý{?o`G EaSazux endstream endobj 139 0 obj << /Filter /FlateDecode /Length 2490 /Subtype /Type1C >> stream HUkP5MSjKwqUdxH ^"rDa-P%| *VZThǶV=.g9̙߼=(0AQtJoQh?}Nv%ׄ\Gw8OL@UkE҄$ILllwOO$Id}ĹFJRxŹHv JJJ>~#"S"#+,@!B @d"F^NG',wsq tğſyaZA`ȷ[B9=7 xB7m,1$k(/6QZ%u S6ӰtJ. t*(T(aF!=^o+o Qj井hZ"baJjEc#lt˷'}^w!*OK-p$uhSڗD Wk ǒN2!t=<\ EP.An^ 'Y~Ct.'kxaPX]_ljQQL]c+ݖl(lG1ԆY-p,)9`w[?X+Y{6c aK5K3 <8OWEݫ;q;gܿ{#Ֆ佲q,7{\ $C2=Q~J) J$V UVsI,ygu~M?⟗Fa=&{d.N9cL <(Ynx - =4bpĠ?ۨ |Bvʸe\Fp{'!~|5bbʃ)ORH֍1 s1-B\_V?8PsU\W C&:f edPQDÂQ'GطhUJc@]K0mb )u4fsTi[x0uߓHv>y XX6^(4 NXYs:-mW^JHIK~Bzs1 SݭSfem`gx/hkcC~)RUe9vӇjd(w:cVxxJ:}Db:꾽7X`"3 |{9m-=Err1PҎrxp٨/َ v$G5zD_,:KBci󟰼 ƍ@W^IXzƑ,6hMNDr  ߐA^ UӋ?guhTnFLOSXe¾7/bgJ ٝ_4SmLH\Ik0IVcU{z[6 t0x&#k?9bp#? ;py9dיTݟA> J;P<::5'tS'a=\l;n XBmnGKuLqk%:S] S]i6ihL/a,gXd!T(\ŭ#wM2n 9 ,7+ISb|Alk,,2+=4qOϖ֟eTh5Z^]Td6PӬ3e2]E T#h-c| "~hт8B .5s .L;1iw&]M9~f_ ,1WUf@$ &wv8˶]g F}Wf.ROzhn)CSYW7OV?IY?W0QC) l;jsj{c RM\_/{oXfvuOZXwHguvڞ3]_zۦKO;g< ^Ѱq5[g4l@36tN)YroKX[gvOZ{>@A@G'̐)^Y2 5N:bn|uR+fTV5nH;px˞SKm?^:{T߉8W20\u{3yx> stream HdUiPfnAahMcfPPSKm3" ʮDFo-YE65 @Zp!pKˋ)6~bRzs9 ASIA|_T"KlEjkz*q# +܅!I)ǥ$Kl 6T-A"&g7ml:dۅojʆZ@ݡZH7ewXpy78vt*1ifī#:u>piuyR97otz8@ ?|l|lQznn}rg@O^>{ 4A}~ bp70Z&.NknmTH2A/eL9*NP^lnUQ;L-0-6wo% pNW/¨)֜E,ͭ'D xv [r6Dcyy=\:WaCcB8 k;a2C u' 7al}Yc0#:+\8.Io:qkEnwk^qb0wv ; .Z( *58!y/'5qI>naxb͐@ bH gL/'x[Ƭl?, V!jfEZ^ F , Wp{#]:A9lQ sc͑x5c]J Xp}l"5l@dޜc4ϐn;[ |}W ^4m6x<{;\]&Mijʜ~|Fg՝8g*,0i4+ʋu=S ~M  aW</n Rg/PvL_̬Lj8o?nRE ݥ! ïJ xh1  jDD[qj?aK)0c(x?{-v(/V9şԢ:e6£ėy|D}lpߠse y%`/Zg>9,ϔ#eyÎ=+yug?(6qw%Y `E9l2Tզj^*&W %hǠZӰ%kxK{vw[H_0lّsakm`%晒_A6J㍹ĩ8BmX pJMhޥ:;*Hw]( ۫t@®-Jc0KQ &a~Z[ĶA%U~s@'?18Lp ״)]`jR~h}t.+x5 ae%dz/5;noOٱ鯞?@FE².5G (6kps5Pf*3]I2Yٜ*gӮr-!t}c _h2E;t_K:³kٸ\2P^-[a+S23ؠvע溶j^!$W(jEGӎJb]ËaT&9J%"5w0ʛU-L!:km4!R/~X.0 APT|cCx IWؠs9r*H–C(W ':'J}*4[=i2.-Te rˆ)·I5ܜܜIqFrrYSSk!7!ỈrI~aޮ&%ɉD~usoGX]զtnJ-^m/ٚ|Ykl$5аjk:.0&.%0= sM?Ћ)|C[ amZwzo3ĩO2(@a}3U^UQY^%w {2f-7E'qtY.z[:Kglq;Ik>fn#]pt~ebeh(;'"LF٩r. c+`ie]mԶ u&k{j !!FoVwaafE*TvkLL72NSGεyyHYeȒ%Zƈ5U0 K}_a< 6t[3ُNVʆ2].%XTti虓=qyo ",lѐYnRtgxy"Bo)'ŽfVv&iە?P|;}cᤥ9ጓGN|( PoecyX{^oXV|W't+`a÷JQq>Y`QBFc1t;Ye2FN<$N[a1k0G[ޘ W!2e~ s6l8 .$FEFEvveaOqۯ<%}pnLVY醤7;~5̥S"-47c/,̂7ֳڏ/HZ ѝLeDu`"#wW<lIfH ۇJ?ZҜЬ5ի9-w+_kM3r=4۵/Ar`?+p=b mўylZBn(9-e~/::3DɯkuRݥWlk뮅Iݳ,'s|Um+_\>eED@Gvw} \P.( +<*t}Ǒ+rb"ݳO/A<#eQ[Ywl?faNvK}"Sˮp7wBK?9i`aYU$]S,hjk68~ _zp[gaWt>PM|ixX!=gj߂HE%ǙΜ1q=-]mE=@[fNl.n+u3]Zә- %K>;X-[*;ZX,[/bĞI|g[5XT.=ѻFzή5\˧]W [J߽+14`_<;Cy6oV.`tJVgW,h[$WZP,pK?oߜrOaOi'Nw$vΕ y8wq}g<;r>䮎N}vM endstream endobj 141 0 obj << /Filter /FlateDecode /Length 1453 /Subtype /Type1C >> stream HyPwdzYHBcuvcmZxLP;(Vp[!XX@/A9&&(!0(**X#eu(R}Kvl켿yϛ/!rpW*U~Y!i. 82]L45HLkT|lr6<"A1W{22Z U( hu3D)6ZMB eT"F"PK҄PDʿeSRB p vnsh~6w^iC`ʂE)ֳ^9JY+Iu̓6yv:=LMdHu(m -0!IyC#JOqrF;o!kLGi%2dF ^/y3hiw8B~<{,Z5dMrq3{VEcEk"9|gfd"O ^60W]5WMB<)jo@n5f*>eOD=_o X7'7Ӄ^ݘ䒠ڊu-Ğm+nbH\Nݹ/ix8e Y))awPK)&@ $A,~nk8-jllkr0MC;爕.G% ܐt0z'R_/0#$,Kg;Irs`M~ cP =7Jخ녍LOEwL@G!lxm߷q\st4v= 0\F`.~=C6kB(9X0PCΆΦ^%+q創k5u\1H\ agVJdaEm 9ĥfУ?8_=1@ c##oczR^RE%TEc$4ݘm>b(-i%X 1nɎ>Dfb$-I Oët:WʶH!cӲ./5GުwTh-z֒T!?7#  L~D7î4iB&ƽ}|`0bUk+&4CV^t_uw]{GC0 ,Ia \O|leOo8NWNǬY8GF,~tk7Z]h7'nZ/;♫y. 颯)[s6r_W_A㩫6gpN I*.΢ZǾJ3IXT"⽻cx{`l姰qJ/o endstream endobj 1 0 obj << /Type /Page /Parent 93 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F6 130 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 3 0 obj << /Length 7021 /Filter /FlateDecode >> stream HWn}W xhܷ^`C\2]p>8uԌd/M @N:۫ݵ:x]ҟL:vsU^^\ƫ(Ko[zpS~0ِe|aqhy5|gΎ!UaFw4ߕFSMZQk L[7ۧF5|Qe,fX?@|K5\d ɰB`:]Vo>M:,nܐa v'-5?R G,ϗ5/[znےٛy箈 EGC?4f[<\џ&ױw_m!$_H ]Pn8%`O$O!n蚱/ +ye%5#-8W x ص+ p -ے vdo`5Mh[ۚ_ϒAn!qȞpUKq/^]݉BE#1VFpp0V|Se+~Aw  ^y '|6t\OCӶ=ۡdOf Tx.Qe㩧8]uXNvɺn @|#ߥxHD`dd"@F&G`ٯb]^% Rțϻ*ޜcf qbzX- ι Y 'W6d鞝)!O6rYr  ]\_27x ?r7?1"涅HfrhaW1 @[¸u#SN<PPseVcd@u/7x waR1rfw8F@A kx@`YF˴Tav(",1.M4٬:V^x2 |Icf%+I|K"YYttuLtGJlW+Y/gY=߂m`117:Adż4{*0D>I̴dt0@@ӥ  ?P?9^M`Z~6>H;u_#pDLӏ0z\l8mr6(ub#٥'vRES+yF6{F+:^ZQ6O<#98pz0JG&"CD( t`9s)1 !"XB,Y,SD9V !&4FjhDp45 ((4!0.JZ6JDbe*A' H ΰȴvC7OCۼ%:GYl/>k-i^PT+-&$b|F"D\:N+АU>jqJXs0 ~=T0H.8ln83z :c RT+G-e6yҲV;uyw( &c5Z`Y5%NqpjIXajFl^Bs![W\CR!'T/0 lP'ENzD ŗa9- X6 v9tr)9|uoY;⾜Dg Lω!Ǎr?g{]e)QY< 7X\Vʞ#YypM!"($QV-Rj,*۴S\$a:HxRD16!D (][]Duj\-:AΧ>#xuB}siuɷD_Nē<ϝEw!aĪD>+ 2BY} C}?ȥ^@r$z+cͨX6+F{,KWU[ 6udS }Tή|@q$RLx5\/\e*& *.U18ZMntl5u#to y0vx†³ȬVc 4_ # F$rl U@ƫU+9zWzZo=A2ڳ)mUK%dؾD`/SsZ>TzGC:L>(Y^\e& 'eB-ctfas*#}pr*U]Sunl2E˯O<7UwB*M8UZho\Omw3}̀e .I,eImv\g{ VB'%g5r<6 RTS!=mg~`B`|-oYGiObm .(U q`?-1ʘo((J,/i|!ιOj/.2sYNӥı~V萅˲m൭PRWYPH“[? C,ng|ֆ@yjoW(6bQ&?(feU ԅ=h!7؝M$z\ -`4QLZK6; H&|x_"gֆ@,/C8݁$(ʖv^=\s]_"'5dyqOvyڢ $`!xcgԣn젧 b{P.fRˤB.'nJ;Vg~Paӗ,x*vqH=J J]G{F [^P}3N|"Y #4VdPˆFIW6BbDEacmXի*@;`f{P̣ 4ǞFpv v.֑( ,a(Tt/W`&:c~ Ro:34ǿ;zQ$h sMS\=z,mE}U %QZEqR5Qlù+5ޤ;0z[?\qƂ̼䦮p Xǡᓌ@' 6 !`tBJ ! 5y<_vtH~; lI {TSчx)RxLUG!VFu:aqU$(BX^,:B NgTpR'52{$9AkFk3Aػ4qlZ)ZIZQw{4qLlǜ'.sR61FK,5+dL ǸΠzq_qSgH"k+]zc=*")R$4z&9Ÿ{>05amw7Nx{vKz[N ĺM>e hج MTB(y>*Y0q߮KfnOd-<-%aI8I/;2g7`Ϗu.Q@h RX`L\oKSJu15 Kk#Z cB;lP_I/z.զ6'I=@c)?Dq;fͬFv,ȑ{G6E嚏J I0MrYoGN-Spn[rk 4C].(oP@JQ2@bBZSt8]+B-׀Uy5T>>AMcZ(L+Dڇͯ ȻӼ̾ j6|:镴orUcTqƴkHa~%_Yˁ~j endstream endobj 4 0 obj << /Type /Page /Parent 93 0 R /Resources 5 0 R /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F6 130 0 R /F7 59 0 R /F8 60 0 R /F9 61 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 6 0 obj << /Length 5661 /Filter /FlateDecode >> stream HWێE^+)4J2oe;RlRF -CV? Nً84u9uWOv33h&8+_zlLYUVE9[]](F&ϛL8N`bBwPJC  @I#=!տ%R;I(<(2-K;HI3T²4+EؾV/c(m/PZVԃm.Д9aO<XhtX21k⑜<{!9ǽ;+')O2w~|TWl5oAW__Ix b.qM$ATBP U1#H_w!Dj/'nj[vJ L-\@#jj+F'~t)[]졲UZʖEh|5 zo!!蚅dMe/=R% a$[ j0^R'S>A5감SwʺK~'0?n@[TÙ4>y\p?iE9[tMB J0{O3NTs0 5* r;\\֬Dj8I 'NW#9fϭbⷬ]9t<_֡J(<ͩMvgē  U?~K~GP\ESJh11B#7(e|x8&;_Tz*6M/E'eBOАѥMLr5eOrnrV LIjd;*]rXVSF-9w@ [c"]1ڋd/T{i/KT!*I Ҭvި6"1cpP|_Dw9clEOtÓ4 p< q)*Q \]O9 Yt(RTj95a_1T O, /p(h.e1rUl-?}^239<yz;N OgK՗9)yڷِ8J %$"mS8J4[_CIc$orL?INʇO۩S6g>+iJ0j6 @JT@R|_%ݥ?~g 4tOvn+w)@UlR +y5<0ahb @;ʖhL>\)_C@6`Qxyۏi!l1m FTgld<>C-} vA,2 &ڐ~ګȬ1vL *iʮMgm1ch#cqC::v $ &t4.ݱ34R3pnV5i)%be CtJu!aZ#SzjI"NwP%7`7Vz ܩA5[شw;aH=_ ;C0Zs_"w-T@4懝ގFKëG >E.ߡ'%?13QǙ<jH#j[_1(Wc^*ctl ,6tB5so |v}~`e>SIU1bƅn96K:4~ZTVv)8(HD{\!;*Vau (}Mt<Zf*ܐ!,YjUiGd= fLdp<]DŽb+1tE& Ŵ>nT8ޣ\RmS I8 JjvH1@HJj8wWMZ>ӫq 뫨j0=vULV&Vź=b\H|+9$ͥ+!B |MUBu+NEɗ9Ҡ}Wt#HOP^m &h*0l>p~58j7Z}QaZ+tPZLM! JH |]1dCn}6c=IukIOǎQ&4n=ՊwMLPi!FaS$[lcUB26XlWAlJ5=|5TjiXv]c5Ďv54nwI+kVi)#aWIj^ `p>M RQ6+9zQ=%k+1.\Yu1Tڟa ,wS}2 Am Sߦ}?H,w/Әyߗ l*Eÿ tH_[SǬ PUC5 yVR0e`? Tv(0;FjE?) V*/ޒv֘]i%fB^<,T[,DCzK^}-@P:V%<@UPdX5o>(%/l[;*X^NjT,[޶Ny`DOt,ot8tn>:`9^5N?CvNDfGHpYI_f#J/B'fg)6 K9vm9VRNxNx4{lvgjZ+X5#'Ruwj2.m^CFpԧ-{zM:zUFȿgN Ґ.퐬g!ɛjQJ>D?RiBD.gnaՠ$R$zYHJPL3{Qj=p69ZH{jzsa8`/.SYw[4!&//b99c:i8Ft'[n*fD,:H&ST{)E`)RJ;f(bB??|5`pI3|eF!Hww[JXZ_`1 Uڀ坐 'ǞNP_aC3Sq3d( ZqI`:P@\IGP=`f2!07wn4}p&A'e$T1# ޗJ/e;bj6~ j[[5VZ^kvGPq>cUVPv@or3ޞMi! 3ϋ=M4\jT(0z.@~g^?i[vK#S#g.^'- :\1 x[N KUjSNc#8qSiwu6{1U,+n5{"&]-Tmc K/aY"ׇ(Qvq(G8]jVUm^P(`mv+J*G< n$83M%0̈́Z(~> endobj 8 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F3 105 0 R /F4 114 0 R /F6 130 0 R /F7 59 0 R /F8 60 0 R >> /XObject << /Im1 62 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 9 0 obj << /Length 5402 /Filter /FlateDecode >> stream HWێ SPu˾el`o#3ӁnVK#dHH."o?LG/ c7ތ.|1.WڜVȎoG/ƍoͭDuiL*̲IʃylIe^'I >~B^*&byavt&<>M'wD)D7<$$5VcWqQO+7~<cyOU"x#yJ *TYL|G&20Ȁ ;1Hȉ]Nu)Iz`i-Db,B56SudE={*Tz,/xj)A)_$)ȴ]wNhq۬N3}VS{'4fZAqOEgo/__^\a2]VՏSEF<Ꚑ`=UX d+w} 'ORCzގ"K Ndں–2]Ive5l3Lbw,qðEq/+!=̱y=,it\gJ|BGz YiQ)kMBPm)Y&x1g丵*DG+&!< p%9&k--Ϛ?xtĈ5)%+Ԃed{!07E2աuaBU&v'}q%}20̖r?P'qw|"VZI(7k@YmJ&V~%k9 C"Gxi.d~(AI6+Yl\Sxhv &1)ꀀ%`zl-} $Sj4 1Y-þivquߟʒz`tb;($.AXds\ h ɞ(`pLJgrz ,S]2pDlIH ޹0]7mȜ1›Ly~LThv%R,]v+n80=H:VB] +<(Qr~k._ug$TdtYňS?7Tfu:%@!IBF(RcrvO8^^*9!W#~0qif>tR7gkKs|l SGW]E|yI", 'u2GGa6LA.sA;@<.jH;<>ڊ1}tLQїǹ<{ɹA`dz -@c_̭fȝGlj {13F_[ټoyQՒkch*T^v"[$Թ$FhPaڒ K*ptѮ({wUk;\9\|z9uf"dn'ɹ1E/yg{ TlUi_iG,jt /ŗ]nTxy_I5-jYYN5% "8iuLBhNpm7HQz#R ZK';#E͈hڥ@3SN :]_#շ,|8(c.|R$kwzտŝ44nRVv +D~<P^ J꤭ᨼɜx ΆwxaͤWTldhi6U_7Ho˥L /ف3aEcujQ'ݬ[L5eE qFydЀ^2wxL,z꛸ 4mk+?5ra(x`x!+{Tےψ!hCjHG3S%,+WmkInڲt:Q}:!5Cמ5 {8F5NȪʱP(gғp P=a'HFlŕ ѿcCFg=?(Qu YrC)|<@ߴӽ+g՞k*@όš*˖R)߶tCɝ#2%O?6%j|w7;ضuhhV; ԢLvC |rF%d"h9NUԐ b$,2}f%q.Eq #88'U ^]С|p`n7JgztWPoUl;}M~l=FRЏ6y[;NYV&3b?{9 o/0D^mtԴG9ѲNj~j=qL܃)V ^ 4"ߪ w㐋L!P0 " %$ Ws϶3Wq DS)ӚI96h=nvVk[lnjи$fasQBQf^/ \@3bW,E7{P}HP< |[S&-zo!h7]WAJ/QHOP*%DLe4,CIvNVnRM.D+HǺdR`PyujGH2l?C;g[6VfF:Uq$sH͑5;+Q?V8ouUaC>RewUO~~l ryWYJ3ǭdզr"_߉An?wߥ"\]O|ʭӏ)'![T_ٿ>I9+؂ջY3,lO?ݎ0r_/ɣ\8>%͹#Ԏ@ٗlQf$Eb~> }աJg3aE MWC3y&iKGP#gݲlIK8٦{[ɉPjn,5 h :X4 :VYA5$k0Е!xZ{mDk QCAԠ .4qh: XLo:#Coto6!KO\GbGȤ822 i7` ỈWp;+)({X/?83e xW)%ΑĈzЃ$m%oC#;r"PWS~lHr2xX=d!`댮nqLj:\l0yqK9HhsCP6+yU$ O Ihs```Yh䨊\tIq"8&S7pw1']b}E+( :B$U;!#8vkz_1=f#$x/[a =J6 5u(oKVwRjA{=\Mcم5\ӶmޥuYuYL֋F>=Ǿ Is(?;M4`S[r`'$Q0,a& [CT=X ?ۑwAg-ϮV:,ӧ*,h6VC`'prcBaZsQeLҋ(̗ ORR^&7PȗQ'6uV*ֽ#[]u9A?_vȏ!eUPr]GaxD3NӘ m[}/;һɶ5[9cI WcȇwgdQ:Hbag/6:X2)H+WPF*~jQ`X(:9&zr@]f}%΀R_H MjlV URLZݒ7 wӷU] Gg&CvQkQ*0A]; Rkmi@̬ endstream endobj 10 0 obj << /Type /Page /Parent 93 0 R /Resources 11 0 R /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 11 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F3 105 0 R /F5 123 0 R /F6 130 0 R /F10 63 0 R /F11 64 0 R /F12 65 0 R >> /XObject << /Im1 62 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 12 0 obj << /Length 7562 /Filter /FlateDecode >> stream HɎ9: h(}飷lvu`A-v Tj~~)2d14cPJe*GYQ31x`q "^Ƿ>t魘}sW{{vyR|nůe݇Sa>k{ɶSNy|nͥz7˜BV7?ߋ٫Ϳ> [ЕYo{H{Q&+|'z{!C/SgOr*'LçxXz>rp=&>rZO8鹽|/59s_Y6wO+Iփ腾z$Ksf]bJp r@ZZ" STҏwW=?r/ :;>Lf@ ttG]>6~[q(5);r0%VbOiAE6(:pPy>cՍmxe۷h#eP:-kg<re:NP`qfZya+X%;S "㉊gl|8[@6k8r32?8{ WȂ}<0W)xO{/ z x|L-,HSyKKeR}C)"&}܂Α{#JfeT `IZ P G3aby85PPᥐ_ynsm&1,B%8E 'FWyu2Y&|2:Yd*H^YsjjD*DMYjઇv ><#MISv9t'VS _$k,݉ f} 9QW&)ԑUxma(D G  b,X%XCk 4#/_E|dSUk$Ng? ;'y܈®8TDqC!uc'cc/63qd(}B֝Dv;֫wn=k!\ɱǾ f}#2 /ɉD^} Տm~BpCEbSh&_w n^dk o'trxx9~}H$[[uA>屘`ۇtV{؂`궋}H[Oc .k,z]åG@ Ci3riΕ(H MNtk"Bk/]m=3Ir;rO][,ŲZkN+w;-!/:!Y~/~0[-WMwF+9E`oxu}}({"5HVfzfz.ltھH^)3p+;Jh`k4*U4[쨫)rx GMu-<>pS%|]e.q]cF%4>Z\nǴX&q49>FΑ Wx"&i507HRoN#MTZdAOwߞ(0hF̍TE^j&]3*^?%x%bܪ1('[bWWz1gՏ6埘W3U2UsɎ(*3+T&>vQ*AxUl0O 7^=LFbE2§&{&3Qi[t2 G7X\*%Okɏk)I`ޘ!@L^1IA{(xFaD |!%捊)te70ԟ7=>n~-\4|?i+R?QhppQ^8*kDIהG8ؓR!Ob|d﷊|+i$s~:-\"GΟY˦)6RjrB$"X*g-M˧~o* v堥`j` f9Пt&\ezn_— M {mWpf/|H&ru&ڃ.L|C%[ot|R{j/Qvْa/~"I|ωkQG@Ct]e<]cWYOr[I蓩<4enq0?'f^BH K66;#:Y:[Bq2*3)A@qks*A\R?{`7-/Ҟm ֲe֙=F~߉<=̦MZRcrg&0Gו.tc iW $B%5RT0bng )D2bWn&VtD,$=kxU۶Dz!~cEE}%1 [(57\ Dr;;3oI‚H?q]}D~OhŰrЂ #XpT`Q@Z'R ]DhϨͤFב"%B ЕEf06n%ۇ*dO;ɥL ר~GᛮĤt37ptbI::qx)Ow_]8 l`F@kv+: 59^ 5%dX+@>Jz A`<Fs?iu7[wy(I(nK^op1{k>ڧXG*l:8cl d{"6k:GRv'7V2%FaVjS<7Nd{iT&h`qa̸ @CF_h͉YGzM R> endobj 14 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F5 123 0 R /F9 61 0 R /F13 66 0 R /F14 67 0 R >> /Pattern << /P1 20 0 R /P2 25 0 R /P3 28 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 15 0 obj << /Length 4409 /Filter /FlateDecode >> stream HWَE^tCbO=Z'Fz@S<ΐ3R[U]UP w빷>xsӬ=V5Y z暇msX}S}?4=*|i8k~lšox8=y Jޘvfj)c1>y fXN~3'3a #19y f(XfOg¢N?d̘τE3%3'3a /ˌLqq9vf{l.xs ѾwY}X1|kCg)n:OZV JǥV͸eMNlK%K$9)>i?!fVx2Ǥ1PLDE08&kZ%ٜ=E,EJJK,EI&`b>49M*(n:sBPtJeG0H`%2aӊD&$ X i, LH H <)%%2a@I%2!IF1=u`[ @]Q\PI8Ge^IDBLRD$K PI|}K"Vo)=PbC% o-~W|P IV f4-MJFWmg"T絝PI`G["nJ@xtK$Tx+{H|xj? მBeL= Ij d [<.޵[K,-j9÷VoU++umo[麊䄊NW, hf2L6H&L֣~mOؔ]фG= '`j?v^BϴWWm/:J,IӢW)kq/AN6NObegPᬟn7eycstLhG-q؉*LK ۾⦃ms IY\b˔Tf!<'uSfGɧ1O'簾bKHy{!]rv)찏ZxƋC9Oo1( <|sv ߚ6EJw3Kt.ۻÇnM 8\s75?򷿾nte?ES`-z:hkOL+9,~1+Ϡ ^sݗ9: K`]k9Ho:8꟒h'OE/np+>1kR915ep 27=_N>-+H}xNaDKl}&:[6ڏ;*ٮߡA5np/~>lNK(s!5zwGGE=w 7N, 3zGh,D.{f5tkZuIK;$X%|C'4LPؽĔQdz ({$۰CQpr&z2ߵ8AүRUjmHPA$3r 6`=ȝiD &?)Yv "9ӏKLJ\w2%,sm(>Z.*QDa2,𩢧E╖QLY…J}nz`İ+& M(Dyӈǹj6J3/wGG֪\-zu.R :y:H+YN]1Bϋ.g-uIb?r YK,Pt -6ݴGbCeJk)3s _(v]vV " ςFj"e6rUT | 3:ߨY@0X-DT_ 8Khd`b@/v2eGxJK7HZ$wɃ#N]z_SH~fo%en5KAc:qk);M6}c?]E0G׿$Uo9h#ko[=q"B=P7|}ÞXq*Q7( DwJ{IN͢Y}j^N+vSh1wӂg q3;|)eRH)KXjw)AڿlwMIba_]dʘX5PgIF=0-2I>ʑ:$!WTE\7#]`"y9@.KtnX9*_2'PS* 7Ua`KmB6jG ĩB`G, ɯ>'&O]^RGD+jO:8faH4yiDH^<[8ile#<>C2ذH=])L@&p38+̑e !NHf8|gK;:0-1ItЊG\Fާ`cE 2LJͮz`1ӈIL%N%L3A4/hYLV 'uҜ53Mh: (# Jd0`+DXt[suHyh3+y U"z#gfn(nRLq؟js`xp 2=a bJq?[{QOVAFE;eN @Cua+Vn vjA0זb E_mC 3)+[4ǖ-wCZ~2%#v+Sxivi\"UQ`jR7=}T/L}byEӶ1kȢG:gup3^] #{C,C^wY ȝ{nxC VFuI|뺌 endstream endobj 16 0 obj << /Length 7 >> stream endstream endobj 17 0 obj [ /Indexed /DeviceRGB 1 16 0 R ] endobj 18 0 obj << /Type /XObject /Subtype /Image /Width 64 /Height 64 /BitsPerComponent 8 /ColorSpace 17 0 R /Length 53 /Filter /FlateDecode >> stream Hϱ ð9!yȘIM{w~~~~~~~~~~~~~` endstream endobj 19 0 obj << /ProcSet [ /PDF /ImageC /ImageI ] /XObject << /Im3 18 0 R >> /ExtGState << /GS1 137 0 R >> /ColorSpace << /Cs9 17 0 R >> >> endobj 20 0 obj << /Type /Pattern /Matrix [ 0.72 0 0 -0.72 33.599 771.22 ] /PatternType 1 /Resources 19 0 R /PaintType 1 /TilingType 1 /BBox [ 0 0 64 64 ] /XStep 64 /YStep 64 /Length 44 /Filter /FlateDecode >> stream Hw6TH/*23Q0B]0 $s=s\ _ endstream endobj 21 0 obj << /Length 7 >> stream endstream endobj 22 0 obj [ /Indexed /DeviceRGB 1 21 0 R ] endobj 23 0 obj << /Type /XObject /Subtype /Image /Width 64 /Height 64 /BitsPerComponent 8 /ColorSpace 22 0 R /Length 56 /Filter /FlateDecode >> stream H 0K: =m?????????????+ endstream endobj 24 0 obj << /ProcSet [ /PDF /ImageC /ImageI ] /XObject << /Im2 23 0 R >> /ExtGState << /GS1 137 0 R >> /ColorSpace << /Cs11 22 0 R >> >> endobj 25 0 obj << /Type /Pattern /Matrix [ 0.72 0 0 -0.72 33.599 771.22 ] /PatternType 1 /Resources 24 0 R /PaintType 1 /TilingType 1 /BBox [ 0 0 64 64 ] /XStep 64 /YStep 64 /Length 44 /Filter /FlateDecode >> stream Hw6TH/*23Q0B]0 $s=s\ ^ endstream endobj 26 0 obj << /Type /XObject /Subtype /Image /Width 64 /Height 64 /BitsPerComponent 8 /ColorSpace 17 0 R /Length 59 /Filter /FlateDecode >> stream H 0 xKWK^2{K^^[>1# endstream endobj 27 0 obj << /ProcSet [ /PDF /ImageC /ImageI ] /XObject << /Im4 26 0 R >> /ExtGState << /GS1 137 0 R >> /ColorSpace << /Cs9 17 0 R >> >> endobj 28 0 obj << /Type /Pattern /Matrix [ 0.72 0 0 -0.72 33.599 771.22 ] /PatternType 1 /Resources 27 0 R /PaintType 1 /TilingType 1 /BBox [ 0 0 64 64 ] /XStep 64 /YStep 64 /Length 44 /Filter /FlateDecode >> stream Hw6TH/*23Q0B]0 $s=sM\ ` endstream endobj 29 0 obj << /Type /Page /Parent 93 0 R /Resources 30 0 R /Contents 31 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 30 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F9 61 0 R /F15 68 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 31 0 obj << /Length 5452 /Filter /FlateDecode >> stream HWr}WH ofuoj!1 2o?>=HYqJ3==O~qsuUS4YIX5UeUX;\ߙxUeYҲFo>_}b>E7.{]&1Re]zdm7:[څNv[妈Y\wP&|?|#}<*-#W:3nze [z6҇+>8lK;96fV*>[zξ`Uzb/Ce psce4M5[]P"{XG榢3|ʭNȃ9&^;[Gйlp{E4b\䍫q;8,9df;=;yw' N@cq N G@Mϕ` S _#u/nݍ&(;["M8 %G( %Md}tۊbG,k{X5X .ʱ'Uon{yӒ J(lnG N3F8 ah=v'Wb^㚂\- r]z@J5S(xZe:<<05=~Cu2i5(ٴPW0ĺ?@K>..݊a pdmFoVLGu:fe_% tVgKJ*-[14&<[Si3DٺtCpO ~qFG=X fR&8|Cn{qWl&Q7vys`_Ԁ)PU [E d%s_67lq+ :Y8u^leQ+2Z^r`n qg֎  >$0=}@{\nC&DU@ӓk^ 6@h1جrM[-;]NȮMCǧrݷ\1(󮲈H-BfiG{-)YXrt^]2'yF6Z+ {Z(2sLĖCbFM<.oUQV4;є6ϱ1ϸ$g8!Ҙ:)3,tg(2>gJ$eLG|b XDʉLi:5A_;w->h,iZ*ݪTwcRTV&G#w ?t;^׶~Gѽؠ%J9pIf6݇V ݮnIT@A$$ߑ7>D!6/e4gQYMnE/dG)ܩ!*{Rio!*JDYMvǷܮ4\pr Zu=r؊W-d"yE E10P5.z |JYý(MJz<~*f0~dIc.0 1P3h^]ǸW>S 2M"$] CP SLXVZbv#>}J_fvUqqyE$2wzknUkxsu ;J $go bӷ%MİemRd2G V6ʢ{^֞hFWLSW4=؏ RgZ샔qFP&TrEo0d8Nd&|D/rמ<3mԳM$ҎW) ѝH*8'pn:w yկ;tN \yzjyƍ| 2dlb˰c+|@pꜪ\$a<.N)^r1? 51A\i8 di{QεAsZLil΃RBn+la_CD \L!b ٭}P!qNV |"1uzht)|^W޿叒t*yK: 1p*PʼnL_B89)Iw&ʼnٮfwb3~zLaNiB̳eϞ%;~||j5Y-Ȳ{olY=+uTϦ159gčb,šRK##iFQFB'=TeJy,tWiGO1-Ovve V%M,)t\Yp`ot1 kig+ogpg+VFBmzڞ_"h_l ЅzoH 0ypy4C >7V*Hl* MG@-6TǁDP~ڊkWp@0as%zש;}sdB08$jK?2Ȧ9oU;`-yVZ"쟔I6xTOʧ'*3'FA,H.qbޗNKwԼLQ2ꇯ`jiDV^&4S@mkVdV,,nɊKSDE bј1=Q-E;e78š4Nf ɎlwxTJ6ƔS""4@~)/D'YH3C_#Pel}6ގ)ѼVN$ c pd A 8⹖\d~zт&#%cĂ'=&|ҙ S/ Lh@|)-9+vJ,%` z j/4taRe -@<Yf} hK cui찝%.9)p\ dbP:zHZi٘咳9l3TگklҲ" (&QS7YwiyoGJ 9V"':[5 G~SXIK6=F.}P{hiϔ[wwD"T"sB%>w~(qmULǪ0&)'xxT>J|~ǎụ,.Q ȭ[1ϢRDC(yi njO6w1QPĚ(ye,NĽ6b ts/EvNB]l'z_ Ȭt)ߍE* `'MM%c Y ǺC~ε טﴫ a\B?/!Jv1U VV: ÛڰxJ.ƃ&X}D'yAńr|P9OQtzےdZrvQi@OcP0r*Pk  n LdV + CohL2UO•!N nƒ!mZ AzvhyH @]gD[itW6^l?Q ~ ZLSD'Rk}:PϖdF\1f+9BNa*ɜl?bX hBQ&J嫑Z1*XlBKHR`'*Jz̼%.gdoӶ*Y;~!uȞ(0%>Tf@|po)3lmkĈgeNhY#T"Mz5"腤DAMԥ}WiM\^`P!J?|HЀF Ԁ5Je[*[E|ű| [ endstream endobj 32 0 obj << /Type /Page /Parent 93 0 R /Resources 33 0 R /Contents 34 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 33 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F15 68 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 34 0 obj << /Length 5658 /Filter /FlateDecode >> stream HW[o~02XQ+CHEB ,֔%8hpw %;6Zk83oޯ.TEU^˜P)E"r/o.Q7E幻\4owC3–*+m5rC?ۉˊ[O~жqsluw4~ݦJg*t voZoӿ@.T+Ej.oަ J>Si |]w& Z7nHW^SRW|ݙߦM=D57/~ݧկ?hٶfwYײWZ-_^F󬪪BtX:9RwÿPғ[(=v8s9t@Tg6A%Bdpw!NJZQT=E$( "(0q+V2&+B2a|8A$rfwȥ\pp.u.0FK._$='|=I(6њYZ'4 S8}ԫc)yoX.\VF"ÆTLT 'jzBYRX)? Ff(57Op1krHF gs8@.(yc zxp{,i(@oТTXEfsp$[Ê q B2q@4N#9v<JpJ=| pbaaOWcJ=Z\, ɁDFFIt iEw$yAv'55!5'Qv/wγOm͌1 $2b/z )G]4rQP~CEU&ę/+ώw8\LL?h3DzsPB@s۱=o햆rȔ SPaYQfۮkc#$37/a)neI:ɯ#0cBJ]2ehiB:TB"=fCc~ .NBE (X}Fu'XHՔMfm;~+ۖ-9Ag(-dSVE +9i*ʞ!ݪ*$Y9ktL% l{ @;Β9NKZ [d+V'gRwE4؅S|#V 刨nNB'癙!sBEmE3 ko8-TBRi2)K&O|8잤O8†ރI;0䂥GRX=r:ԡwm$pZh]e3@,؝a9_r~̭){eG'h,)ra{@%^sr!/0"~97/>Yc)S@9mmIc@nWpF2P`ap2&\4E,"߅ Vrodw!9űcq^#JJz .kLJ0S^e;nY# DmU$^dv2-csϹ(Սaj, I58ÛIP&WL _8NBf^1v{.+zT ʴ?s7<*KKE0(-r0RDD'<ܡVUp 4ƚ7R@PvM|U iKS@[eVxϟE1yTwT*`^XېaIU5 jŤNb/:"4h`&A_k|.qw܍O-֛ \moI؟D*)*PbhGx cbEDD IX.-Spu鲔xԏb(VrhC+_gG =-LN+1H*=T&n;v ;G%ivS@awƜP![řVt]y(-VH \#l۹2q'+& qL{/yӏnu8NoriTjj)6n@?`oX";N:jJ".a K/xz-AMuBK]ۖ6heXr^bä9Ě`!Blh+u5gؠ26 B+:MƒILx+8d2CScGut YhE-g`ⰐK1ri֖GXm>i".oRs7 y!^0.UHm7D+D8(X'|#GuKp|Ѐp5iԥ,byXUߺ%F]T;YכI2bgtiL+d-3O8~0]-h ўcj![3`lFhwK u+t]7+TBw^B<TPN5Ac!\m!Au&hP 7AL͵rB}ObF`CzLEm@՞>cW`0&A.vQvמz"r0Z|Ӈ֮ҚN{[66&&V~ujApd~`>L]Kra<SWЩ{ \JW}F"R]SJlQ7?OSW*H\>S_CC.lG4$-<<ML{te10&<QniReh*qRGnB CT"o+{N+/tD^H5qUiW"t!Xnj>f w"ɐC=Y2~wUWE++4}1{&_!]:<%11#"OQI!1% w xݴRDi((E 6q~R Q&j]ZƖ7K1w 1jφ.-uZ=*շiU]S7FtZ`#;Oyسw:%kD;Г` 6vԂro+JtAP[Y=Cu:ϖ]' GmNq#T$jU=cЙ/RV>@4>bW]G:+WJF/|ö`EdFIM- 5kC]rs5&U|c.B adh=ԜT1pY B trj+obw{72E聪>|1&"+M+A\˖lbMR7=H:+7\6H*[1VkӨ'* BftX}!~3*T m pV*SZUe73l&ΗFۼ [b){DeEaq kʨl%egMTMk4#}zH#SMweկWJtM7 *GWuB|=rWFZWmsXPX}V[sv>A?(/ݞ nk*ŏy4v  ˤȅ1ør@ \T+9ʈ`+N He%2tD!#wb$;"*894,0[w`[AG줨}iZۣ7<GX&ԱMvz B\фL%"I7vhޠVHh(jK|Z[ߤR<v!'/ KU4($xAdW& 9B d\85NR q8_`ŏ=8 jjIRtL0>97-eqլRaAjzP@ :6 ɔҡ"$^̕ε~[GwZNa=E DZ{D7|y(a8tL[ K ZLJg endstream endobj 35 0 obj << /Type /Page /Parent 93 0 R /Resources 36 0 R /Contents 37 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 36 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F9 61 0 R /F16 69 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 37 0 obj << /Length 7358 /Filter /FlateDecode >> stream HtWnEpP,BFr<) -ITD)?EÝfScp}s[7Wo߻Y]2ֶ^T/l좩Z_pmUUVKKYyܗm ۘ2dSnJҹ1/lzՈ|k7n[yC.&8(.QL%aqz{Zǧ`~ϮEom?hL1XPdPvtyшTrgWhQn7VcD/ݥ݊:Yc}2ƫkn(k׀_Lӱb݈}b*Szm'{Jk^"83Xދuk#V(fEH<?LDy4Y3m ӏ=2{hIU4 xn@"V}tuxumjR 6*9KIҖbՑɒ'+5ݪ;ː[uH7f vSNmΡ;"Q|ݻ"%h4\4Lti^?zf7qe14bJRn; TpjgVvԚَ#!qMY(pen-wHIQ[ y3$k!'-!9_:%4h<#p4sm?uh*-6G*,HQ U} LL]׷p9Ӳ5ls ƴtLLX<:f%w*k2>9t$VUS/`b[x*4S(Zؙ= u~oA-SlD)Qlx$/}$@žg|apĽmEoaH&,7wz$, t;閧SS&Ϊچ6jK/*~ e/Mc8lXpW2$e,V+mC Ć [psJK2tZ"Zm}_[q(6r $v@#c<Ҋdd6D!R8'NZtydCSo۔`b1Ms)֣v@sFjzXd9ĵÄ}, "I'"wGHZF{p1KlhpʝT Rf5+p~"m J D%y V_̴A SR#`BSմK@}`~.Oe1A$\u0܉<Q8? ꟣dfp7]\\'Ee_TXһN V{д%DƑr5p~ 60@J+\dH[F5! 9Px ю -M2biX7wk[͐e1G'nVJ`^J=ҒE;v. XMä +3.qdT F$7]匊Sԋox.b5tpOw10o>-.T )!G,õM$Չ54u6/I2($d p-aJRQ#op˜)MD ͇a3l45#c,D]1jnzYD,F٪lJUFoE C ; :,0 }Z`/'HQA&x#IAZ&d"All^ h-pꜪH$3"sRE]}2An&%bV"v|I;:qn%^~QǺeUhXs&˦8`Lj|J R*ᚔ<,]y?h|m iH'ؚtO†SMU0=sј_ j:7]н Fݏ@9r|(9eUL":%Ifn7=r̼è j\nS.R̝8`e" z轮amV%u-(ڨxݕĪC1"A\ lJs둲K&ol9f]WʮcDX'Jc)A+IR]ҴcqE(k"{DzX ̵ 43-Zb~{|qWVOAD8miVKgu7vR,X-1 +<0^^U2_=p|hX7-/nx,{n~@b+0$# *3J(ef!]F./U‘(RNЮ''~?/x{{7t.^&D?fjp(W}wpG g-$hpOumcc_.Rũ*8 Tœjݡ<U\V/ܯL ucW){H1#@-!TZݼF+RhEaOQ`l{n']>!tO3SC}ʍ`P*'a`S_(O[12;AyQ(K{ ʻT:򉗂O(G^7\Ӄ0H_tdx7y"r#N<|Dݨ[Ыӛp\ G$wyWBU% E/j,+uVxd;(RސP)z5S)h=s)*W7YP7B6Ht_|@q o+MJ}*j&!Vs&J}tߨ1YJ/zT6U`gHwXKOT̃kkgꠂZc%ItMPeL Uc2FAVƅקMӶꘪ!=UQRq둦u9EoVðV`]^fm΃V+A&( gĻ^Qw z5.A} V 4$E8s)l1=9@u%l4%Ϥ'#q;ٗ&4f_X9KPԑ%"x C+1Gd`>sT(h[q_b D5|[pH>Ƞ>cy<J Z&Q*{  eaӛB20dkZ:gNM3zY?1/G*`SPQ]#ZMNOТ`것UQ9пt̂ i/ `1J?YNJ{ws䃜p*C<-0YѶ L89,@DLRED8 x'x[ix6[( .qIvJ.aK\Dž꡷QPb= Nu1wi;*Fb|DIG*7VXxbUh*Kggh%a 1Ӷ{Wܺ!4kt@']kS!rau18rPhXAko؎CՉNiQ)V@y o/<{]w@ݿ?*j혹d*dOрי Bw&&\ywVP|ʗ X_+ Cዲk| Qs!z:FG=kԝ4izҵ E;$.;Τ >dTMj<wpI)"˲zm" Of+edp"xz>IÝs"I7-l P,"4ę0L]SAJ)8I%WIk̭^rR؜t=22hO4' T Ws՛l>)*Q MW\mEqh~F h6-F0န &IgE~T rE_j?ⱐpVl5t:N4q00(S󮢂]G oo q&IXp;TmAC,EȺx22.LGΘL"ԊxUgYy:H@clkID(T8b}۝TW/UJC)Q#oɿXnE~tN@*>$ cE #% [&ALHY/~-f(W OE|b^$iHZvgD}{i6˶d?ګgN6I-sz@cb <*qDit/I+QEMNC7a4pvma'ۮln9`ĩ7*@HFI):NS0 TT9HH>E#jseX5+ͲWs҂?|T-PuTD0u@9~z` ,Eta1錱bWG;B[;sO&v}ѶJyגcn[G~FwHQ$| !#pqc> endobj 39 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F5 123 0 R /F9 61 0 R /F15 68 0 R /F16 69 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 40 0 obj << /Length 4383 /Filter /FlateDecode >> stream HWkoE?0/d2>~ZǛ8ibkI!"c+QI3ZΙ$;nw0`뜙zvJO뉋]ӄO,8͕,Mť:O8Iق&g'A}W:R'6։O$v姳N>PJSAFy ^Qa׵ad6U}?釺 >q:?YlVuΈlȜu6_(7?v'.-[WJ¶P='͍5?]v(f3Mڑi҆U^KQi'HUe:?Ǐuor ߍR4nvի_?U9&D*ΝS5¨c6H!̺͊4)i%X5Wae&Ӝ&s?3_lj~[ xuhXƥW.>}>s3_B$NHc+̡GA%ɒ1ZF6 kc#?bzkn!0щx sR X׻0#ɀ"( M[1[̗MU|m8KhkNYCqLDHy ˑ.^stA׌iJ3Qj+5~*@t(Z9RKN`Ego# QW 0t8.W:<>ܞA)*S8~%} 2Ldp>" xq+PV<VeL!jd N|a؏=ԹXՋ͚ݱрmU# mlI vM=t2`~˲I]j(D-B -A9̬kXPRꜯEvX GHSRJj_~H٦;,RHԗF< 2? am)A0E t0-SDT1C=[֠]p>I8dG *Nmvi/`¼E##"muHH0uHQ';r5lk!Oo;Oc_"lFwH:.L{˅& Dta >--Nh_3Hm)k=明d[$4 cdqRpMHprւ;~=̠6fS6|1/ۋ}l?6oe*-Ý% Z^OZ'Ψ9c{5^܈&@c?3zHZC:wO̐xS'5T!_ D {:`e{؞ 5Ԧ%#rEPۖ}M8阳Lۻ_-ذrM %.XK$ȟM%9^< p"3L2UQ5OvaU[Ӯ `T&@ƞO9G7HEpg%Yg@ RX :y$*k#D~]y,C*#ND4ܷj|pʸ via߫<[%'I @+=8޻Lop$'0$DἩHx\*B (Eɔ hJeʫ)wR-Qa_^^4|eKh.G!>,]2̭& qıtiWvP E N\N o4t ~OTC016 kHezūKKʃ s``l?sXq4VxY6&g 5>_ k_Z$& =DZx=#(u焐T.׌ost枞Ĭl܌넶ܡGdi ^B萞`"eV>?+ 9g*ŠmY_>9وR=_חUMZ0{ZRy]:p<U$6_22]dflsk9vd$[.^!\yv^Apr*/{ƍW/ ؊^ wI [HA,_ e]]3B4/ -,R[&L M_xޙ5zvvR:0[őw_VM1yvK7ԟ<0[s:a_sr .\7lU>`f5E4|_U8XA *D **I5j鲌l,h+D&`b ok^ g+۲S'ٲ\f cXbg8N,M)m̎5 HiSn6Eo'h9Mub|=؉RK7!Ѻ)n̯Ujר~Ue)K݋q(. "S4 5kӉa> d2]oثceqRMdAx&2Jv{S1;շ*i7avm/>eo@L/=i 2hD5SyIt6T@ NbHV:dt :|W}9@$""W=eKy sк{43Z> endobj 42 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F15 68 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 43 0 obj << /Length 791 /Filter /FlateDecode >> stream HT]o0}ϯ{R\;vxo*5C! ZIû΍C cJ4={z}OǞaF| eW9K=O'k3#?-`31/ge hzL`\Oz7dTUIl;ˮ㇫k*y zCȳK@|{oHlC'\6t+-|*3cLHinY;QeWG'Ï$bD\E@n( IE;I+}{dh2~[cnLܢ|\U+i/+P Zi_R҇%8ⱝG7?i@ar]D^P1xJ dd <Vk9BT*N4I%`(^%8%"٧blh*? iv`ankN%_|ΊbnԋZl"rv '.]#tT2j7CDJᅡ*lcIؚ5aZ%hVε{ R 9o AVy&Lh'j"AZ+x,| Y֧"$m?R`bC< Oö, ȋUce1\|Uտ%um^nQcNJcIŢs]=n.މXBi1uiz[: endstream endobj 44 0 obj << /Type /Page /Parent 95 0 R /Resources 45 0 R /Contents 46 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 45 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F9 61 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 46 0 obj << /Length 6917 /Filter /FlateDecode >> stream HWn#Y)1҇DE E@S̈́;k͐:Ʊ[ͽgfe͚w7X添Ǜz[Kw[fֹ&}iɶYow,^ov8Nݯqmƶo"֫j[.7N+tl}孌*iM|-Ã4~[&>ۑCmM7߻lJQn+B c`j?r4&,Ѣ']3LM{.kֆrf}{H#Vndz&', b!„ >iq pihЍ)dY'}؈V)n6&5XHƴ/P{vS/uN9ՁkŢǴ^q܉;<ԲR=m^)J9Fez5(iA8%Qpx>AK$u  Crrg1Z1 A)2s\ުOa qXC?Ue#[R *6j 0Jw<`XMKvB\|ƑEOZR߄Qq=vKDjz>]6a 1_#e}ODmX{/4T).ئJk@t ZF9OQS ^eY$2&/)o$Ą TKN~2 #ik]+G$*M/Ŏ\ #(aUN(N`d-X˘ZC"2y&ij=c_`bnYO:; ;ke:`fL.s$.Kfȫo<5HIܾ IxH]'^1OGEadB`PXn*ёVeFe#Dmm>RM>)j"@d]d~ Xunp&2.Q!ỳ#Lku_S L2} ܼ#מÌTK֢ςERb&"du-$7 \Ry#NO,s/pLR$Pp݇eUEzN&(^ Xɵ~\?HziܝdG"d&^erOqM;3a`[zB&Ϭ$6P}hƅѥrP7}T't& DAϭpYU!L!`^A%#bNwrIBԆ5<hqz>;ˑnn:8Ek?qTA5=)ӂݼ&څmrĽ1;ތSZ#4HϼZU,|Ǭ"-v+K_uB9#He]T?km> @EJ%ncncSTyZղJ 5p7_PslW[Sy) tjKFAL v~?NJeUI[%:(ZymC[e YQCc{ҭ>G+W:9u;{bUVndytnh+㄀ D$m{\8+3FY\g sUHUxmtci6R 8kR-?`jA 2J9H]vܸ*()uNкA]YFRp]jkgnRJ~j˫a%׽ 5o~BUctw* Y3nҌ+yBdLYKUDVYY6<=yD$Dp|.ìMuQvJOӅ]=(c+- $:G.%;8F <0cO:Ԕ_ OAa5wA"zY߻)+34*Yq/=c/vqgB 2b/%-uTaLN:M[Ar@ RzDf(adtuG8rʃv=;gR#g6c^|iƞ(F{,9U#ppRxK2/U҄!4ʱNB-}Rt%|Wز*}kl*jt:̕ '<<j$\c˽tZa=I!kmd^l_z<*֋ڬ5$ 3 urb?G} >?Oy.06j(FI*%"s29"!6̴Bvsrǔ&ot PcF˕-Ba>FUЁoW4zpSdD 7#IKx춑]QdHJemndOR%b  8{νHUUo|U1g40Wӣ4JӠ^F|+LO>lBᡩu$ӏNILDa(6Q(;$ƕ\42%L F9ZWV j  a43a^g=89 hPphU/hSLk5V^ߖU[p~͜z¦!4*v!uvHj"ҏh''C'M/>*J:K6WۦK ;p02|'ZDTa#jsr'oP`2,TV=.T"wNUռϯ&_޸G2G2ҺiL9&U#y߉+.7+ . coh18 !8@r`b:~/́Oӹv_rqzY/ ?< mTI薻 5 haӒ (jcG7M0Pef"JO+MJ%W^-22YyZO{FkŰީH|*2@Ex8wBUh{]g"֫R2Jugr۞۞Lm`^bua: %ll{)$ej*%.L0R0 'nljrA;dp[PWD+&w0H3I=a5Ò36jL=%qewN9H(V(꺻Feqpn,6mJ]:c,UЯ( H2M^7Z`I]h1t(3c3A5gκ@`(.`[A< +7E 7(ͪ24ʖ^rC8#@a4wG@YxKrvJU# 铝:(Jaz֝]C]f,D-iDL ͰVbMt=ֳBC 6vr%fKx')x@^h}'e`'K;EY ]0`oh#]kpӏ84T_+.$_{ʯ{qVwOtY3oEŐ9#_7<` %Ȥ[|ƧܕcZtR(w9:ՁmXVT YƳrԾ팦jNMG֑d8IN b9>k?Ay*:by 39{̡F/[NeJzKy{cV M].|,2auNy;-N :Zvv)tx:V>)o_kք/ U@ (hd̗I_A. MCe_tШe8+-6kgO fiIoD;{u?5ɼ|5b(b .{q܎NjV, %2빶S;(,ȿ*m1kokg;(Ox4;4$%tZDۦ ݾTdE3DAeM@(/d=m_]rBZnOPஞz5oԶH{%W ;-ά>\`9EP6S9NYӝxsgg"M~!WF_F>8d+մS̆^c/"'Gi&_BUdmV- /"euCB[z\TBѿ$)qp[':"kw:{mB !եly W/4=T=U6pnԴvg'KMbK/qM +rAՓ=K×^+.z:}.DŤh/1gg-q|җBef3PpUh..U&t*e Bo¤T[}^V]aߖ uYjR5ؚNe0ZUðU_PfC?w iQ##'nh?7%6z>]-IŁc݆ ޟċ$J7frC&3ҥwtG| lEVJ*OUq!W FWrlj_R;d@(Pi/il4=qG>O@I .wd'MR'+rD#LI7!L8 DùZӶ|i^nۑ3 21H(P۶X{@oR'22[ȱ&B$L]nrk@?jmb4?E~%aFNW+qIRfV۫2R:jO;l%SEAB%N.%,jI|Ice[Tq9DQ_ 6-RӍOw,mQtﯘlĔ)NeYLU6)CR*J8l{AS3+ xu>x׾~E}wY޸WĮ9x~0@]2v/?FsOk30/r6~ȾJ*S@՛t|3*fcSdt7jQfMv=>b"; ;rEt\a1lМN;cq=Y-iKlXb˟Ã0დCPP-]bp9@:KBɁW4hi_n];/ ca;!ŲckK p ^j3|`2zHKfgWo7Á4R:%78{ 1A_;1;˿Y>WՄ}aK:]!`rcуC s D;ܿQP' ?i_-CO#V4]-3z'(5wQ 묺>Η.$2r4˩m8=}FD HkӠwO .)|E1NipaeISq~$~+ީN CrBCjYǮ#r)y.0e囹*4/g\()#~W ; yLc>.(M|kjNՄ}͂gY'W6U+:yS *3R&ASM3])#14Pg6w?`jeCPq>_LVEmZ MeYg'FW)SKǛ 4}#(Ҏx8ql~[?ND!> ,K(cRJA ({?{hsUs̍Ķ=2 z}>jq$Hr͹dX-V>GKz뮷$6ۯɚ6lI)irԯO{ endstream endobj 47 0 obj << /Type /Page /Parent 95 0 R /Resources 48 0 R /Contents 49 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 48 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F9 61 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 49 0 obj << /Length 7387 /Filter /FlateDecode >> stream HtWˎ%X48 AYDf0 6ESFNl n>ԩ_w?{sY]>2..y"TfJ(~M#/6R@Y>7m4/?od=7 |>FzzTFo3QX 3beȔtn3ޕXp2^X1a6 WqUזlEǝ^&%8&V䦇 H܆*R%W+zN_ տy'LL Z - Dm96lN"R_*蹙u]y(Ŋe:'͘:«N@sx?`θs:xF8p㿔5CsjK؂sxZ] j%R%<&8$5GUqA3?FQ#+$RRNn$&yd.yJ~9)ACM/oc#餠]1Jv+? H*^AC/xc`=b ϶=]L_!HU9`VrүTZ V 9|rS~!q=sd*4A, GN;]>z 3Pnt%Q <u0=zRBuPvR]6otyc8R U+wPF=(R4y S""h sohEU#g4peL]HOaeE7C-j|)%c/W z< L+Rq2j^Dr>x{ֲn2ۏȏQݤ+QrUqs[W~T͹&JK`W`/ߥ΃-\XF.cӸW%uRH~%Dh>g 0rxNjZsW,b$򪨈loI ]qfy,_VIfiEkb0>ƞC r;-׾qzwѬ/*Qs;F (`?iCf=w.771\ #zIP`yO7cʓ}s2:ARtv|XBj^fzN06 7q!W,6bp ?DNIGyP0|iQF *l~x񞇵+z+nP=j qT/MgTڂ7)m,*8w`!Ts6q# ya#&Z]UN IhTf$/LA/TlA> GqB*W([y>R*t*U۫g#/0|yUӠ-ҌbҨsp Šg:ʕ/,/2 {! = D 8lNss5ZAIhd$>N ϛ[]ȋ/b<&>;X7{n( i^y)*Qk,.BXYhw%@;sdg]$c;M!%`H آzN/;gNi&\y"Zޥ榥nX,k$WHDsܐ m#$&|skʛ|iۮ )r9xPݟnl*z?J ʕiG~Iµsی#]"Dv,yp+FOM _g46[CcOOQPħ Y <+w W1^@A♁3}1!bY~0Eo-[C|8@ κ{S} D> ;Դ\9[^ttX7YOo dۊ,x1Y9Z1yLhL.e%Ή{~_wt)m̨edk<̻MŖ%>cy J=z:-aN"Hb2<^firdmtAj"%)Ɂ Xw\Ze{ݓux, J-  d+{ zOmv@j돉J xYޫIכn*ʭ5VA_LTr=3U1V0='YT,E6Ä|V~#7$E]94, 4zpy\t$Z6ՊDvՌ[؞;M۱8fǓ@2a@erz{x⻤Q/AaѮ¾#%g֎mʚ.'f|b׷ pɤey82#BzVIvZ ll,Q$-SL9_R" fT6c}|T50Ŗ_;] c˼9W0׋d2 ڟ>VH%_t3I&622~w8bfԾ'l`3/qAprX WϸB+D>\d;k(jY])6BW'D7Gjm7YHT۲V0_^hCZ}Hӣ1倾7y[+Yj~y `V;Sj4"LCVAxllSP!>T~@!!G3dƍ|f?AhKMK-Va<2xEM.l/sw`9뼡"'b>Xٶ64ܻntþl,!C ZI̋5Re\L#v՟,j[Pg/.rCi(;:85ؾrrQcc5 XBM>B+\~"}v b͝iwFBV*ӎVTI'IaX`*m&5߄7l}A+gBgOaUb'0|*?u.0&T |)\2.& fyP9 #@gt_F"KPDy \n\\H﷘n D;:F? g7 w'=0iV3k\P6;P*J'Ue Jj ]<MP!^A 搹 oBj`XgƒZ{#e)*٨&fI`\̶_dޭ+syX |lTcu-uC B~:-e&R/tbuԢwsX/4%u=r@#hjtUf 6d*qE:ln _Nۉ αHva}3ԓݤd ]:\jd&LòcVܻ4E7n/7n,A4k9QX].:=oeLCXȝ?ڸ֫f/Isr^pӆz6!CD@@*m7G;#Sd?WnFr`.$d7I 2 Ek%?éWd2zOA+l;6J\aaP%DڭOu\|w-_oõW6\C n/ٞfXP.~Kʟeb0Fm{h<@"E 8"eZa+H JZ\Ӷ ىt -W`yaw52Aaek"#@d(Q[P}={˄+~\ ZSN\KYRWd“IlTt a?}X%ZcSQdԔYA֎1\VG}_ r97NbX[(c+Y 3TB=bI?f#+j'qPM_k|_l|uGTX( Z -u_gNoT!mgм4S" 0%L ˚jzE7-TlN`(j!}2E\A᜔͎IIr ps9_në<60lo&_VoEBv F3_|&>%&u-S>iI"\_Qƈ/j/:xb)k3bFpMRL R%>Q}z #1{^pfǠ/Lø ^Qv~ )@(d3f zK3A.[h6swq[דu-V\&sBڌǴ |wEN<|ZHrWuye~)f66թj]lF陴>B$R[[wZx0 I.\̈́`2qsenXcx .xԗ&Ll c-Egy' ,Qߐ) ~8lԫ,ȕt"P!D`BؘFPaW}rcX|B,/*1'PF0'0xwЎ[renTCS?h8J`@pl앝cO FlT'&n+0X7KCQGI0J3}^,sА\VpKH?kjzy2sr0P9n1 Ҫ]6X8`~cU] 8Ņ8El5b]ˡ :TUTYU^=q{}"m^"f`2> endobj 51 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 52 0 obj << /Length 7036 /Filter /FlateDecode >> stream HWnH+t$6Yu,fOX{)5~ ɖތȬV $*+3+22>wiUgkv]u??wOj]UUw.4/Wk_Kiw߬(OhW i8p0ZWB\3+K%XWV}[IB{af/'K)\JWtP3X|*;"+1X"_= GIv$QXCXS|9L]0SAȞrgZKV'ypR=g$؋bC2SN&&75e>Frߟʺ\)p\F||,YF,bݏa- NyR$r3̳UN ~txȜ_ZamC2QQ$8"TصS2Ncp"=c( QOquTj#xJ mDW)bQ_|7'^"T?9/ l;pQ|"3(˦VuMڒE^]<-MNFc76ca3)coO-969#3_܄5h[vg6[QʾlޱW 1[QY VH kR@śpXGcv]솣q9kK>Ȣ6}-VO8~0Iú i%Pߋs֠k} kiڮoeTLk)qR Su;^&g/{B<ЄT$'cYLsLAU1@a NttJ-ec 6H$7IJ_?-@dMȳR5FɶZ.3}[Ɛ0qt w=u>?_jS98ϢNCEu4fiAvh!ik]:NO@yl߿ıIIh{J*I9FA DXYƌbK|P]pDJj-;6<*2J-_Iݏ.Ih#eWvmRȿJ!pgeghPz },">*tt7%YC6;؄6\duӀo&.6aЄ7Dx)irWnhQ2{d9k$\aLظzH_ $B[4ܔZBnn<dq}&XK'6ھŤu=F>jJ:ҟ H+J%η9VkW6j B&bnbFi-.7Fi!Aی%rjlXmSӠbX_INjq!Gpz}biCQ_~El;}Ǩ!l i`8)ӤCRS?ԅj9eF+m_Fy#oQh]E+56WP(]&(VbݙL]YPolFh rT^C]EUW{ jjM8ezu 5 9r9DP&_EƘ]sw:KU'$R34bSB6sETHHL27S)6iwѴM@$*+(҈i1XC$Bn4H 9X$XUukOd<]AzyrְYnuYuK1M,yUjF"⫴TIB[?JP~;O2lӒEN0+2#MOfnN b5at: 0GzX~K-f_"%eF `('-vMKj,tJJB ۘ:0ye[6꺯t|pҡľuйNFVTm:ŽE"K9^|$q4N{ڲϧ]S0'TOtF( ZRT 0,Qw@QdO6^ujl։q 6m]*yrsa|X׭M$dOm \XXFNK3*7 {K]m>hye uH^XR{BpÂR*<% VAnL<75]z6 Pi=l?ce0msat{#3y49+ 4vykԚI.Ɇ /l qkZUfA 鹧XZ14&c@y"Y)vOz]{?'8hzЇ5'A?q ۥ6Foe&eB1O65~~(AE-rPWv1FǁW0\؏_prJ'I9Eb[ >]t2[搬lp)HB`m(NeYgG=$ p8NU)з9kB / K`qw:T<$b!bs"qTCw h05Y|93UpbYj.T<3f9ao'șmc6\U9`)v(>KD3h Hm&M762&uT{.t8s]T4 —~ 37JO&.5$?_k4G/ %/"#8$b] _, #ŭS oS&%f {e?ݶ(phfH ٝEn5lJH!Qp{9w()n޹@}6aLY؆~HH @^H)a 7+.iK$Y#+(c-p2M np.纼X5BGiZP~ǣC"jR"' &fÌ Y2LDGJG.3Vt"dӚ;."+ԔHdglL}0}fdޯHD/KE{Mv;m_-W{RUHE:֟V6g bT\:4O<ԙ6Qҙ 5ޝS'.5oQK(@(B!%nqC{0ߪ?Tzv{R@udB ~rv8h3.ʫwϵ36oЗ g?Oڄ ڒ<%NI*Q[m^GO H Q#@4ó鋔l?}w|tfg +5nWB%nj0Z iOb1'q؃$2ͥ6l SgzФAyF* #DfBn(]_g45U^vbŁBY1QiO@;%f|n-4-m@JӁڻ$4o9+ҘSy=rֆuJP6 9ѿ!0X58ߏRP:#ȷm0Mii]YR$pVeqэ͒Lӷ~_3 endstream endobj 53 0 obj << /Type /Page /Parent 95 0 R /Resources 54 0 R /Contents 55 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 54 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F4 114 0 R /F5 123 0 R /F9 61 0 R /F17 70 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 55 0 obj << /Length 5463 /Filter /FlateDecode >> stream HWr}WHX G7rRey_\y@PD\=)YNʖ]fg/OxwnmwyY{{x>aYͧl1ƆL>X!:s6ͳ*iNHtj XqDe2#>ˀ"h E%g9DVإ+wՅ-D 틪ʊڋPOGI780Qdpz042Ec~!!mjkXEd 'pP2>+O }02X:FalQp܋g{h4#7ئʂn7têU^V 0 ӏ&y< c7X%:xz;x8Ȍz.u햳 0,q,2ug| bCtuB2f[MmN\ Y|hkÔ2y}ŅD%N]tMJqG qZCQ}9iWtͳYYBUsjgC 8% 29/2ET5}S!|wf9)\ٲ; )eu6<2SʜAQ3)A]bP|Kfy~E!=mVVX@rDV$mqTSܡU(0?HQry<&8A]eZ(u].-9̸rUZLlm^zd*f[Ë]LkM\u(4JvRo=Q)mx7\|iب,^leqzErHzjRw!ӬPv@̗A_p5ϲJ8͈1mdF-X[$F^eقmB/#:PNI 2%%P.ˢ1|Ed\ ^SF2] V5#m*"@Iڳ_waRH3{ɨ&5) ahYtm@ml/Hpu$[>&hxEh"Xt ɴKsIbozAG pc _4=kEA( n y A fJCuKPК&ır( =` =t3跨ܷ:Qy%4_!(nw$@Tȉ UYu:6hR)ė d]?X`fcU2?# iXt&2GWJZFB0/{S#lQ2"%&dKR zleYE4=sݟvF r&;G C{ؙxOcd JV.~=i;^s5M3f6ZzN}n{ƒvGd? ?RW EUy ` x1٦u|۾9,i0\Yo'4Ȩ5*uFKtjAR~hKԧQ0zaC)Q9!v]) M4!7e!kJ/mep͡ Kϭ7ЯNhtTkjTT?cvRsf{;-K˗3=-V +(jHiSNl4MlrgAm'yىz.Gq#3eutX m Ѿ vҁlPH""j4RmM໿^/<_Y6()RH9D ^[|/G ˎ"ƟPN"` "̖wmq$GQ{g֡@yf /FHV“l}N{͕JUO| ;ՂzɬjWcE^"&81H~9i t椸)Aφ\jBıh- $RdyxAa1q4Y}F[M]R޲ LB +<.2jq) W ͣn&7E̊A$J\<R g+6c#pf흐.6?/ח1j`rbg1ꭐнqMV!IH;"IC~R!' `fp8I?5LT'5Z,OreIBIge۟r&CGk@q݉Y8+>/_HZ#+1Ĥ ~Gg!bb^?QM~4m]}#ƢZO43YY$$Q& HZVCLowEPdji.p="0O..QU I(67V Ѝ%c ȸ?r:"6I:[`KU:d:iS`U$L8\gU~Ivʕ*&Pn-nh)'| z89_H*W3Il_Q}L%Gcs=-d:hcisMa'$x+d+_v{:obԍV ՠ"v9߰2(P,㟄0v\,LNIuL UwI얩ێ n:~Ч3pj@(day"{ } rKXX.lM߉ tv`*ZN?+SMDlتS˶PDAThdpLȭ,y#ȣ"튷8e>M:ى#AJN/$ɘO$P_~ksg1=`X}DcXS^Z&X]e!sc(2.9z,tNJyuv+Z,/DB@;~HZz Y DI`!כ, " P >-:/^Q>\TjFlU=>b.#ij839d H'=ˌkEMGQoi5VO݃J(7>޴gChPȏ֙&<Y cjg\sIF@uf~_'0R|Tfxsn.l_wba>/+?RjA ;b!QeJKa PJ}h2wZ"2F3Nf|rAjN%<;;XogW*1vR ѻQͮs2;%*V9vU.i*:QZ=lc4"lwd9IҨI->YV^iI , V=bGQ=)_)ۑ7bOD3_b `geʚ[i YEmcd,KpPr$1)QD8$Tvtf鐭7ۡN*Y >\LD^mZݦ5ɀMSr;wEqr8qX?6NZ ſZ)TO(XKu|(t/_-_J{io|nsq|Ox\HSZ2$unN^KSc#CG}LjBytH;5 O҆ՓAY>p|LHd '-.L%B8溜&3D_h?\#b\)JHq_T:QǤΉd_r&׿"L`lqM/l}۱["$ޑU0)#盦jC&tuqɷuFXG NTAŞ3ߞm)Ot»>7 5!fQ-" ,zN1hqq.g|n <: 6fR٭+j"ƍ\HO9WIs5d5nz4 .i9u9nG]C\ & ) endstream endobj 56 0 obj << /Type /Page /Parent 95 0 R /Resources 57 0 R /Contents 58 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 57 0 obj << /ProcSet [ /PDF /Text ] /Font << /F3 105 0 R /F9 61 0 R >> /ExtGState << /GS1 137 0 R >> >> endobj 58 0 obj << /Length 867 /Filter /FlateDecode >> stream HVMo0 W("v\va@P:! i~HǺ"]C)b2;#ˉ6Y$G1B&FhBE0J!p b7dOP,O\<)!̪OcmD.\H[\gZC4$sض  \B#Oa7cǂ_gИ,*eFŻ bH%[cf6RV+  EElr3Y%ޤBj \݆Pr>s"د\CKַ>/dط>Xu(g voVAl66jg[uI@)BO= Kw ϯr/:1F{~ 8Sw5‚IX;Ni %;Up`*aEk]]zƋJ"Wb*#Uxc6[<\2φԄ9K&/eK7q2L"dc eSvIX 9{!$,$*W5\lY'0`1ys7#c,QprԒ Y/L56-q؊^툗X4| XdGS1b[ڂ endstream endobj 59 0 obj << /Type /Font /Subtype /Type1 /FirstChar 75 /LastChar 82 /Widths [ 849 0 0 0 0 0 0 759 ] /Encoding /WinAnsiEncoding /BaseFont /ADACPG+CMMI10 /FontDescriptor 85 0 R >> endobj 60 0 obj << /Type /Font /Subtype /Type1 /FirstChar 115 /LastChar 116 /Widths [ 539 432 ] /Encoding /WinAnsiEncoding /BaseFont /ADACPH+CMMI7 /FontDescriptor 83 0 R >> endobj 61 0 obj << /Type /Font /Subtype /Type1 /FirstChar 35 /LastChar 126 /Widths [ 525 0 0 0 0 525 525 0 525 525 525 525 525 525 0 525 525 525 0 0 0 0 0 525 0 525 0 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 0 525 525 525 525 525 525 0 0 525 0 0 0 0 525 0 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 525 0 525 0 0 0 525 ] /Encoding /WinAnsiEncoding /BaseFont /ADADAI+CMTT10 /FontDescriptor 81 0 R >> endobj 62 0 obj << /Type /XObject /Subtype /Image /Width 1 /Height 1 /BitsPerComponent 1 /ImageMask true /Length 5 /Filter /CCITTFaxDecode /DecodeParms << /K -1 /Columns 1 >> >> stream P endstream endobj 63 0 obj << /Type /Font /Subtype /Type1 /FirstChar 48 /LastChar 57 /Widths [ 611 611 611 611 611 611 611 611 611 611 ] /Encoding /WinAnsiEncoding /BaseFont /ADADDH+CMR6 /FontDescriptor 79 0 R >> endobj 64 0 obj << /Type /Font /Subtype /Type1 /FirstChar 43 /LastChar 148 /Widths [ 826 295 354 295 531 531 531 531 531 531 531 531 531 531 531 295 0 0 0 0 0 0 796 752 767 811 723 693 834 796 383 545 825 664 973 796 826 723 0 782 590 767 796 796 1091 796 796 0 0 0 0 0 0 0 531 590 472 590 472 325 531 590 295 0 0 295 885 590 531 590 0 414 419 413 590 561 767 561 561 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 295 531 531 ] /Encoding /WinAnsiEncoding /BaseFont /ADADDI+CMR8 /FontDescriptor 77 0 R >> endobj 65 0 obj << /Type /Font /Subtype /Type1 /FirstChar 99 /LastChar 112 /Widths [ 544 0 0 0 0 0 0 0 0 0 1021 0 0 681 ] /Encoding /WinAnsiEncoding /BaseFont /ADADDJ+CMBX8 /FontDescriptor 75 0 R >> endobj 66 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Courier-Bold >> endobj 67 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Helvetica >> endobj 68 0 obj << /Type /Font /Subtype /Type1 /FirstChar 34 /LastChar 121 /Widths [ 525 525 0 0 525 0 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 0 525 525 525 525 525 525 525 0 525 0 0 0 0 525 0 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 0 525 525 525 525 525 525 525 525 ] /Encoding /WinAnsiEncoding /BaseFont /ADAEKC+CMTT10 /FontDescriptor 87 0 R >> endobj 69 0 obj << /Type /Font /Subtype /Type1 /FirstChar 1 /LastChar 1 /Widths [ 500 ] /Encoding 89 0 R /BaseFont /ADAENC+CMSY10 /FontDescriptor 73 0 R /ToUnicode 90 0 R >> endobj 70 0 obj << /Type /Font /Subtype /Type1 /FirstChar 40 /LastChar 150 /Widths [ 409 409 0 767 0 358 307 511 511 511 511 511 511 0 0 0 511 511 307 0 0 0 0 0 0 743 0 716 0 678 0 0 0 386 0 0 627 0 0 767 678 0 0 562 716 0 0 0 0 0 0 0 0 0 0 0 0 511 460 460 511 460 0 460 511 307 0 0 256 818 562 511 0 0 422 409 332 537 0 0 0 486 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 511 ] /Encoding /WinAnsiEncoding /BaseFont /ADAFFA+CMTI10 /FontDescriptor 71 0 R >> endobj 71 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 681 /Descent -206 /Flags 98 /FontBBox [ -163 -250 1146 969 ] /FontName /ADAFFA+CMTI10 /ItalicAngle -14.03999 /StemV 68 /StemH 31 /CharSet (/I/S/O/slash/E/C/nine/eight/colon/one/zero/parenleft/parenright/P/r/o/g/\ a/m/hyphen/i/n/L/u/e/s/endash/b/d/period/T/c/h/l/A/t/y/two/four/plus/thr\ ee) /FontFile3 72 0 R >> endobj 72 0 obj << /Filter /FlateDecode /Length 4635 /Subtype /Type1C >> stream HlTiPTW}#b@qskQ\bRA\ (ۈFEEn}Fi1 (H2qKARI%M.qg罷}|pMYvmԌm?v3+Lᷢgѯbb$d-#.LwNcQ8vc,rabl$aJQ^YbaFnȡPU/?z0Peᖼ#yeGñq8a|QX6Űql1Eal+ۉak`8gE(nT%g!^;>^ ŏQ4~ԘSM=q:$^{2ľr׭HCYz PE˲Үh%,QZ_ M΍lz]Sf/eZmĀFu?yZ F`++ɎH4m(i1 j!)La\~!c[N@' D aNx/A PjxZnS.KUF:sWS*+@'k\Wб9WgƁx,f ZI Hiū41juU:R>:v&xC.9.:\4ζұ ELUNZk8G{~Kjd@o$Na;؊ ݄9OS "unˤwԅd!@ $o߹Ew}w.|JOG5D(7`_}QǕ`uhCJ:'ޑEłPXxk1;̤CkjMcrz4MA3)LR˶^1Z-P+(5OUr72-= =TߣRF͓IXVTX5==AqXr+ ·ygB>?|$䯸%&J`y]di*Imn]%K;79%GriI4tZYqw:R)ibC_.5M&[:Ja2Be4:~~` u8x~LIHT3-<5jUbV&/,n}hdud|1þ!cۯ=L_^LR{_!6FfMv12@\\~}թR%ڄ#~xOx5'fz`GXCT <4Ǥ]%+v $IFh IX[^=(f ,G @"%vVqii|hgt'A4{0ɣu.Fw\lT˭ZGe4T%FX]ږM7>+/r(Sߵ.Y3f]2ڦfM UsȤ{x@>QYAVf%&Ҩ 1{W!B{Q@rY\Jj;P܆%TҢ0a .xw^\zynbTW`xmw=ncdkF6|pdgddI"hDo>Q(W,vژ;̻chLŌѨ5r-f p9ˀᨖ^SUUZ4qjjJecblvs֖ڎtNbX߮^ Dȃnrs~<(<*UWhjn8;'e{cgg[s};6OrcMGdqBW3` zo QMayJU!R JYTZ lRLS'q`Ff3Th.*u> ?Hb| Y$aaųOPNH>3WV+ʪ Ug%zdϢ+i,Zx 틷)|^[aN.&e0 kJfЗ 9e;]tP܊/Y*B(1?ALs9)#k%1k)*#u\YƿnwF'NU:Dgr:$QYkh wm˒3ĀPۢ=FEk+zћl0czK?`!Th6(2VxF \Law;(RP\Cx+HAy*D "ʡ.LшӴpA@JRuNTW+^ċEqؙfwQ^&"Fj1rxMetyaR T| N0<<Ϭ2pc7Crv:}MZ5A]F-ǎQn+u$R|@{ !]G\lg = ܾ(<^ess/ݷnvQI*{*hDAi'I'zRA%~ hwHrL8wm~pk#Ez=-]'ABfY*#m8 D 6+%rPMt)nhnwdt``8 ]xK5+J^P {aJA9Ayl3.F")P#u5 Q(BIVƿD ")b%#WaFuŊvxyn-;?F.ǠzkT>`2Of;~K8j)ZuP]V_y8+`)$6(fguVܺw=8 '#.ѴU%B-NT%R&Yt⵱^H`{uםí w840؍}`ߪ~nړau3HAnm+A34 ie;әe,B'`'zsP X x/X2?#G "oňW~ :w̛xypHR1SJ ́NB<9MzMDj ۄ_O`N丼P%"Be, .4G+/Gygf&\4ۤeb zZ"oQnjYCf?i0>9OZMב;mnN/]4$*f'T2P/bknnB*"5#qG['!D*UIL [kHTnx]uV,YЦY[ ӏS4,P{|bDoK Q,E.7 bRۙ\w2Եp݃׮?jd p!(iVBȝW5v~x EsC,qs d${ (o.}`F-`-p^h9HI9)Р2(PrwIr>`g{V6ŭ&GaZ/#r)"* Tnl x0ѼwETA^T ܶ4<&Tzd5e%Ei&>@<;^dɳO;fU0$%W}wfP}i[lk"*2`6f54@-lο73Y{uTAC}wWe\teCtAِSh韘uҢ{&IMkUے){G[ewgSd~E^nt\5'<]r^~ 3IZ[QЬ(,n,M/t-t 29wڕ+˅:0BNu΅?T7,z Z.m)]qBOOϤU/-zZe}JkpC}zD9֞h^*:%?2o\x 92cɢvO74v7 C`ˡtOM^;qJ> endobj 74 0 obj << /Length 354 /Subtype /Type1C >> stream ADAENC+CMSY10'J_  nT58; RXasteriskmathCopyright (C) 1997 American Mathematical Society. All Rights ReservedCMSY10qyqpq~}%"}~.4r{~~~3~~}{{!H!G{{}8|u?Cy endstream endobj 75 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 262176 /FontBBox [ -59 -250 1235 750 ] /FontName /ADADDJ+CMBX8 /ItalicAngle 0 /StemV 122 /StemH 52 /CharSet (/m/c/p) /FontFile3 76 0 R >> endobj 76 0 obj << /Filter /FlateDecode /Length 534 /Subtype /Type1C >> stream Hbd`ab`ddutqtqvu f!CG,w MenE9(3=DAYS\17(391O7$#57QOL-SpQ(VJ-N-*KM. ~ `031r3gIDˮ,|]s+:+[<=kvWv;wI;ۻ:;:kjW߸rwU~[w{'/"w`ͬ3ӽϭ@SA/E8-W )Y1]7oui|Gͬ&u>wp]FMk;UE<;0 VY]z]Y[ ~+z~wgKݿuw/A$hiPpMv.^ ͛1]~NGwCԟV4<]0gKҷxf-pO<_̟N3O=~.r +pǽu*we<=<| endstream endobj 77 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 680 /Descent -206 /Flags 34 /FontBBox [ -36 -250 1070 750 ] /FontName /ADADDI+CMR8 /ItalicAngle 0 /StemV 76 /XHeight 434 /StemH 33 /CharSet (/D/E/C/U/S/c/p/colon/O/r/i/g/n/a/l/v/e/s/o/w/t/b/y/M/comma/h/d/u/m/L/x/s\ lash/G/period/two/zero/f/W/F/B/seven/J/P/V/one/I/N/three/four/A/five/nin\ e/T/hyphen/plus/eight/R/quoteright/H/K/quotedblleft/quotedblright/six/Y/\ X) /FontFile3 78 0 R >> endobj 78 0 obj << /Filter /FlateDecode /Length 6364 /Subtype /Type1C >> stream HdiTWǫhz b#*\2jFDE\ . "K4h~ ͚iQAYE Lp .3C1Q_3:/ι?8fj8n5^_}iYS:iLC:Zvr+=6J箙gh2G{I`@g,4(<@aޑ Y{0{^AA1b8&0s lw!*)y7-i}ۃ=C9Rvo߅ߕpeA/v@gfܟ0x4V^X_x0-~OoU/+:%x:OvATVƁA1d .FCd2=(f W R@\e% lX6`T*U?= {⻿EG|@k59p<7q8 y0M/*nTQ CI uvX)r)%FxFC$UYQtXJ*>/0o J*hVP63PRĈ}˟PnXZ,N3,ŻN(+9ѽ(5U'Y Mf+Ҁ*dA \(3v*DA2<byuȃ'~p Gĝ3[϶պsJcr_TdR O(OGygz採]Y˷:W%ke=-Úrح)LxLCu:Le4'1~fnXz"tM >':c5+"dI' ʎa󕥢0%CGD7A CG;j!}up>0xpNV_M>K\I"2y^-՛D& W%-etR:kyr(i$/~DΞD Dm&W-fbo`o`81_k;D횺(LX@b#҂ӡ5RXf#_"DχO=J#r-QȚ@YT7ǫu`L S+keGw/ESS@YѺ2djvhɇU^41*÷HCƘ$ܔ_`P %G@,\4#y΄T/N fޖ U9㤬??~vod} x^%̹HA6dѐbs%?>*h/j53{Uh#.2SJ>35_bEMV(.,Β&Dvvivbx _xS{:a?mG T;2b&~VݎPۄ m"_DjM M"2rMF*% ~zJXgg%J9jBgl0 'CIՇr|pv3Z>h\4KI;`$-+" @8C40Y[:co7flJ%0 ad}<&u`pGA)|S mdSΘ2ÆVL!4](v vcO^b.\r[HkAQĩH6Bn Nk!*O@517Pp4r.*>Sڜ1UIiP(iҔ6hYM1dd_"y#:"ڻ:] #WE!x~a]zVV)g*dPQO*Kt~PgQkT(y,$:Iz;V>IGTґH_gub)g2{6LtR;[HBKXeoL2;X] j>Wk* N'mE6f, C r*9ZAZTė2"C!QIQ_ m8xYLGLl,[s*7K&-GZc2>pPTrř[kByN)9%}[) u]5%8,0?HKf(p5]\}^^Z߉&g稊53rkϜ*Zv-M&;<=۳<6m%IƬԩARO!2̼ q>7otM8g=.wSu?(jPK*~sz60*:Z %]]ak׆;hκh)[7c\lo'Ee:,@<|Esg`3l;q5 FthPn~evkD*ry )jw[qV^KwZ2M?ɰULEicA-試ksƿE0>rdPl(mb%3^A<]q@^r)(1p'wLpW=Uxu1ݦP% mh:iԦGfߞ(|ai- J`Ȱ#=C9uEZQcPBϥ^͂'=l- ^SdX,4cg?O vr6 |ڙߛ?evp֤nXZ@p(W3(^?QOk Wnաz ^mA'Wl؉TƊj^%W`'( emYKٗK^Tf&/TW{=xxb=2**(-[(e*)i=`tH S٠IHbV![:IG:`Q(nT&ZE&f&l0-:)s Bb΂eIDŽ` n<bs^~.Xm dR!pT:%Z:%% >M4P,"PSL?ϗ ҢɪH<0Di0Iv7av.G]TRQZ[4ãy({}N{^S6f @_(Ů(.U{M9)SKz HhVG<*f=ծoajL /P51h{M.Yi* L^=qEG//lg~nv+*#G}MZ,]Emݕv~qCLFÜHk"q1<,Hfh(UdQo:S6_Q*ZK|9!#7RͰ%LںQƺ=53ϩ鈞O>N_2O?y endstream endobj 79 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 32 /FontBBox [ -20 -250 1193 750 ] /FontName /ADADDH+CMR6 /ItalicAngle 0 /StemV 83 /StemH 39 /CharSet (/one/two/three/four/five/six/seven/eight/nine/zero) /FontFile3 80 0 R >> endobj 80 0 obj << /Filter /FlateDecode /Length 1369 /Subtype /Type1C >> stream HkPgP)VZUĂ8 U "$HE:Ɛ|$H)n \V[ؑ6[П9s9ֆaC@p@p5AQ^ fI]j˺8| ҸؚJ:m^̱ATʠU6y ٩ILa(`Tc hYRjrN0 #C!F%˓s_`g{"+ ϑprצU:j\Wfl4 Rd HUP~GpQnJN׉oR3gu75{h4,0t ct4W_$I-}$$KZk{O P!Q-qy{潩Ej)A*7%oeԘ endstream endobj 81 0 obj << /Type /FontDescriptor /Ascent 615 /CapHeight 615 /Descent -230 /Flags 32 /FontBBox [ -4 -235 731 800 ] /FontName /ADADAI+CMTT10 /ItalicAngle 0 /StemV 69 /XHeight 434 /StemH 61 /CharSet (/less/b/a/c/k/s/l/h/greater/n/e/w/i/underscore/P/r/g/m/parenleft/parenri\ ght/hyphen/p/d/t/W/V/A/R/I/N/T/B/O/L/slash/o/period/M/C/zero/numbersign/\ f/comma/u/S/H/E/D/plus/four/at/G/two/three/U/F/K/Z/colon/j/z/x/question/\ v/asciitilde) /FontFile3 82 0 R >> endobj 82 0 obj << /Filter /FlateDecode /Length 5332 /Subtype /Type1C >> stream HlT PYN.i;593 "^`$ܐ7D ꎨu :kǢcָxت;LV~އcljժЍuF^>~w!2H~GXOj虂p|竒S2ձ14٫-^D:6zg42qg0HߐLEBs?\Q(wI\q̃"La0{ VzbHl mޘ܎?JDcbG%"X sH]f>w[61褰I]27Yggdɚg{z0||/STw#Ue_#0sx7!E-Yuw8#LL%YRXJH(L2z42ҨTnDfDD!OάY^0ԓW󧓲ō/4VV8|&ʒw Aom?Џ{>S{|BWXS*?0+zmCZC <[N2W6:QsʊX(H1vPn4X&$P0Q0j[%Ƞi(@S M#[! b.:cKNQfA:;<zG%+]}͌ ZF!~_,$|y2Ή ^b~:T'$H=>n|fm/<)s>ץkY y.δ6-Y'+t# Q~ B4 Aǐ@ha UPKCΆ^ DTgQ8ėQ2=e<̶IX ykshy ɐ'?mˮklU2`l]&",x#+0ð>vbK "5[ƵNR2Wd̶D*EƧc] \-" <.lF/;8ʖ˭tKUs#w0‚h{2eqt\e^'e %u.!rNdžv}b]yL2)(Ibђq 0F1BaLy,`$\Dv?X[YF([>y=w}O ֞}pi=~>B/#7ķ_ˠ{c ZcFf,Gӻ#eZIٴMZmrrfkj1|);t7LjQr}bI"D yxV|́FSd֡߀ [gm\".'W)c@ǞNof?Cȝo 9~?,(h[xj K>N c2KP$8E CWfdщm\3FַHb|H6O#bpYu*2ZN@x wt@S{έqz ^и9t6%SO_ CRDFe7g)N-$ljX(!uP)$=;VnB9a1_ĵ+RZ@@x7ץMi\R1R]@gհ{K:\M;AeCw A!bXӵ+R1.KJv)FPŤ3 u۾N3#~,0LF#;?YM2 c 366vh5@ 퉃Ic LOۯ䈜xX!I^.peZqch6"V9Kȗm+aIPE"k԰YE*eu78kBuM% W ZHpU엗r((`Hg"!!6W="m5iOg d_';AA9597^Cn碴ȋJ4GZ}n#骄C;tGW$N+TyIԤ0Vq)šjhbpCbLl9t}SxRtLUW:Z"m#!mb.g{T"MʷyQǏ>BǺqMG q1T^R?4ܴ)hLq} xN[m $xzt/>{]N_䫆2i%wh-ߦjQT[@qR_YD=_5BOEV#1 A2*ԚXPHkPr-1AĜ]|ЧUWoj4GisY>liဳZa&Z`ð/MRw˄C:`M/tQ_0oY!`b*rĭ 5e&?1'v;0pcƪMq.aJi#&T.WR6)dMPf4MX$WRATCW2=>xr\8C{u(rGتщ*ȌϠQ\:{ 3[K堦,M"QzmF`%Fd<_S"-'٢(WN/Bn,9\t㐒Vߵ%ғQVtg9*cx5S#_±Y8˲Y`eukbF$UH~0WBƿAвHSReAj9PD)=`xܖҕ=n?¤:ɟH=I !56ɶ{ 0- Yɰ(_`t_l:*)x6V1u4x<'ago~!K-W.wܼlL_ZyM xYao?I3xH̻QVRzv|& XJ/X~fm:2XLUIWJkF2O<^V:o~vIRbbez-< ) YX𝗝M5fGn}x?\vj?`b/- 8P<D}>H׷2LͦQ9bݩ99ɬ6KͱظK0ʈ9as@Γ@ "N! MM Rx%RMM5ޡIjj}|/Dׯj%nn-1a~Nw&͎G tk nab>(P -+ V βzeܲhbFlbri" pJ)u7dx&wbnxH$DN"m@ ڂ2NRAA/<%eMVfcMY /mv}U2F̮qFW8RlW.7C`&E'3^ z-Jb(e%H9 2 c,QQ_0>~l;(& kڗ*4U-J+-k׶)%/o7A՟>"ZkR?^;˰{]MHe@ӴMӲLgQF+ʏ05sk`x`A %Va(EdͿ?TW~cekuо6wu;WPzݖonT|y[l7;@4FRĦ b̿C'%_LܘZ#]кQGme& hJru9*J/Ka)ۺ+az(r+cAZaQ%T؆Wߟxx!I88l CSD7Qxȏ4*P>Z i{؋LQcPL<r^)YY:W.|jE[7"Ἄwx;,G~gWV endstream endobj 83 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 96 /FontBBox [ 0 -250 1171 750 ] /FontName /ADACPH+CMMI7 /ItalicAngle -14.03999 /StemV 81 /StemH 32 /CharSet (/s/t) /FontFile3 84 0 R >> endobj 84 0 obj << /Length 474 /Subtype /Type1C >> stream  ADACPH+CMMI7%J  $(MFKCopyright (C) 1997 American Mathematical Society. All Rights ReservedCMMI7TMUV0#ۯ.?C q{vwtCN0olfswYzearudZcRtyvnnt_OfL&frfyi B~z,(}wr|zqr_B%x~u}x> endobj 86 0 obj << /Filter /FlateDecode /Length 663 /Subtype /Type1C >> stream HdO_LqC@ FKg]݃mZzhnm,[$$"!wӃ_rˢ0mzJ{|ɗo}>| ahyln3\8`$ueYN ޫO](0z}D/Fm fx*Atz6> endobj 88 0 obj << /Filter /FlateDecode /Length 6269 /Subtype /Type1C >> stream H|{PSwo<ˋphZw: +VjT^ "L.G$ ShyqbӢ]kq\)q33a6l غ#裠={VF(Vcز +Qی@;AKB/OW̆%%Js}+ -^{(+P4>PIȈMQ+ 5+|FWx|v,/>?)1aB 7l ǰ(BXՊ`<>o&9ߗί>dM!-ԊEEM歜g[dWeϳOcKqx).\\Wj\v*IXV> 죞H/Swn͖*er1!$>L$=p<?1$gXh5Z'+,HPUul`, aB5S.)4v!lBNV2_R|GL3У,I ƩCSLܦ77h/Y-"1)U$e {C &,x*b--FbFj7QbD\x`s ;PP\)*9PIUĝIK 骪u:xe==.|N uRSztQu9F8Fu"tUL=٦4s˕E 4L1(p»l0N`ABWh؀o@BuZ_ܻ;!Z \yVlyYNLgZ~Eq_y4_-*3HYJ~y'>‚l&5P;|Yc [DiYLdZ)x.a;s"IgPR49:t;GbdmBQ餡I\}H-jг/D[\|:Xs?_t]%BBmɝYjLˉiJif.%S'EJ&t{͍Vj;#B}b75gZHve9ʔ'Xg?>0Kq faq埁cDi }hY}Ϊ0v >P^De*F߉+z%בVpB/IHcsrJ\^BvoOkyt!0dO2v5V3=9yʴҸu-x~Evu^y3V7) hяӭGUZZRU(6yW{) ?9h *18fDF9M:G]iuj=ڠ#_+|ÃL젅w:a(&LdC2f -"c[uu 9kj S&IbrC|&i~U8r{p[87 0:2za1TS.N#{}(כvLi 0QP?.xj|l,tuQ(@]]r.ٸ#IibUk]1K&?Ҷs։So]o=+poVkWkGwZktQ($!@A`x_G㫽UZѩ=3 srs~78? ~sTG8:W&mHWnT%v:v?*ZܦpeY"Axe0g)r* 8(CMY]6m! 6x"ίҗq$)*6ڬ\UM;+l%57O8wOs!h#s\I`)."zYjCÏB nGք긧t}K&Q0v6d5z)]ׄ<Յeq+sAᑒ+a{B*7΅)4(ç.*n,8u7#7tt r`LuJVG8gvŠOO]/I'h i2d)쟰b9'ۊ *ď/ښN&ήᷗzV*z[z!L%wNNM a4L)Sawud@uH,ǃa8Lj/,/DxeDޯ}*b,j!KDiziV)#an+7rAtfɪ7T)OSF`&E(H|#p}>]JP}{Ch"l$xQ67|sWDzQ3I |K*RoimxdMalΓnZYR |j@bv ,$+7 A#Nɐ쀦7tA ?8*e2d,4KdW"MjiOۂօ x_`9uA<ҶMiͤpln WxoS*ބ=֨!ADK'U›JwX;o H3;[`!,p6CI?9q"=*./rXo7[ wx"B4'/[J^ҶH$!7zeO#(FCLa.?L۩M߷Az[(|7Qtv l`F d*ivCuR7sb`jth'ϒzQe4$Fvٜh> endobj 90 0 obj << /Filter /FlateDecode /Length 216 >> stream HTP1n0 2,<)괻"Ѯhy+)n> endobj 92 0 obj << /Nums [ 0 91 0 R ] >> endobj 93 0 obj << /Type /Pages /Kids [ 100 0 R 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 29 0 R 32 0 R 35 0 R 38 0 R ] /Count 10 /Parent 94 0 R >> endobj 94 0 obj << /Type /Pages /Kids [ 93 0 R 95 0 R ] /Count 16 >> endobj 95 0 obj << /Type /Pages /Kids [ 41 0 R 44 0 R 47 0 R 50 0 R 53 0 R 56 0 R ] /Count 6 /Parent 94 0 R >> endobj 96 0 obj << /CreationDate (D:20081129171651+09'00') /ModDate (D:20081129171651+09'00') /Producer (Acrobat Distiller 5.0.5 \(Windows\)) /Creator (dvips\(k\) p1.7a Copyright 2005 ASCII Corp.\(www-ptex@ascii.co.jp\) bas\ ed on dvips\(k\) 5.95b Copyright 2005 Radical Eye Software \(www.radical\ eye.com\)) /Title (mcpp-summary.dvi) >> endobj 97 0 obj << /Type /Metadata /Subtype /XML /Length 1121 >> stream dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp) based on dvips(k) 5.95b Copyright 2005 Radical Eye Software (www.radicaleye.com) mcpp-summary.dvi endstream endobj xref 0 98 0000000000 65535 f 0000043643 00000 n 0000043794 00000 n 0000043934 00000 n 0000051029 00000 n 0000051180 00000 n 0000051354 00000 n 0000057089 00000 n 0000057240 00000 n 0000057426 00000 n 0000062902 00000 n 0000063056 00000 n 0000063257 00000 n 0000070894 00000 n 0000071048 00000 n 0000071249 00000 n 0000075733 00000 n 0000075791 00000 n 0000075842 00000 n 0000076060 00000 n 0000076209 00000 n 0000076484 00000 n 0000076542 00000 n 0000076593 00000 n 0000076814 00000 n 0000076964 00000 n 0000077239 00000 n 0000077463 00000 n 0000077612 00000 n 0000077887 00000 n 0000078041 00000 n 0000078193 00000 n 0000083720 00000 n 0000083874 00000 n 0000084015 00000 n 0000089748 00000 n 0000089902 00000 n 0000090054 00000 n 0000097487 00000 n 0000097641 00000 n 0000097793 00000 n 0000102251 00000 n 0000102405 00000 n 0000102522 00000 n 0000103387 00000 n 0000103541 00000 n 0000103681 00000 n 0000110673 00000 n 0000110827 00000 n 0000110967 00000 n 0000118429 00000 n 0000118583 00000 n 0000118712 00000 n 0000125823 00000 n 0000125977 00000 n 0000126129 00000 n 0000131667 00000 n 0000131821 00000 n 0000131937 00000 n 0000132878 00000 n 0000133072 00000 n 0000133255 00000 n 0000133748 00000 n 0000133951 00000 n 0000134163 00000 n 0000134684 00000 n 0000134893 00000 n 0000135000 00000 n 0000135104 00000 n 0000135608 00000 n 0000135793 00000 n 0000136276 00000 n 0000136665 00000 n 0000141392 00000 n 0000141634 00000 n 0000142058 00000 n 0000142291 00000 n 0000142916 00000 n 0000143381 00000 n 0000149837 00000 n 0000150108 00000 n 0000151569 00000 n 0000152045 00000 n 0000157469 00000 n 0000157701 00000 n 0000158245 00000 n 0000158480 00000 n 0000159234 00000 n 0000159767 00000 n 0000166128 00000 n 0000166203 00000 n 0000166493 00000 n 0000166524 00000 n 0000166568 00000 n 0000166713 00000 n 0000166787 00000 n 0000166904 00000 n 0000167246 00000 n trailer << /Size 98 /ID[<37e5eec95206a42fdb51b2b11af06a93><1a2c2a3920c5e10776794727dd9e71ab>] >> startxref 173 %%EOF mcpp-2.7.2/doc/LICENSE0000644000175000017500000000314410762207414011161 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * The most part of the documents in this directory were translated by * Highwell inc. from the Japanese documents written by Kiyoshi Matsui, * and revised by the author. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/ChangeLog.old0000644000175000017500000004245710465372416011755 00000000000000ChangeLog.old of MCPP and its accompanying Validation Suite 2005/03/19 kmatsui * V.2.5 * Absorbed POST_STANDARD mode into STANDARD as an execution time option, absorbed OLD_PREPROCESSOR mode as an execution time option of PRE_STANDARD. (all the sources) * Changed the evaluation of #if expression in PRE_STANDARD mode to use only (signed) long, not to use unsigned long. (eval.c) * Revised the Standard mode macro expansion routine using GCC 3. 2 testsuite and Wave 1.0 testcases. Revised "blue painting" of the same name macro. Revised debugging information. Revised handling of token separator in STANDARD mode. Split is_macro_call() from is_macro(). (expand.c) * Revised the old-preprocessor mode to follow "Reiser cpp model". (expand.c) * Removed FOLD_CASE settings. (system.c) * Renamed most of #pragma __* directives as #pragma MCPP *. (system.c) * Added porting to GCC V.3.3 and 3.4. Changed some options accordingly (changed -c to -@compat, changed -m to -e, removed -E, added -finput-charset=). Created init_gcc_macro(), undef_gcc_macro(). (system.c) * Sorted usage() message lines alphabetically. * Removed documents on older preprocessors (DJGPP, compiler systems on MS-DOS except Borland C). * Revised judgment of GCC version and include directories. (configure.ac). * Provided man page. * Renamed the documents. * Validation Suite: Moved tests of multi-byte character encoding to quality matters. * Validation Suite: Changed points allocation of the test items. * Validation Suite: Added a few testcases for macro expansion. * Updated Japanese and English documents. 2004/03/20 kmatsui * V.2.4.1 * Revised recursive macro expansion. (expand.c) * Added -c option (compatible mode to GCC expansion of recursive macro). (expand.c, system.c) * Revised some testcases in cpp-test/test-t directory. 2004/02/25 kmatsui * V.2.4 release. * Implemented handling of multi-byte character encodings other than 2-byte encodings. Made various encodings available simultaneously. Added #pragma __setlocale. Added -m option. Enabled environment variable LC_ALL, LC_CTYPE and LANG to specify the encoding. (all the sources) * Created mbchar.c. Moved type[] from system.c. Created type_* [] tables for various encodings of multi-byte character. Created encoding_name[][] table. Created mb_init(), mb_read_2byte(), mb_read_iso2022_jp(), mb_read_utf8(), mb_eval(), set_encoding(), search_encoding() and strip_bar(). (mbchar.c) * Added porting to Plan 9 / pcc. (noconfig.H, system.c) * Validation Suite: Added tests of various multi-byte character encodings. * Updated Japanese documents. * Updated English documents which were translated by Highwell, inc. ltd. from the Japanese documents. * Renamed the documents. 2003/11/28 kmatsui * V.2.4 prerelease. * Named this proprocessor as MCPP (This is not necessarily the name of its executable). * Changed predefined macro __decus_cpp as __MCPP. * Created configure script to make mcpp executable automatically. Accordingly, reorganized system.H, created configed.H and noconfig.H, and changed some macro names. * Diagnostics on macro expansion or macro redefinition were made to show the original macro definition and its location. * Changed DEFBUF and FILEINFO structure, reorganized some functions and variables. Created set_fname() in system.c. (other than system.H, eval.c lib.c) * Created look_and_install(). (control.c) * Removed CON_NOEXPAND and CON_EXPAND modes. Renamed CON_FALSE mode as PRE_STANDARD. (all the sources) * Removed append_string(), catenate() and conv_st_quote(). (expand.c) * Added #pragma __push_macro, #pragma __pop_macro, #pragma __preprocess, #pragma __preprocessed. Created push_or_pop() and do_preprocess(), revised do_pragma() accordingly. (system.c) * Implemented -MF, -MT, -MP, -MQ options for GCC-3-compatibility. Created md_init() and md_quote(). (system.c) * Added porting to Visual C++ .net. (system.H, system.c) * Removed the oldest settings on VMS, DEC C and OS-9/09. And removed accordingly vmsparse(), reopen_stdout(), set_stdin(), get_redirection(), put_start_file(), put_fname() and put_source(). (system.H, system.c) * Added strstr() and strcspn(). (lib.c) * Moved open_file() and add_file() from main.c to system.c. Moved sharp() from system.c to main.c. * Updated test-reports on LCC-Win32 and ucpp. * Updated the Japanese documents. (The English documents are not yet updated.) 2003/03/29 kmatsui * V.2.3 patch 1. * Debugged the modes other than STANDARD. (system.c) 2003/02/28 kmatsui * V.2.3 release. * Implemented identifier-like operators in C++98. Created chk_ops() in eval.c and id_operator() in support.c. (eval.c, control.c, support.c) * Reinforced checking of __VA_ARGS__. (control.c) * Enabled interspersed options between filename arguments. (system.c) * Renamed #pragma __debug and #pragma __warning to #pragma __debug_cpp and #pragma __warning_cpp. (system.c) * Created the edition of Validation Suite for GCC / testsuite. * -j option (GCC-compatible diagnostic format) added for testsuite. * Created the document named mcpp-summary.pdf. * Updated documents. * Released English version of documents which were translated by Highwell, inc. ltd. from the Japanese documents and revised by kmatsui. 2002/12/16 kmatsui * V.2.3 prerelease 2. * Port to GCC 3.2. (system.H, system.c) * Fixed the bug of #include_next. (system.c) * GCC-compatible options (-I-, -std=*) added. (system.c) * Created norm_path() to normalize include directories. (system. c) * Fixed the bug of rescan() which warns an innocent macro call. (expand.c) * Updated documents. Renamed the documents. 2002/08/26 kmatsui * V.2.3 prerelease 1. * Updated according to C99 (ISO/IEC 9899:1999). * Added compatibility mode of C++ to C99. (eval.c, expand.c, system.c) * Increased the class of warnings from four (OR of 1, 2, 4, 8) to five (OR of 1, 2, 4, 8, 16). Changed some errors to warnings. * Fixed the bug of 0-parameter function-like macro. Modified re- examination of macro of the same name. (expand.c) * Fixed the bug of handling digraphs. Implemented UCN in pp- number and string-literal. (support.c) * Fixed the bugs of parse_env() and bsl2sl(). (system.c) * Implemented many GCC-compatible options. Added -dM, -dD, -include and -isystem option for GCC. Added -a (-lang-asm, -x assembler-with-cpp) option. Extended -D option to enable function-like macro definition. Changed specification of -S option and added -V, -h option. (system.c) * Implemented #include_next and #warning for GCC. Implemented also #pragma __include_next and #pragma __warning_cpp. (system. c) * Created conv_case(), chk_env() and at_end(). Split set_limit(), set_pragma_op(), def_a_macro() from dooptions(). Split search_dir() from openinclude(). Removed is_id(). (system.c) * Port to Linux / GCC 2.95.3, LCC-Win32, Borland C 5.5. (system. H, control.c, system.c) * Renamed functions and some variables using underscore to separate the two words. (internal.H, all the *.c files) * Updated the Validation Suite. * Updated the documents. * Renamed the directories and the documents by NIIBE Yutaka. * Registered to CVS repository at m17n.org by NIIBE Yutaka . 1998/11 kmatsui * V.2.2 * Updated according to C++98 (ISO/IEC 14882:1998) * Changed to evaluate "true" as 1 and "false" as 0 on C++, according to C++ Standard. (eval.c) * Updated UCN constraint on C++ according to C++ Standard. (support.c) * Fixed the bug of interaction of predefined non-standard macro with -D option. (main.c, control.c, expand.c, system.c) * Created undef_a_predef(). (main.c) * Removed alloc_mem(). (system.c) 1998/09 kmatsui * V.2.1 * Updated C99 features according to 1998/08 draft (including UCN, optional multi-byte-character in identifier, type of #if expression in integer of maximum size and concatenation of wide- character-string-literal and character-string-literal). (main.c, eval.c, support.c) 1998/08 kmatsui (Kiyoshi Matsui ) * V.2.0 * First release of MCPP (DECUS cpp V.2) at nifty-serve and vector/software-pack. * Re-written according to ISO 9899:1990 and it's Amendment 1, Corrigendum 1, 2. * Implemented translation phases precisely. (support.c) * Revised tokenization according to the Standard and Amendment1. (support.c & others) * Implemented the pre-defined macros __STDC__, __STDC_VERSION__, __TIME__, and revised __DATE__. Made these standard macros cannot be undefined nor redefined. (main.c) * Implemented _Pragma() operator. (main.c & others) * Revised some non-standard pre-defined macros. (main.c) * Implemented #error directive. The error message is output to the stderr. (control.c) * Implemented #pragma __once directive, -i option and -M* option, imported from GCC. (control.c & others) * Implemented #pragma __put_defines, #pragma __debug directives and the old style directives corresponding to them. (system.c & others) * Made #pragma lines to be output with warning to the stderr for the compiler which can't recognize the directive. (system.c) * Made #line argument to be subject to macro expansion. (control.c, support.c) * Reinforced the test of #define syntax. (control.c) * Created Standard conforming mode of macro-expansion (including the processing of #, ## operators). (expand.c) * Created "post-Standard" mode of preprocessing, which is a simplified version of Standard mode. (all the sources) * Simplified CON_FALSE mode corresponding to K&R 1st. specifications. CON_NOEXPAND, CON_EXPAND modes of the original version are retained (after revising). (main.c, control.c eval. c, expand.c) * Revised # operator so as to inserts \ before \ or " in stringized arguments (except in MBCHAR) in Standard mode. (expand.c) * Changed the type of #if expression from int to long / unsigned long. Reinforced expression evaluation. (eval.c) * Implemented wide character constant, multi-character character constant, and revised multi-byte character constant in #if expression. (eval.c) * Revised the handling of MBCHAR in string literal and character constant. (support.c, expand.c, eval.c, main.c) * Supplemented the optional phase for the pre-Standard compiler- proper to concatenate adjacent string literals, convert '\a' and '\v' to octals, convert digraphs. (main.c) * Implemented the features of C99-1997/11 draft except Unicode- related features (_Pragma operator, variable arguments of macro, // comments, long long of #if expression, p+ of pp-number) (all the sources) * Supplemented the C++ preprocessor option. (support.c, system. c) * Refined error checks and diagnostic messages. (all the sources) * Implemented -M* option. (main.c, system.c) * Updated MS-DOS memory model option. (system.c) * Revised command line options. (system.c) * Made the source files compilable by C++ as well as C. (all the sources) * Re-organized and re-written the source files to be portable to many systems. (all the sources) * * main.c: * Renamed cpp1.c main.c. * Created do_pragma_op(), de_stringize(), devide_line(), putout(), putline(), post_preproc(), conv_esc(), conv2oct(), is_last_esc(), esc_mbchar(), conv_a_digraph(). * Removed output(). * Moved sharp() from cpp1.c to system.c, addfile(), openfile(), initdefines(), unpredefine() from cpp3.c to main.c, * Revised most of the functions and variables. * * control.c: * Renamed cpp2.c control.c. * Moved dodefine(), is_formal(), mtokensave(), stparmscan(), doundef() from cpp4.c to control.c. * Moved lookid(), defendel(), dump_a_def() from cpp6.c to control.c. * Moved doinclude(), openinclude(), vmsparse() from cpp2.c to system.c. * Split doline() from control(). * Split getparm(), getrepl(), def_stringization() from dodefine(). * Split dumprepl() from dump_a_def(). * Devided defendel() to install(), undefine(), lookprev(). * Removed textput(), charput(), checkparm() from cpp4.c. * Expanded specification of stparmscan(). * Revised most of the functions. * * eval.c: * Renamed cpp5.c eval.c. * Created overflow(), dumpval(). * Split evalsval(), evaluval() from evaleval(). * Made #if error returns 0 (rather than 1). * Changed the type of #if evaluation from int to long / unsigned long (unsigned long is only for the compiler which has that type) or long long / unsigned long long for C99. * Reinforced expression evaluation (eval(), opdope[]). * Implemented evaluation of multi-character character constant, wide character constant and revised evaluation of multi-byte character constant. * Revised most of the functions. * * expand.c: * Split from cpp4.c and cpp6.c (support.c). * Created Standard conforming mode of macro expansion. * Created is_macro(), squeeze_ws(), skip_macro() as common routines, expand(), replace(), def_special(), prescan(), catenate(), stringize(), substitute(), rescan(), disable_repl(), enable_repl(), is_able_repl() for MODE >= STANDARD, expand(), conv_st_quote() for MODE < STANDARD. * Split expcollect() into collect_args() and get_an_arg(). * Renamed macroid() to rescan(), expand() to replace(), expstuff () to substitute() for MODE < STANDARD, dumpparm() to dump_args(). * Revised most of the functions. * * support.c: * Renamed cpp6.c support.c. * Created get_unexpandable(), scantoken(), cat_line(), scanop(), parse_line(), last_is_mbchar(), cnv_digraph(), at_eof(), xrealloc(), putline(), dumptoken(). * Split getline(), read_a_comment() from get(). * Extended cfatal(), cerror(), cwarn(), removing cierror(), ciwarn(). * Removed save(), cget(). * Moved macroid(), catenate(), appendstring() from cpp6.c to expand.c, lookid(), defendel() from cpp6.c to control.c. * Renamed scanstring() to scanquote(), getmem() to xmalloc(). * Revised most of the functions. * Revised line splicing and tokenization. * * system.c: * Created this file gathering routines from other files. Moved sharp(), sharpsub(), getredirection() from cpp1.c to system.c, doinclude(), openinclude(), hasdirectory(), vmsparse() from cpp2. c to system.c, setincdirs(), dooptions(), zap_uc() from cpp3.c to system.c, * Created setoptlist(), setcplus(), bsl2sl(), put_depend(), dopragma(), doonce(), included(), dumppath(), is_junk(), alloc_mem(), print_heap(); * Split reopen_stdout(), setstdin() from main(), put_start_file(), putfname() from cppmain(), setfiles(), usage(), mem_model(), is_id() from dooptions(), doold(), dodebug(), doasm(), put_asm() from control(). * Split setincdirs() to setsysdirs(), setenvdirs(), parse_env(), set_a_dir(). * Moved type[] from cpp6.c to system.c. * Revised most of the functions. * * system.H: * Re-written and renamed from cppdef.h. * * internal.H: * Re-written and renamed from cpp.h. * * Created Validation Suite for C/C++ preprocessing. * * Provided some supplementary tools for preprocessor testing. * * Wrote comprehensive documents (in Japanese). * Edit history of DECUS CPP (MM: Martin Minow) * 21-May-84 MM "Field test" release * 11-Jul-84 MM "Official" first release (that's what I thought!) * 31-Aug-84 MM USENET net.sources release. * 7-Dec-84 MM Stuff in Nov 12 Draft Standard * 07-Jun-85 KR Latest revision mcpp-2.7.2/cpp-test/0000777000175000017500000000000010763014421011223 500000000000000mcpp-2.7.2/cpp-test/test-l/0000777000175000017500000000000010624535761012446 500000000000000mcpp-2.7.2/cpp-test/test-l/nest36.h0000644000175000017500000000004310216765467013657 00000000000000/* nest36.h */ #include "nest37.h" mcpp-2.7.2/cpp-test/test-l/nest125.h0000644000175000017500000000004510216765467013740 00000000000000/* nest125.h */ #include "nest126.h" mcpp-2.7.2/cpp-test/test-l/nest3.h0000644000175000017500000000004110216765467013567 00000000000000/* nest3.h */ #include "nest4.h" mcpp-2.7.2/cpp-test/test-l/nest76.h0000644000175000017500000000004310216765467013663 00000000000000/* nest76.h */ #include "nest77.h" mcpp-2.7.2/cpp-test/test-l/nest6.h0000644000175000017500000000004110216765467013572 00000000000000/* nest6.h */ #include "nest7.h" mcpp-2.7.2/cpp-test/test-l/nest82.h0000644000175000017500000000004310216765467013660 00000000000000/* nest82.h */ #include "nest83.h" mcpp-2.7.2/cpp-test/test-l/nest81.h0000644000175000017500000000004310216765467013657 00000000000000/* nest81.h */ #include "nest82.h" mcpp-2.7.2/cpp-test/test-l/nest95.h0000644000175000017500000000004310216765467013664 00000000000000/* nest95.h */ #include "nest96.h" mcpp-2.7.2/cpp-test/test-l/l_37_1.h0000644000175000017500000000257710216765467013537 00000000000000/* l_37_1.h: Translation limits larger than C99 / 1. */ /* 37.1L: Number of parameters in macro. */ #define glue255( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7, p7, \ a8, b8, c8, d8, e8, f8, g8, h8, i8, j8, k8, l8, m8, n8, o8, p8, \ a9, b9, c9, d9, e9, f9, g9, h9, i9, j9, k9, l9, m9, n9, o9, p9, \ aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, \ ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb, \ ac, bc, cc, dc, ec, fc, gc, hc, ic, jc, kc, lc, mc, nc, oc, pc, \ ad, bd, cd, dd, ed, fd, gd, hd, id, jd, kd, ld, md, nd, od, pd, \ ae, be, ce, de, ee, fe, ge, he, ie, je, ke, le, me, ne, oe, pe, \ af, bf, cf, df, ef, ff, gf, hf, if, jf, kf, lf, mf, nf, of) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## p7 ## \ p8 ## p9 ## pa ## pb ## pc ## pd ## pe ## of mcpp-2.7.2/cpp-test/test-l/nest43.h0000644000175000017500000000004310216765467013655 00000000000000/* nest43.h */ #include "nest44.h" mcpp-2.7.2/cpp-test/test-l/nest64.h0000644000175000017500000000004310216765467013660 00000000000000/* nest64.h */ #include "nest65.h" mcpp-2.7.2/cpp-test/test-l/nest105.h0000644000175000017500000000004510216765467013736 00000000000000/* nest105.h */ #include "nest106.h" mcpp-2.7.2/cpp-test/test-l/nest9.h0000644000175000017500000000004210216765467013576 00000000000000/* nest9.h */ #include "nest10.h" mcpp-2.7.2/cpp-test/test-l/nest106.h0000644000175000017500000000004510216765467013737 00000000000000/* nest106.h */ #include "nest107.h" mcpp-2.7.2/cpp-test/test-l/nest35.h0000644000175000017500000000004310216765467013656 00000000000000/* nest35.h */ #include "nest36.h" mcpp-2.7.2/cpp-test/test-l/nest8.h0000644000175000017500000000004110216765467013574 00000000000000/* nest8.h */ #include "nest9.h" mcpp-2.7.2/cpp-test/test-l/nest27.h0000644000175000017500000000004310216765467013657 00000000000000/* nest27.h */ #include "nest28.h" mcpp-2.7.2/cpp-test/test-l/nest89.h0000644000175000017500000000004310216765467013667 00000000000000/* nest89.h */ #include "nest90.h" mcpp-2.7.2/cpp-test/test-l/nest14.h0000644000175000017500000000004310216765467013653 00000000000000/* nest14.h */ #include "nest15.h" mcpp-2.7.2/cpp-test/test-l/nest118.h0000644000175000017500000000004510216765467013742 00000000000000/* nest118.h */ #include "nest119.h" mcpp-2.7.2/cpp-test/test-l/nest45.h0000644000175000017500000000004310216765467013657 00000000000000/* nest45.h */ #include "nest46.h" mcpp-2.7.2/cpp-test/test-l/nest1.h0000644000175000017500000000004110216765467013565 00000000000000/* nest1.h */ #include "nest2.h" mcpp-2.7.2/cpp-test/test-l/nest57.h0000644000175000017500000000004310216765467013662 00000000000000/* nest57.h */ #include "nest58.h" mcpp-2.7.2/cpp-test/test-l/nest67.h0000644000175000017500000000004310216765467013663 00000000000000/* nest67.h */ #include "nest68.h" mcpp-2.7.2/cpp-test/test-l/nest55.h0000644000175000017500000000004310216765467013660 00000000000000/* nest55.h */ #include "nest56.h" mcpp-2.7.2/cpp-test/test-l/nest32.h0000644000175000017500000000004310216765467013653 00000000000000/* nest32.h */ #include "nest33.h" mcpp-2.7.2/cpp-test/test-l/nest71.h0000644000175000017500000000004310216765467013656 00000000000000/* nest71.h */ #include "nest72.h" mcpp-2.7.2/cpp-test/test-l/nest92.h0000644000175000017500000000004310216765467013661 00000000000000/* nest92.h */ #include "nest93.h" mcpp-2.7.2/cpp-test/test-l/nest100.h0000644000175000017500000000004510216765467013731 00000000000000/* nest100.h */ #include "nest101.h" mcpp-2.7.2/cpp-test/test-l/nest127.h0000644000175000017500000000004110216765467013736 00000000000000/* nest127.h */ nest = 0x7f; mcpp-2.7.2/cpp-test/test-l/nest39.h0000644000175000017500000000004310216765467013662 00000000000000/* nest39.h */ #include "nest40.h" mcpp-2.7.2/cpp-test/test-l/nest126.h0000644000175000017500000000004510216765467013741 00000000000000/* nest126.h */ #include "nest127.h" mcpp-2.7.2/cpp-test/test-l/nest69.h0000644000175000017500000000004310216765467013665 00000000000000/* nest69.h */ #include "nest70.h" mcpp-2.7.2/cpp-test/test-l/nest7.h0000644000175000017500000000004110216765467013573 00000000000000/* nest7.h */ #include "nest8.h" mcpp-2.7.2/cpp-test/test-l/nest58.h0000644000175000017500000000004310216765467013663 00000000000000/* nest58.h */ #include "nest59.h" mcpp-2.7.2/cpp-test/test-l/nest116.h0000644000175000017500000000004510216765467013740 00000000000000/* nest116.h */ #include "nest117.h" mcpp-2.7.2/cpp-test/test-l/nest86.h0000644000175000017500000000004310216765467013664 00000000000000/* nest86.h */ #include "nest87.h" mcpp-2.7.2/cpp-test/test-l/nest109.h0000644000175000017500000000004510216765467013742 00000000000000/* nest109.h */ #include "nest110.h" mcpp-2.7.2/cpp-test/test-l/nest84.h0000644000175000017500000000004310216765467013662 00000000000000/* nest84.h */ #include "nest85.h" mcpp-2.7.2/cpp-test/test-l/nest61.h0000644000175000017500000000004310216765467013655 00000000000000/* nest61.h */ #include "nest62.h" mcpp-2.7.2/cpp-test/test-l/nest13.h0000644000175000017500000000004310216765467013652 00000000000000/* nest13.h */ #include "nest14.h" mcpp-2.7.2/cpp-test/test-l/nest50.h0000644000175000017500000000004310216765467013653 00000000000000/* nest50.h */ #include "nest51.h" mcpp-2.7.2/cpp-test/test-l/nest99.h0000644000175000017500000000004410216765467013671 00000000000000/* nest99.h */ #include "nest100.h" mcpp-2.7.2/cpp-test/test-l/nest34.h0000644000175000017500000000004310216765467013655 00000000000000/* nest34.h */ #include "nest35.h" mcpp-2.7.2/cpp-test/test-l/nest12.h0000644000175000017500000000004310216765467013651 00000000000000/* nest12.h */ #include "nest13.h" mcpp-2.7.2/cpp-test/test-l/nest25.h0000644000175000017500000000004310216765467013655 00000000000000/* nest25.h */ #include "nest26.h" mcpp-2.7.2/cpp-test/test-l/nest41.h0000644000175000017500000000004310216765467013653 00000000000000/* nest41.h */ #include "nest42.h" mcpp-2.7.2/cpp-test/test-l/nest37.h0000644000175000017500000000004310216765467013660 00000000000000/* nest37.h */ #include "nest38.h" mcpp-2.7.2/cpp-test/test-l/nest15.h0000644000175000017500000000011510216765467013654 00000000000000/* nest15.h */ #ifdef X0F nest = 0x0f; #else #include "nest16.h" #endif mcpp-2.7.2/cpp-test/test-l/cpp-test.exp0000644000175000017500000000067310216765467014652 00000000000000# cpp-test.exp 2002/12 # to test cpp-test # imported from dg.exp of GNU C # Load support procs. load_lib gcc-dg.exp # If a testcase doesn't have special options, use these. global DEFAULT_CFLAGS if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS " -ansi -pedantic-errors" } # Initialize `dg'. dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ "" $DEFAULT_CFLAGS # All done. dg-finish mcpp-2.7.2/cpp-test/test-l/nest73.h0000644000175000017500000000004310216765467013660 00000000000000/* nest73.h */ #include "nest74.h" mcpp-2.7.2/cpp-test/test-l/nest112.h0000644000175000017500000000004510216765467013734 00000000000000/* nest112.h */ #include "nest113.h" mcpp-2.7.2/cpp-test/test-l/nest114.h0000644000175000017500000000004510216765467013736 00000000000000/* nest114.h */ #include "nest115.h" mcpp-2.7.2/cpp-test/test-l/nest52.h0000644000175000017500000000004310216765467013655 00000000000000/* nest52.h */ #include "nest53.h" mcpp-2.7.2/cpp-test/test-l/nest66.h0000644000175000017500000000004310216765467013662 00000000000000/* nest66.h */ #include "nest67.h" mcpp-2.7.2/cpp-test/test-l/nest48.h0000644000175000017500000000004310216765467013662 00000000000000/* nest48.h */ #include "nest49.h" mcpp-2.7.2/cpp-test/test-l/l_37_5.c0000644000175000017500000000123710216765467013526 00000000000000/* l_37_5.c: Translation limits larger than C99 / 5. */ /* 37.5L: Nested source file inclusion. */ /* Define one of the macros X1F, X3F or it will test 127 levels of #include */ #include "nest1.h" /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| More than 15 nesting of #include" "translation limit" { target *-*-* } 0 } { dg-final { if ![file exist l_37_5_.i] { return } } } { dg-final { if \{ [grep l_37_5_.i "nest = 0x7f"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "l_37_5_.c: more than 15 nesting of #include" } } */ mcpp-2.7.2/cpp-test/test-l/nest115.h0000644000175000017500000000004510216765467013737 00000000000000/* nest115.h */ #include "nest116.h" mcpp-2.7.2/cpp-test/test-l/nest90.h0000644000175000017500000000004310216765467013657 00000000000000/* nest90.h */ #include "nest91.h" mcpp-2.7.2/cpp-test/test-l/nest122.h0000644000175000017500000000004510216765467013735 00000000000000/* nest122.h */ #include "nest123.h" mcpp-2.7.2/cpp-test/test-l/nest68.h0000644000175000017500000000004310216765467013664 00000000000000/* nest68.h */ #include "nest69.h" mcpp-2.7.2/cpp-test/test-l/nest111.h0000644000175000017500000000004510216765467013733 00000000000000/* nest111.h */ #include "nest112.h" mcpp-2.7.2/cpp-test/test-l/l_37_8.c0000644000175000017500000000154310216765467013531 00000000000000/* l_37_8.c: Translation limits larger than C99 / 8. */ /* 37.8L: Length of logical source line. */ /* Define one of the macros X03FF, X07FF, X0FFF, X1FFF or it will test the line of 0x3fff bytes long. */ #include "longline.t" /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| Logical source line longer than 4095 bytes" "translation limit" { target *-*-* } 673 } { dg-warning "| Logical source line longer than 4095 bytes" "translation limit" { target *-*-* } 1532 } { dg-final { if ![file exist l_37_8_.i] { return } } } { dg-final { if \{ [grep l_37_8_.i "pushback"] != "" \} \{ } } { dg-final { if \{ [grep l_37_8_.i "s_name"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "l_37_8_.c: logical source line longer than 4095 bytes" } } */ mcpp-2.7.2/cpp-test/test-l/l_37_3.c0000644000175000017500000000265010216765467013524 00000000000000/* l_37_3.c: Translation limits larger than C99 / 3. */ /* 37.3L: Significant initial characters in an internal identifier or a macro name. */ /* Name of 127 bytes long. */ int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 127; #ifndef X7F /* Name of 255 bytes long. */ int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 255; #endif /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| Identifier longer than 63 bytes" "translation limit" { target *-*-* } 9 } { dg-warning "| Identifier longer than 63 bytes" "translation limit" { target *-*-* } 16 } { dg-final { if ![file exist l_37_3.i] { return } } } { dg-final { if \{ [grep l_37_3.i "A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefB123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefC123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefD123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "l_37_3.c: identifier longer than 63 bytes" } } */ mcpp-2.7.2/cpp-test/test-l/nest87.h0000644000175000017500000000004310216765467013665 00000000000000/* nest87.h */ #include "nest88.h" mcpp-2.7.2/cpp-test/test-l/nest5.h0000644000175000017500000000004110216765467013571 00000000000000/* nest5.h */ #include "nest6.h" mcpp-2.7.2/cpp-test/test-l/nest4.h0000644000175000017500000000004110216765467013570 00000000000000/* nest4.h */ #include "nest5.h" mcpp-2.7.2/cpp-test/test-l/nest49.h0000644000175000017500000000004310216765467013663 00000000000000/* nest49.h */ #include "nest50.h" mcpp-2.7.2/cpp-test/test-l/nest22.h0000644000175000017500000000004310216765467013652 00000000000000/* nest22.h */ #include "nest23.h" mcpp-2.7.2/cpp-test/test-l/nest108.h0000644000175000017500000000004510216765467013741 00000000000000/* nest108.h */ #include "nest109.h" mcpp-2.7.2/cpp-test/test-l/nest123.h0000644000175000017500000000004510216765467013736 00000000000000/* nest123.h */ #include "nest124.h" mcpp-2.7.2/cpp-test/test-l/nest88.h0000644000175000017500000000004310216765467013666 00000000000000/* nest88.h */ #include "nest89.h" mcpp-2.7.2/cpp-test/test-l/nest91.h0000644000175000017500000000004310216765467013660 00000000000000/* nest91.h */ #include "nest92.h" mcpp-2.7.2/cpp-test/test-l/nest44.h0000644000175000017500000000004310216765467013656 00000000000000/* nest44.h */ #include "nest45.h" mcpp-2.7.2/cpp-test/test-l/m8191.h0000644000175000017500000030010210216765467013313 00000000000000/* m8191.h */ #define AAA #define AAB #define AAC #define AAD #define AAE #define AAF #define AAG #define AAH #define AAI #define AAJ #define AAK #define AAL #define AAM #define AAN #define AAO #define AAP #define AAQ #define AAR #define AAS #define AAT #define AAU #define AAV #define AAW #define AAX #define AAY #define AAZ #define ABA #define ABB #define ABC #define ABD #define ABE #define ABF #define ABG #define ABH #define ABI #define ABJ #define ABK #define ABL #define ABM #define ABN #define ABO #define ABP #define ABQ #define ABR #define ABS #define ABT #define ABU #define ABV #define ABW #define ABX #define ABY #define ABZ #define ACA #define ACB #define ACC #define ACD #define ACE #define ACF #define ACG #define ACH #define ACI #define ACJ #define ACK #define ACL #define ACM #define ACN #define ACO #define ACP #define ACQ #define ACR #define ACS #define ACT #define ACU #define ACV #define ACW #define ACX #define ACY #define ACZ #define ADA #define ADB #define ADC #define ADD #define ADE #define ADF #define ADG #define ADH #define ADI #define ADJ #define ADK #define ADL #define ADM #define ADN #define ADO #define ADP #define ADQ #define ADR #define ADS #define ADT #define ADU #define ADV #define ADW #define ADX #define ADY #define ADZ #define AEA #define AEB #define AEC #define AED #define AEE #define AEF #define AEG #define AEH #define AEI #define AEJ #define AEK #define AEL #define AEM #define AEN #define AEO #define AEP #define AEQ #define AER #define AES #define AET #define AEU #define AEV #define AEW #define AEX #define AEY #define AEZ #define AFA #define AFB #define AFC #define AFD #define AFE #define AFF #define AFG #define AFH #define AFI #define AFJ #define AFK #define AFL #define AFM #define AFN #define AFO #define AFP #define AFQ #define AFR #define AFS #define AFT #define AFU #define AFV #define AFW #define AFX #define AFY #define AFZ #define AGA #define AGB #define AGC #define AGD #define AGE #define AGF #define AGG #define AGH #define AGI #define AGJ #define AGK #define AGL #define AGM #define AGN #define AGO #define AGP #define AGQ #define AGR #define AGS #define AGT #define AGU #define AGV #define AGW #define AGX #define AGY #define AGZ #define AHA #define AHB #define AHC #define AHD #define AHE #define AHF #define AHG #define AHH #define AHI #define AHJ #define AHK #define AHL #define AHM #define AHN #define AHO #define AHP #define AHQ #define AHR #define AHS #define AHT #define AHU #define AHV #define AHW #define AHX #define AHY #define AHZ #define AIA #define AIB #define AIC #define AID #define AIE #define AIF #define AIG #define AIH #define AII #define AIJ #define AIK #define AIL #define AIM #define AIN #define AIO #define AIP #define AIQ #define AIR #define AIS #define AIT #define AIU #define AIV #define AIW #define AIX #define AIY #define AIZ #define AJA #define AJB #define AJC #define AJD #define AJE #define AJF #define AJG #define AJH #define AJI #define AJJ #define AJK #define AJL #define AJM #define AJN #define AJO #define AJP #define AJQ #define AJR #define AJS #define AJT #define AJU #define AJV #define AJW #define AJX #define AJY #define AJZ #define AKA #define AKB #define AKC #define AKD #define AKE #define AKF #define AKG #define AKH #define AKI #define AKJ #define AKK #define AKL #define AKM #define AKN #define AKO #define AKP #define AKQ #define AKR #define AKS #define AKT #define AKU #define AKV #define AKW #define AKX #define AKY #define AKZ #define ALA #define ALB #define ALC #define ALD #define ALE #define ALF #define ALG #define ALH #define ALI #define ALJ #define ALK #define ALL #define ALM #define ALN #define ALO #define ALP #define ALQ #define ALR #define ALS #define ALT #define ALU #define ALV #define ALW #define ALX #define ALY #define ALZ #define AMA #define AMB #define AMC #define AMD #define AME #define AMF #define AMG #define AMH #define AMI #define AMJ #define AMK #define AML #define AMM #define AMN #define AMO #define AMP #define AMQ #define AMR #define AMS #define AMT #define AMU #define AMV #define AMW #define AMX #define AMY #define AMZ #define ANA #define ANB #define ANC #define AND #define ANE #define ANF #define ANG #define ANH #define ANI #define ANJ #define ANK #define ANL #define ANM #define ANN #define ANO #define ANP #define ANQ #define ANR #define ANS #define ANT #define ANU #define ANV #define ANW #define ANX #define ANY #define ANZ #define AOA #define AOB #define AOC #define AOD #define AOE #define AOF #define AOG #define AOH #define AOI #define AOJ #define AOK #define AOL #define AOM #define AON #define AOO #define AOP #define AOQ #define AOR #define AOS #define AOT #define AOU #define AOV #define AOW #define AOX #define AOY #define AOZ #define APA #define APB #define APC #define APD #define APE #define APF #define APG #define APH #define API #define APJ #define APK #define APL #define APM #define APN #define APO #define APP #define APQ #define APR #define APS #define APT #define APU #define APV #define APW #define APX #define APY #define APZ #define AQA #define AQB #define AQC #define AQD #define AQE #define AQF #define AQG #define AQH #define AQI #define AQJ #define AQK #define AQL #define AQM #define AQN #define AQO #define AQP #define AQQ #define AQR #define AQS #define AQT #define AQU #define AQV #define AQW #define AQX #define AQY #define AQZ #define ARA #define ARB #define ARC #define ARD #define ARE #define ARF #define ARG #define ARH #define ARI #define ARJ #define ARK #define ARL #define ARM #define ARN #define ARO #define ARP #define ARQ #define ARR #define ARS #define ART #define ARU #define ARV #define ARW #define ARX #define ARY #define ARZ #define ASA #define ASB #define ASC #define ASD #define ASE #define ASF #define ASG #define ASH #define ASI #define ASJ #define ASK #define ASL #define ASM #define ASN #define ASO #define ASP #define ASQ #define ASR #define ASS #define AST #define ASU #define ASV #define ASW #define ASX #define ASY #define ASZ #define ATA #define ATB #define ATC #define ATD #define ATE #define ATF #define ATG #define ATH #define ATI #define ATJ #define ATK #define ATL #define ATM #define ATN #define ATO #define ATP #define ATQ #define ATR #define ATS #define ATT #define ATU #define ATV #define ATW #define ATX #define ATY #define ATZ #define AUA #define AUB #define AUC #define AUD #define AUE #define AUF #define AUG #define AUH #define AUI #define AUJ #define AUK #define AUL #define AUM #define AUN #define AUO #define AUP #define AUQ #define AUR #define AUS #define AUT #define AUU #define AUV #define AUW #define AUX #define AUY #define AUZ #define AVA #define AVB #define AVC #define AVD #define AVE #define AVF #define AVG #define AVH #define AVI #define AVJ #define AVK #define AVL #define AVM #define AVN #define AVO #define AVP #define AVQ #define AVR #define AVS #define AVT #define AVU #define AVV #define AVW #define AVX #define AVY #define AVZ #define AWA #define AWB #define AWC #define AWD #define AWE #define AWF #define AWG #define AWH #define AWI #define AWJ #define AWK #define AWL #define AWM #define AWN #define AWO #define AWP #define AWQ #define AWR #define AWS #define AWT #define AWU #define AWV #define AWW #define AWX #define AWY #define AWZ #define AXA #define AXB #define AXC #define AXD #define AXE #define AXF #define AXG #define AXH #define AXI #define AXJ #define AXK #define AXL #define AXM #define AXN #define AXO #define AXP #define AXQ #define AXR #define AXS #define AXT #define AXU #define AXV #define AXW #define AXX #define AXY #define AXZ #define AYA #define AYB #define AYC #define AYD #define AYE #define AYF #define AYG #define AYH #define AYI #define AYJ #define AYK #define AYL #define AYM #define AYN #define AYO #define AYP #define AYQ #define AYR #define AYS #define AYT #define AYU #define AYV #define AYW #define AYX #define AYY #define AYZ #define AZA #define AZB #define AZC #define AZD #define AZE #define AZF #define AZG #define AZH #define AZI #define AZJ #define AZK #define AZL #define AZM #define AZN #define AZO #define AZP #define AZQ #define AZR #define AZS #define AZT #define AZU #define AZV #define AZW #define AZX #define AZY #define AZZ #define BAA #define BAB #define BAC #define BAD #define BAE #define BAF #define BAG #define BAH #define BAI #define BAJ #define BAK #define BAL #define BAM #define BAN #define BAO #define BAP #define BAQ #define BAR #define BAS #define BAT #define BAU #define BAV #define BAW #define BAX #define BAY #define BAZ #define BBA #define BBB #define BBC #define BBD #define BBE #define BBF #define BBG #define BBH #define BBI #define BBJ #define BBK #define BBL #define BBM #define BBN #define BBO #define BBP #define BBQ #define BBR #define BBS #define BBT #define BBU #define BBV #define BBW #define BBX #define BBY #define BBZ #define BCA #define BCB #define BCC #define BCD #define BCE #define BCF #define BCG #define BCH #define BCI #define BCJ #define BCK #define BCL #define BCM #define BCN #define BCO #define BCP #define BCQ #define BCR #define BCS #define BCT #define BCU #define BCV #define BCW #define BCX #define BCY #define BCZ #define BDA #define BDB #define BDC #define BDD #define BDE #define BDF #define BDG #define BDH #define BDI #define BDJ #define BDK #define BDL #define BDM #define BDN #define BDO #define BDP #define BDQ #define BDR #define BDS #define BDT #define BDU #define BDV #define BDW #define BDX #define BDY #define BDZ #define BEA #define BEB #define BEC #define BED #define BEE #define BEF #define BEG #define BEH #define BEI #define BEJ #define BEK #define BEL #define BEM #define BEN #define BEO #define BEP #define BEQ #define BER #define BES #define BET #define BEU #define BEV #define BEW #define BEX #define BEY #define BEZ #define BFA #define BFB #define BFC #define BFD #define BFE #define BFF #define BFG #define BFH #define BFI #define BFJ #define BFK #define BFL #define BFM #define BFN #define BFO #define BFP #define BFQ #define BFR #define BFS #define BFT #define BFU #define BFV #define BFW #define BFX #define BFY #define BFZ #define BGA #define BGB #define BGC #define BGD #define BGE #define BGF #define BGG #define BGH #define BGI #define BGJ #define BGK #define BGL #define BGM #define BGN #define BGO #define BGP #define BGQ #define BGR #define BGS #define BGT #define BGU #define BGV #define BGW #define BGX #define BGY #define BGZ #define BHA #define BHB #define BHC #define BHD #define BHE #define BHF #define BHG #define BHH #define BHI #define BHJ #define BHK #define BHL #define BHM #define BHN #define BHO #define BHP #define BHQ #define BHR #define BHS #define BHT #define BHU #define BHV #define BHW #define BHX #define BHY #define BHZ #define BIA #define BIB #define BIC #define BID #define BIE #define BIF #define BIG #define BIH #define BII #define BIJ #define BIK #define BIL #define BIM #define BIN #define BIO #define BIP #define BIQ #define BIR #define BIS #define BIT #define BIU #define BIV #define BIW #define BIX #define BIY #define BIZ #define BJA #define BJB #define BJC #define BJD #define BJE #define BJF #define BJG #define BJH #define BJI #define BJJ #define BJK #define BJL #define BJM #define BJN #define BJO #define BJP #define BJQ #define BJR #define BJS #define BJT #define BJU #define BJV #define BJW #define BJX #define BJY #define BJZ #define BKA #define BKB #define BKC #define BKD #define BKE #define BKF #define BKG #define BKH #define BKI #define BKJ #define BKK #define BKL #define BKM #define BKN #define BKO #define BKP #define BKQ #define BKR #define BKS #define BKT #define BKU #define BKV #define BKW #define BKX #define BKY #define BKZ #define BLA #define BLB #define BLC #define BLD #define BLE #define BLF #define BLG #define BLH #define BLI #define BLJ #define BLK #define BLL #define BLM #define BLN #define BLO #define BLP #define BLQ #define BLR #define BLS #define BLT #define BLU #define BLV #define BLW #define BLX #define BLY #define BLZ #define BMA #define BMB #define BMC #define BMD #define BME #define BMF #define BMG #define BMH #define BMI #define BMJ #define BMK #define BML #define BMM #define BMN #define BMO #define BMP #define BMQ #define BMR #define BMS #define BMT #define BMU #define BMV #define BMW #define BMX #define BMY #define BMZ #define BNA #define BNB #define BNC #define BND #define BNE #define BNF #define BNG #define BNH #define BNI #define BNJ #define BNK #define BNL #define BNM #define BNN #define BNO #define BNP #define BNQ #define BNR #define BNS #define BNT #define BNU #define BNV #define BNW #define BNX #define BNY #define BNZ #define BOA #define BOB #define BOC #define BOD #define BOE #define BOF #define BOG #define BOH #define BOI #define BOJ #define BOK #define BOL #define BOM #define BON #define BOO #define BOP #define BOQ #define BOR #define BOS #define BOT #define BOU #define BOV #define BOW #define BOX #define BOY #define BOZ #define BPA #define BPB #define BPC #define BPD #define BPE #define BPF #define BPG #define BPH #define BPI #define BPJ #define BPK #define BPL #define BPM #define BPN #define BPO #define BPP #define BPQ #define BPR #define BPS #define BPT #define BPU #define BPV #define BPW #define BPX #define BPY #define BPZ #define BQA #define BQB #define BQC #define BQD #define BQE #define BQF #define BQG #define BQH #define BQI #define BQJ #define BQK #define BQL #define BQM #define BQN #define BQO #define BQP #define BQQ #define BQR #define BQS #define BQT #define BQU #define BQV #define BQW #define BQX #define BQY #define BQZ #define BRA #define BRB #define BRC #define BRD #define BRE #define BRF #define BRG #define BRH #define BRI #define BRJ #define BRK #define BRL #define BRM #define BRN #define BRO #define BRP #define BRQ #define BRR #define BRS #define BRT #define BRU #define BRV #define BRW #define BRX #define BRY #define BRZ #define BSA #define BSB #define BSC #define BSD #define BSE #define BSF #define BSG #define BSH #define BSI #define BSJ #define BSK #define BSL #define BSM #define BSN #define BSO #define BSP #define BSQ #define BSR #define BSS #define BST #define BSU #define BSV #define BSW #define BSX #define BSY #define BSZ #define BTA #define BTB #define BTC #define BTD #define BTE #define BTF #define BTG #define BTH #define BTI #define BTJ #define BTK #define BTL #define BTM #define BTN #define BTO #define BTP #define BTQ #define BTR #define BTS #define BTT #define BTU #define BTV #define BTW #define BTX #define BTY #define BTZ #define BUA #define BUB #define BUC #define BUD #define BUE #define BUF #define BUG #define BUH #define BUI #define BUJ #define BUK #define BUL #define BUM #define BUN #define BUO #define BUP #define BUQ #define BUR #define BUS #define BUT #define BUU #define BUV #define BUW #define BUX #define BUY #define BUZ #define BVA #define BVB #define BVC #define BVD #define BVE #define BVF #define BVG #define BVH #define BVI #define BVJ #define BVK #define BVL #define BVM #define BVN #define BVO #define BVP #define BVQ #define BVR #define BVS #define BVT #define BVU #define BVV #define BVW #define BVX #define BVY #define BVZ #define BWA #define BWB #define BWC #define BWD #define BWE #define BWF #define BWG #define BWH #define BWI #define BWJ #define BWK #define BWL #define BWM #define BWN #define BWO #define BWP #define BWQ #define BWR #define BWS #define BWT #define BWU #define BWV #define BWW #define BWX #define BWY #define BWZ #define BXA #define BXB #define BXC #define BXD #define BXE #define BXF #define BXG #define BXH #define BXI #define BXJ #define BXK #define BXL #define BXM #define BXN #define BXO #define BXP #define BXQ #define BXR #define BXS #define BXT #define BXU #define BXV #define BXW #define BXX #define BXY #define BXZ #define BYA #define BYB #define BYC #define BYD #define BYE #define BYF #define BYG #define BYH #define BYI #define BYJ #define BYK #define BYL #define BYM #define BYN #define BYO #define BYP #define BYQ #define BYR #define BYS #define BYT #define BYU #define BYV #define BYW #define BYX #define BYY #define BYZ #define BZA #define BZB #define BZC #define BZD #define BZE #define BZF #define BZG #define BZH #define BZI #define BZJ #define BZK #define BZL #define BZM #define BZN #define BZO #define BZP #define BZQ #define BZR #define BZS #define BZT #define BZU #define BZV #define BZW #define BZX #define BZY #define BZZ #define CAA #define CAB #define CAC #define CAD #define CAE #define CAF #define CAG #define CAH #define CAI #define CAJ #define CAK #define CAL #define CAM #define CAN #define CAO #define CAP #define CAQ #define CAR #define CAS #define CAT #define CAU #define CAV #define CAW #define CAX #define CAY #define CAZ #define CBA #define CBB #define CBC #define CBD #define CBE #define CBF #define CBG #define CBH #define CBI #define CBJ #define CBK #define CBL #define CBM #define CBN #define CBO #define CBP #define CBQ #define CBR #define CBS #define CBT #define CBU #define CBV #define CBW #define CBX #define CBY #define CBZ #define CCA #define CCB #define CCC #define CCD #define CCE #define CCF #define CCG #define CCH #define CCI #define CCJ #define CCK #define CCL #define CCM #define CCN #define CCO #define CCP #define CCQ #define CCR #define CCS #define CCT #define CCU #define CCV #define CCW #define CCX #define CCY #define CCZ #define CDA #define CDB #define CDC #define CDD #define CDE #define CDF #define CDG #define CDH #define CDI #define CDJ #define CDK #define CDL #define CDM #define CDN #define CDO #define CDP #define CDQ #define CDR #define CDS #define CDT #define CDU #define CDV #define CDW #define CDX #define CDY #define CDZ #define CEA #define CEB #define CEC #define CED #define CEE #define CEF #define CEG #define CEH #define CEI #define CEJ #define CEK #define CEL #define CEM #define CEN #define CEO #define CEP #define CEQ #define CER #define CES #define CET #define CEU #define CEV #define CEW #define CEX #define CEY #define CEZ #define CFA #define CFB #define CFC #define CFD #define CFE #define CFF #define CFG #define CFH #define CFI #define CFJ #define CFK #define CFL #define CFM #define CFN #define CFO #define CFP #define CFQ #define CFR #define CFS #define CFT #define CFU #define CFV #define CFW #define CFX #define CFY #define CFZ #define CGA #define CGB #define CGC #define CGD #define CGE #define CGF #define CGG #define CGH #define CGI #define CGJ #define CGK #define CGL #define CGM #define CGN #define CGO #define CGP #define CGQ #define CGR #define CGS #define CGT #define CGU #define CGV #define CGW #define CGX #define CGY #define CGZ #define CHA #define CHB #define CHC #define CHD #define CHE #define CHF #define CHG #define CHH #define CHI #define CHJ #define CHK #define CHL #define CHM #define CHN #define CHO #define CHP #define CHQ #define CHR #define CHS #define CHT #define CHU #define CHV #define CHW #define CHX #define CHY #define CHZ #define CIA #define CIB #define CIC #define CID #define CIE #define CIF #define CIG #define CIH #define CII #define CIJ #define CIK #define CIL #define CIM #define CIN #define CIO #define CIP #define CIQ #define CIR #define CIS #define CIT #define CIU #define CIV #define CIW #define CIX #define CIY #define CIZ #define CJA #define CJB #define CJC #define CJD #define CJE #define CJF #define CJG #define CJH #define CJI #define CJJ #define CJK #define CJL #define CJM #define CJN #define CJO #define CJP #define CJQ #define CJR #define CJS #define CJT #define CJU #define CJV #define CJW #define CJX #define CJY #define CJZ #define CKA #define CKB #define CKC #define CKD #define CKE #define CKF #define CKG #define CKH #define CKI #define CKJ #define CKK #define CKL #define CKM #define CKN #define CKO #define CKP #define CKQ #define CKR #define CKS #define CKT #define CKU #define CKV #define CKW #define CKX #define CKY #define CKZ #define CLA #define CLB #define CLC #define CLD #define CLE #define CLF #define CLG #define CLH #define CLI #define CLJ #define CLK #define CLL #define CLM #define CLN #define CLO #define CLP #define CLQ #define CLR #define CLS #define CLT #define CLU #define CLV #define CLW #define CLX #define CLY #define CLZ #define CMA #define CMB #define CMC #define CMD #define CME #define CMF #define CMG #define CMH #define CMI #define CMJ #define CMK #define CML #define CMM #define CMN #define CMO #define CMP #define CMQ #define CMR #define CMS #define CMT #define CMU #define CMV #define CMW #define CMX #define CMY #define CMZ #define CNA #define CNB #define CNC #define CND #define CNE #define CNF #define CNG #define CNH #define CNI #define CNJ #define CNK #define CNL #define CNM #define CNN #define CNO #define CNP #define CNQ #define CNR #define CNS #define CNT #define CNU #define CNV #define CNW #define CNX #define CNY #define CNZ #define COA #define COB #define COC #define COD #define COE #define COF #define COG #define COH #define COI #define COJ #define COK #define COL #define COM #define CON #define COO #define COP #define COQ #define COR #define COS #define COT #define COU #define COV #define COW #define COX #define COY #define COZ #define CPA #define CPB #define CPC #define CPD #define CPE #define CPF #define CPG #define CPH #define CPI #define CPJ #define CPK #define CPL #define CPM #define CPN #define CPO #define CPP #define CPQ #define CPR #define CPS #define CPT #define CPU #define CPV #define CPW #define CPX #define CPY #define CPZ #define CQA #define CQB #define CQC #define CQD #define CQE #define CQF #define CQG #define CQH #define CQI #define CQJ #define CQK #define CQL #define CQM #define CQN #define CQO #define CQP #define CQQ #define CQR #define CQS #define CQT #define CQU #define CQV #define CQW #define CQX #define CQY #define CQZ #define CRA #define CRB #define CRC #define CRD #define CRE #define CRF #define CRG #define CRH #define CRI #define CRJ #define CRK #define CRL #define CRM #define CRN #define CRO #define CRP #define CRQ #define CRR #define CRS #define CRT #define CRU #define CRV #define CRW #define CRX #define CRY #define CRZ #define CSA #define CSB #define CSC #define CSD #define CSE #define CSF #define CSG #define CSH #define CSI #define CSJ #define CSK #define CSL #define CSM #define CSN #define CSO #define CSP #define CSQ #define CSR #define CSS #define CST #define CSU #define CSV #define CSW #define CSX #define CSY #define CSZ #define CTA #define CTB #define CTC #define CTD #define CTE #define CTF #define CTG #define CTH #define CTI #define CTJ #define CTK #define CTL #define CTM #define CTN #define CTO #define CTP #define CTQ #define CTR #define CTS #define CTT #define CTU #define CTV #define CTW #define CTX #define CTY #define CTZ #define CUA #define CUB #define CUC #define CUD #define CUE #define CUF #define CUG #define CUH #define CUI #define CUJ #define CUK #define CUL #define CUM #define CUN #define CUO #define CUP #define CUQ #define CUR #define CUS #define CUT #define CUU #define CUV #define CUW #define CUX #define CUY #define CUZ #define CVA #define CVB #define CVC #define CVD #define CVE #define CVF #define CVG #define CVH #define CVI #define CVJ #define CVK #define CVL #define CVM #define CVN #define CVO #define CVP #define CVQ #define CVR #define CVS #define CVT #define CVU #define CVV #define CVW #define CVX #define CVY #define CVZ #define CWA #define CWB #define CWC #define CWD #define CWE #define CWF #define CWG #define CWH #define CWI #define CWJ #define CWK #define CWL #define CWM #define CWN #define CWO #define CWP #define CWQ #define CWR #define CWS #define CWT #define CWU #define CWV #define CWW #define CWX #define CWY #define CWZ #define CXA #define CXB #define CXC #define CXD #define CXE #define CXF #define CXG #define CXH #define CXI #define CXJ #define CXK #define CXL #define CXM #define CXN #define CXO #define CXP #define CXQ #define CXR #define CXS #define CXT #define CXU #define CXV #define CXW #define CXX #define CXY #define CXZ #define CYA #define CYB #define CYC #define CYD #define CYE #define CYF #define CYG #define CYH #define CYI #define CYJ #define CYK #define CYL #define CYM #define CYN #define CYO #define CYP #define CYQ #define CYR #define CYS #define CYT #define CYU #define CYV #define CYW #define CYX #define CYY #define CYZ #define CZA #define CZB #define CZC #define CZD #define CZE #define CZF #define CZG #define CZH #define CZI #define CZJ #define CZK #define CZL #define CZM #define CZN #define CZO #define CZP #define CZQ #define CZR #define CZS #define CZT #define CZU #define CZV #define CZW #define CZX #define CZY #define CZZ #define DAA #define DAB #define DAC #define DAD #define DAE #define DAF #define DAG #define DAH #define DAI #define DAJ #define DAK #define DAL #define DAM #define DAN #define DAO #define DAP #define DAQ #define DAR #define DAS 0x07ff #ifndef X07FF #define DAT #define DAU #define DAV #define DAW #define DAX #define DAY #define DAZ #define DBA #define DBB #define DBC #define DBD #define DBE #define DBF #define DBG #define DBH #define DBI #define DBJ #define DBK #define DBL #define DBM #define DBN #define DBO #define DBP #define DBQ #define DBR #define DBS #define DBT #define DBU #define DBV #define DBW #define DBX #define DBY #define DBZ #define DCA #define DCB #define DCC #define DCD #define DCE #define DCF #define DCG #define DCH #define DCI #define DCJ #define DCK #define DCL #define DCM #define DCN #define DCO #define DCP #define DCQ #define DCR #define DCS #define DCT #define DCU #define DCV #define DCW #define DCX #define DCY #define DCZ #define DDA #define DDB #define DDC #define DDD #define DDE #define DDF #define DDG #define DDH #define DDI #define DDJ #define DDK #define DDL #define DDM #define DDN #define DDO #define DDP #define DDQ #define DDR #define DDS #define DDT #define DDU #define DDV #define DDW #define DDX #define DDY #define DDZ #define DEA #define DEB #define DEC #define DED #define DEE #define DEF #define DEG #define DEH #define DEI #define DEJ #define DEK #define DEL #define DEM #define DEN #define DEO #define DEP #define DEQ #define DER #define DES #define DET #define DEU #define DEV #define DEW #define DEX #define DEY #define DEZ #define DFA #define DFB #define DFC #define DFD #define DFE #define DFF #define DFG #define DFH #define DFI #define DFJ #define DFK #define DFL #define DFM #define DFN #define DFO #define DFP #define DFQ #define DFR #define DFS #define DFT #define DFU #define DFV #define DFW #define DFX #define DFY #define DFZ #define DGA #define DGB #define DGC #define DGD #define DGE #define DGF #define DGG #define DGH #define DGI #define DGJ #define DGK #define DGL #define DGM #define DGN #define DGO #define DGP #define DGQ #define DGR #define DGS #define DGT #define DGU #define DGV #define DGW #define DGX #define DGY #define DGZ #define DHA #define DHB #define DHC #define DHD #define DHE #define DHF #define DHG #define DHH #define DHI #define DHJ #define DHK #define DHL #define DHM #define DHN #define DHO #define DHP #define DHQ #define DHR #define DHS #define DHT #define DHU #define DHV #define DHW #define DHX #define DHY #define DHZ #define DIA #define DIB #define DIC #define DID #define DIE #define DIF #define DIG #define DIH #define DII #define DIJ #define DIK #define DIL #define DIM #define DIN #define DIO #define DIP #define DIQ #define DIR #define DIS #define DIT #define DIU #define DIV #define DIW #define DIX #define DIY #define DIZ #define DJA #define DJB #define DJC #define DJD #define DJE #define DJF #define DJG #define DJH #define DJI #define DJJ #define DJK #define DJL #define DJM #define DJN #define DJO #define DJP #define DJQ #define DJR #define DJS #define DJT #define DJU #define DJV #define DJW #define DJX #define DJY #define DJZ #define DKA #define DKB #define DKC #define DKD #define DKE #define DKF #define DKG #define DKH #define DKI #define DKJ #define DKK #define DKL #define DKM #define DKN #define DKO #define DKP #define DKQ #define DKR #define DKS #define DKT #define DKU #define DKV #define DKW #define DKX #define DKY #define DKZ #define DLA #define DLB #define DLC #define DLD #define DLE #define DLF #define DLG #define DLH #define DLI #define DLJ #define DLK #define DLL #define DLM #define DLN #define DLO #define DLP #define DLQ #define DLR #define DLS #define DLT #define DLU #define DLV #define DLW #define DLX #define DLY #define DLZ #define DMA #define DMB #define DMC #define DMD #define DME #define DMF #define DMG #define DMH #define DMI #define DMJ #define DMK #define DML #define DMM #define DMN #define DMO #define DMP #define DMQ #define DMR #define DMS #define DMT #define DMU #define DMV #define DMW #define DMX #define DMY #define DMZ #define DNA #define DNB #define DNC #define DND #define DNE #define DNF #define DNG #define DNH #define DNI #define DNJ #define DNK #define DNL #define DNM #define DNN #define DNO #define DNP #define DNQ #define DNR #define DNS #define DNT #define DNU #define DNV #define DNW #define DNX #define DNY #define DNZ #define DOA #define DOB #define DOC #define DOD #define DOE #define DOF #define DOG #define DOH #define DOI #define DOJ #define DOK #define DOL #define DOM #define DON #define DOO #define DOP #define DOQ #define DOR #define DOS #define DOT #define DOU #define DOV #define DOW #define DOX #define DOY #define DOZ #define DPA #define DPB #define DPC #define DPD #define DPE #define DPF #define DPG #define DPH #define DPI #define DPJ #define DPK #define DPL #define DPM #define DPN #define DPO #define DPP #define DPQ #define DPR #define DPS #define DPT #define DPU #define DPV #define DPW #define DPX #define DPY #define DPZ #define DQA #define DQB #define DQC #define DQD #define DQE #define DQF #define DQG #define DQH #define DQI #define DQJ #define DQK #define DQL #define DQM #define DQN #define DQO #define DQP #define DQQ #define DQR #define DQS #define DQT #define DQU #define DQV #define DQW #define DQX #define DQY #define DQZ #define DRA #define DRB #define DRC #define DRD #define DRE #define DRF #define DRG #define DRH #define DRI #define DRJ #define DRK #define DRL #define DRM #define DRN #define DRO #define DRP #define DRQ #define DRR #define DRS #define DRT #define DRU #define DRV #define DRW #define DRX #define DRY #define DRZ #define DSA #define DSB #define DSC #define DSD #define DSE #define DSF #define DSG #define DSH #define DSI #define DSJ #define DSK #define DSL #define DSM #define DSN #define DSO #define DSP #define DSQ #define DSR #define DSS #define DST #define DSU #define DSV #define DSW #define DSX #define DSY #define DSZ #define DTA #define DTB #define DTC #define DTD #define DTE #define DTF #define DTG #define DTH #define DTI #define DTJ #define DTK #define DTL #define DTM #define DTN #define DTO #define DTP #define DTQ #define DTR #define DTS #define DTT #define DTU #define DTV #define DTW #define DTX #define DTY #define DTZ #define DUA #define DUB #define DUC #define DUD #define DUE #define DUF #define DUG #define DUH #define DUI #define DUJ #define DUK #define DUL #define DUM #define DUN #define DUO #define DUP #define DUQ #define DUR #define DUS #define DUT #define DUU #define DUV #define DUW #define DUX #define DUY #define DUZ #define DVA #define DVB #define DVC #define DVD #define DVE #define DVF #define DVG #define DVH #define DVI #define DVJ #define DVK #define DVL #define DVM #define DVN #define DVO #define DVP #define DVQ #define DVR #define DVS #define DVT #define DVU #define DVV #define DVW #define DVX #define DVY #define DVZ #define DWA #define DWB #define DWC #define DWD #define DWE #define DWF #define DWG #define DWH #define DWI #define DWJ #define DWK #define DWL #define DWM #define DWN #define DWO #define DWP #define DWQ #define DWR #define DWS #define DWT #define DWU #define DWV #define DWW #define DWX #define DWY #define DWZ #define DXA #define DXB #define DXC #define DXD #define DXE #define DXF #define DXG #define DXH #define DXI #define DXJ #define DXK #define DXL #define DXM #define DXN #define DXO #define DXP #define DXQ #define DXR #define DXS #define DXT #define DXU #define DXV #define DXW #define DXX #define DXY #define DXZ #define DYA #define DYB #define DYC #define DYD #define DYE #define DYF #define DYG #define DYH #define DYI #define DYJ #define DYK #define DYL #define DYM #define DYN #define DYO #define DYP #define DYQ #define DYR #define DYS #define DYT #define DYU #define DYV #define DYW #define DYX #define DYY #define DYZ #define DZA #define DZB #define DZC #define DZD #define DZE #define DZF #define DZG #define DZH #define DZI #define DZJ #define DZK #define DZL #define DZM #define DZN #define DZO #define DZP #define DZQ #define DZR #define DZS #define DZT #define DZU #define DZV #define DZW #define DZX #define DZY #define DZZ #define EAA #define EAB #define EAC #define EAD #define EAE #define EAF #define EAG #define EAH #define EAI #define EAJ #define EAK #define EAL #define EAM #define EAN #define EAO #define EAP #define EAQ #define EAR #define EAS #define EAT #define EAU #define EAV #define EAW #define EAX #define EAY #define EAZ #define EBA #define EBB #define EBC #define EBD #define EBE #define EBF #define EBG #define EBH #define EBI #define EBJ #define EBK #define EBL #define EBM #define EBN #define EBO #define EBP #define EBQ #define EBR #define EBS #define EBT #define EBU #define EBV #define EBW #define EBX #define EBY #define EBZ #define ECA #define ECB #define ECC #define ECD #define ECE #define ECF #define ECG #define ECH #define ECI #define ECJ #define ECK #define ECL #define ECM #define ECN #define ECO #define ECP #define ECQ #define ECR #define ECS #define ECT #define ECU #define ECV #define ECW #define ECX #define ECY #define ECZ #define EDA #define EDB #define EDC #define EDD #define EDE #define EDF #define EDG #define EDH #define EDI #define EDJ #define EDK #define EDL #define EDM #define EDN #define EDO #define EDP #define EDQ #define EDR #define EDS #define EDT #define EDU #define EDV #define EDW #define EDX #define EDY #define EDZ #define EEA #define EEB #define EEC #define EED #define EEE #define EEF #define EEG #define EEH #define EEI #define EEJ #define EEK #define EEL #define EEM #define EEN #define EEO #define EEP #define EEQ #define EER #define EES #define EET #define EEU #define EEV #define EEW #define EEX #define EEY #define EEZ #define EFA #define EFB #define EFC #define EFD #define EFE #define EFF #define EFG #define EFH #define EFI #define EFJ #define EFK #define EFL #define EFM #define EFN #define EFO #define EFP #define EFQ #define EFR #define EFS #define EFT #define EFU #define EFV #define EFW #define EFX #define EFY #define EFZ #define EGA #define EGB #define EGC #define EGD #define EGE #define EGF #define EGG #define EGH #define EGI #define EGJ #define EGK #define EGL #define EGM #define EGN #define EGO #define EGP #define EGQ #define EGR #define EGS #define EGT #define EGU #define EGV #define EGW #define EGX #define EGY #define EGZ #define EHA #define EHB #define EHC #define EHD #define EHE #define EHF #define EHG #define EHH #define EHI #define EHJ #define EHK #define EHL #define EHM #define EHN #define EHO #define EHP #define EHQ #define EHR #define EHS #define EHT #define EHU #define EHV #define EHW #define EHX #define EHY #define EHZ #define EIA #define EIB #define EIC #define EID #define EIE #define EIF #define EIG #define EIH #define EII #define EIJ #define EIK #define EIL #define EIM #define EIN #define EIO #define EIP #define EIQ #define EIR #define EIS #define EIT #define EIU #define EIV #define EIW #define EIX #define EIY #define EIZ #define EJA #define EJB #define EJC #define EJD #define EJE #define EJF #define EJG #define EJH #define EJI #define EJJ #define EJK #define EJL #define EJM #define EJN #define EJO #define EJP #define EJQ #define EJR #define EJS #define EJT #define EJU #define EJV #define EJW #define EJX #define EJY #define EJZ #define EKA #define EKB #define EKC #define EKD #define EKE #define EKF #define EKG #define EKH #define EKI #define EKJ #define EKK #define EKL #define EKM #define EKN #define EKO #define EKP #define EKQ #define EKR #define EKS #define EKT #define EKU #define EKV #define EKW #define EKX #define EKY #define EKZ #define ELA #define ELB #define ELC #define ELD #define ELE #define ELF #define ELG #define ELH #define ELI #define ELJ #define ELK #define ELL #define ELM #define ELN #define ELO #define ELP #define ELQ #define ELR #define ELS #define ELT #define ELU #define ELV #define ELW #define ELX #define ELY #define ELZ #define EMA #define EMB #define EMC #define EMD #define EME #define EMF #define EMG #define EMH #define EMI #define EMJ #define EMK #define EML #define EMM #define EMN #define EMO #define EMP #define EMQ #define EMR #define EMS #define EMT #define EMU #define EMV #define EMW #define EMX #define EMY #define EMZ #define ENA #define ENB #define ENC #define END #define ENE #define ENF #define ENG #define ENH #define ENI #define ENJ #define ENK #define ENL #define ENM #define ENN #define ENO #define ENP #define ENQ #define ENR #define ENS #define ENT #define ENU #define ENV #define ENW #define ENX #define ENY #define ENZ #define EOA #define EOB #define EOC #define EOD #define EOE #define EOF #define EOG #define EOH #define EOI #define EOJ #define EOK #define EOL #define EOM #define EON #define EOO #define EOP #define EOQ #define EOR #define EOS #define EOT #define EOU #define EOV #define EOW #define EOX #define EOY #define EOZ #define EPA #define EPB #define EPC #define EPD #define EPE #define EPF #define EPG #define EPH #define EPI #define EPJ #define EPK #define EPL #define EPM #define EPN #define EPO #define EPP #define EPQ #define EPR #define EPS #define EPT #define EPU #define EPV #define EPW #define EPX #define EPY #define EPZ #define EQA #define EQB #define EQC #define EQD #define EQE #define EQF #define EQG #define EQH #define EQI #define EQJ #define EQK #define EQL #define EQM #define EQN #define EQO #define EQP #define EQQ #define EQR #define EQS #define EQT #define EQU #define EQV #define EQW #define EQX #define EQY #define EQZ #define ERA #define ERB #define ERC #define ERD #define ERE #define ERF #define ERG #define ERH #define ERI #define ERJ #define ERK #define ERL #define ERM #define ERN #define ERO #define ERP #define ERQ #define ERR #define ERS #define ERT #define ERU #define ERV #define ERW #define ERX #define ERY #define ERZ #define ESA #define ESB #define ESC #define ESD #define ESE #define ESF #define ESG #define ESH #define ESI #define ESJ #define ESK #define ESL #define ESM #define ESN #define ESO #define ESP #define ESQ #define ESR #define ESS #define EST #define ESU #define ESV #define ESW #define ESX #define ESY #define ESZ #define ETA #define ETB #define ETC #define ETD #define ETE #define ETF #define ETG #define ETH #define ETI #define ETJ #define ETK #define ETL #define ETM #define ETN #define ETO #define ETP #define ETQ #define ETR #define ETS #define ETT #define ETU #define ETV #define ETW #define ETX #define ETY #define ETZ #define EUA #define EUB #define EUC #define EUD #define EUE #define EUF #define EUG #define EUH #define EUI #define EUJ #define EUK #define EUL #define EUM #define EUN #define EUO #define EUP #define EUQ #define EUR #define EUS #define EUT #define EUU #define EUV #define EUW #define EUX #define EUY #define EUZ #define EVA #define EVB #define EVC #define EVD #define EVE #define EVF #define EVG #define EVH #define EVI #define EVJ #define EVK #define EVL #define EVM #define EVN #define EVO #define EVP #define EVQ #define EVR #define EVS #define EVT #define EVU #define EVV #define EVW #define EVX #define EVY #define EVZ #define EWA #define EWB #define EWC #define EWD #define EWE #define EWF #define EWG #define EWH #define EWI #define EWJ #define EWK #define EWL #define EWM #define EWN #define EWO #define EWP #define EWQ #define EWR #define EWS #define EWT #define EWU #define EWV #define EWW #define EWX #define EWY #define EWZ #define EXA #define EXB #define EXC #define EXD #define EXE #define EXF #define EXG #define EXH #define EXI #define EXJ #define EXK #define EXL #define EXM #define EXN #define EXO #define EXP #define EXQ #define EXR #define EXS #define EXT #define EXU #define EXV #define EXW #define EXX #define EXY #define EXZ #define EYA #define EYB #define EYC #define EYD #define EYE #define EYF #define EYG #define EYH #define EYI #define EYJ #define EYK #define EYL #define EYM #define EYN #define EYO #define EYP #define EYQ #define EYR #define EYS #define EYT #define EYU #define EYV #define EYW #define EYX #define EYY #define EYZ #define EZA #define EZB #define EZC #define EZD #define EZE #define EZF #define EZG #define EZH #define EZI #define EZJ #define EZK #define EZL #define EZM #define EZN #define EZO #define EZP #define EZQ #define EZR #define EZS #define EZT #define EZU #define EZV #define EZW #define EZX #define EZY #define EZZ #define FAA #define FAB #define FAC #define FAD #define FAE #define FAF #define FAG #define FAH #define FAI #define FAJ #define FAK #define FAL #define FAM #define FAN #define FAO #define FAP #define FAQ #define FAR #define FAS #define FAT #define FAU #define FAV #define FAW #define FAX #define FAY #define FAZ #define FBA #define FBB #define FBC #define FBD #define FBE #define FBF #define FBG #define FBH #define FBI #define FBJ #define FBK #define FBL #define FBM #define FBN #define FBO #define FBP #define FBQ #define FBR #define FBS #define FBT #define FBU #define FBV #define FBW #define FBX #define FBY #define FBZ #define FCA #define FCB #define FCC #define FCD #define FCE #define FCF #define FCG #define FCH #define FCI #define FCJ #define FCK #define FCL #define FCM #define FCN #define FCO #define FCP #define FCQ #define FCR #define FCS #define FCT #define FCU #define FCV #define FCW #define FCX #define FCY #define FCZ #define FDA #define FDB #define FDC #define FDD #define FDE #define FDF #define FDG #define FDH #define FDI #define FDJ #define FDK #define FDL #define FDM #define FDN #define FDO #define FDP #define FDQ #define FDR #define FDS #define FDT #define FDU #define FDV #define FDW #define FDX #define FDY #define FDZ #define FEA #define FEB #define FEC #define FED #define FEE #define FEF #define FEG #define FEH #define FEI #define FEJ #define FEK #define FEL #define FEM #define FEN #define FEO #define FEP #define FEQ #define FER #define FES #define FET #define FEU #define FEV #define FEW #define FEX #define FEY #define FEZ #define FFA #define FFB #define FFC #define FFD #define FFE #define FFF #define FFG #define FFH #define FFI #define FFJ #define FFK #define FFL #define FFM #define FFN #define FFO #define FFP #define FFQ #define FFR #define FFS #define FFT #define FFU #define FFV #define FFW #define FFX #define FFY #define FFZ #define FGA #define FGB #define FGC #define FGD #define FGE #define FGF #define FGG #define FGH #define FGI #define FGJ #define FGK #define FGL #define FGM #define FGN #define FGO #define FGP #define FGQ #define FGR #define FGS #define FGT #define FGU #define FGV #define FGW #define FGX #define FGY #define FGZ #define FHA #define FHB #define FHC #define FHD #define FHE #define FHF #define FHG #define FHH #define FHI #define FHJ #define FHK #define FHL #define FHM #define FHN #define FHO #define FHP #define FHQ #define FHR #define FHS #define FHT #define FHU #define FHV #define FHW #define FHX #define FHY #define FHZ #define FIA #define FIB #define FIC #define FID #define FIE #define FIF #define FIG #define FIH #define FII #define FIJ #define FIK #define FIL #define FIM #define FIN #define FIO #define FIP #define FIQ #define FIR #define FIS #define FIT #define FIU #define FIV #define FIW #define FIX #define FIY #define FIZ #define FJA #define FJB #define FJC #define FJD #define FJE #define FJF #define FJG #define FJH #define FJI #define FJJ #define FJK #define FJL #define FJM #define FJN #define FJO #define FJP #define FJQ #define FJR #define FJS #define FJT #define FJU #define FJV #define FJW #define FJX #define FJY #define FJZ #define FKA #define FKB #define FKC #define FKD #define FKE #define FKF #define FKG #define FKH #define FKI #define FKJ #define FKK #define FKL #define FKM #define FKN #define FKO #define FKP #define FKQ #define FKR #define FKS #define FKT #define FKU #define FKV #define FKW #define FKX #define FKY #define FKZ #define FLA #define FLB #define FLC #define FLD #define FLE #define FLF #define FLG #define FLH #define FLI #define FLJ #define FLK #define FLL #define FLM #define FLN #define FLO #define FLP #define FLQ #define FLR #define FLS #define FLT #define FLU #define FLV #define FLW #define FLX #define FLY #define FLZ #define FMA #define FMB #define FMC #define FMD #define FME #define FMF #define FMG #define FMH #define FMI #define FMJ #define FMK #define FML #define FMM #define FMN #define FMO #define FMP #define FMQ #define FMR #define FMS #define FMT #define FMU #define FMV #define FMW #define FMX #define FMY #define FMZ #define FNA #define FNB #define FNC #define FND #define FNE #define FNF #define FNG #define FNH #define FNI #define FNJ #define FNK #define FNL #define FNM #define FNN #define FNO #define FNP #define FNQ #define FNR #define FNS #define FNT #define FNU #define FNV #define FNW #define FNX #define FNY #define FNZ #define FOA #define FOB #define FOC #define FOD #define FOE #define FOF #define FOG #define FOH #define FOI #define FOJ #define FOK #define FOL #define FOM #define FON #define FOO #define FOP #define FOQ #define FOR #define FOS #define FOT #define FOU #define FOV #define FOW #define FOX #define FOY #define FOZ #define FPA #define FPB #define FPC #define FPD #define FPE #define FPF #define FPG #define FPH #define FPI #define FPJ #define FPK #define FPL #define FPM #define FPN #define FPO #define FPP #define FPQ #define FPR #define FPS #define FPT #define FPU #define FPV #define FPW #define FPX #define FPY #define FPZ #define FQA #define FQB #define FQC #define FQD #define FQE #define FQF #define FQG #define FQH #define FQI #define FQJ #define FQK #define FQL #define FQM #define FQN #define FQO #define FQP #define FQQ #define FQR #define FQS #define FQT #define FQU #define FQV #define FQW #define FQX #define FQY #define FQZ #define FRA #define FRB #define FRC #define FRD #define FRE #define FRF #define FRG #define FRH #define FRI #define FRJ #define FRK #define FRL #define FRM #define FRN #define FRO #define FRP #define FRQ #define FRR #define FRS #define FRT #define FRU #define FRV #define FRW #define FRX #define FRY #define FRZ #define FSA #define FSB #define FSC #define FSD #define FSE #define FSF #define FSG #define FSH #define FSI #define FSJ #define FSK #define FSL #define FSM #define FSN #define FSO #define FSP #define FSQ #define FSR #define FSS #define FST #define FSU #define FSV #define FSW #define FSX #define FSY #define FSZ #define FTA #define FTB #define FTC #define FTD #define FTE #define FTF #define FTG #define FTH #define FTI #define FTJ #define FTK #define FTL #define FTM #define FTN #define FTO #define FTP #define FTQ #define FTR #define FTS #define FTT #define FTU #define FTV #define FTW #define FTX #define FTY #define FTZ #define FUA #define FUB #define FUC #define FUD #define FUE #define FUF #define FUG #define FUH #define FUI #define FUJ #define FUK #define FUL #define FUM #define FUN #define FUO #define FUP #define FUQ #define FUR #define FUS #define FUT #define FUU #define FUV #define FUW #define FUX #define FUY #define FUZ #define FVA #define FVB #define FVC #define FVD #define FVE #define FVF #define FVG #define FVH #define FVI #define FVJ #define FVK #define FVL #define FVM #define FVN #define FVO #define FVP #define FVQ #define FVR #define FVS #define FVT #define FVU #define FVV #define FVW #define FVX #define FVY #define FVZ #define FWA #define FWB #define FWC #define FWD #define FWE #define FWF #define FWG #define FWH #define FWI #define FWJ #define FWK #define FWL #define FWM #define FWN #define FWO #define FWP #define FWQ #define FWR #define FWS #define FWT #define FWU #define FWV #define FWW #define FWX #define FWY #define FWZ #define FXA #define FXB #define FXC #define FXD #define FXE #define FXF #define FXG #define FXH #define FXI #define FXJ #define FXK #define FXL #define FXM #define FXN #define FXO #define FXP #define FXQ #define FXR #define FXS #define FXT #define FXU #define FXV #define FXW #define FXX #define FXY #define FXZ #define FYA #define FYB #define FYC #define FYD #define FYE #define FYF #define FYG #define FYH #define FYI #define FYJ #define FYK #define FYL #define FYM #define FYN #define FYO #define FYP #define FYQ #define FYR #define FYS #define FYT #define FYU #define FYV #define FYW #define FYX #define FYY #define FYZ #define FZA #define FZB #define FZC #define FZD #define FZE #define FZF #define FZG #define FZH #define FZI #define FZJ #define FZK #define FZL #define FZM #define FZN #define FZO #define FZP #define FZQ #define FZR #define FZS #define FZT #define FZU #define FZV #define FZW #define FZX #define FZY #define FZZ #define GAA #define GAB #define GAC #define GAD #define GAE #define GAF #define GAG #define GAH #define GAI #define GAJ #define GAK #define GAL #define GAM #define GAN #define GAO #define GAP #define GAQ #define GAR #define GAS #define GAT #define GAU #define GAV #define GAW #define GAX #define GAY #define GAZ #define GBA #define GBB #define GBC #define GBD #define GBE #define GBF #define GBG #define GBH #define GBI #define GBJ #define GBK #define GBL #define GBM 0x0fff #ifndef X0FFF #define GBN #define GBO #define GBP #define GBQ #define GBR #define GBS #define GBT #define GBU #define GBV #define GBW #define GBX #define GBY #define GBZ #define GCA #define GCB #define GCC #define GCD #define GCE #define GCF #define GCG #define GCH #define GCI #define GCJ #define GCK #define GCL #define GCM #define GCN #define GCO #define GCP #define GCQ #define GCR #define GCS #define GCT #define GCU #define GCV #define GCW #define GCX #define GCY #define GCZ #define GDA #define GDB #define GDC #define GDD #define GDE #define GDF #define GDG #define GDH #define GDI #define GDJ #define GDK #define GDL #define GDM #define GDN #define GDO #define GDP #define GDQ #define GDR #define GDS #define GDT #define GDU #define GDV #define GDW #define GDX #define GDY #define GDZ #define GEA #define GEB #define GEC #define GED #define GEE #define GEF #define GEG #define GEH #define GEI #define GEJ #define GEK #define GEL #define GEM #define GEN #define GEO #define GEP #define GEQ #define GER #define GES #define GET #define GEU #define GEV #define GEW #define GEX #define GEY #define GEZ #define GFA #define GFB #define GFC #define GFD #define GFE #define GFF #define GFG #define GFH #define GFI #define GFJ #define GFK #define GFL #define GFM #define GFN #define GFO #define GFP #define GFQ #define GFR #define GFS #define GFT #define GFU #define GFV #define GFW #define GFX #define GFY #define GFZ #define GGA #define GGB #define GGC #define GGD #define GGE #define GGF #define GGG #define GGH #define GGI #define GGJ #define GGK #define GGL #define GGM #define GGN #define GGO #define GGP #define GGQ #define GGR #define GGS #define GGT #define GGU #define GGV #define GGW #define GGX #define GGY #define GGZ #define GHA #define GHB #define GHC #define GHD #define GHE #define GHF #define GHG #define GHH #define GHI #define GHJ #define GHK #define GHL #define GHM #define GHN #define GHO #define GHP #define GHQ #define GHR #define GHS #define GHT #define GHU #define GHV #define GHW #define GHX #define GHY #define GHZ #define GIA #define GIB #define GIC #define GID #define GIE #define GIF #define GIG #define GIH #define GII #define GIJ #define GIK #define GIL #define GIM #define GIN #define GIO #define GIP #define GIQ #define GIR #define GIS #define GIT #define GIU #define GIV #define GIW #define GIX #define GIY #define GIZ #define GJA #define GJB #define GJC #define GJD #define GJE #define GJF #define GJG #define GJH #define GJI #define GJJ #define GJK #define GJL #define GJM #define GJN #define GJO #define GJP #define GJQ #define GJR #define GJS #define GJT #define GJU #define GJV #define GJW #define GJX #define GJY #define GJZ #define GKA #define GKB #define GKC #define GKD #define GKE #define GKF #define GKG #define GKH #define GKI #define GKJ #define GKK #define GKL #define GKM #define GKN #define GKO #define GKP #define GKQ #define GKR #define GKS #define GKT #define GKU #define GKV #define GKW #define GKX #define GKY #define GKZ #define GLA #define GLB #define GLC #define GLD #define GLE #define GLF #define GLG #define GLH #define GLI #define GLJ #define GLK #define GLL #define GLM #define GLN #define GLO #define GLP #define GLQ #define GLR #define GLS #define GLT #define GLU #define GLV #define GLW #define GLX #define GLY #define GLZ #define GMA #define GMB #define GMC #define GMD #define GME #define GMF #define GMG #define GMH #define GMI #define GMJ #define GMK #define GML #define GMM #define GMN #define GMO #define GMP #define GMQ #define GMR #define GMS #define GMT #define GMU #define GMV #define GMW #define GMX #define GMY #define GMZ #define GNA #define GNB #define GNC #define GND #define GNE #define GNF #define GNG #define GNH #define GNI #define GNJ #define GNK #define GNL #define GNM #define GNN #define GNO #define GNP #define GNQ #define GNR #define GNS #define GNT #define GNU #define GNV #define GNW #define GNX #define GNY #define GNZ #define GOA #define GOB #define GOC #define GOD #define GOE #define GOF #define GOG #define GOH #define GOI #define GOJ #define GOK #define GOL #define GOM #define GON #define GOO #define GOP #define GOQ #define GOR #define GOS #define GOT #define GOU #define GOV #define GOW #define GOX #define GOY #define GOZ #define GPA #define GPB #define GPC #define GPD #define GPE #define GPF #define GPG #define GPH #define GPI #define GPJ #define GPK #define GPL #define GPM #define GPN #define GPO #define GPP #define GPQ #define GPR #define GPS #define GPT #define GPU #define GPV #define GPW #define GPX #define GPY #define GPZ #define GQA #define GQB #define GQC #define GQD #define GQE #define GQF #define GQG #define GQH #define GQI #define GQJ #define GQK #define GQL #define GQM #define GQN #define GQO #define GQP #define GQQ #define GQR #define GQS #define GQT #define GQU #define GQV #define GQW #define GQX #define GQY #define GQZ #define GRA #define GRB #define GRC #define GRD #define GRE #define GRF #define GRG #define GRH #define GRI #define GRJ #define GRK #define GRL #define GRM #define GRN #define GRO #define GRP #define GRQ #define GRR #define GRS #define GRT #define GRU #define GRV #define GRW #define GRX #define GRY #define GRZ #define GSA #define GSB #define GSC #define GSD #define GSE #define GSF #define GSG #define GSH #define GSI #define GSJ #define GSK #define GSL #define GSM #define GSN #define GSO #define GSP #define GSQ #define GSR #define GSS #define GST #define GSU #define GSV #define GSW #define GSX #define GSY #define GSZ #define GTA #define GTB #define GTC #define GTD #define GTE #define GTF #define GTG #define GTH #define GTI #define GTJ #define GTK #define GTL #define GTM #define GTN #define GTO #define GTP #define GTQ #define GTR #define GTS #define GTT #define GTU #define GTV #define GTW #define GTX #define GTY #define GTZ #define GUA #define GUB #define GUC #define GUD #define GUE #define GUF #define GUG #define GUH #define GUI #define GUJ #define GUK #define GUL #define GUM #define GUN #define GUO #define GUP #define GUQ #define GUR #define GUS #define GUT #define GUU #define GUV #define GUW #define GUX #define GUY #define GUZ #define GVA #define GVB #define GVC #define GVD #define GVE #define GVF #define GVG #define GVH #define GVI #define GVJ #define GVK #define GVL #define GVM #define GVN #define GVO #define GVP #define GVQ #define GVR #define GVS #define GVT #define GVU #define GVV #define GVW #define GVX #define GVY #define GVZ #define GWA #define GWB #define GWC #define GWD #define GWE #define GWF #define GWG #define GWH #define GWI #define GWJ #define GWK #define GWL #define GWM #define GWN #define GWO #define GWP #define GWQ #define GWR #define GWS #define GWT #define GWU #define GWV #define GWW #define GWX #define GWY #define GWZ #define GXA #define GXB #define GXC #define GXD #define GXE #define GXF #define GXG #define GXH #define GXI #define GXJ #define GXK #define GXL #define GXM #define GXN #define GXO #define GXP #define GXQ #define GXR #define GXS #define GXT #define GXU #define GXV #define GXW #define GXX #define GXY #define GXZ #define GYA #define GYB #define GYC #define GYD #define GYE #define GYF #define GYG #define GYH #define GYI #define GYJ #define GYK #define GYL #define GYM #define GYN #define GYO #define GYP #define GYQ #define GYR #define GYS #define GYT #define GYU #define GYV #define GYW #define GYX #define GYY #define GYZ #define GZA #define GZB #define GZC #define GZD #define GZE #define GZF #define GZG #define GZH #define GZI #define GZJ #define GZK #define GZL #define GZM #define GZN #define GZO #define GZP #define GZQ #define GZR #define GZS #define GZT #define GZU #define GZV #define GZW #define GZX #define GZY #define GZZ #define HAA #define HAB #define HAC #define HAD #define HAE #define HAF #define HAG #define HAH #define HAI #define HAJ #define HAK #define HAL #define HAM #define HAN #define HAO #define HAP #define HAQ #define HAR #define HAS #define HAT #define HAU #define HAV #define HAW #define HAX #define HAY #define HAZ #define HBA #define HBB #define HBC #define HBD #define HBE #define HBF #define HBG #define HBH #define HBI #define HBJ #define HBK #define HBL #define HBM #define HBN #define HBO #define HBP #define HBQ #define HBR #define HBS #define HBT #define HBU #define HBV #define HBW #define HBX #define HBY #define HBZ #define HCA #define HCB #define HCC #define HCD #define HCE #define HCF #define HCG #define HCH #define HCI #define HCJ #define HCK #define HCL #define HCM #define HCN #define HCO #define HCP #define HCQ #define HCR #define HCS #define HCT #define HCU #define HCV #define HCW #define HCX #define HCY #define HCZ #define HDA #define HDB #define HDC #define HDD #define HDE #define HDF #define HDG #define HDH #define HDI #define HDJ #define HDK #define HDL #define HDM #define HDN #define HDO #define HDP #define HDQ #define HDR #define HDS #define HDT #define HDU #define HDV #define HDW #define HDX #define HDY #define HDZ #define HEA #define HEB #define HEC #define HED #define HEE #define HEF #define HEG #define HEH #define HEI #define HEJ #define HEK #define HEL #define HEM #define HEN #define HEO #define HEP #define HEQ #define HER #define HES #define HET #define HEU #define HEV #define HEW #define HEX #define HEY #define HEZ #define HFA #define HFB #define HFC #define HFD #define HFE #define HFF #define HFG #define HFH #define HFI #define HFJ #define HFK #define HFL #define HFM #define HFN #define HFO #define HFP #define HFQ #define HFR #define HFS #define HFT #define HFU #define HFV #define HFW #define HFX #define HFY #define HFZ #define HGA #define HGB #define HGC #define HGD #define HGE #define HGF #define HGG #define HGH #define HGI #define HGJ #define HGK #define HGL #define HGM #define HGN #define HGO #define HGP #define HGQ #define HGR #define HGS #define HGT #define HGU #define HGV #define HGW #define HGX #define HGY #define HGZ #define HHA #define HHB #define HHC #define HHD #define HHE #define HHF #define HHG #define HHH #define HHI #define HHJ #define HHK #define HHL #define HHM #define HHN #define HHO #define HHP #define HHQ #define HHR #define HHS #define HHT #define HHU #define HHV #define HHW #define HHX #define HHY #define HHZ #define HIA #define HIB #define HIC #define HID #define HIE #define HIF #define HIG #define HIH #define HII #define HIJ #define HIK #define HIL #define HIM #define HIN #define HIO #define HIP #define HIQ #define HIR #define HIS #define HIT #define HIU #define HIV #define HIW #define HIX #define HIY #define HIZ #define HJA #define HJB #define HJC #define HJD #define HJE #define HJF #define HJG #define HJH #define HJI #define HJJ #define HJK #define HJL #define HJM #define HJN #define HJO #define HJP #define HJQ #define HJR #define HJS #define HJT #define HJU #define HJV #define HJW #define HJX #define HJY #define HJZ #define HKA #define HKB #define HKC #define HKD #define HKE #define HKF #define HKG #define HKH #define HKI #define HKJ #define HKK #define HKL #define HKM #define HKN #define HKO #define HKP #define HKQ #define HKR #define HKS #define HKT #define HKU #define HKV #define HKW #define HKX #define HKY #define HKZ #define HLA #define HLB #define HLC #define HLD #define HLE #define HLF #define HLG #define HLH #define HLI #define HLJ #define HLK #define HLL #define HLM #define HLN #define HLO #define HLP #define HLQ #define HLR #define HLS #define HLT #define HLU #define HLV #define HLW #define HLX #define HLY #define HLZ #define HMA #define HMB #define HMC #define HMD #define HME #define HMF #define HMG #define HMH #define HMI #define HMJ #define HMK #define HML #define HMM #define HMN #define HMO #define HMP #define HMQ #define HMR #define HMS #define HMT #define HMU #define HMV #define HMW #define HMX #define HMY #define HMZ #define HNA #define HNB #define HNC #define HND #define HNE #define HNF #define HNG #define HNH #define HNI #define HNJ #define HNK #define HNL #define HNM #define HNN #define HNO #define HNP #define HNQ #define HNR #define HNS #define HNT #define HNU #define HNV #define HNW #define HNX #define HNY #define HNZ #define HOA #define HOB #define HOC #define HOD #define HOE #define HOF #define HOG #define HOH #define HOI #define HOJ #define HOK #define HOL #define HOM #define HON #define HOO #define HOP #define HOQ #define HOR #define HOS #define HOT #define HOU #define HOV #define HOW #define HOX #define HOY #define HOZ #define HPA #define HPB #define HPC #define HPD #define HPE #define HPF #define HPG #define HPH #define HPI #define HPJ #define HPK #define HPL #define HPM #define HPN #define HPO #define HPP #define HPQ #define HPR #define HPS #define HPT #define HPU #define HPV #define HPW #define HPX #define HPY #define HPZ #define HQA #define HQB #define HQC #define HQD #define HQE #define HQF #define HQG #define HQH #define HQI #define HQJ #define HQK #define HQL #define HQM #define HQN #define HQO #define HQP #define HQQ #define HQR #define HQS #define HQT #define HQU #define HQV #define HQW #define HQX #define HQY #define HQZ #define HRA #define HRB #define HRC #define HRD #define HRE #define HRF #define HRG #define HRH #define HRI #define HRJ #define HRK #define HRL #define HRM #define HRN #define HRO #define HRP #define HRQ #define HRR #define HRS #define HRT #define HRU #define HRV #define HRW #define HRX #define HRY #define HRZ #define HSA #define HSB #define HSC #define HSD #define HSE #define HSF #define HSG #define HSH #define HSI #define HSJ #define HSK #define HSL #define HSM #define HSN #define HSO #define HSP #define HSQ #define HSR #define HSS #define HST #define HSU #define HSV #define HSW #define HSX #define HSY #define HSZ #define HTA #define HTB #define HTC #define HTD #define HTE #define HTF #define HTG #define HTH #define HTI #define HTJ #define HTK #define HTL #define HTM #define HTN #define HTO #define HTP #define HTQ #define HTR #define HTS #define HTT #define HTU #define HTV #define HTW #define HTX #define HTY #define HTZ #define HUA #define HUB #define HUC #define HUD #define HUE #define HUF #define HUG #define HUH #define HUI #define HUJ #define HUK #define HUL #define HUM #define HUN #define HUO #define HUP #define HUQ #define HUR #define HUS #define HUT #define HUU #define HUV #define HUW #define HUX #define HUY #define HUZ #define HVA #define HVB #define HVC #define HVD #define HVE #define HVF #define HVG #define HVH #define HVI #define HVJ #define HVK #define HVL #define HVM #define HVN #define HVO #define HVP #define HVQ #define HVR #define HVS #define HVT #define HVU #define HVV #define HVW #define HVX #define HVY #define HVZ #define HWA #define HWB #define HWC #define HWD #define HWE #define HWF #define HWG #define HWH #define HWI #define HWJ #define HWK #define HWL #define HWM #define HWN #define HWO #define HWP #define HWQ #define HWR #define HWS #define HWT #define HWU #define HWV #define HWW #define HWX #define HWY #define HWZ #define HXA #define HXB #define HXC #define HXD #define HXE #define HXF #define HXG #define HXH #define HXI #define HXJ #define HXK #define HXL #define HXM #define HXN #define HXO #define HXP #define HXQ #define HXR #define HXS #define HXT #define HXU #define HXV #define HXW #define HXX #define HXY #define HXZ #define HYA #define HYB #define HYC #define HYD #define HYE #define HYF #define HYG #define HYH #define HYI #define HYJ #define HYK #define HYL #define HYM #define HYN #define HYO #define HYP #define HYQ #define HYR #define HYS #define HYT #define HYU #define HYV #define HYW #define HYX #define HYY #define HYZ #define HZA #define HZB #define HZC #define HZD #define HZE #define HZF #define HZG #define HZH #define HZI #define HZJ #define HZK #define HZL #define HZM #define HZN #define HZO #define HZP #define HZQ #define HZR #define HZS #define HZT #define HZU #define HZV #define HZW #define HZX #define HZY #define HZZ #define IAA #define IAB #define IAC #define IAD #define IAE #define IAF #define IAG #define IAH #define IAI #define IAJ #define IAK #define IAL #define IAM #define IAN #define IAO #define IAP #define IAQ #define IAR #define IAS #define IAT #define IAU #define IAV #define IAW #define IAX #define IAY #define IAZ #define IBA #define IBB #define IBC #define IBD #define IBE #define IBF #define IBG #define IBH #define IBI #define IBJ #define IBK #define IBL #define IBM #define IBN #define IBO #define IBP #define IBQ #define IBR #define IBS #define IBT #define IBU #define IBV #define IBW #define IBX #define IBY #define IBZ #define ICA #define ICB #define ICC #define ICD #define ICE #define ICF #define ICG #define ICH #define ICI #define ICJ #define ICK #define ICL #define ICM #define ICN #define ICO #define ICP #define ICQ #define ICR #define ICS #define ICT #define ICU #define ICV #define ICW #define ICX #define ICY #define ICZ #define IDA #define IDB #define IDC #define IDD #define IDE #define IDF #define IDG #define IDH #define IDI #define IDJ #define IDK #define IDL #define IDM #define IDN #define IDO #define IDP #define IDQ #define IDR #define IDS #define IDT #define IDU #define IDV #define IDW #define IDX #define IDY #define IDZ #define IEA #define IEB #define IEC #define IED #define IEE #define IEF #define IEG #define IEH #define IEI #define IEJ #define IEK #define IEL #define IEM #define IEN #define IEO #define IEP #define IEQ #define IER #define IES #define IET #define IEU #define IEV #define IEW #define IEX #define IEY #define IEZ #define IFA #define IFB #define IFC #define IFD #define IFE #define IFF #define IFG #define IFH #define IFI #define IFJ #define IFK #define IFL #define IFM #define IFN #define IFO #define IFP #define IFQ #define IFR #define IFS #define IFT #define IFU #define IFV #define IFW #define IFX #define IFY #define IFZ #define IGA #define IGB #define IGC #define IGD #define IGE #define IGF #define IGG #define IGH #define IGI #define IGJ #define IGK #define IGL #define IGM #define IGN #define IGO #define IGP #define IGQ #define IGR #define IGS #define IGT #define IGU #define IGV #define IGW #define IGX #define IGY #define IGZ #define IHA #define IHB #define IHC #define IHD #define IHE #define IHF #define IHG #define IHH #define IHI #define IHJ #define IHK #define IHL #define IHM #define IHN #define IHO #define IHP #define IHQ #define IHR #define IHS #define IHT #define IHU #define IHV #define IHW #define IHX #define IHY #define IHZ #define IIA #define IIB #define IIC #define IID #define IIE #define IIF #define IIG #define IIH #define III #define IIJ #define IIK #define IIL #define IIM #define IIN #define IIO #define IIP #define IIQ #define IIR #define IIS #define IIT #define IIU #define IIV #define IIW #define IIX #define IIY #define IIZ #define IJA #define IJB #define IJC #define IJD #define IJE #define IJF #define IJG #define IJH #define IJI #define IJJ #define IJK #define IJL #define IJM #define IJN #define IJO #define IJP #define IJQ #define IJR #define IJS #define IJT #define IJU #define IJV #define IJW #define IJX #define IJY #define IJZ #define IKA #define IKB #define IKC #define IKD #define IKE #define IKF #define IKG #define IKH #define IKI #define IKJ #define IKK #define IKL #define IKM #define IKN #define IKO #define IKP #define IKQ #define IKR #define IKS #define IKT #define IKU #define IKV #define IKW #define IKX #define IKY #define IKZ #define ILA #define ILB #define ILC #define ILD #define ILE #define ILF #define ILG #define ILH #define ILI #define ILJ #define ILK #define ILL #define ILM #define ILN #define ILO #define ILP #define ILQ #define ILR #define ILS #define ILT #define ILU #define ILV #define ILW #define ILX #define ILY #define ILZ #define IMA #define IMB #define IMC #define IMD #define IME #define IMF #define IMG #define IMH #define IMI #define IMJ #define IMK #define IML #define IMM #define IMN #define IMO #define IMP #define IMQ #define IMR #define IMS #define IMT #define IMU #define IMV #define IMW #define IMX #define IMY #define IMZ #define INA #define INB #define INC #define IND #define INE #define INF #define ING #define INH #define INI #define INJ #define INK #define INL #define INM #define INN #define INO #define INP #define INQ #define INR #define INS #define INT #define INU #define INV #define INW #define INX #define INY #define INZ #define IOA #define IOB #define IOC #define IOD #define IOE #define IOF #define IOG #define IOH #define IOI #define IOJ #define IOK #define IOL #define IOM #define ION #define IOO #define IOP #define IOQ #define IOR #define IOS #define IOT #define IOU #define IOV #define IOW #define IOX #define IOY #define IOZ #define IPA #define IPB #define IPC #define IPD #define IPE #define IPF #define IPG #define IPH #define IPI #define IPJ #define IPK #define IPL #define IPM #define IPN #define IPO #define IPP #define IPQ #define IPR #define IPS #define IPT #define IPU #define IPV #define IPW #define IPX #define IPY #define IPZ #define IQA #define IQB #define IQC #define IQD #define IQE #define IQF #define IQG #define IQH #define IQI #define IQJ #define IQK #define IQL #define IQM #define IQN #define IQO #define IQP #define IQQ #define IQR #define IQS #define IQT #define IQU #define IQV #define IQW #define IQX #define IQY #define IQZ #define IRA #define IRB #define IRC #define IRD #define IRE #define IRF #define IRG #define IRH #define IRI #define IRJ #define IRK #define IRL #define IRM #define IRN #define IRO #define IRP #define IRQ #define IRR #define IRS #define IRT #define IRU #define IRV #define IRW #define IRX #define IRY #define IRZ #define ISA #define ISB #define ISC #define ISD #define ISE #define ISF #define ISG #define ISH #define ISI #define ISJ #define ISK #define ISL #define ISM #define ISN #define ISO #define ISP #define ISQ #define ISR #define ISS #define IST #define ISU #define ISV #define ISW #define ISX #define ISY #define ISZ #define ITA #define ITB #define ITC #define ITD #define ITE #define ITF #define ITG #define ITH #define ITI #define ITJ #define ITK #define ITL #define ITM #define ITN #define ITO #define ITP #define ITQ #define ITR #define ITS #define ITT #define ITU #define ITV #define ITW #define ITX #define ITY #define ITZ #define IUA #define IUB #define IUC #define IUD #define IUE #define IUF #define IUG #define IUH #define IUI #define IUJ #define IUK #define IUL #define IUM #define IUN #define IUO #define IUP #define IUQ #define IUR #define IUS #define IUT #define IUU #define IUV #define IUW #define IUX #define IUY #define IUZ #define IVA #define IVB #define IVC #define IVD #define IVE #define IVF #define IVG #define IVH #define IVI #define IVJ #define IVK #define IVL #define IVM #define IVN #define IVO #define IVP #define IVQ #define IVR #define IVS #define IVT #define IVU #define IVV #define IVW #define IVX #define IVY #define IVZ #define IWA #define IWB #define IWC #define IWD #define IWE #define IWF #define IWG #define IWH #define IWI #define IWJ #define IWK #define IWL #define IWM #define IWN #define IWO #define IWP #define IWQ #define IWR #define IWS #define IWT #define IWU #define IWV #define IWW #define IWX #define IWY #define IWZ #define IXA #define IXB #define IXC #define IXD #define IXE #define IXF #define IXG #define IXH #define IXI #define IXJ #define IXK #define IXL #define IXM #define IXN #define IXO #define IXP #define IXQ #define IXR #define IXS #define IXT #define IXU #define IXV #define IXW #define IXX #define IXY #define IXZ #define IYA #define IYB #define IYC #define IYD #define IYE #define IYF #define IYG #define IYH #define IYI #define IYJ #define IYK #define IYL #define IYM #define IYN #define IYO #define IYP #define IYQ #define IYR #define IYS #define IYT #define IYU #define IYV #define IYW #define IYX #define IYY #define IYZ #define IZA #define IZB #define IZC #define IZD #define IZE #define IZF #define IZG #define IZH #define IZI #define IZJ #define IZK #define IZL #define IZM #define IZN #define IZO #define IZP #define IZQ #define IZR #define IZS #define IZT #define IZU #define IZV #define IZW #define IZX #define IZY #define IZZ #define JAA #define JAB #define JAC #define JAD #define JAE #define JAF #define JAG #define JAH #define JAI #define JAJ #define JAK #define JAL #define JAM #define JAN #define JAO #define JAP #define JAQ #define JAR #define JAS #define JAT #define JAU #define JAV #define JAW #define JAX #define JAY #define JAZ #define JBA #define JBB #define JBC #define JBD #define JBE #define JBF #define JBG #define JBH #define JBI #define JBJ #define JBK #define JBL #define JBM #define JBN #define JBO #define JBP #define JBQ #define JBR #define JBS #define JBT #define JBU #define JBV #define JBW #define JBX #define JBY #define JBZ #define JCA #define JCB #define JCC #define JCD #define JCE #define JCF #define JCG #define JCH #define JCI #define JCJ #define JCK #define JCL #define JCM #define JCN #define JCO #define JCP #define JCQ #define JCR #define JCS #define JCT #define JCU #define JCV #define JCW #define JCX #define JCY #define JCZ #define JDA #define JDB #define JDC #define JDD #define JDE #define JDF #define JDG #define JDH #define JDI #define JDJ #define JDK #define JDL #define JDM #define JDN #define JDO #define JDP #define JDQ #define JDR #define JDS #define JDT #define JDU #define JDV #define JDW #define JDX #define JDY #define JDZ #define JEA #define JEB #define JEC #define JED #define JEE #define JEF #define JEG #define JEH #define JEI #define JEJ #define JEK #define JEL #define JEM #define JEN #define JEO #define JEP #define JEQ #define JER #define JES #define JET #define JEU #define JEV #define JEW #define JEX #define JEY #define JEZ #define JFA #define JFB #define JFC #define JFD #define JFE #define JFF #define JFG #define JFH #define JFI #define JFJ #define JFK #define JFL #define JFM #define JFN #define JFO #define JFP #define JFQ #define JFR #define JFS #define JFT #define JFU #define JFV #define JFW #define JFX #define JFY #define JFZ #define JGA #define JGB #define JGC #define JGD #define JGE #define JGF #define JGG #define JGH #define JGI #define JGJ #define JGK #define JGL #define JGM #define JGN #define JGO #define JGP #define JGQ #define JGR #define JGS #define JGT #define JGU #define JGV #define JGW #define JGX #define JGY #define JGZ #define JHA #define JHB #define JHC #define JHD #define JHE #define JHF #define JHG #define JHH #define JHI #define JHJ #define JHK #define JHL #define JHM #define JHN #define JHO #define JHP #define JHQ #define JHR #define JHS #define JHT #define JHU #define JHV #define JHW #define JHX #define JHY #define JHZ #define JIA #define JIB #define JIC #define JID #define JIE #define JIF #define JIG #define JIH #define JII #define JIJ #define JIK #define JIL #define JIM #define JIN #define JIO #define JIP #define JIQ #define JIR #define JIS #define JIT #define JIU #define JIV #define JIW #define JIX #define JIY #define JIZ #define JJA #define JJB #define JJC #define JJD #define JJE #define JJF #define JJG #define JJH #define JJI #define JJJ #define JJK #define JJL #define JJM #define JJN #define JJO #define JJP #define JJQ #define JJR #define JJS #define JJT #define JJU #define JJV #define JJW #define JJX #define JJY #define JJZ #define JKA #define JKB #define JKC #define JKD #define JKE #define JKF #define JKG #define JKH #define JKI #define JKJ #define JKK #define JKL #define JKM #define JKN #define JKO #define JKP #define JKQ #define JKR #define JKS #define JKT #define JKU #define JKV #define JKW #define JKX #define JKY #define JKZ #define JLA #define JLB #define JLC #define JLD #define JLE #define JLF #define JLG #define JLH #define JLI #define JLJ #define JLK #define JLL #define JLM #define JLN #define JLO #define JLP #define JLQ #define JLR #define JLS #define JLT #define JLU #define JLV #define JLW #define JLX #define JLY #define JLZ #define JMA #define JMB #define JMC #define JMD #define JME #define JMF #define JMG #define JMH #define JMI #define JMJ #define JMK #define JML #define JMM #define JMN #define JMO #define JMP #define JMQ #define JMR #define JMS #define JMT #define JMU #define JMV #define JMW #define JMX #define JMY #define JMZ #define JNA #define JNB #define JNC #define JND #define JNE #define JNF #define JNG #define JNH #define JNI #define JNJ #define JNK #define JNL #define JNM #define JNN #define JNO #define JNP #define JNQ #define JNR #define JNS #define JNT #define JNU #define JNV #define JNW #define JNX #define JNY #define JNZ #define JOA #define JOB #define JOC #define JOD #define JOE #define JOF #define JOG #define JOH #define JOI #define JOJ #define JOK #define JOL #define JOM #define JON #define JOO #define JOP #define JOQ #define JOR #define JOS #define JOT #define JOU #define JOV #define JOW #define JOX #define JOY #define JOZ #define JPA #define JPB #define JPC #define JPD #define JPE #define JPF #define JPG #define JPH #define JPI #define JPJ #define JPK #define JPL #define JPM #define JPN #define JPO #define JPP #define JPQ #define JPR #define JPS #define JPT #define JPU #define JPV #define JPW #define JPX #define JPY #define JPZ #define JQA #define JQB #define JQC #define JQD #define JQE #define JQF #define JQG #define JQH #define JQI #define JQJ #define JQK #define JQL #define JQM #define JQN #define JQO #define JQP #define JQQ #define JQR #define JQS #define JQT #define JQU #define JQV #define JQW #define JQX #define JQY #define JQZ #define JRA #define JRB #define JRC #define JRD #define JRE #define JRF #define JRG #define JRH #define JRI #define JRJ #define JRK #define JRL #define JRM #define JRN #define JRO #define JRP #define JRQ #define JRR #define JRS #define JRT #define JRU #define JRV #define JRW #define JRX #define JRY #define JRZ #define JSA #define JSB #define JSC #define JSD #define JSE #define JSF #define JSG #define JSH #define JSI #define JSJ #define JSK #define JSL #define JSM #define JSN #define JSO #define JSP #define JSQ #define JSR #define JSS #define JST #define JSU #define JSV #define JSW #define JSX #define JSY #define JSZ #define JTA #define JTB #define JTC #define JTD #define JTE #define JTF #define JTG #define JTH #define JTI #define JTJ #define JTK #define JTL #define JTM #define JTN #define JTO #define JTP #define JTQ #define JTR #define JTS #define JTT #define JTU #define JTV #define JTW #define JTX #define JTY #define JTZ #define JUA #define JUB #define JUC #define JUD #define JUE #define JUF #define JUG #define JUH #define JUI #define JUJ #define JUK #define JUL #define JUM #define JUN #define JUO #define JUP #define JUQ #define JUR #define JUS #define JUT #define JUU #define JUV #define JUW #define JUX #define JUY #define JUZ #define JVA #define JVB #define JVC #define JVD #define JVE #define JVF #define JVG #define JVH #define JVI #define JVJ #define JVK #define JVL #define JVM #define JVN #define JVO #define JVP #define JVQ #define JVR #define JVS #define JVT #define JVU #define JVV #define JVW #define JVX #define JVY #define JVZ #define JWA #define JWB #define JWC #define JWD #define JWE #define JWF #define JWG #define JWH #define JWI #define JWJ #define JWK #define JWL #define JWM #define JWN #define JWO #define JWP #define JWQ #define JWR #define JWS #define JWT #define JWU #define JWV #define JWW #define JWX #define JWY #define JWZ #define JXA #define JXB #define JXC #define JXD #define JXE #define JXF #define JXG #define JXH #define JXI #define JXJ #define JXK #define JXL #define JXM #define JXN #define JXO #define JXP #define JXQ #define JXR #define JXS #define JXT #define JXU #define JXV #define JXW #define JXX #define JXY #define JXZ #define JYA #define JYB #define JYC #define JYD #define JYE #define JYF #define JYG #define JYH #define JYI #define JYJ #define JYK #define JYL #define JYM #define JYN #define JYO #define JYP #define JYQ #define JYR #define JYS #define JYT #define JYU #define JYV #define JYW #define JYX #define JYY #define JYZ #define JZA #define JZB #define JZC #define JZD #define JZE #define JZF #define JZG #define JZH #define JZI #define JZJ #define JZK #define JZL #define JZM #define JZN #define JZO #define JZP #define JZQ #define JZR #define JZS #define JZT #define JZU #define JZV #define JZW #define JZX #define JZY #define JZZ #define KAA #define KAB #define KAC #define KAD #define KAE #define KAF #define KAG #define KAH #define KAI #define KAJ #define KAK #define KAL #define KAM #define KAN #define KAO #define KAP #define KAQ #define KAR #define KAS #define KAT #define KAU #define KAV #define KAW #define KAX #define KAY #define KAZ #define KBA #define KBB #define KBC #define KBD #define KBE #define KBF #define KBG #define KBH #define KBI #define KBJ #define KBK #define KBL #define KBM #define KBN #define KBO #define KBP #define KBQ #define KBR #define KBS #define KBT #define KBU #define KBV #define KBW #define KBX #define KBY #define KBZ #define KCA #define KCB #define KCC #define KCD #define KCE #define KCF #define KCG #define KCH #define KCI #define KCJ #define KCK #define KCL #define KCM #define KCN #define KCO #define KCP #define KCQ #define KCR #define KCS #define KCT #define KCU #define KCV #define KCW #define KCX #define KCY #define KCZ #define KDA #define KDB #define KDC #define KDD #define KDE #define KDF #define KDG #define KDH #define KDI #define KDJ #define KDK #define KDL #define KDM #define KDN #define KDO #define KDP #define KDQ #define KDR #define KDS #define KDT #define KDU #define KDV #define KDW #define KDX #define KDY #define KDZ #define KEA #define KEB #define KEC #define KED #define KEE #define KEF #define KEG #define KEH #define KEI #define KEJ #define KEK #define KEL #define KEM #define KEN #define KEO #define KEP #define KEQ #define KER #define KES #define KET #define KEU #define KEV #define KEW #define KEX #define KEY #define KEZ #define KFA #define KFB #define KFC #define KFD #define KFE #define KFF #define KFG #define KFH #define KFI #define KFJ #define KFK #define KFL #define KFM #define KFN #define KFO #define KFP #define KFQ #define KFR #define KFS #define KFT #define KFU #define KFV #define KFW #define KFX #define KFY #define KFZ #define KGA #define KGB #define KGC #define KGD #define KGE #define KGF #define KGG #define KGH #define KGI #define KGJ #define KGK #define KGL #define KGM #define KGN #define KGO #define KGP #define KGQ #define KGR #define KGS #define KGT #define KGU #define KGV #define KGW #define KGX #define KGY #define KGZ #define KHA #define KHB #define KHC #define KHD #define KHE #define KHF #define KHG #define KHH #define KHI #define KHJ #define KHK #define KHL #define KHM #define KHN #define KHO #define KHP #define KHQ #define KHR #define KHS #define KHT #define KHU #define KHV #define KHW #define KHX #define KHY #define KHZ #define KIA #define KIB #define KIC #define KID #define KIE #define KIF #define KIG #define KIH #define KII #define KIJ #define KIK #define KIL #define KIM #define KIN #define KIO #define KIP #define KIQ #define KIR #define KIS #define KIT #define KIU #define KIV #define KIW #define KIX #define KIY #define KIZ #define KJA #define KJB #define KJC #define KJD #define KJE #define KJF #define KJG #define KJH #define KJI #define KJJ #define KJK #define KJL #define KJM #define KJN #define KJO #define KJP #define KJQ #define KJR #define KJS #define KJT #define KJU #define KJV #define KJW #define KJX #define KJY #define KJZ #define KKA #define KKB #define KKC #define KKD #define KKE #define KKF #define KKG #define KKH #define KKI #define KKJ #define KKK #define KKL #define KKM #define KKN #define KKO #define KKP #define KKQ #define KKR #define KKS #define KKT #define KKU #define KKV #define KKW #define KKX #define KKY #define KKZ #define KLA #define KLB #define KLC #define KLD #define KLE #define KLF #define KLG #define KLH #define KLI #define KLJ #define KLK #define KLL #define KLM #define KLN #define KLO #define KLP #define KLQ #define KLR #define KLS #define KLT #define KLU #define KLV #define KLW #define KLX #define KLY #define KLZ #define KMA #define KMB #define KMC #define KMD #define KME #define KMF #define KMG #define KMH #define KMI #define KMJ #define KMK #define KML #define KMM #define KMN #define KMO #define KMP #define KMQ #define KMR #define KMS #define KMT #define KMU #define KMV #define KMW #define KMX #define KMY #define KMZ #define KNA #define KNB #define KNC #define KND #define KNE #define KNF #define KNG #define KNH #define KNI #define KNJ #define KNK #define KNL #define KNM #define KNN #define KNO #define KNP #define KNQ #define KNR #define KNS #define KNT #define KNU #define KNV #define KNW #define KNX #define KNY #define KNZ #define KOA #define KOB #define KOC #define KOD #define KOE #define KOF #define KOG #define KOH #define KOI #define KOJ #define KOK #define KOL #define KOM #define KON #define KOO #define KOP #define KOQ #define KOR #define KOS #define KOT #define KOU #define KOV #define KOW #define KOX #define KOY #define KOZ #define KPA #define KPB #define KPC #define KPD #define KPE #define KPF #define KPG #define KPH #define KPI #define KPJ #define KPK #define KPL #define KPM #define KPN #define KPO #define KPP #define KPQ #define KPR #define KPS #define KPT #define KPU #define KPV #define KPW #define KPX #define KPY #define KPZ #define KQA #define KQB #define KQC #define KQD #define KQE #define KQF #define KQG #define KQH #define KQI #define KQJ #define KQK #define KQL #define KQM #define KQN #define KQO #define KQP #define KQQ #define KQR #define KQS #define KQT #define KQU #define KQV #define KQW #define KQX #define KQY #define KQZ #define KRA #define KRB #define KRC #define KRD #define KRE #define KRF #define KRG #define KRH #define KRI #define KRJ #define KRK #define KRL #define KRM #define KRN #define KRO #define KRP #define KRQ #define KRR #define KRS #define KRT #define KRU #define KRV #define KRW #define KRX #define KRY #define KRZ #define KSA #define KSB #define KSC #define KSD #define KSE #define KSF #define KSG #define KSH #define KSI #define KSJ #define KSK #define KSL #define KSM #define KSN #define KSO #define KSP #define KSQ #define KSR #define KSS #define KST #define KSU #define KSV #define KSW #define KSX #define KSY #define KSZ #define KTA #define KTB #define KTC #define KTD #define KTE #define KTF #define KTG #define KTH #define KTI #define KTJ #define KTK #define KTL #define KTM #define KTN #define KTO #define KTP #define KTQ #define KTR #define KTS #define KTT #define KTU #define KTV #define KTW #define KTX #define KTY #define KTZ #define KUA #define KUB #define KUC #define KUD #define KUE #define KUF #define KUG #define KUH #define KUI #define KUJ #define KUK #define KUL #define KUM #define KUN #define KUO #define KUP #define KUQ #define KUR #define KUS #define KUT #define KUU #define KUV #define KUW #define KUX #define KUY #define KUZ #define KVA #define KVB #define KVC #define KVD #define KVE #define KVF #define KVG #define KVH #define KVI #define KVJ #define KVK #define KVL #define KVM #define KVN #define KVO #define KVP #define KVQ #define KVR #define KVS #define KVT #define KVU #define KVV #define KVW #define KVX #define KVY #define KVZ #define KWA #define KWB #define KWC #define KWD #define KWE #define KWF #define KWG #define KWH #define KWI #define KWJ #define KWK #define KWL #define KWM #define KWN #define KWO #define KWP #define KWQ #define KWR #define KWS #define KWT #define KWU #define KWV #define KWW #define KWX #define KWY #define KWZ #define KXA #define KXB #define KXC #define KXD #define KXE #define KXF #define KXG #define KXH #define KXI #define KXJ #define KXK #define KXL #define KXM #define KXN #define KXO #define KXP #define KXQ #define KXR #define KXS #define KXT #define KXU #define KXV #define KXW #define KXX #define KXY #define KXZ #define KYA #define KYB #define KYC #define KYD #define KYE #define KYF #define KYG #define KYH #define KYI #define KYJ #define KYK #define KYL #define KYM #define KYN #define KYO #define KYP #define KYQ #define KYR #define KYS #define KYT #define KYU #define KYV #define KYW #define KYX #define KYY #define KYZ #define KZA #define KZB #define KZC #define KZD #define KZE #define KZF #define KZG #define KZH #define KZI #define KZJ #define KZK #define KZL #define KZM #define KZN #define KZO #define KZP #define KZQ #define KZR #define KZS #define KZT #define KZU #define KZV #define KZW #define KZX #define KZY #define KZZ #define LAA #define LAB #define LAC #define LAD #define LAE #define LAF #define LAG #define LAH #define LAI #define LAJ #define LAK #define LAL #define LAM #define LAN #define LAO #define LAP #define LAQ #define LAR #define LAS #define LAT #define LAU #define LAV #define LAW #define LAX #define LAY #define LAZ #define LBA #define LBB #define LBC #define LBD #define LBE #define LBF #define LBG #define LBH #define LBI #define LBJ #define LBK #define LBL #define LBM #define LBN #define LBO #define LBP #define LBQ #define LBR #define LBS #define LBT #define LBU #define LBV #define LBW #define LBX #define LBY #define LBZ #define LCA #define LCB #define LCC #define LCD #define LCE #define LCF #define LCG #define LCH #define LCI #define LCJ #define LCK #define LCL #define LCM #define LCN #define LCO #define LCP #define LCQ #define LCR #define LCS #define LCT #define LCU #define LCV #define LCW #define LCX #define LCY #define LCZ #define LDA #define LDB #define LDC #define LDD #define LDE #define LDF #define LDG #define LDH #define LDI #define LDJ #define LDK #define LDL #define LDM #define LDN #define LDO #define LDP #define LDQ #define LDR #define LDS #define LDT #define LDU #define LDV #define LDW #define LDX #define LDY #define LDZ #define LEA #define LEB #define LEC #define LED #define LEE #define LEF #define LEG #define LEH #define LEI #define LEJ #define LEK #define LEL #define LEM #define LEN #define LEO #define LEP #define LEQ #define LER #define LES #define LET #define LEU #define LEV #define LEW #define LEX #define LEY #define LEZ #define LFA #define LFB #define LFC #define LFD #define LFE #define LFF #define LFG #define LFH #define LFI #define LFJ #define LFK #define LFL #define LFM #define LFN #define LFO #define LFP #define LFQ #define LFR #define LFS #define LFT #define LFU #define LFV #define LFW #define LFX #define LFY #define LFZ #define LGA #define LGB #define LGC #define LGD #define LGE #define LGF #define LGG #define LGH #define LGI #define LGJ #define LGK #define LGL #define LGM #define LGN #define LGO #define LGP #define LGQ #define LGR #define LGS #define LGT #define LGU #define LGV #define LGW #define LGX #define LGY #define LGZ #define LHA #define LHB #define LHC #define LHD #define LHE #define LHF #define LHG #define LHH #define LHI #define LHJ #define LHK #define LHL #define LHM #define LHN #define LHO #define LHP #define LHQ #define LHR #define LHS #define LHT #define LHU #define LHV #define LHW #define LHX #define LHY #define LHZ #define LIA #define LIB #define LIC #define LID #define LIE #define LIF #define LIG #define LIH #define LII #define LIJ #define LIK #define LIL #define LIM #define LIN #define LIO #define LIP #define LIQ #define LIR #define LIS #define LIT #define LIU #define LIV #define LIW #define LIX #define LIY #define LIZ #define LJA #define LJB #define LJC #define LJD #define LJE #define LJF #define LJG #define LJH #define LJI #define LJJ #define LJK #define LJL #define LJM #define LJN #define LJO #define LJP #define LJQ #define LJR #define LJS #define LJT #define LJU #define LJV #define LJW #define LJX #define LJY #define LJZ #define LKA #define LKB #define LKC #define LKD #define LKE #define LKF #define LKG #define LKH #define LKI #define LKJ #define LKK #define LKL #define LKM #define LKN #define LKO #define LKP #define LKQ #define LKR #define LKS #define LKT #define LKU #define LKV #define LKW #define LKX #define LKY #define LKZ #define LLA #define LLB #define LLC #define LLD #define LLE #define LLF #define LLG #define LLH #define LLI #define LLJ #define LLK #define LLL #define LLM #define LLN #define LLO #define LLP #define LLQ #define LLR #define LLS #define LLT #define LLU #define LLV #define LLW #define LLX #define LLY #define LLZ #define LMA #define LMB #define LMC #define LMD #define LME #define LMF #define LMG #define LMH #define LMI #define LMJ #define LMK #define LML #define LMM #define LMN #define LMO #define LMP #define LMQ #define LMR #define LMS #define LMT #define LMU #define LMV #define LMW #define LMX #define LMY #define LMZ #define LNA #define LNB #define LNC #define LND #define LNE #define LNF #define LNG #define LNH #define LNI #define LNJ #define LNK #define LNL #define LNM #define LNN #define LNO #define LNP #define LNQ #define LNR #define LNS #define LNT #define LNU #define LNV #define LNW #define LNX #define LNY #define LNZ #define LOA #define LOB #define LOC #define LOD #define LOE #define LOF #define LOG #define LOH #define LOI #define LOJ #define LOK #define LOL #define LOM #define LON #define LOO #define LOP #define LOQ #define LOR #define LOS #define LOT #define LOU #define LOV #define LOW #define LOX #define LOY #define LOZ #define LPA #define LPB #define LPC #define LPD #define LPE #define LPF #define LPG #define LPH #define LPI #define LPJ #define LPK #define LPL #define LPM #define LPN #define LPO #define LPP #define LPQ #define LPR #define LPS #define LPT #define LPU #define LPV #define LPW #define LPX #define LPY #define LPZ #define LQA #define LQB #define LQC #define LQD #define LQE #define LQF #define LQG #define LQH #define LQI #define LQJ #define LQK #define LQL #define LQM #define LQN #define LQO #define LQP #define LQQ #define LQR #define LQS #define LQT #define LQU #define LQV #define LQW #define LQX #define LQY #define LQZ #define LRA #define LRB #define LRC #define LRD #define LRE #define LRF #define LRG #define LRH #define LRI #define LRJ #define LRK #define LRL #define LRM #define LRN #define LRO #define LRP #define LRQ #define LRR #define LRS #define LRT #define LRU #define LRV #define LRW #define LRX #define LRY #define LRZ #define LSA #define LSB #define LSC #define LSD #define LSE #define LSF #define LSG #define LSH #define LSI #define LSJ #define LSK #define LSL #define LSM #define LSN #define LSO #define LSP #define LSQ #define LSR #define LSS #define LST #define LSU #define LSV #define LSW #define LSX #define LSY #define LSZ #define LTA #define LTB #define LTC #define LTD #define LTE #define LTF #define LTG #define LTH #define LTI #define LTJ #define LTK #define LTL #define LTM #define LTN #define LTO #define LTP #define LTQ #define LTR #define LTS #define LTT #define LTU #define LTV #define LTW #define LTX #define LTY #define LTZ #define LUA #define LUB #define LUC #define LUD #define LUE #define LUF #define LUG #define LUH #define LUI #define LUJ #define LUK #define LUL #define LUM #define LUN #define LUO #define LUP #define LUQ #define LUR #define LUS #define LUT #define LUU #define LUV #define LUW #define LUX #define LUY #define LUZ #define LVA #define LVB #define LVC #define LVD #define LVE #define LVF #define LVG #define LVH #define LVI #define LVJ #define LVK #define LVL #define LVM #define LVN #define LVO #define LVP #define LVQ #define LVR #define LVS #define LVT #define LVU #define LVV #define LVW #define LVX #define LVY #define LVZ #define LWA #define LWB #define LWC #define LWD #define LWE #define LWF #define LWG #define LWH #define LWI #define LWJ #define LWK #define LWL #define LWM #define LWN #define LWO #define LWP #define LWQ #define LWR #define LWS #define LWT #define LWU #define LWV #define LWW #define LWX #define LWY #define LWZ #define LXA #define LXB #define LXC #define LXD #define LXE #define LXF #define LXG #define LXH #define LXI #define LXJ #define LXK #define LXL #define LXM #define LXN #define LXO #define LXP #define LXQ #define LXR #define LXS #define LXT #define LXU #define LXV #define LXW #define LXX #define LXY #define LXZ #define LYA #define LYB #define LYC #define LYD #define LYE #define LYF #define LYG #define LYH #define LYI #define LYJ #define LYK #define LYL #define LYM #define LYN #define LYO #define LYP #define LYQ #define LYR #define LYS #define LYT #define LYU #define LYV #define LYW #define LYX #define LYY #define LYZ #define LZA #define LZB #define LZC #define LZD #define LZE #define LZF #define LZG #define LZH #define LZI #define LZJ #define LZK #define LZL #define LZM #define LZN #define LZO #define LZP #define LZQ #define LZR #define LZS #define LZT #define LZU #define LZV #define LZW #define LZX #define LZY #define LZZ #define MAA #define MAB #define MAC #define MAD #define MAE #define MAF #define MAG #define MAH #define MAI #define MAJ #define MAK #define MAL #define MAM #define MAN #define MAO #define MAP #define MAQ #define MAR #define MAS #define MAT #define MAU #define MAV #define MAW #define MAX #define MAY #define MAZ #define MBA #define MBB #define MBC #define MBD #define MBE #define MBF #define MBG #define MBH #define MBI #define MBJ #define MBK #define MBL #define MBM #define MBN #define MBO #define MBP #define MBQ #define MBR #define MBS #define MBT #define MBU #define MBV #define MBW #define MBX #define MBY #define MBZ #define MCA #define MCB #define MCC #define MCD #define MCE #define MCF #define MCG #define MCH #define MCI #define MCJ #define MCK #define MCL #define MCM #define MCN #define MCO #define MCP #define MCQ #define MCR #define MCS #define MCT #define MCU #define MCV #define MCW #define MCX #define MCY #define MCZ #define MDA 0x1fff #endif #endif mcpp-2.7.2/cpp-test/test-l/l_37_9.c0000644000175000017500000000115510216765467013531 00000000000000/* l_37_9.c: Translation limits larger than C99 / 9. */ /* 37.9L: Number of macro definitions. */ #include "m8191.h" #ifdef X0FFF /* 0x0fff; */ GBM; #else /* 0x1fff; */ MDA; #endif /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| More than 4095 macros defined" "translation limit" { target *-*-* } 0 } { dg-final { if ![file exist l_37_9_.i] { return } } } { dg-final { if \{ [grep l_37_9_.i "0x1fff"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "l_37_9_.c: defining more than 4095 macros" } } */ mcpp-2.7.2/cpp-test/test-l/nest78.h0000644000175000017500000000004310216765467013665 00000000000000/* nest78.h */ #include "nest79.h" mcpp-2.7.2/cpp-test/test-l/nest60.h0000644000175000017500000000004310216765467013654 00000000000000/* nest60.h */ #include "nest61.h" mcpp-2.7.2/cpp-test/test-l/nest101.h0000644000175000017500000000004510216765467013732 00000000000000/* nest101.h */ #include "nest102.h" mcpp-2.7.2/cpp-test/test-l/nest20.h0000644000175000017500000000004310216765467013650 00000000000000/* nest20.h */ #include "nest21.h" mcpp-2.7.2/cpp-test/test-l/nest53.h0000644000175000017500000000004310216765467013656 00000000000000/* nest53.h */ #include "nest54.h" mcpp-2.7.2/cpp-test/test-l/nest113.h0000644000175000017500000000004510216765467013735 00000000000000/* nest113.h */ #include "nest114.h" mcpp-2.7.2/cpp-test/test-l/nest75.h0000644000175000017500000000004310216765467013662 00000000000000/* nest75.h */ #include "nest76.h" mcpp-2.7.2/cpp-test/test-l/nest19.h0000644000175000017500000000004310216765467013660 00000000000000/* nest19.h */ #include "nest20.h" mcpp-2.7.2/cpp-test/test-l/ifdef255.h0000644000175000017500000001130210216765467014046 00000000000000/* ifdef255.h */ #ifdef X80 #else #ifdef X81 #else #ifdef X82 #else #ifdef X83 #else #ifdef X84 #else #ifdef X85 #else #ifdef X86 #else #ifdef X87 #else #ifdef X88 #else #ifdef X89 #else #ifdef X8A #else #ifdef X8B #else #ifdef X8C #else #ifdef X8D #else #ifdef X8E #else #ifdef X8F #else #ifdef X90 #else #ifdef X91 #else #ifdef X92 #else #ifdef X93 #else #ifdef X94 #else #ifdef X95 #else #ifdef X96 #else #ifdef X97 #else #ifdef X98 #else #ifdef X99 #else #ifdef X9A #else #ifdef X9B #else #ifdef X9C #else #ifdef X9D #else #ifdef X9E #else #ifdef X9F #else #ifdef XA0 #else #ifdef XA1 #else #ifdef XA2 #else #ifdef XA3 #else #ifdef XA4 #else #ifdef XA5 #else #ifdef XA6 #else #ifdef XA7 #else #ifdef XA8 #else #ifdef XA9 #else #ifdef XAA #else #ifdef XAB #else #ifdef XAC #else #ifdef XAD #else #ifdef XAE #else #ifdef XAF #else #ifdef XB0 #else #ifdef XB1 #else #ifdef XB2 #else #ifdef XB3 #else #ifdef XB4 #else #ifdef XB5 #else #ifdef XB6 #else #ifdef XB7 #else #ifdef XB8 #else #ifdef XB9 #else #ifdef XBA #else #ifdef XBB #else #ifdef XBC #else #ifdef XBD #else #ifdef XBE #else #ifdef XBF #else #ifdef XC0 #else #ifdef XC1 #else #ifdef XC2 #else #ifdef XC3 #else #ifdef XC4 #else #ifdef XC5 #else #ifdef XC6 #else #ifdef XC7 #else #ifdef XC8 #else #ifdef XC9 #else #ifdef XCA #else #ifdef XCB #else #ifdef XCC #else #ifdef XCD #else #ifdef XCE #else #ifdef XCF #else #ifdef XD0 #else #ifdef XD1 #else #ifdef XD2 #else #ifdef XD3 #else #ifdef XD4 #else #ifdef XD5 #else #ifdef XD6 #else #ifdef XD7 #else #ifdef XD8 #else #ifdef XD9 #else #ifdef XDA #else #ifdef XDB #else #ifdef XDC #else #ifdef XDD #else #ifdef XDE #else #ifdef XDF #else #ifdef XE0 #else #ifdef XE1 #else #ifdef XE2 #else #ifdef XE3 #else #ifdef XE4 #else #ifdef XE5 #else #ifdef XE6 #else #ifdef XE7 #else #ifdef XE8 #else #ifdef XE9 #else #ifdef XEA #else #ifdef XEB #else #ifdef XEC #else #ifdef XED #else #ifdef XEE #else #ifdef XEF #else #ifdef XF0 #else #ifdef XF1 #else #ifdef XF2 #else #ifdef XF3 #else #ifdef XF4 #else #ifdef XF5 #else #ifdef XF6 #else #ifdef XF7 #else #ifdef XF8 #else #ifdef XF9 #else #ifdef XFA #else #ifdef XFB #else #ifdef XFC #else #ifdef XFD #else #ifdef XFE #else #ifdef XFF ifdef_nest = 0xff; #else ifdef_nest = 0xff; #endif /* XFF */ #endif /* XFE */ #endif /* XFD */ #endif /* XFC */ #endif /* XFB */ #endif /* XFA */ #endif /* XF9 */ #endif /* XF8 */ #endif /* XF7 */ #endif /* XF6 */ #endif /* XF5 */ #endif /* XF4 */ #endif /* XF3 */ #endif /* XF2 */ #endif /* XF1 */ #endif /* XF0 */ #endif /* XEF */ #endif /* XEE */ #endif /* XED */ #endif /* XEC */ #endif /* XEB */ #endif /* XEA */ #endif /* XE9 */ #endif /* XE8 */ #endif /* XE7 */ #endif /* XE6 */ #endif /* XE5 */ #endif /* XE4 */ #endif /* XE3 */ #endif /* XE2 */ #endif /* XE1 */ #endif /* XE0 */ #endif /* XDF */ #endif /* XDE */ #endif /* XDD */ #endif /* XDC */ #endif /* XDB */ #endif /* XDA */ #endif /* XD9 */ #endif /* XD8 */ #endif /* XD7 */ #endif /* XD6 */ #endif /* XD5 */ #endif /* XD4 */ #endif /* XD3 */ #endif /* XD2 */ #endif /* XD1 */ #endif /* XD0 */ #endif /* XCF */ #endif /* XCE */ #endif /* XCD */ #endif /* XCC */ #endif /* XCB */ #endif /* XCA */ #endif /* XC9 */ #endif /* XC8 */ #endif /* XC7 */ #endif /* XC6 */ #endif /* XC5 */ #endif /* XC4 */ #endif /* XC3 */ #endif /* XC2 */ #endif /* XC1 */ #endif /* XC0 */ #endif /* XBF */ #endif /* XBE */ #endif /* XBD */ #endif /* XBC */ #endif /* XBB */ #endif /* XBA */ #endif /* XB9 */ #endif /* XB8 */ #endif /* XB7 */ #endif /* XB6 */ #endif /* XB5 */ #endif /* XB4 */ #endif /* XB3 */ #endif /* XB2 */ #endif /* XB1 */ #endif /* XB0 */ #endif /* XAF */ #endif /* XAE */ #endif /* XAD */ #endif /* XAC */ #endif /* XAB */ #endif /* XAA */ #endif /* XA9 */ #endif /* XA8 */ #endif /* XA7 */ #endif /* XA6 */ #endif /* XA5 */ #endif /* XA4 */ #endif /* XA3 */ #endif /* XA2 */ #endif /* XA1 */ #endif /* XA0 */ #endif /* X9F */ #endif /* X9E */ #endif /* X9D */ #endif /* X9C */ #endif /* X9B */ #endif /* X9A */ #endif /* X99 */ #endif /* X98 */ #endif /* X97 */ #endif /* X96 */ #endif /* X95 */ #endif /* X94 */ #endif /* X93 */ #endif /* X92 */ #endif /* X91 */ #endif /* X90 */ #endif /* X8F */ #endif /* X8E */ #endif /* X8D */ #endif /* X8C */ #endif /* X8B */ #endif /* X8A */ #endif /* X89 */ #endif /* X88 */ #endif /* X87 */ #endif /* X86 */ #endif /* X85 */ #endif /* X84 */ #endif /* X83 */ #endif /* X82 */ #endif /* X81 */ #endif /* X80 */ mcpp-2.7.2/cpp-test/test-l/nest42.h0000644000175000017500000000004310216765467013654 00000000000000/* nest42.h */ #include "nest43.h" mcpp-2.7.2/cpp-test/test-l/nest17.h0000644000175000017500000000004310216765467013656 00000000000000/* nest17.h */ #include "nest18.h" mcpp-2.7.2/cpp-test/test-l/nest93.h0000644000175000017500000000004310216765467013662 00000000000000/* nest93.h */ #include "nest94.h" mcpp-2.7.2/cpp-test/test-l/nest80.h0000644000175000017500000000004310216765467013656 00000000000000/* nest80.h */ #include "nest81.h" mcpp-2.7.2/cpp-test/test-l/nest121.h0000644000175000017500000000004510216765467013734 00000000000000/* nest121.h */ #include "nest122.h" mcpp-2.7.2/cpp-test/test-l/nest77.h0000644000175000017500000000004310216765467013664 00000000000000/* nest77.h */ #include "nest78.h" mcpp-2.7.2/cpp-test/test-l/nest16.h0000644000175000017500000000004310216765467013655 00000000000000/* nest16.h */ #include "nest17.h" mcpp-2.7.2/cpp-test/test-l/nest26.h0000644000175000017500000000004310216765467013656 00000000000000/* nest26.h */ #include "nest27.h" mcpp-2.7.2/cpp-test/test-l/l_37_2.c0000644000175000017500000000333410216765467013523 00000000000000/* l_37_2.c: Translation limits larger than C99 / 2. */ /* 37.2L: Number of arguments in macro call. */ #include "l_37_1.h" /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6P7P8P9PAPBPCPDPEOF; */ glue255( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7, P7, A8, B8, C8, D8, E8, F8, G8, H8, I8, J8, K8, L8, M8, N8, O8, P8, A9, B9, C9, D9, E9, F9, G9, H9, I9, J9, K9, L9, M9, N9, O9, P9, AA, BA, CA, DA, EA, FA, GA, HA, IA, JA, KA, LA, MA, NA, OA, PA, AB, BB, CB, DB, EB, FB, GB, HB, IB, JB, KB, LB, MB, NB, OB, PB, AC, BC, CC, DC, EC, FC, GC, HC, IC, JC, KC, LC, MC, NC, OC, PC, AD, BD, CD, DD, ED, FD, GD, HD, ID, JD, KD, LD, MD, ND, OD, PD, AE, BE, CE, DE, EE, FE, GE, HE, IE, JE, KE, LE, ME, NE, OE, PE, AF, BF, CF, DF, EF, FF, GF, HF, IF, JF, KF, LF, MF, NF, OF); /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| More than 127 (parameters|arguments)" "translation limit" { target *-*-* } 0 } { dg-final { if ![file exist l_37_2.i] { return } } } { dg-final { if \{ [grep l_37_2.i "A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6P7P8P9PAPBPCPDPEOF"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "more than 127 parameters" } } */ mcpp-2.7.2/cpp-test/test-l/nest2.h0000644000175000017500000000004110216765467013566 00000000000000/* nest2.h */ #include "nest3.h" mcpp-2.7.2/cpp-test/test-l/nest46.h0000644000175000017500000000004310216765467013660 00000000000000/* nest46.h */ #include "nest47.h" mcpp-2.7.2/cpp-test/test-l/l_37_7.c0000644000175000017500000002156510216765467013536 00000000000000/* l_37_7.c: Translation limits larger than C99 / 7. */ /* 37.7L: Characters in a string (after concatenation). */ /* 8191 bytes long. */ char *string8189 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ E123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ F123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ G123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| Quotation longer than 4095 bytes" "translation limit" { target *-*-* } 133 } { dg-final { if ![file exist l_37_7_.i] { return } } } { dg-final { if \{ [grep l_37_7_.i "abcd\""] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "l_37_7_.c: quotation longer than 4095 bytes" } } */ mcpp-2.7.2/cpp-test/test-l/nest70.h0000644000175000017500000000004310216765467013655 00000000000000/* nest70.h */ #include "nest71.h" mcpp-2.7.2/cpp-test/test-l/nest97.h0000644000175000017500000000004310216765467013666 00000000000000/* nest97.h */ #include "nest98.h" mcpp-2.7.2/cpp-test/test-l/nest119.h0000644000175000017500000000004510216765467013743 00000000000000/* nest119.h */ #include "nest120.h" mcpp-2.7.2/cpp-test/test-l/ifdef127.h0000644000175000017500000001134510216765467014053 00000000000000/* ifdef127.h */ #ifdef X01 #else #ifdef X02 #else #ifdef X03 #else #ifdef X04 #else #ifdef X05 #else #ifdef X06 #else #ifdef X07 #else #ifdef X08 #else #ifdef X09 #else #ifdef X0A #else #ifdef X0B #else #ifdef X0C #else #ifdef X0D #else #ifdef X0E #else #ifdef X0F ifdef_nest = 0x0f; #else #ifdef X10 #else #ifdef X11 #else #ifdef X12 #else #ifdef X13 #else #ifdef X14 #else #ifdef X15 #else #ifdef X16 #else #ifdef X17 #else #ifdef X18 #else #ifdef X19 #else #ifdef X1A #else #ifdef X1B #else #ifdef X1C #else #ifdef X1D #else #ifdef X1E #else #ifdef X1F ifdef_nest = 0x1f; #else #ifdef X20 #else #ifdef X21 #else #ifdef X22 #else #ifdef X23 #else #ifdef X24 #else #ifdef X25 #else #ifdef X26 #else #ifdef X27 #else #ifdef X28 #else #ifdef X29 #else #ifdef X2A #else #ifdef X2B #else #ifdef X2C #else #ifdef X2D #else #ifdef X2E #else #ifdef X2F #else #ifdef X30 #else #ifdef X31 #else #ifdef X32 #else #ifdef X33 #else #ifdef X34 #else #ifdef X35 #else #ifdef X36 #else #ifdef X37 #else #ifdef X38 #else #ifdef X39 #else #ifdef X3A #else #ifdef X3B #else #ifdef X3C #else #ifdef X3D #else #ifdef X3E #else #ifdef X3F ifdef_nest = 0x3f; #else #ifdef X40 #else #ifdef X41 #else #ifdef X42 #else #ifdef X43 #else #ifdef X44 #else #ifdef X45 #else #ifdef X46 #else #ifdef X47 #else #ifdef X48 #else #ifdef X49 #else #ifdef X4A #else #ifdef X4B #else #ifdef X4C #else #ifdef X4D #else #ifdef X4E #else #ifdef X4F #else #ifdef X50 #else #ifdef X51 #else #ifdef X52 #else #ifdef X53 #else #ifdef X54 #else #ifdef X55 #else #ifdef X56 #else #ifdef X57 #else #ifdef X58 #else #ifdef X59 #else #ifdef X5A #else #ifdef X5B #else #ifdef X5C #else #ifdef X5D #else #ifdef X5E #else #ifdef X5F #else #ifdef X60 #else #ifdef X61 #else #ifdef X62 #else #ifdef X63 #else #ifdef X64 #else #ifdef X65 #else #ifdef X66 #else #ifdef X67 #else #ifdef X68 #else #ifdef X69 #else #ifdef X6A #else #ifdef X6B #else #ifdef X6C #else #ifdef X6D #else #ifdef X6E #else #ifdef X6F #else #ifdef X70 #else #ifdef X71 #else #ifdef X72 #else #ifdef X73 #else #ifdef X74 #else #ifdef X75 #else #ifdef X76 #else #ifdef X77 #else #ifdef X78 #else #ifdef X79 #else #ifdef X7A #else #ifdef X7B #else #ifdef X7C #else #ifdef X7D #else #ifdef X7E #else #ifdef X7F ifdef_nest = 0x7f; #else #include "ifdef255.h" #endif /* X7F */ #endif /* X7E */ #endif /* X7D */ #endif /* X7C */ #endif /* X7B */ #endif /* X7A */ #endif /* X79 */ #endif /* X78 */ #endif /* X77 */ #endif /* X76 */ #endif /* X75 */ #endif /* X74 */ #endif /* X73 */ #endif /* X72 */ #endif /* X71 */ #endif /* X70 */ #endif /* X6F */ #endif /* X6E */ #endif /* X6D */ #endif /* X6C */ #endif /* X6B */ #endif /* X6A */ #endif /* X69 */ #endif /* X68 */ #endif /* X67 */ #endif /* X66 */ #endif /* X65 */ #endif /* X64 */ #endif /* X63 */ #endif /* X62 */ #endif /* X61 */ #endif /* X60 */ #endif /* X5F */ #endif /* X5E */ #endif /* X5D */ #endif /* X5C */ #endif /* X5B */ #endif /* X5A */ #endif /* X59 */ #endif /* X58 */ #endif /* X57 */ #endif /* X56 */ #endif /* X55 */ #endif /* X54 */ #endif /* X53 */ #endif /* X52 */ #endif /* X51 */ #endif /* X50 */ #endif /* X4F */ #endif /* X4E */ #endif /* X4D */ #endif /* X4C */ #endif /* X4B */ #endif /* X4A */ #endif /* X49 */ #endif /* X48 */ #endif /* X47 */ #endif /* X46 */ #endif /* X45 */ #endif /* X44 */ #endif /* X43 */ #endif /* X42 */ #endif /* X41 */ #endif /* X40 */ #endif /* X3F */ #endif /* X3E */ #endif /* X3D */ #endif /* X3C */ #endif /* X3B */ #endif /* X3A */ #endif /* X39 */ #endif /* X38 */ #endif /* X37 */ #endif /* X36 */ #endif /* X35 */ #endif /* X34 */ #endif /* X33 */ #endif /* X32 */ #endif /* X31 */ #endif /* X30 */ #endif /* X2F */ #endif /* X2E */ #endif /* X2D */ #endif /* X2C */ #endif /* X2B */ #endif /* X2A */ #endif /* X29 */ #endif /* X28 */ #endif /* X27 */ #endif /* X26 */ #endif /* X25 */ #endif /* X24 */ #endif /* X23 */ #endif /* X22 */ #endif /* X21 */ #endif /* X20 */ #endif /* X1F */ #endif /* X1E */ #endif /* X1D */ #endif /* X1C */ #endif /* X1B */ #endif /* X1A */ #endif /* X19 */ #endif /* X18 */ #endif /* X17 */ #endif /* X16 */ #endif /* X15 */ #endif /* X14 */ #endif /* X13 */ #endif /* X12 */ #endif /* X11 */ #endif /* X10 */ #endif /* X0F */ #endif /* X0E */ #endif /* X0D */ #endif /* X0C */ #endif /* X0B */ #endif /* X0A */ #endif /* X09 */ #endif /* X08 */ #endif /* X07 */ #endif /* X06 */ #endif /* X05 */ #endif /* X04 */ #endif /* X03 */ #endif /* X02 */ #endif /* X01 */ mcpp-2.7.2/cpp-test/test-l/nest124.h0000644000175000017500000000004510216765467013737 00000000000000/* nest124.h */ #include "nest125.h" mcpp-2.7.2/cpp-test/test-l/nest23.h0000644000175000017500000000004310216765467013653 00000000000000/* nest23.h */ #include "nest24.h" mcpp-2.7.2/cpp-test/test-l/nest51.h0000644000175000017500000000004310216765467013654 00000000000000/* nest51.h */ #include "nest52.h" mcpp-2.7.2/cpp-test/test-l/nest59.h0000644000175000017500000000004310216765467013664 00000000000000/* nest59.h */ #include "nest60.h" mcpp-2.7.2/cpp-test/test-l/nest62.h0000644000175000017500000000004310216765467013656 00000000000000/* nest62.h */ #include "nest63.h" mcpp-2.7.2/cpp-test/test-l/nest47.h0000644000175000017500000000004310216765467013661 00000000000000/* nest47.h */ #include "nest48.h" mcpp-2.7.2/cpp-test/test-l/nest104.h0000644000175000017500000000004510216765467013735 00000000000000/* nest104.h */ #include "nest105.h" mcpp-2.7.2/cpp-test/test-l/nest54.h0000644000175000017500000000004310216765467013657 00000000000000/* nest54.h */ #include "nest55.h" mcpp-2.7.2/cpp-test/test-l/nest79.h0000644000175000017500000000004310216765467013666 00000000000000/* nest79.h */ #include "nest80.h" mcpp-2.7.2/cpp-test/test-l/nest74.h0000644000175000017500000000004310216765467013661 00000000000000/* nest74.h */ #include "nest75.h" mcpp-2.7.2/cpp-test/test-l/nest30.h0000644000175000017500000000004310216765467013651 00000000000000/* nest30.h */ #include "nest31.h" mcpp-2.7.2/cpp-test/test-l/nest72.h0000644000175000017500000000004310216765467013657 00000000000000/* nest72.h */ #include "nest73.h" mcpp-2.7.2/cpp-test/test-l/nest38.h0000644000175000017500000000004310216765467013661 00000000000000/* nest38.h */ #include "nest39.h" mcpp-2.7.2/cpp-test/test-l/nest21.h0000644000175000017500000000004310216765467013651 00000000000000/* nest21.h */ #include "nest22.h" mcpp-2.7.2/cpp-test/test-l/nest94.h0000644000175000017500000000004310216765467013663 00000000000000/* nest94.h */ #include "nest95.h" mcpp-2.7.2/cpp-test/test-l/nest10.h0000644000175000017500000000004310216765467013647 00000000000000/* nest10.h */ #include "nest11.h" mcpp-2.7.2/cpp-test/test-l/l_37_4.c0000644000175000017500000000125610216765467013526 00000000000000/* l_37_4.c: Translation limits larger than C99 / 4. */ /* 37.4L: Nested conditional inclusion. */ /* * Define one of the macros X7F or XFF, or 255 nesting of #ifdef will be * tested. */ #include "ifdef127.h" /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| More than 63 nesting of #if" "translation limit" { target *-*-* } 0 } { dg-final { if ![file exist l_37_4_.i] { return } } } { dg-final { if \{ [grep l_37_4_.i "ifdef_nest = 0xff"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "l_37_4_.c: more than 63 nesting of #if" } } */ mcpp-2.7.2/cpp-test/test-l/nest63.h0000644000175000017500000000011510216765467013657 00000000000000/* nest63.h */ #ifdef X3F nest = 0x3f; #else #include "nest64.h" #endif mcpp-2.7.2/cpp-test/test-l/nest83.h0000644000175000017500000000004310216765467013661 00000000000000/* nest83.h */ #include "nest84.h" mcpp-2.7.2/cpp-test/test-l/nest29.h0000644000175000017500000000004310216765467013661 00000000000000/* nest29.h */ #include "nest30.h" mcpp-2.7.2/cpp-test/test-l/nest85.h0000644000175000017500000000004310216765467013663 00000000000000/* nest85.h */ #include "nest86.h" mcpp-2.7.2/cpp-test/test-l/nest98.h0000644000175000017500000000004310216765467013667 00000000000000/* nest98.h */ #include "nest99.h" mcpp-2.7.2/cpp-test/test-l/nest33.h0000644000175000017500000000004310216765467013654 00000000000000/* nest33.h */ #include "nest34.h" mcpp-2.7.2/cpp-test/test-l/nest103.h0000644000175000017500000000004510216765467013734 00000000000000/* nest103.h */ #include "nest104.h" mcpp-2.7.2/cpp-test/test-l/nest31.h0000644000175000017500000000011510216765467013652 00000000000000/* nest31.h */ #ifdef X1F nest = 0x1f; #else #include "nest32.h" #endif mcpp-2.7.2/cpp-test/test-l/l_37_6.c0000644000175000017500000001137010216765467013526 00000000000000/* l_37_6.c: Translation limits larger than C99 / 6. */ /* 37.6L: Parenthesized expression. */ #ifndef X3F /* nest = 127; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \ (0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \ (0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \ (0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \ (0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \ (0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \ (0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \ (0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \ (0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + 0x7F) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -0x80 nest = 127; #endif #ifndef X7F /* nest = 255; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \ (0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \ (0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \ (0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \ (0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \ (0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \ (0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \ (0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \ (0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + (0x7F - \ (0x80 + (0x81 - (0x82 + (0x83 - (0x84 + (0x85 - (0x86 + (0x87 - \ (0x88 + (0x89 - (0x8A + (0x8B - (0x8C + (0x8D - (0x8E + (0x8F - \ (0x90 + (0x91 - (0x92 + (0x93 - (0x94 + (0x95 - (0x96 + (0x97 - \ (0x98 + (0x99 - (0x9A + (0x9B - (0x9C + (0x9D - (0x9E + (0x9F - \ (0xA0 + (0xA1 - (0xA2 + (0xA3 - (0xA4 + (0xA5 - (0xA6 + (0xA7 - \ (0xA8 + (0xA9 - (0xAA + (0xAB - (0xAC + (0xAD - (0xAE + (0xAF - \ (0xB0 + (0xB1 - (0xB2 + (0xB3 - (0xB4 + (0xB5 - (0xB6 + (0xB7 - \ (0xB8 + (0xB9 - (0xBA + (0xBB - (0xBC + (0xBD - (0xBE + (0xBF - \ (0xC0 + (0xC1 - (0xC2 + (0xC3 - (0xC4 + (0xC5 - (0xC6 + (0xC7 - \ (0xC8 + (0xC9 - (0xCA + (0xCB - (0xCC + (0xCD - (0xCE + (0xCF - \ (0xD0 + (0xD1 - (0xD2 + (0xD3 - (0xD4 + (0xD5 - (0xD6 + (0xD7 - \ (0xD8 + (0xD9 - (0xDA + (0xDB - (0xDC + (0xDD - (0xDE + (0xDF - \ (0xE0 + (0xE1 - (0xE2 + (0xE3 - (0xE4 + (0xE5 - (0xE6 + (0xE7 - \ (0xE8 + (0xE9 - (0xEA + (0xEB - (0xEC + (0xED - (0xEE + (0xEF - \ (0xF0 + (0xF1 - (0xF2 + (0xF3 - (0xF4 + (0xF5 - (0xF6 + (0xF7 - \ (0xF8 + (0xF9 - (0xFA + (0xFB - (0xFC + (0xFD - (0xFE + 0xFF) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -0x100 nest = 255; #endif #endif #endif /* { dg-do preprocess } { dg-options "-std=c99 -pedantic" } { dg-warning "| More than 63 nesting of parens" "translation limit" { target *-*-* } 25 } { dg-warning "| More than 63 nesting of parens" "translation limit" { target *-*-* } 68 } { dg-final { if ![file exist l_37_6_.i] { return } } } { dg-final { if \{ [grep l_37_6_.i "nest = 127"] != "" \} \{ } } { dg-final { if \{ [grep l_37_6_.i "nest = 255"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "l_37_6_.c: more than 63 nesting of parens" } } */ mcpp-2.7.2/cpp-test/test-l/nest65.h0000644000175000017500000000004310216765467013661 00000000000000/* nest65.h */ #include "nest66.h" mcpp-2.7.2/cpp-test/test-l/longline.t0000644000175000017500000010411310216765467014363 00000000000000/* longline.t: source of long logical line. */ typedef unsigned int size_t; \ typedef struct __sfpos { \ char _pos[8]; \ } fpos_t; \ struct __sbuf { \ unsigned char *_base; \ int _size; \ }; \ typedef struct __sFILE { \ unsigned char *_p; \ int _r; \ int _w; \ short _flags; \ short _file; \ struct __sbuf _bf; \ int _lbfsize; \ \ \ void *_cookie; \ int (*_close) (void *) ; \ int (*_read) (void *, char *, int) ; \ fpos_t (*_seek) (void *, fpos_t, int) ; \ int (*_write) (void *, const char *, int) ; \ \ \ struct __sbuf _ub; \ unsigned char *_up; \ int _ur; \ \ \ unsigned char _ubuf[3]; \ unsigned char _nbuf[1]; \ \ \ struct __sbuf _lb; \ \ \ int _blksize; \ fpos_t _offset; \ } FILE; \ \ \ extern FILE __sF[]; \ \ \ void clearerr (FILE *) ; \ int fclose (FILE *) ; \ int feof (FILE *) ; \ int ferror (FILE *) ; \ int fflush (FILE *) ; \ int fgetc (FILE *) ; \ int fgetpos (FILE *, fpos_t *) ; \ char *fgets (char *, size_t, FILE *) ; \ FILE *fopen (const char *, const char *) ; \ int fprintf (FILE *, const char *, ...) ; \ int fputc (int, FILE *) ; \ int fputs (const char *, FILE *) ; \ \ #ifndef X03FF size_t fread (void *, size_t, size_t, FILE *) ; \ FILE *freopen (const char *, const char *, FILE *) ; \ int fscanf (FILE *, const char *, ...) ; \ int fseek (FILE *, long, int) ; \ int fsetpos (FILE *, const fpos_t *) ; \ long ftell (const FILE *) ; \ size_t fwrite (const void *, size_t, size_t, FILE *) ; \ int getc (FILE *) ; \ int getchar (void) ; \ char *gets (char *) ; \ \ extern int sys_nerr; \ extern const char * const sys_errlist[]; \ \ void perror (const char *) ; \ int printf (const char *, ...) ; \ int putc (int, FILE *) ; \ int putchar (int) ; \ int puts (const char *) ; \ int remove (const char *) ; \ int rename (const char *, const char *) ; \ void rewind (FILE *) ; \ int scanf (const char *, ...) ; \ void setbuf (FILE *, char *) ; \ int setvbuf (FILE *, char *, int, size_t) ; \ int sprintf (char *, const char *, ...) ; \ int sscanf (const char *, const char *, ...) ; \ FILE *tmpfile (void) ; \ char *tmpnam (char *) ; \ int ungetc (int, FILE *) ; \ int vfprintf (FILE *, const char *, char * ) ; \ int vprintf (const char *, char * ) ; \ int vsprintf (char *, const char *, char * ) ; \ \ \ char *ctermid (char *) ; \ FILE *fdopen (int, const char *) ; \ int fileno (FILE *) ; \ \ \ char *fgetln (FILE *, size_t *) ; \ int fpurge (FILE *) ; \ int getw (FILE *) ; \ int pclose (FILE *) ; \ FILE *popen (const char *, const char *) ; \ int putw (int, FILE *) ; \ void setbuffer (FILE *, char *, int) ; \ int setlinebuf (FILE *) ; \ char *tempnam (const char *, const char *) ; \ int snprintf (char *, size_t, const char *, ...) ; \ int vsnprintf (char *, size_t, const char *, char * ) ; \ int vscanf (const char *, char * ) ; \ int vsscanf (const char *, const char *, char * ) ; \ FILE *zopen (const char *, const char *, int) ; \ \ \ FILE *funopen (const void *, int (*)(void *, char *, int), int (*)(void *, const char *, int), fpos_t (*)(void *, fpos_t, int), int (*)(void *)) ; \ \ \ int __srget (FILE *) ; \ int __svfscanf (FILE *, const char *, char * ) ; \ int __swbuf (int, FILE *) ; \ \ typedef int rune_t; \ \ #ifndef X07FF typedef int wchar_t; \ typedef struct { \ rune_t min; \ rune_t max; \ rune_t map; \ unsigned long *types; \ } _RuneEntry; \ \ typedef struct { \ int nranges; \ _RuneEntry *ranges; \ } _RuneRange; \ \ typedef struct { \ char magic[8]; \ char encoding[32]; \ \ rune_t (*sgetrune) \ (const char *, unsigned int, char const **) ; \ int (*sputrune) \ (rune_t, char *, unsigned int, char **) ; \ rune_t invalid_rune; \ \ unsigned long runetype[ (1 <<8 ) ]; \ rune_t maplower[ (1 <<8 ) ]; \ rune_t mapupper[ (1 <<8 ) ]; \ _RuneRange runetype_ext; \ _RuneRange maplower_ext; \ _RuneRange mapupper_ext; \ \ void *variable; \ int variable_len; \ } _RuneLocale; \ \ \ \ extern _RuneLocale _DefaultRuneLocale; \ extern _RuneLocale *_CurrentRuneLocale; \ \ unsigned long ___runetype ( int ) ; \ int ___tolower ( int ) ; \ int ___toupper ( int ) ; \ \ \ int __istype ( int , unsigned long) ; \ int __isctype ( int , unsigned long) ; \ int toupper ( int ) ; \ int tolower ( int ) ; \ \ extern int errno; \ \ void *memchr (const void *, int, size_t) ; \ int memcmp (const void *, const void *, size_t) ; \ void *memcpy (void *, const void *, size_t) ; \ void *memmove (void *, const void *, size_t) ; \ void *memset (void *, int, size_t) ; \ char *strcat (char *, const char *) ; \ char *strchr (const char *, int) ; \ int strcmp (const char *, const char *) ; \ int strcoll (const char *, const char *) ; \ char *strcpy (char *, const char *) ; \ size_t strcspn (const char *, const char *) ; \ char *strerror (int) ; \ size_t strlen (const char *) ; \ char *strncat (char *, const char *, size_t) ; \ int strncmp (const char *, const char *, size_t) ; \ char *strncpy (char *, const char *, size_t) ; \ char *strpbrk (const char *, const char *) ; \ char *strrchr (const char *, int) ; \ size_t strspn (const char *, const char *) ; \ char *strstr (const char *, const char *) ; \ char *strtok (char *, const char *) ; \ size_t strxfrm (char *, const char *, size_t) ; \ \ \ \ int bcmp (const void *, const void *, size_t) ; \ void bcopy (const void *, void *, size_t) ; \ void bzero (void *, size_t) ; \ int ffs (int) ; \ char *index (const char *, int) ; \ void *memccpy (void *, const void *, int, size_t) ; \ char *rindex (const char *, int) ; \ int strcasecmp (const char *, const char *) ; \ char *strdup (const char *) ; \ void strmode (int, char *) ; \ int strncasecmp (const char *, const char *, size_t) ; \ char *strsep (char **, const char *) ; \ void swab (const void *, void *, size_t) ; \ \ \ typedef struct { \ int quot; \ int rem; \ } div_t; \ \ typedef struct { \ long quot; \ long rem; \ } ldiv_t; \ extern int __mb_cur_max; \ \ \ void \ abort (void) ; \ int \ abs (int) ; \ int atexit (void (*)(void)) ; \ double atof (const char *) ; \ int atoi (const char *) ; \ long atol (const char *) ; \ void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *)) ; \ void *calloc (size_t, size_t) ; \ div_t \ div (int, int) ; \ void \ exit (int) ; \ void free (void *) ; \ char *getenv (const char *) ; \ long \ labs (long) ; \ ldiv_t \ ldiv (long, long) ; \ void *malloc (size_t) ; \ void qsort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ int rand (void) ; \ void *realloc (void *, size_t) ; \ void srand (unsigned) ; \ double strtod (const char *, char **) ; \ long strtol (const char *, char **, int) ; \ unsigned long \ strtoul (const char *, char **, int) ; \ int system (const char *) ; \ \ \ int mblen (const char *, size_t) ; \ size_t mbstowcs (wchar_t *, const char *, size_t) ; \ int wctomb (char *, wchar_t) ; \ int mbtowc (wchar_t *, const char *, size_t) ; \ size_t wcstombs (char *, const wchar_t *, size_t) ; \ \ \ int putenv (const char *) ; \ int setenv (const char *, const char *, int) ; \ \ \ \ double drand48 (void) ; \ double erand48 (unsigned short[3]) ; \ long lrand48 (void) ; \ long nrand48 (unsigned short[3]) ; \ long mrand48 (void) ; \ long jrand48 (unsigned short[3]) ; \ void srand48 (long) ; \ unsigned short *seed48 (unsigned short[3]) ; \ void lcong48 (unsigned short[7]) ; \ \ void *alloca (size_t) ; \ \ char *getbsize (int *, long *) ; \ char *cgetcap (char *, char *, int) ; \ int cgetclose (void) ; \ \ #ifndef X0FFF int cgetent (char **, char **, char *) ; \ int cgetfirst (char **, char **) ; \ int cgetmatch (char *, char *) ; \ int cgetnext (char **, char **) ; \ int cgetnum (char *, char *, long *) ; \ int cgetset (char *) ; \ int cgetstr (char *, char *, char **) ; \ int cgetustr (char *, char *, char **) ; \ \ int daemon (int, int) ; \ char *devname (int, int) ; \ int getloadavg (double [], int) ; \ \ extern char *optarg; \ extern int opterr, optind, optopt; \ int getopt (int, char * const *, const char *) ; \ \ extern char *suboptarg; \ int getsubopt (char **, char * const *, char **) ; \ \ char *group_from_gid (unsigned long, int) ; \ int heapsort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ char *initstate (unsigned, char *, int) ; \ int mergesort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ int radixsort (const unsigned char **, int, const unsigned char *, unsigned) ; \ int sradixsort (const unsigned char **, int, const unsigned char *, unsigned) ; \ long random (void) ; \ char *realpath (const char *, char resolved_path[]) ; \ char *setstate (char *) ; \ void srandom (unsigned) ; \ char *user_from_uid (unsigned long, int) ; \ void unsetenv (const char *) ; \ \ \ typedef int ptrdiff_t; \ typedef unsigned long clock_t; \ \ \ \ \ typedef long time_t; \ struct tm { \ int tm_sec; \ int tm_min; \ int tm_hour; \ int tm_mday; \ int tm_mon; \ int tm_year; \ int tm_wday; \ int tm_yday; \ int tm_isdst; \ long tm_gmtoff; \ char *tm_zone; \ }; \ \ char *asctime (const struct tm *) ; \ clock_t clock (void) ; \ char *ctime (const time_t *) ; \ double difftime (time_t, time_t) ; \ struct tm *gmtime (const time_t *) ; \ struct tm *localtime (const time_t *) ; \ time_t mktime (struct tm *) ; \ size_t strftime (char *, size_t, const char *, const struct tm *) ; \ time_t time (time_t *) ; \ \ \ void tzset (void) ; \ \ \ \ char *timezone (int, int) ; \ void tzsetwall (void) ; \ \ \ extern int getopt( int argc, char * const * argv, const char * opts); \ extern char * stpcpy( char * dest, const char * src); \ typedef struct defbuf { \ struct defbuf * link; \ short nargs; \ \ char * parmnames; \ \ char * repl; \ char name[1]; \ } DEFBUF; \ typedef struct fileinfo { \ char * bptr; \ unsigned line; \ FILE * fp; \ long pos; \ struct fileinfo * parent; \ struct ifinfo * initif; \ char * filename; \ char * buffer; \ } FILEINFO; \ typedef struct ifinfo { \ int stat; \ unsigned ifline; \ unsigned elseline; \ } IFINFO; \ typedef struct val_sign { \ long val; \ int sign; \ } VAL_SIGN; \ extern int cflag; \ extern int eflag; \ extern int iflag; \ extern int lflag; \ extern int pflag; \ extern int qflag; \ \ extern int tflag; \ \ \ \ extern int digraphs; \ \ extern int stdc_val; \ extern long cplus; \ extern int stdc2; \ extern int has_pragma; \ \ extern int std_line_prefix; \ extern int warn_level; \ extern int errors; \ extern unsigned line; \ extern int wrongline; \ extern int keepcomments; \ extern int no_output; \ extern int in_directive; \ extern int in_define; \ extern unsigned macro_line; \ extern int openum; \ extern IFINFO * ifptr; \ extern FILEINFO * infile; \ extern int mkdep; \ \ extern char * workp; \ extern char * const work_end; \ extern char identifier[ 0xFF + 1]; \ extern const char type[]; \ extern IFINFO ifstack[]; \ extern char work[]; \ extern int debug; \ extern void curfile( void); \ extern int openfile( const char * filename, int local); \ extern void unpredefine( int clearall); \ \ extern int control( int newlines); \ extern DEFBUF * lookid( const char * name); \ extern DEFBUF * install( const char * name, int nargs, const char * parmnames \ , const char * repl); \ extern int undefine( const char * name); \ extern void dumpadef( const char * why, const DEFBUF * dp, int newdef); \ extern void dumpdef( void); \ \ extern long eval( void); \ extern VAL_SIGN * evalnum( const char * nump); \ \ extern DEFBUF * is_macro( char ** cp); \ extern char * expand( DEFBUF * defp, char * out, char * out_end); \ \ extern int get_unexpandable( int c, int diag); \ extern void skipnl( void); \ extern int skipws( void); \ extern int scantoken( int c, char ** out_pp, char * out_end); \ extern char * scanquote( int delim, char * out, char * out_end, int diag); \ extern int get( void); \ \ extern int trigraph( char * in); \ extern void unget( void); \ extern FILEINFO * ungetstring( const char * text, const char * name); \ extern char * savestring( const char * text); \ extern FILEINFO * getfile( const char * name, size_t bufsize); \ extern char * (xmalloc)( size_t size); \ extern char * (xrealloc)( char * ptr, size_t size); \ extern void cfatal( const char * format, const char * arg1, int arg2 \ , const char * arg3); \ extern void cerror( const char * format, const char * arg1, int arg2 \ , const char * arg3); \ extern void cwarn( const char * format, const char * arg1, int arg2 \ , const char * arg3); \ \ extern void dooptions( int argc, char ** argv, char ** in_pp \ , char ** out_pp); \ extern int reopen_stdout( const char * filename); \ extern void setstdin( char * cp); \ extern void put_start_file( char * filename); \ extern void sharp( void); \ extern void putfname( char * filename); \ extern int getredirection( int argc, char ** argv); \ \ extern void put_depend( const char * filename); \ \ extern int doinclude( void); \ \ extern void dopragma( void); \ extern void put_source( const char * src); \ extern void alloc_mem( void); \ \ \ \ extern void dumpstring( const char * why, const char * text); \ extern void dumpunget( const char * why); \ \ extern void print_heap( void); \ static void scanid( int c); \ static char * scannumber( int c, char * out, char * out_end); \ static char * scanop( int c, char * out); \ static char * parse_line( void); \ static char * read_a_comment( char * sp); \ static char * getline( int in_comment); \ static void at_eof( int in_comment); \ void dumptoken( int token_type, const char * cp); \ int \ \ get_unexpandable( int c, int diag) \ { \ DEFBUF * defp; \ FILEINFO * file; \ FILE * fp = 0 ; \ int token_type = 0 ; \ \ while (c != '\0' && c != '\n' \ && (fp = infile->fp, \ (token_type = scantoken( c, (workp = work, &workp), work_end)) == 65 ) \ && fp != 0 \ && (defp = is_macro( (char **) 0 )) != 0 ) { \ expand( defp, work, work_end); \ file = ungetstring( work, defp->name); \ c = skipws(); \ if (file != infile && macro_line != 65535U && (warn_level & 1)) \ cwarn( "Macro \"%s\" is expanded to 0 token" \ , defp->name, 0, ((char *) 0 ) ); \ } \ \ if (c == '\n' || c == '\0' ) { \ unget(); \ return 0 ; \ } \ \ if (diag && fp == 0 && token_type == 65 ) { \ \ if ( (strcmp(identifier, "defined") == 0) && (warn_level & 1)) \ cwarn( "Macro \"%s\" is expanded to \"defined\"" \ , defp->name, 0, ((char *) 0 ) ); \ } \ return token_type; \ } \ \ void \ \ skipnl( void) \ { \ while (infile && infile->fp == 0 ) { \ infile->bptr += strlen( infile->bptr); \ get(); \ } \ if (infile) \ infile->bptr += strlen( infile->bptr); \ } \ \ int \ \ skipws( void) \ { \ int c; \ \ do { \ c = get(); \ } \ \ while (c == ' ' || c == 0x1F ); \ return c; \ } \ int \ \ scantoken( int c, char ** out_pp, char * out_end) \ { \ char * out = *out_pp; \ int ch_type; \ int token_type = 0; \ int ch; \ \ \ ch_type = type[ c] & (~ ((char)128) & 255 ); \ switch (ch_type) { \ case 1 : \ switch (c) { \ \ case 'L': \ ch = (*infile->bptr++ & 255 ) ; \ if (type[ ch] & 16 ) { \ if (ch == '"') \ token_type = 68 ; \ else \ token_type = 70 ; \ c = ch; \ *out++ = 'L'; \ break; \ } else { \ (infile->bptr--) ; \ } \ \ default: \ scanid( c); \ out = stpcpy( out, identifier); \ token_type = 65 ; \ break; \ } \ if (token_type == 65 ) \ break; \ \ case 16 : \ out = scanquote( c, out, out_end, 0 ); \ if (token_type == 0) { \ if (c == '"') \ token_type = 67 ; \ else \ token_type = 69 ; \ } \ break; \ case 4 : \ ch = (*infile->bptr++ & 255 ) ; \ (infile->bptr--) ; \ if (type[ ch] != 2 ) \ goto operat; \ \ case 2 : \ out = scannumber( c, out, out_end); \ token_type = 66 ; \ break; \ case 8 : \ operat: out = scanop( c, out); \ token_type = 71 ; \ break; \ default: \ if \ \ \ \ ((type[ c] & 32 ) || c == 0x1E || c == 0x1D ) \ \ token_type = 73 ; \ else \ token_type = 72 ; \ *out++ = c; \ *out = '\0' ; \ break; \ } \ \ if (out_end < out) \ cfatal( "Buffer overflow scanning token \"%s\"" \ , *out_pp, 0, ((char *) 0 ) ); \ \ if (debug & 2 ) \ dumptoken( token_type, *out_pp); \ *out_pp = out; \ \ return token_type; \ } \ \ static void \ \ scanid( int c) \ { \ static char * const limit = &identifier[ 0xFF ]; \ int long_ident = 0 ; \ char * bp; \ \ bp = identifier; \ \ do { \ *bp++ = c; \ \ #ifndef X1FFF c = (*infile->bptr++ & 255 ) ; \ } while ((type[ c] & ( 1 | 2 )) && bp < limit); \ if (type[ c] & ( 1 | 2 )) { \ long_ident = 1 ; \ do { \ c = (*infile->bptr++ & 255 ) ; \ } while (type[ c] & ( 1 | 2 )); \ } \ (infile->bptr--) ; \ *bp = '\0' ; \ \ if (long_ident && (warn_level & 1)) \ cwarn( "Too long identifier truncated to \"%s\"" \ , identifier, 0, ((char *) 0 ) ); \ \ if (infile->fp && bp - identifier > 0x1F && (warn_level & 2)) \ cwarn( "Identifier longer than %.0s%d bytes \"%s\"" \ , ((char *) 0 ) , 0x1F , identifier); \ } \ \ char * \ \ scanquote( int delim, char * out, char * out_end, int diag) \ { \ const char * const skip_line = ", skipped the line"; \ const char * skip; \ int c; \ int c1; \ char * out_p = out; \ \ *out_p++ = delim; \ \ if (delim == '<') \ delim = '>'; \ \ \ while ((c = (*infile->bptr++ & 255 ) ) != '\0' ) { \ \ \ if (type[ c] & 64 ) { \ c1 = (*infile->bptr++ & 255 ) ; \ if (type[ c1] & ((char)128) ) { \ *out_p++ = c; \ *out_p++ = c1; \ goto chk_limit; \ } else { \ (infile->bptr--) ; \ *out_p++ = c; \ if (infile->fp != 0 && ifstack[0].stat && diag) { \ *out_p = c1; \ *(out_p + 1) = '\0' ; \ if (warn_level & 1) \ cwarn( \ "Illegal multi-byte character sequence \"%s\" in quotation", \ out_p - 1, 0, ((char *) 0 ) ); \ } \ continue; \ } \ } \ \ if (c == delim) { \ break; \ } else if (c == '\\' \ \ && delim != '>' \ \ ) { \ *out_p++ = c; \ c = (*infile->bptr++ & 255 ) ; \ \ if (type[ c] & 64 ) { \ (infile->bptr--) ; \ continue; \ } \ } else if (c == ' ' && delim == '>' && infile->fp == 0 ) { \ continue; \ \ } else if (c == '\n') { \ break; \ } \ if (diag && __istype((c), 0x00000200L ) && ((type[ c] & 32 ) == 0) && (warn_level & 1)) \ cwarn( \ "Illegal control character %.0s0x%02x in quotation" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ *out_p++ = c; \ chk_limit: \ if (out_end < out_p) { \ *out_end = '\0' ; \ cfatal( "Too long quotation %s", out, 0, ((char *) 0 ) ); \ } \ } \ \ if (c == '\n' || c == '\0' ) \ (infile->bptr--) ; \ if (c == delim) \ *out_p++ = delim; \ *out_p = '\0' ; \ if (diag) { \ skip = (infile->fp == 0 ) ? ((char *) 0 ) : skip_line; \ if (c != delim) { \ if (delim == '"') \ cerror( "Unterminated string literal %s%.0d%s" \ , out, 0, skip); \ else if (delim == '\'') \ cerror( "Unterminated character constant %s%.0d%s" \ , out, 0, skip); \ \ else \ cerror( "Unterminated header name %s%.0d%s" \ , out, 0, skip); \ \ out_p = 0 ; \ } else if (delim == '\'' && out_p - out <= 2) { \ cerror( "Empty character constant %s%.0d%s" \ , out, 0, skip); \ out_p = 0 ; \ } \ if (out_p - out > 0x1FD && (warn_level & 2)) \ cwarn( "Quotation longer than %.0s%d bytes %s" \ , ((char *) 0 ) , 0x1FD , out); \ \ } \ \ return out_p; \ } \ static char * \ \ scannumber( int c, char * out, char * out_end) \ { \ char * out_p = out; \ \ do { \ *out_p++ = c; \ if (c == 'E' || c == 'e') { \ c = (*infile->bptr++ & 255 ) ; \ if (c == '+' || c == '-') { \ *out_p++ = c; \ c = (*infile->bptr++ & 255 ) ; \ } \ } else { \ c = (*infile->bptr++ & 255 ) ; \ } \ } while (type[ c] & ( 2 | 4 | 1 )); \ \ *out_p = '\0' ; \ if (out_end < out_p) \ cfatal( "Too long pp-number token \"%s\"" \ , out, 0, ((char *) 0 ) ); \ (infile->bptr--) ; \ return out_p; \ } \ static char * \ \ scanop( int c, char * out) \ { \ int c2, c3; \ \ int c4; \ \ \ *out++ = c; \ \ switch (c) { \ case '~': openum = 5 ; break; \ case '(': openum = 2 ; break; \ case ')': openum = 27 ; break; \ case '?': openum = 25 ; break; \ case ';': case '[': case ']': case '{': \ case '}': case ',': \ openum = 32 ; \ break; \ default: \ openum = 33 ; \ } \ \ if (openum != 33 ) { \ *out = '\0' ; \ return out; \ } \ \ c2 = (*infile->bptr++ & 255 ) ; \ *out++ = c2; \ \ switch (c) { \ case '=': \ openum = ((c2 == '=') ? 18 : 32 ); \ break; \ case '!': \ openum = ((c2 == '=') ? 19 : 6 ); \ break; \ case '&': \ switch (c2) { \ case '&': openum = 23 ; break; \ case '=': break; \ default : openum = 20 ; break; \ } \ break; \ case '|': \ switch (c2) { \ case '|': openum = 24 ; break; \ case '=': break; \ default : openum = 22 ; break; \ } \ break; \ case '<': \ switch (c2) { \ case '<': c3 = (*infile->bptr++ & 255 ) ; \ if (c3 == '=') { \ openum = 34 ; \ *out++ = c3; \ } else { \ openum = 12 ; \ (infile->bptr--) ; \ } \ break; \ case '=': openum = 15 ; break; \ \ case ':': \ if (digraphs) \ openum = 0x42 ; \ else \ openum = 14 ; \ break; \ case '%': \ if (digraphs) \ openum = 0x40 ; \ else \ openum = 14 ; \ break; \ \ default : openum = 14 ; break; \ } \ break; \ case '>': \ switch (c2) { \ case '>': c3 = (*infile->bptr++ & 255 ) ; \ if (c3 == '=') { \ openum = 34 ; \ *out++ = c3; \ } else { \ openum = 13 ; \ (infile->bptr--) ; \ } \ break; \ case '=': openum = 17 ; break; \ default : openum = 16 ; break; \ } \ break; \ case '#': \ \ if (in_define) \ openum = ((c2 == '#') ? 31 : 30 ); \ else \ \ openum = 32 ; \ break; \ case '+': \ switch (c2) { \ case '+': \ case '=': break; \ default : openum = 10 ; break; \ } \ break; \ case '-': \ switch (c2) { \ case '-': \ case '=': \ \ break; \ case '>': \ \ if (cplus) { \ if ((c3 = (*infile->bptr++ & 255 ) ) == '*') { \ openum = 34 ; \ *out++ = c3; \ } else { \ \ (infile->bptr--) ; \ } \ } \ break; \ default : openum = 11 ; break; \ } \ break; \ case '%': \ switch (c2) { \ case '=': break; \ \ case '>': \ if (digraphs) \ openum = 0x41 ; \ else \ openum = 9 ; \ break; \ case ':': \ if (! digraphs || ! in_define) { \ openum = 9 ; \ } else if ((c3 = (*infile->bptr++ & 255 ) ) == '%') { \ if ((c4 = (*infile->bptr++ & 255 ) ) == ':') { \ openum = 31 ; \ *out++ = c3; \ *out++ = c4; \ } else { \ (infile->bptr--) ; \ (infile->bptr--) ; \ openum = 30 ; \ } \ } else { \ (infile->bptr--) ; \ openum = 30 ; \ } \ break; \ \ default : openum = 9 ; break; \ } \ break; \ case '*': \ if (c2 != '=') \ openum = 7 ; \ \ break; \ case '/': \ if (c2 != '=') \ openum = 8 ; \ \ break; \ case '^': \ if (c2 != '=') \ openum = 21 ; \ \ break; \ case '.': \ \ if (c2 == '.') { \ c3 = (*infile->bptr++ & 255 ) ; \ if (c3 == '.') { \ openum = 34 ; \ *out++ = c3; \ break; \ } else { \ (infile->bptr--) ; \ openum = 32 ; \ } \ } \ \ else if (cplus && c2 == '*') \ ; \ \ else \ openum = 32 ; \ break; \ case ':': \ \ if (stdc2 && c2 == ':') \ ; \ \ else if (c2 == '>' && digraphs) \ openum = 0x43 ; \ \ else \ openum = 26 ; \ break; \ default: \ \ cfatal( "Bug: Punctuator is mis-implemented %.0s0x%x" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ \ openum = 32 ; \ break; \ } \ \ switch (openum) { \ \ case 30 : \ \ if (c == '%') break; \ \ \ case 32 : \ case 6 : case 20 : case 22 : case 14 : \ case 16 : case 10 : case 11 : case 9 : \ case 7 : case 8 : case 21 : case 5 : \ case 26 : \ \ (infile->bptr--) ; \ out--; \ break; \ default: \ break; \ } \ \ *out = '\0' ; \ return out; \ } \ int \ \ get( void) \ { \ int len; \ int c; \ FILEINFO * file; \ \ if ((file = infile) == 0 ) \ return 0 ; \ if (debug & 32 ) { \ printf( "get(%s), line %u, bptr = %d, buffer" \ , file->filename ? file->filename : "NULL" \ , line, (int) (file->bptr - file->buffer)); \ dumpstring( ((char *) 0 ) , file->buffer); \ dumpunget( "get entrance"); \ } \ if ((c = (*file->bptr++ & 255 )) != '\0' ) { \ \ return c; \ } \ if (file->fp && \ parse_line() != 0 ) \ return get(); \ infile = file->parent; \ if (infile == 0 ) \ return 0 ; \ free(( char *)file->buffer); \ if (file->filename) \ free( file->filename); \ if (file->fp) { \ fclose( file->fp); \ if (! (strcmp("stdin", infile->filename) == 0) ) { \ infile->fp = fopen( infile->filename, "r"); \ fseek( infile->fp, infile->pos, 0 ); \ } \ len = (int) (infile->bptr - infile->buffer); \ infile->buffer = xrealloc( infile->buffer, 0x4000 ); \ \ infile->bptr = infile->buffer + len; \ line = infile->line; \ wrongline = 1 ; \ } \ free(( char *)file); \ return get(); \ } \ \ static char * \ \ parse_line( void) \ { \ char * temp; \ char * limit; \ char * tp; \ char * sp; \ int c; \ \ if ((sp = getline( 0 )) == 0 ) \ return 0 ; \ tp = temp = xmalloc( (size_t) 0x4000 ); \ limit = temp + 0x4000 - 2; \ \ while ((c = *sp++ & 255 ) != '\n') { \ \ switch (c) { \ case '/': \ switch (*sp++) { \ case '*': \ if ((sp = read_a_comment( sp)) == 0 ) { \ free( temp); \ return 0 ; \ } \ \ \ \ \ \ if (temp < tp && *(tp - 1) != ' ') \ *tp++ = ' '; \ break; \ \ case '/': \ if (stdc2) { \ \ if (keepcomments) { \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('/')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('/'), (&__sF[1])) : (*((&__sF[1]))->_p = ('/'), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('*')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('*'), (&__sF[1])) : (*((&__sF[1]))->_p = ('*'), (int)*((&__sF[1]))->_p++)) ; \ while ((c = *sp++) != '\n') \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('*')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('*'), (&__sF[1])) : (*((&__sF[1]))->_p = ('*'), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('/')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('/'), (&__sF[1])) : (*((&__sF[1]))->_p = ('/'), (int)*((&__sF[1]))->_p++)) ; \ } \ goto end_line; \ } \ \ default: \ *tp++ = '/'; \ sp--; \ break; \ } \ break; \ case '\r': \ case '\f': \ \ \ \ case '\v': \ \ if (warn_level & 1) \ cwarn( "Converted %.0s0x%02x to a space" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ case '\t': \ case ' ': \ \ if (temp < tp && *(tp - 1) != ' ') \ *tp++ = ' '; \ break; \ case '"': \ case '\'': \ infile->bptr = sp; \ \ tp = scanquote( c, tp, limit, 1 ); \ if (tp == 0 ) { \ free( temp); \ return parse_line(); \ } \ sp = infile->bptr; \ break; \ default: \ if ( __istype((c), 0x00000200L ) ) { \ cerror( \ "Illegal control character %.0s0x%x, skipped the character" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ } else { \ *tp++ = c; \ } \ break; \ } \ \ if (limit < tp) { \ *tp = '\0' ; \ cfatal( "Too long line spliced by comments :%s" \ , temp, 0, ((char *) 0 ) ); \ } \ } \ \ \ end_line: \ \ if (temp < tp && *(tp - 1) == ' ') \ tp--; \ *tp++ = '\n'; \ *tp = '\0' ; \ infile->bptr = strcpy( infile->buffer, temp); \ free( temp); \ if (macro_line != 0 && macro_line != 65535U ) { \ \ \ \ \ \ \ \ \ \ \ if (*(infile->buffer) == '#' \ \ || (*(infile->buffer) == '%' && *(infile->buffer + 1) == ':') \ \ ) \ \ if (warn_level & 1) \ cwarn( \ "Macro started at line %.0s%u swallowed directive-like line" \ , ((char *) 0 ) , macro_line, ((char *) 0 ) ); \ } \ return infile->buffer; \ } \ \ static char * \ \ read_a_comment( char * sp) \ { \ int c; \ \ if (keepcomments) { \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('/')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('/'), (&__sF[1])) : (*((&__sF[1]))->_p = ('/'), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('*')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('*'), (&__sF[1])) : (*((&__sF[1]))->_p = ('*'), (int)*((&__sF[1]))->_p++)) ; \ } \ c = *sp++; \ \ while (1) { \ if (keepcomments) \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ \ switch (c) { \ case '/': \ if ((c = *sp++) != '*') \ continue; \ if (warn_level & 1) \ cwarn( "\"/*\" in comment", ((char *) 0 ) , 0, ((char *) 0 ) ); \ if (keepcomments) \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ \ case '*': \ if ((c = *sp++) != '/') \ continue; \ if (keepcomments) \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ return sp; \ case '\n': \ if (! keepcomments) \ wrongline = 1 ; \ if ((sp = getline( 1 )) == 0 ) \ return 0 ; \ break; \ default: \ break; \ } \ \ c = *sp++; \ } \ \ return sp; \ } \ \ static char * \ \ getline( int in_comment) \ { \ \ int converted = 0 ; \ \ \ int esc; \ \ int len; \ char * ptr; \ \ if (infile == 0 ) \ return 0 ; \ ptr = infile->bptr = infile->buffer; \ \ while (fgets( ptr, (int) (infile->buffer + 0x4000 - ptr), infile->fp) \ != 0 ) { \ \ line++; \ if (line == 32768U && (warn_level & 1)) \ cwarn( "Line number %.0s\"%u\" got beyond range" \ , ((char *) 0 ) , line, ((char *) 0 ) ); \ \ if (debug & ( 2 | 32 )) { \ printf( "\n#line %u (%s)", line \ , infile->filename ? infile->filename : "NULL"); \ dumpstring( ((char *) 0 ) , ptr); \ } \ \ len = strlen( ptr); \ if ( 0x4000 - 1 <= ptr - infile->buffer + len \ && *(ptr + len - 1) != '\n') { \ if ( 0x4000 - 1 <= len) \ cfatal( "Too long source line" \ , ((char *) 0 ) , 0, ((char *) 0 ) ); \ else \ cfatal( "Too long logical line" \ , ((char *) 0 ) , 0, ((char *) 0 ) ); \ } \ if (*(ptr + len - 1) != '\n') \ break; \ if (lflag) \ put_source( ptr); \ \ if (tflag) \ converted = trigraph( ptr); \ if (converted) \ len = strlen( ptr); \ \ \ \ len -= 2; \ if (len >= 0) { \ esc = (*(ptr + len) == '\\'); \ if (esc) { \ ptr = infile->bptr += len; \ wrongline = 1 ; \ continue; \ } \ } \ \ \ if (ptr - infile->buffer + len + 2 > 0x1FD + 1 && (warn_level & 2)) \ \ cwarn( "Logical source line longer than %.0s%d bytes" \ , ((char *) 0 ) , 0x1FD , ((char *) 0 ) ); \ \ return infile->bptr = infile->buffer; \ } \ \ \ if ( (((infile->fp)->_flags & 0x0040 ) != 0) ) \ cfatal( "File read error", ((char *) 0 ) , 0, ((char *) 0 ) ); \ at_eof( in_comment); \ if (iflag) { \ no_output--; \ keepcomments = cflag && ifstack[0].stat && !no_output; \ } \ return 0 ; \ } \ \ \ \ \ \ int \ \ trigraph( char * in) \ { \ const char * const tritext = "=(/)'-\0#[\\]^{|}~"; \ int count = 0; \ const char * tp; \ \ while ((in = strchr( in, '?')) != 0 ) { \ if (*++in != '?') \ continue; \ while (*++in == '?') \ ; \ if ((tp = strchr( tritext, *in)) == 0 ) \ continue; \ in[ -2] = tp[ 10 ]; \ in--; \ memmove( in, in + 2, strlen( in + 1)); \ count++; \ } \ \ if (count && (warn_level & 8)) \ cwarn( "%.0s%d trigraph(s) converted" \ , ((char *) 0 ) , count, ((char *) 0 ) ); \ return count; \ } \ static void \ \ at_eof( int in_comment) \ { \ const char * const format \ = "End of %s with %.0d%s"; \ const char * const unterm_if_format \ = "End of %s within #if (#ifdef) section started at line %u"; \ const char * const unterm_macro_format \ = "End of %s within macro call started at line %u"; \ const char * const input \ = infile->parent ? "file" : "input"; \ const char * const no_newline \ = "no newline, skipped the line"; \ const char * const unterm_com \ = "unterminated comment, skipped the line"; \ \ const char * const backsl = "\\, skipped the line"; \ int len; \ char * cp = infile->buffer; \ IFINFO * ifp; \ \ len = strlen( cp); \ if (len && *(cp += (len - 1)) != '\n') { \ line++; \ *++cp = '\n'; \ *++cp = '\0' ; \ cerror( format, input, 0, no_newline); \ } \ \ \ if (infile->buffer < infile->bptr) \ cerror( format, input, 0, backsl); \ \ \ if (in_comment) \ cerror( format, input, 0, unterm_com); \ \ if (infile->initif < ifptr) { \ ifp = infile->initif + 1; \ \ cerror( unterm_if_format, input, ifp->ifline, ((char *) 0 ) ); \ ifptr = infile->initif; \ ifstack[0].stat = ifptr->stat; \ } \ \ if (macro_line != 0 && macro_line != 65535U ) { \ \ cerror( unterm_macro_format, input, macro_line, ((char *) 0 ) ); \ macro_line = 65535U ; \ } \ } \ \ void \ \ unget( void) \ { \ if (infile != 0 ) { \ --infile->bptr; \ \ if (infile->bptr < infile->buffer) \ cfatal( "Bug: Too much pushback", ((char *) 0 ) , 0, ((char *) 0 ) ); \ \ } \ \ \ if (debug & 32 ) \ dumpunget( "after unget"); \ \ } \ \ FILEINFO * \ \ ungetstring( const char * text, const char * name) \ { \ FILEINFO * file; \ size_t size; \ \ if (text) \ size = strlen( text) + 1; \ else \ size = 1; \ file = getfile( name, size); \ if (text) \ memcpy( file->buffer, text, size); \ else \ *file->buffer = '\0' ; \ return file; \ } \ \ char * \ \ savestring( const char * text) \ { \ char * result; \ size_t size; \ \ size = strlen( text) + 1; \ result = xmalloc( size); \ memcpy( result, text, size); \ return result; \ } \ \ FILEINFO * \ \ getfile( const char * name, size_t bufsize) \ { \ FILEINFO * file; \ size_t s_name; \ \ file = (FILEINFO *) xmalloc( sizeof (FILEINFO)); \ file->buffer = xmalloc( bufsize); \ if (name) { \ s_name = strlen( name) + 1; \ file->filename = (char *) xmalloc( s_name); \ memcpy( file->filename, name, s_name); \ } else { \ file->filename = 0 ; \ } \ \ file->bptr = file->buffer; \ return file; } \ #endif #endif #endif #endif mcpp-2.7.2/cpp-test/test-l/nest56.h0000644000175000017500000000004310216765467013661 00000000000000/* nest56.h */ #include "nest57.h" mcpp-2.7.2/cpp-test/test-l/nest24.h0000644000175000017500000000004310216765467013654 00000000000000/* nest24.h */ #include "nest25.h" mcpp-2.7.2/cpp-test/test-l/nest96.h0000644000175000017500000000004310216765467013665 00000000000000/* nest96.h */ #include "nest97.h" mcpp-2.7.2/cpp-test/test-l/nest28.h0000644000175000017500000000004310216765467013660 00000000000000/* nest28.h */ #include "nest29.h" mcpp-2.7.2/cpp-test/test-l/nest18.h0000644000175000017500000000004310216765467013657 00000000000000/* nest18.h */ #include "nest19.h" mcpp-2.7.2/cpp-test/test-l/nest120.h0000644000175000017500000000004510216765467013733 00000000000000/* nest120.h */ #include "nest121.h" mcpp-2.7.2/cpp-test/test-l/nest110.h0000644000175000017500000000004510216765467013732 00000000000000/* nest110.h */ #include "nest111.h" mcpp-2.7.2/cpp-test/test-l/nest107.h0000644000175000017500000000004510216765467013740 00000000000000/* nest107.h */ #include "nest108.h" mcpp-2.7.2/cpp-test/test-l/nest117.h0000644000175000017500000000004510216765467013741 00000000000000/* nest117.h */ #include "nest118.h" mcpp-2.7.2/cpp-test/test-l/nest102.h0000644000175000017500000000004510216765467013733 00000000000000/* nest102.h */ #include "nest103.h" mcpp-2.7.2/cpp-test/test-l/nest40.h0000644000175000017500000000004310216765467013652 00000000000000/* nest40.h */ #include "nest41.h" mcpp-2.7.2/cpp-test/test-l/nest11.h0000644000175000017500000000004310216765467013650 00000000000000/* nest11.h */ #include "nest12.h" mcpp-2.7.2/cpp-test/LICENSE0000644000175000017500000000266410763014414012156 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/cpp-test/test-t/0000777000175000017500000000000011070072314012440 500000000000000mcpp-2.7.2/cpp-test/test-t/u_1_19.c0000644000175000017500000000246510642113357013533 00000000000000/* u_1_19.c: Undefined behaviors on undefined #define and #undef syntax. */ /* { dg-do preprocess } */ /* u.1.19: A macro expanded to "defined" in #if expression. */ #define DEFINED defined #if DEFINED DEFINED /* { dg-warning "this use of \"defined\" may not be portable| is expanded to \"defined\"" } */ #endif #undef __linux__ #undef __arm__ #define __linux__ 1 #define HAVE_MREMAP defined(__linux__) && !defined(__arm__) /* Wrong macro definition. * This macro should be defined as follows. * #if defined(__linux__) && !defined(__arm__) * #define HAVE_MREMAP 1 * #endif */ #if HAVE_MREMAP /* { dg-warning "this use of \"defined\" may not be portable| is expanded to \"defined\"" } */ mremap(); #endif /* u.1.20: Undefining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or "defined" in #undef directive. */ #undef __LINE__ /* { dg-error "undefining| shouldn't be undefined" } */ /* u.1.21: Defining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or "defined" in #define directive. */ #define __LINE__ 1234 /* { dg-error "defining| shouldn't be redefined" } */ #define defined defined /* { dg-error "cannot be used as a macro name| invalid macro name | shouldn't be defined" } */ #if defined defined # error I am not a good preprocessor. #endif mcpp-2.7.2/cpp-test/test-t/u_line_s.c0000644000175000017500000000100410216765467014333 00000000000000/* u_line_s.c: Undefined behavior on out-of-range #line number. */ /* { dg-do preprocess } */ /* { dg-options "-std=c99 -pedantic-errors" } */ /* C99: Line number argument of #line directive should be in range of [1..2147483647] */ #line 2147483648 /* { dg-error "out of range" } */ /* * Note: DejaGnu sometimes fails to handle one of the dg-error lines of * #line 0 and #line 2147483648, when those are tested in a single testcase * file. * So, we separated this testcase from u_line.c. */ mcpp-2.7.2/cpp-test/test-t/nest3.h0000644000175000017500000000006510216765467013605 00000000000000/* nest3.h */ nest = 3; #include "nest4.h" mcpp-2.7.2/cpp-test/test-t/e_intmax.c0000644000175000017500000000143310441602741014331 00000000000000/* e_intmax.c: Overflow of constant expression in #if directive. */ /* { dg-do preprocess } */ /* { dg-options "-std=c99 -pedantic-errors -w" } */ #define INTMAX_MAX 0x7FFFFFFFFFFFFFFF #define INTMAX_MIN (-INTMAX_MAX-1) #define SHRT_MAX 0x7FFF #if INTMAX_MAX - INTMAX_MIN /* { dg-error "integer overflow in preprocessor expression| Result of \"-\" is out of range" } */ #endif #if INTMAX_MAX + 1 > SHRT_MAX /* { dg-error "integer overflow in preprocessor expression| Result of \"\\+\" is out of range" } */ #endif #if INTMAX_MIN - 1 /* { dg-error "integer overflow in preprocessor expression| Result of \"-\" is out of range" } */ #endif #if INTMAX_MAX * 2 /* { dg-error "integer overflow in preprocessor expression| Result of \"\\*\" is out of range" } */ #endif mcpp-2.7.2/cpp-test/test-t/nest6.h0000644000175000017500000000006510216765467013610 00000000000000/* nest6.h */ nest = 6; #include "nest7.h" mcpp-2.7.2/cpp-test/test-t/n_27.c0000644000175000017500000000455710216765467013323 00000000000000/* n_27.t: Rescanning of a macro replace any macro call in the replacement text after substitution of parameters by pre-expanded-arguments. This re-examination may involve the succeding sequences from the source file (what a queer thing!). */ /* 27.1: Cascaded use of object-like macros. */ /* 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8; */ #define NEST8 NEST7 + 8 #define NEST7 NEST6 + 7 #define NEST6 NEST5 + 6 #define NEST5 NEST4 + 5 #define NEST4 NEST3 + 4 #define NEST3 NEST2 + 3 #define NEST2 NEST1 + 2 #define NEST1 1 NEST8; /* 27.2: Cascaded use of function-like macros. */ /* (1) + (1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4; */ #define FUNC4( a, b) FUNC3( a, b) + NEST4 #define FUNC3( a, b) FUNC2( a, b) + NEST3 #define FUNC2( a, b) FUNC1( a, b) + NEST2 #define FUNC1( a, b) (a) + (b) FUNC4( NEST1, NEST2); /* 27.3: An identifier generated by ## operator is subject to expansion. */ /* 1; */ #define glue( a, b) a ## b #define MACRO_1 1 glue( MACRO_, 1); #define sub( x, y) (x - y) #define head sub( #define math( op, a, b) op( (a), (b)) /* 27.4: 'sub' as an argument of math() is not pre-expanded, since '(' is missing. */ /* ((a) - (b)); */ math( sub, a, b); /* 27.5: Queer thing. */ /* (a - b); */ head a,b ); /* 27.6: Recursive macro (the 2nd 'm' is expanded to 'n' since it is in source file). */ /* n; */ #define m n #define n( a) a m( m); /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-final { if ![file exist n_27.i] { return } } } { dg-final { if \{ [grep n_27.i "1 *\\+ *2 *\\+ *3 *\\+ *4 *\\+ *5 *\\+ *6 *\\+ *7 *\\+ *8"] != "" \} \{ } } { dg-final { if \{ [grep n_27.i "\\( *1 *\\) *\\+ *\\( *1 *\\+ *2 *\\) *\\+ *1 *\\+ *2 *\\+ *1 *\\+ *2 *\\+ *3 *\\+ *1 *\\+ *2 *\\+ *3 *\\+ *4"] != "" \} \{ } } { dg-final { if \{ [grep n_27.i "^ *1 *;"] != "" \} \{ } } { dg-final { if \{ [grep n_27.i "\\( *\\( *a *\\) *- *\\( *b *\\) *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_27.i "\\( *a *- *b *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_27.i " *n *;"] != "" \} \{ } } { dg-final { return \} \} \} \} \} \} } } { dg-final { fail "n_27.c: macro rescanning" } } */ mcpp-2.7.2/cpp-test/test-t/n_13_13.c0000644000175000017500000000214610216765467013611 00000000000000/* n_13_13.c: #if expression with macros. */ #define ZERO_TOKEN #define MACRO_0 0 #define MACRO_1 1 #define and && #define or || #define not_eq != #define bitor | /* 13.13: With macros expanding to operators. */ /* Valid block */ #if (1 bitor 2) == 3 and 4 not_eq 5 or 0 /* #if (1 | 2) == 3 && 4 != 5 || 0 */ Valid block 1 #else Block to be skipped #endif /* 13.14: With macros expanding to 0 token, nonsence but legal expression.*/ /* Valid block */ #if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN /* #if 1 > 0 */ Valid block 2 #else Block to be skipped #endif /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-final { if ![file exist n_13_13.i] { return } } } { dg-final { if \{ [grep n_13_13.i "Valid block 1"] != "" \} \{ } } { dg-final { if \{ [grep n_13_13.i "Valid block 2"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_13_13.c: #if expression with macros" } } */ mcpp-2.7.2/cpp-test/test-t/n_37.c0000644000175000017500000000763510216765467013324 00000000000000/* n_37.t: Translation limits. */ /* 37.1: Number of parameters in macro: at least 31. */ #define glue31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E /* 37.2: Number of arguments of macro call: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcde; */ glue31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R , S, T, U, V, W, X, Y, Z, a, b, c, d, e); /* 37.3: Significant initial characters in an internal identifier or a macro name: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; */ ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; /* 37.4: Nested conditional inclusion: at least 8 levels. */ /* ifdef_nest = 8; */ #ifdef A #else # ifdef B # else # ifdef C # else # ifdef D # else # ifdef E # else # ifdef F # else # ifdef G # else # ifdef H # else ifdef_nest = 8; # endif # endif # endif # endif # endif # endif # endif #endif /* 37.5: Nested source file inclusion: at least 8 levels. */ #define X8 /* nest = 1; nest = 2; nest = 3; nest = 4; nest = 5; nest = 6; nest = 7; nest = 8; */ #include "nest1.h" /* 37.6: Parenthesized expression: at least 32 levels. */ /* nest = 32; */ #if 0 + (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 + 0)))))))))) \ )))))))))))))))))))))) == 0 nest = 32; #endif /* 37.7: Characters in a string (after concatenation): at least 509. */ "123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 012345678901234567" ; /* 37.8: Characters in a logical source line: at least 509. */ int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int A123456789012345678901234567890 = 123456; \ int B123456789012345678901234567890 = 123457; \ int C123456789012345678901234567890 = 123458; \ int D1234567890123456789012 = 123459; /* 37.9: Macro definitions: at least 1024. */ #define X0400 #include "m4095.h" /* 0x0400; */ BNJ; /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-final { if ![file exist n_37.i] { return } } } { dg-final { if \{ [grep n_37.i "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"] != "" \} \{ } } { dg-final { if \{ [grep n_37.i "ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_"] != "" \} \{ } } { dg-final { if \{ [grep n_37.i "ifdef_nest = 8"] != "" \} \{ } } { dg-final { if \{ [grep n_37.i "nest = 8"] != "" \} \{ } } { dg-final { if \{ [grep n_37.i "nest = 32"] != "" \} \{ } } { dg-final { if \{ [grep n_37.i "0x0400"] != "" \} \{ } } { dg-final { return \} \} \} \} \} \} } } { dg-final { fail "n_37.c: translation limits" } } */ mcpp-2.7.2/cpp-test/test-t/n_tlimit.c0000644000175000017500000001777010216765467014376 00000000000000/* n_tlimit.c: Tests of translation limits of C99. */ /* n_tlim_1: Number of parameters of macro definition: at least 127. */ #define glue127( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## o7 /* n_tlim_2: Number of arguments of macro call: at least 127. */ /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6O7; */ glue127( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7); /* n_tlim_3: Significant initial characters in an internal identifier or a macro name: at least 63 bytes. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; /* n_tlim_4: Nested conditional inclusion: at least 63 level. */ /* ifdef_nest = 0x3f; */ #define X3F #include "ifdef15.h" /* n_tlim_5: Nested source file inclusion: at least 15 level. */ /* nest = 0x0f; */ #define X0F #include "nest1.h" /* n_tlim_6: Parenthesized expression: at least 63 level. */ /* nest = 63; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif /* n_tlim_7: Characters in a string (after concatenation) : at least 4095 bytes. */ /* 4095 bytes long. */ char *string4093 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; /* n_tlim_8: Length of logical source line: at least 4095 bytes. */ #include "long4095.h" /* n_tlim_9: Number of macro definitions: at least 4095. */ #undef ARG #include "m4095.h" /* 0x0fff; */ GBM; /* { dg-do preprocess } { dg-options -std=c99 } { dg-final { if ![file exist n_tlimit.i] { return } } } { dg-final { if \{ [grep n_tlimit.i "A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6O7"] != "" \} \{ } } { dg-final { if \{ [grep n_tlimit.i "A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef "] != "" \} \{ } } { dg-final { if \{ [grep n_tlimit.i "ifdef_nest = 0x3f"] != "" \} \{ } } { dg-final { if \{ [grep n_tlimit.i "nest = 0x0f"] != "" \} \{ } } { dg-final { if \{ [grep n_tlimit.i "nest = 63"] != "" \} \{ } } { dg-final { if \{ [grep n_tlimit.i "0x0fff"] != "" \} \{ } } { dg-final { return \} \} \} \} \} \} } } { dg-final { fail "n_tlimit.c: translation limits of C99" } } */ mcpp-2.7.2/cpp-test/test-t/u_2.c0000644000175000017500000000102111000136464013177 00000000000000/* u_2.c: Undefined behaviors on undefined constant expression. */ /* { dg-do preprocess } */ /* u.2.1: Undefined escape sequence. */ #if '\x' /* { dg-error "no following hex digits| Undefined escape sequence '\\\\x'\n\[^ \]* warning:" } */ #endif /* u.2.2: Illegal bit shift count. */ /* dg-warning, not dg-error to avoid a problem of GCC 4.3 testsuite */ #if 1 << -1 /* { dg-warning "Illegal shift count" } */ #endif #if 1 << 64 /* { dg-error "integer overflow | Illegal shift count" } */ #endif mcpp-2.7.2/cpp-test/test-t/n_ppnum.c0000644000175000017500000000105210216765467014215 00000000000000/* n_ppnum.c: Preprocessing number token *p+* */ /* Undefined on C90, because '+A' is not a valid pp-token. */ #define A 3 #define glue( a, b) a ## b /* 12p+A; */ glue( 12p+, A); /* { dg-do preprocess } { dg-options "-std=c99" } { dg-final { if ![file exist n_ppnum.i] { return } } } { dg-final { if \{ [grep n_ppnum.i "12p\\+A"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_ppnum.c: pp-number including p+" } } */ mcpp-2.7.2/cpp-test/test-t/nest9.h0000644000175000017500000000004210216765467013606 00000000000000/* nest9.h */ #include "nest10.h" mcpp-2.7.2/cpp-test/test-t/n_10.c0000644000175000017500000000201110216765467013272 00000000000000/* n_10.c: #if, #elif, #else and #endif pp-directive. */ #define MACRO_0 0 #define MACRO_1 1 /* 10.1: */ /* Note: an undefined identifier in #if expression is replaced to 0. */ /* 1; */ #if a a; #elif MACRO_0 MACRO_0; #elif MACRO_1 /* Valid block */ MACRO_1; #else 0; #endif /* 10.2: Comments must be processed even if in skipped #if block. */ /* At least tokenization of string literal and character constant is necessary to process comments, e.g. /* is not a comment mark in string literal. */ #ifdef UNDEFINED /* Comment */ "in literal /* is not a comment" #endif /* No excess-errors */ /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-final { if ![file exist n_10.i] { return } } } { dg-final { if \{ [grep n_10.i "1" ] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_10.c: #if, #elif, #else and #endif" } } */ mcpp-2.7.2/cpp-test/test-t/unbal5.h0000644000175000017500000000006710216765467013741 00000000000000/* unbal5.h */ int unbal5; /* unterminated comment mcpp-2.7.2/cpp-test/test-t/nest8.h0000644000175000017500000000010710216765467013607 00000000000000/* nest8.h */ nest = 8; #ifndef X8 #include "nest9.h" #endif mcpp-2.7.2/cpp-test/test-t/u_1_8.c0000644000175000017500000000201010435347773013446 00000000000000/* u_1_8.c: Undefined behaviors on unterminated quotations. */ /* { dg-do preprocess } { dg-excess-errors "" } */ /* u.1.8: Unterminated character constant. */ /* The following "comment" may not interpreted as a comment but swallowed by the unterminated character constant. */ #error I can't understand. /* Token error prior to execution of #error. */ /* { dg-error "missing terminating ' character| unterminated string or character constant| Unterminated character constant" "" { target *-*-* } 9 } */ /* u.1.9: Unterminated string literal. */ "String literal across the lines. " /* { dg-error "multi-line string literals are deprecated| missing terminating \" character| string constant runs past end of line| Unterminated string literal, skipped the line" "" { target *-*-* } 13 } */ /* u.1.10: Unterminated header-name. */ #include character| (`#include'|#include) expects | Unterminated header name" "" { target *-*-* } 19 } */ mcpp-2.7.2/cpp-test/test-t/n_11.c0000644000175000017500000000175410216765467013310 00000000000000/* n_11.c: Operator "defined" in #if or #elif directive. */ #define MACRO_abc abc #define MACRO_xyz xyz #define MACRO_0 0 #define ZERO_TOKEN /* 11.1: */ /* abc; */ /* xyz; */ #if defined a a; #else MACRO_abc; #endif #if defined (MACRO_xyz) MACRO_xyz; #else 0; #endif /* 11.2: "defined" is an unary operator whose result is 1 or 0. */ #if defined MACRO_0 * 3 != 3 #error Bad handling of "defined" operator. #endif #if (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1) #error Bad grouping of "defined", !, - operator. #endif /* { dg-do preprocess } { dg-final { if ![file exist n_11.i] { return } } } { dg-final { if \{ [grep n_11.i "abc"] != "" \} \{ } } { dg-final { if \{ [grep n_11.i "xyz"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_11.c: 'defined' operator" } } */ mcpp-2.7.2/cpp-test/test-t/e_23_3.c0000644000175000017500000000146610216765467013524 00000000000000/* e_23_3.c: ## operator shall not occur at the beginning or at the end of replacement list for either form of macro definition. */ /* { dg-do preprocess } */ /* 23.3: In object-like macro. */ #define con ## name /* { dg-error "'##' cannot appear at either end of a macro expansion| `##' at start of macro definition| No token before ##" } */ #define cat 12 ## /* { dg-error "'##' cannot appear at either end of a macro expansion| No token after ##" } */ /* 23.4: In function-like macro. */ #define CON( a, b) ## a ## b /* { dg-error "'##' cannot appear at either end of a macro expansion| `##' at start of macro definition| No token before ##" } */ #define CAT( b, c) b ## c ## /* { dg-error "'##' cannot appear at either end of a macro expansion| No token after ##" } */ mcpp-2.7.2/cpp-test/test-t/n_12.c0000644000175000017500000000177310216765467013312 00000000000000/* n_12.c: Integer preprocessing number token and type of #if expression. */ #include /* 12.1: Type long. */ #if LONG_MAX <= LONG_MIN #error Bad evaluation of long. #endif #if LONG_MAX <= 1073741823 /* 0x3FFFFFFF */ #error Bad evaluation of long. #endif /* 12.2: Type unsigned long. */ #if ULONG_MAX / 2 < LONG_MAX #error Bad evaluation of unsigned long. #endif /* 12.3: Octal number. */ #if 0177777 != 65535 #error Bad evaluation of octal number. #endif /* 12.4: Hexadecimal number. */ #if 0Xffff != 65535 || 0xFfFf != 65535 #error Bad evaluation of hexadecimal number. #endif /* 12.5: Suffix 'L' or 'l'. */ #if 0L != 0 || 0l != 0 #error Bad evaluation of 'L' suffix. #endif /* 12.6: Suffix 'U' or 'u'. */ #if 1U != 1 || 1u != 1 #error Bad evaluation of 'U' suffix. #endif /* 12.7: Negative integer. */ #if 0 <= -1 #error Bad evaluation of negative number. #endif /* { dg-do preprocess } { dg-options "-ansi -w" } */ mcpp-2.7.2/cpp-test/test-t/n_30.c0000644000175000017500000000220710216765467013303 00000000000000/* n_30.c: Macro call. */ /* Note: Comma separate the arguments of function-like macro call, but comma between matching inner parenthesis doesn't. This feature is tested on so many places in this suite especially on *.c samples which use assert() macro, that no separete item to test this feature is provided. */ /* 30.1: A macro call may cross the lines. */ #define FUNC( a, b, c) a + b + c /* a + b + c; */ FUNC ( a, b, c ) ; /* { dg-do preprocess } { dg-final { if ![file exist n_30.i] { return } } } { dg-final { if \{ [grep n_30.i "a *\\+ *b *\\+ *c"] != "" \} \{ } } { dg-final { return \} } } { dg-final { if \{ [grep n_30.i "a *\\+ *"] != "" \} \{ } } { dg-final { if \{ [grep n_30.i "b *\\+ *"] != "" \} \{ } } { dg-final { if \{ [grep n_30.i "c"] != "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_30.c: macro call on multi-line" } } */ mcpp-2.7.2/cpp-test/test-t/n_24_3_run.c.gcc20000644000175000017500000000157310715612522015221 00000000000000/* n_24_3_run.c: # operator in macro definition. */ #include #include #include #define str( a) # a int main( void) { /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ assert( strcmp( str( '"' + "' \""), "'\"' + \"' \\\"\"") == 0); /* 24.4: Line splicing by is done prior to token parsing. */ assert( strcmp( str( "ab\ c"), "\"abc\"") == 0); return 0; } /* { dg-do run } * { dg-options "-ansi -w" } */ /* * Note: DejaGnu cannot handle the preprocessor output which contains a * doubly stringized string literal. * So, we test this testcase with strcmp(). * Note: -no-integrated-cpp is necessary for MCPP on GCC 3. GCC 2, however, * does not recognize this option. Remove this option on GCC 2. */ mcpp-2.7.2/cpp-test/test-t/nest14.h0000644000175000017500000000004310216765467013663 00000000000000/* nest14.h */ #include "nest15.h" mcpp-2.7.2/cpp-test/test-t/n_15.c0000644000175000017500000000133010216765467013302 00000000000000/* n_15.c: #ifdef, #ifndef directives. */ #define MACRO_1 1 /* 15.1: #ifdef directive. */ /* Valid block */ #ifdef MACRO_1 Valid block 1 #else Block to be skipped #endif /* 15.2: #ifndef directive. */ /* Valid block */ #ifndef MACRO_1 Block to be skipped #else Valid block 2 #endif /* { dg-do preprocess } { dg-final { if ![file exist n_15.i] { return } } } { dg-final { if \{ [grep n_15.i "Valid block 1"] != "" \} \{ } } { dg-final { if \{ [grep n_15.i "Valid block 2"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_15.c: #ifdef, #ifndef directives" } } */ mcpp-2.7.2/cpp-test/test-t/warn_1_2.c0000644000175000017500000000125110216765467014152 00000000000000/* warn_1_2.c */ /* * The following text is legal but suspicious one. Good preprocessor * will warn at this text. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic -Wall" } */ /* w.1.2: Rescanning of replacement text involves succeding text. */ #define sub( x, y) (x - y) #define head sub( int a = 1, b = 2, c; c = head a,b ); /* { dg-warning "involved subsequent text" "macro call involves subsequent text" } */ #define OBJECT_LIKE FUNCTION_LIKE #define FUNCTION_LIKE( x, y) (x + y) c = OBJECT_LIKE( a, b); /* { dg-warning "involved subsequent text" "macro call involves subsequent text" } */ mcpp-2.7.2/cpp-test/test-t/e_25_6.c0000644000175000017500000000112510216765467013521 00000000000000/* e_25_6.c: Macro arguments are pre-expanded separately. */ /* { dg-do preprocess } */ #define sub( x, y) (x - y) /* 25.6: */ #define head sub( #define body(x,y) x,y #define tail ) #define head_body_tail( a, b, c) a b c /* "head" is once replaced to "sub(", then rescanning of "sub(" causes an uncompleted macro call. Expansion of an argument should complete within the argument. */ head_body_tail( head, body(a,b), tail); /* { dg-error "unterminated argument list| (U|u)nterminated macro call" "" { target *-*-* } 15 } */ mcpp-2.7.2/cpp-test/test-t/u_1_22.c0000644000175000017500000000207510216765467013536 00000000000000/* u_1_22.c: Undefined behaviors on generating invalid pp-token by # and ## operators. */ /* { dg-do preprocess } */ /* u.1.22: Result of ## operator is not a valid pp-token. */ #define NUM( dig, exp) dig ## E+ ## exp /* * "E+" is a sequence of two pp-tokens "E" and "+", not a single pp-token. * The first ## concatenates the last pp-token of first argument with "E", * and the second ## concatenates "+" with the first pp-token of the second * argument. * While "12E" (one of the sequence generated by the token concatenation) * is a valid pp-token, "+34" (the another sequence) is not a valid pp-token * and causes an undefined behavior. */ NUM( 12, 34); /* { dg-error "(n|N)ot (give |)a valid preprocessing token" } */ /* u.1.23: Result of # operator is not a valid string literal. */ /* "\\"\""; This sequence is parsed to three tokens "\\" \ "", and will be diagnosed by compiler-proper unless diagnosed by preprocessor. */ #define str( a) #a str( \""); /* { dg-error "(n|N)ot (give |)a valid string literal" } */ mcpp-2.7.2/cpp-test/test-t/n_9.c0000644000175000017500000000032010216765467013223 00000000000000/* n_9.t: #pragma directive. */ /* 9.1: Any #pragma directive should be processed or ignored, should not be diagnosed as an error. */ #pragma __once #pragma who knows ? /* { dg-do preprocess } */ mcpp-2.7.2/cpp-test/test-t/u_1_27.c0000644000175000017500000000056010216765467013540 00000000000000/* u_1_27.c: Pseudo-directive-line. */ /* { dg-do preprocess } */ /* u.1.27: Unknown preprocessing directive (other than #pragma). */ #ifdefined MACRO /* { dg-error "invalid preprocessing directive| Unknown #directive" } */ /* The second error. */ #endif /* { dg-error "#endif without #if| unbalanced `#endif'| Not in a #if \\(#ifdef\\) section" } */ mcpp-2.7.2/cpp-test/test-t/unbal3.h0000644000175000017500000000003210216765467013727 00000000000000/* unbal3.h */ int unbal3;mcpp-2.7.2/cpp-test/test-t/n_dslcom_cplus.C0000644000175000017500000000074310216765467015513 00000000000000/* n_dslcom_cplus.C: // is a comment of C++ and C99. */ /* a; */ a; // is a comment of C++ and C99 /* { dg-do preprocess } { dg-options "-std=c++98" } { dg-final { if ![file exist n_dslcom_cplus.i] { return } } } { dg-final { if \{ [grep n_dslcom_cplus.i "^\[ \]*a;\[ \]*$"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_dslcom_cplus.C: double slash comment" } } */ mcpp-2.7.2/cpp-test/test-t/e_17.c0000644000175000017500000000232210216765467013275 00000000000000/* e_17.c: Ill-formed group in a source file. */ /* { dg-do preprocess } */ #define MACRO_1 1 /* 17.1: Error of #endif without #if. */ #endif /* { dg-error "#endif without #if| unbalanced `#endif'| Not in a #if \\(#ifdef\\) section" } */ /* 17.2: Error of #else without #if. */ #else /* { dg-error "#else without #if| `#else' not within a conditional| Not in a #if \\(#ifdef\\) section" } */ /* 17.3: Error of #else after #else. */ #if MACRO_1 #else /* line 15 */ #if 1 #else #endif #else /* { dg-error "#else after #else\n\[\^ \]*( error:|) the conditional began here| `#else' after `#else'\n (matches line 14)| Already seen #else at line 15" } */ #endif /* 17.4: Error of #elif after #else. */ #if MACRO_1 == 1 #else /* line 24 */ #elif MACRO_1 == 0 /* { dg-error "#elif after #else\n\[\^ \]*( error:|) the conditional began here| `#elif' after `#else'\n (matches line 23)| Already seen #else at line 24" } */ #endif /* 17.7: Error of unterminated #if section. */ #if MACRO_1 == 0 /* line 29 */ #else /* { dg-error "unterminated #else| unterminated `#else'| End of input within #if \\(#ifdef\\) section" "" { target *-*-* } 0 } */ mcpp-2.7.2/cpp-test/test-t/nest1.h0000644000175000017500000000006510216765467013603 00000000000000/* nest1.h */ nest = 1; #include "nest2.h" mcpp-2.7.2/cpp-test/test-t/unbal1.h0000644000175000017500000000002610216765467013730 00000000000000/* unbal1.h */ #endif mcpp-2.7.2/cpp-test/test-t/ifdef63.h0000644000175000017500000000230610216765467013777 00000000000000/* ifdef63.h */ #ifdef X20 #else #ifdef X21 #else #ifdef X22 #else #ifdef X23 #else #ifdef X24 #else #ifdef X25 #else #ifdef X26 #else #ifdef X27 #else #ifdef X28 #else #ifdef X29 #else #ifdef X2A #else #ifdef X2B #else #ifdef X2C #else #ifdef X2D #else #ifdef X2E #else #ifdef X2F #else #ifdef X30 #else #ifdef X31 #else #ifdef X32 #else #ifdef X33 #else #ifdef X34 #else #ifdef X35 #else #ifdef X36 #else #ifdef X37 #else #ifdef X38 #else #ifdef X39 #else #ifdef X3A #else #ifdef X3B #else #ifdef X3C #else #ifdef X3D #else #ifdef X3E #else #ifdef X3F ifdef_nest = 0x3f; #endif /* X3F */ #endif /* X3E */ #endif /* X3D */ #endif /* X3C */ #endif /* X3B */ #endif /* X3A */ #endif /* X39 */ #endif /* X38 */ #endif /* X37 */ #endif /* X36 */ #endif /* X35 */ #endif /* X34 */ #endif /* X33 */ #endif /* X32 */ #endif /* X31 */ #endif /* X30 */ #endif /* X2F */ #endif /* X2E */ #endif /* X2D */ #endif /* X2C */ #endif /* X2B */ #endif /* X2A */ #endif /* X29 */ #endif /* X28 */ #endif /* X27 */ #endif /* X26 */ #endif /* X25 */ #endif /* X24 */ #endif /* X23 */ #endif /* X22 */ #endif /* X21 */ #endif /* X20 */ mcpp-2.7.2/cpp-test/test-t/n_20.c0000644000175000017500000000073310216765467013304 00000000000000/* n_20.c: Definition of macro lexically identical to keyword. */ /* 20.1: */ /* double fl; */ #define float double float fl; /* { dg-do preprocess } { dg-final { if ![file exist n_20.i] { return } } } { dg-final { if \{ [grep n_20.i "double +fl"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_20.c: macro identical to keyword" } } */ mcpp-2.7.2/cpp-test/test-t/e_14_7.c0000644000175000017500000000113110216765467013515 00000000000000/* e_14_7.c: There is no keyword in #if expression. */ /* { dg-do preprocess } { dg-options "-ansi -w" } */ /* 14.7: sizeof operator is disallowed. */ /* Evaluated as: 0 (0) Constant expression syntax error. */ #if sizeof (int) /* { dg-error "missing binary operator|(parse|syntax) error| Operator \"\\(\" in incorrect context" } */ #endif /* 14.8: type cast is disallowed. */ /* Evaluated as: (0)0x8000 Also a constant expression error. */ #if (int)0x8000 < 0 /* { dg-error "missing binary operator|(parse|syntax) error| Misplaced constant" } */ #endif mcpp-2.7.2/cpp-test/test-t/u_1_1.c0000644000175000017500000000203610216765467013450 00000000000000/* u_1_1.c: Undefined behaviors on unterminated line, comment or macro. */ /* { dg-do preprocess } */ /* u.1.1: End of a source file without . */ #include "unbal3.h" /* { dg-error "u_1_1\.c:6:\n\[^ \]*( error:|) (no newline at end of file|file does not end in newline)| End of file with no newline" "" { target *-*-* } 0 } */ int e_1; /* u.1.2: End of a source file with . */ #include "unbal4.h" /* { dg-error "u_1_1\.c:11:\n\[^ \]*( error:|) backslash-newline at end of file| End of file with \\\\" "" { target *-*-* } 0 } */ ; /* u.1.3: End of a source file with an unterminated comment. */ #include "unbal5.h" /* { dg-error "u_1_1\.c:16:\n\[^ \]*( error:|) unterminated comment| End of file with unterminated comment" "" { target *-*-* } 0 } */ */ /* u.1.4: End of a source file with an uncompleted macro call. */ #include "unbal6.h" /* { dg-error "u_1_1\.c:21:\n\[^ \]*( error:|) unterminated (argument list|macro call)| End of file within macro call" "" { target *-*-* } 0 } */ y); mcpp-2.7.2/cpp-test/test-t/e_15_3.c0000644000175000017500000000120310216765467013512 00000000000000/* e_15_3.c: #ifdef, #ifndef syntax errors. */ /* { dg-do preprocess } */ /* 15.3: Not an identifier. */ #ifdef "string" /* { dg-error "macro names must be identifiers|argument starts with punctuation| Not an identifier" } */ #endif #ifdef 123 /* { dg-error "macro names must be identifiers|argument starts with a digit| Not an identifier" } */ #endif /* 15.4: Excessive token sequence. */ #ifdef MACRO Junk /* { dg-error "extra tokens|garbage at end| Excessive token sequence" } */ #endif /* 15.5: No argument. */ #ifndef /* { dg-error "no macro name given| (N|n)o argument" } */ #endif mcpp-2.7.2/cpp-test/test-t/n_token.C0000644000175000017500000000155410216765467014145 00000000000000/* n_token.C: special pp-token in C++ */ #define str( a) xstr( a) #define xstr( a) # a #define paste( a, b) a ## b /* token.1: '::' is a token in C++, although illegal token sequence in C */ /* "::"; */ str( paste( :, :)); /* token.2: 'and', 'or', 'not', etc. are tokens in C++, although in C these are macros defined by */ /* "xor"; */ #if 1 and 2 or not 3 str( xor); #endif /* { dg-do preprocess } { dg-options "-std=c++98" } { dg-final { if ![file exist n_token.i] { return } } } { dg-final { if \{ [grep n_token.i "\"::\""] != "" \} \{ } } { dg-final { if \{ [grep n_token.i "\"xor\""] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_token.C: C++ tokens" } } */ mcpp-2.7.2/cpp-test/test-t/e_operat.C0000644000175000017500000000072510216765467014305 00000000000000/* e_operat.C */ /* * In C++98 the 11 identifier-like tokens are operators, not identifiers. * Note: in C95 these are defined as macros by . */ /* { dg-do preprocess } */ /* { dg-options "-std=c++98 -pedantic-errors" } */ /* Cannot define operator as a macro. */ #define and && /* { dg-error "cannot be used as a macro name| is defined as macro" } */ #define xor_eq ^= /* { dg-error "cannot be used as a macro name| is defined as macro" } */ mcpp-2.7.2/cpp-test/test-t/nest7.h0000644000175000017500000000006510216765467013611 00000000000000/* nest7.h */ nest = 7; #include "nest8.h" mcpp-2.7.2/cpp-test/test-t/n_line.c0000644000175000017500000000103510216765467014006 00000000000000/* n_line.c: line number argument of #line */ /* C99: Range of line number in #line directive is [1..2147483647] */ /* 2147483647; */ #line 2147483647 __LINE__; /* { dg-do preprocess } { dg-options "-std=c99 -w" } { dg-final { if ![file exist n_line.i] { return } } } { dg-final { if \{ [grep n_line.i "2147483647"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_line.c: line number in C99" } } */ mcpp-2.7.2/cpp-test/test-t/n_8.c0000644000175000017500000000067510216765467013237 00000000000000/* n_8.c: #error directive. */ /* 8.1: Argument of #error directive is not a subject of macro expansion. Output to stderr as an example: Preprocessing error directive: MACRO is not a positive number. from line 10 of file "n_8.c" */ #define MACRO 0 #if MACRO <= 0 #error MACRO is not a positive number. #endif /* { dg-do preprocess } { dg-error "MACRO is not a positive number." "n_8.c" { target *-*-* } 10 } */ mcpp-2.7.2/cpp-test/test-t/nest13.h0000644000175000017500000000004310216765467013662 00000000000000/* nest13.h */ #include "nest14.h" mcpp-2.7.2/cpp-test/test-t/unbal4.h0000644000175000017500000000003310216765467013731 00000000000000/* unbal4.h */ int unbal4\ mcpp-2.7.2/cpp-test/test-t/nest12.h0000644000175000017500000000004310216765467013661 00000000000000/* nest12.h */ #include "nest13.h" mcpp-2.7.2/cpp-test/test-t/n_24_3_run.c.gcc30000644000175000017500000000161610720554426015224 00000000000000/* n_24_3_run.c: # operator in macro definition. */ #include #include #include #define str( a) # a int main( void) { /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ assert( strcmp( str( '"' + "' \""), "'\"' + \"' \\\"\"") == 0); /* 24.4: Line splicing by is done prior to token parsing. */ assert( strcmp( str( "ab\ c"), "\"abc\"") == 0); return 0; } /* { dg-do run } * { dg-options "-ansi -no-integrated-cpp -w" } */ /* * Note: DejaGnu cannot handle the preprocessor output which contains a * doubly stringized string literal. * So, we test this testcase with strcmp(). * Note: -no-integrated-cpp is necessary for MCPP on GCC 3. GCC 2, however, * does not recognize this option. Remove this option on GCC 2. */ mcpp-2.7.2/cpp-test/test-t/u_1_11.c0000644000175000017500000000101510216765467013525 00000000000000/* u_1_11.c: Undefined behaviors on undefined #include syntax or header- name. */ /* { dg-do preprocess } */ /* u.1.11: Header-name containing ', ", \ or / followed by *. */ /* Probably illegal filename and fails to open. */ #include "../*line.h" /* { dg-error "No such file or directory| Can't open include file" } */ /* \ is a legal path-delimiter in DOS/Windows or some other OS's. */ #include "..\test-t\line.h" /* { dg-error "No such file or directory| Can't open include file" } */ mcpp-2.7.2/cpp-test/test-t/n_3.c0000644000175000017500000000170410216765467013224 00000000000000/* n_3.c: Handling of comment. */ /* 3.1: A comment is converted to one space. */ /* abc de */ abc/* comment */de /* 3.2: // is not a comment of C. */ #if 0 /* This feature is obsolete now. */ /* // is not a comment of C */ // is not a comment of C #endif /* 3.3: Comment is parsed prior to the parsing of preprocessing directive. */ /* abcd */ #if 0 "nonsence"; /* #else still in comment */ #else #define MACRO_abcd /* in comment */ abcd #endif MACRO_abcd /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-final { if ![file exist n_3.i] { return } } } { dg-final { if \{ [grep n_3.i "abc de"] != "" \} \{ } } { dg-final { if \{ [grep n_3.i "abcd"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_3.c: handling of comments" } } */ mcpp-2.7.2/cpp-test/test-t/nest15.h0000644000175000017500000000006310216765467013666 00000000000000/* nest15.h */ #ifdef X0F nest = 0x0f; #endif mcpp-2.7.2/cpp-test/test-t/cpp-test.exp0000644000175000017500000000071110216765467014653 00000000000000# cpp-test.exp 2002/12 # to test cpp-test # imported and modified from dg.exp of GNU C # Load support procs. load_lib gcc-dg.exp # If a testcase doesn't have special options, use these. global DEFAULT_CFLAGS if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS " -ansi -pedantic-errors" } # Initialize `dg'. dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSC\]]] \ "" $DEFAULT_CFLAGS # All done. dg-finish mcpp-2.7.2/cpp-test/test-t/n_13_7.c0000644000175000017500000000163410216765467013535 00000000000000/* n_13_7.c: Short-circuit evaluation of #if expression. */ /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error cannot occur. */ #define MACRO_0 0 /* Valid block */ #if 0 && 10 / 0 Block to be skipped #endif #if not_defined && 10 / not_defined Block to be skipped #endif #if MACRO_0 && 10 / MACRO_0 > 1 Block to be skipped #endif #if MACRO_0 ? 10 / MACRO_0 : 0 Block to be skipped #endif #if MACRO_0 == 0 || 10 / MACRO_0 > 1 Valid block #else Block to be skipped #endif /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-final { if ![file exist n_13_7.i] { return } } } { dg-final { if \{ [grep n_13_7.i "Valid block"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_13_7.c: short-circuit evaluation of #if expression" } } */ mcpp-2.7.2/cpp-test/test-t/u_1_24.c0000644000175000017500000000242410216765467013536 00000000000000/* u_1_24.c: Undefined behaviors on empty argument of macro call. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic -Wall" } */ /* u.1.24: Empty argument of macro call. */ /* * Note: Since no argument and one empty argument cannot be distinguished * syntactically, additional dummy argument may be necessary for an * intermediate macro to process one empty argument (if possible). */ #define ARG( a, dummy) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s, dummy)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); or other undefined behavior. */ SHOWN( math( sub, , y)); /* { dg-warning "(e|E)mpty argument" } */ /* printf( "%s : %s\n", "EMPTY", ""); or other undefined behavior. */ SHOWS( EMPTY); /* { dg-warning "(e|E)mpty argument" } */ /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( , )", ""); or other undefined behavior. */ SHOWS( APPEND( , )); /* { dg-warning "(e|E)mpty argument" } */ mcpp-2.7.2/cpp-test/test-t/e_pragma.c0000644000175000017500000000056210216765467014321 00000000000000/* e_pragma.c: Erroneous use of _Pragma() operator */ /* { dg-do preprocess } */ /* { dg-options "-std=c99 -pedantic-errors" } */ /* Operand of _Pragma() should be a string literal */ _Pragma( This is not a string literal) /* { dg-error "_Pragma takes a parenthesized string literal| Operand of _Pragma\\(\\) is not a string literal" "" { target *-*-* } 7 } */ mcpp-2.7.2/cpp-test/test-t/e_18_4.c0000644000175000017500000000315210757201515013510 00000000000000/* e_18_4.c: #define syntax errors. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic" } */ /* 18.4: Not an identifier. */ #define "string" /* { dg-error "macro names must be identifiers| invalid macro name| Not an identifier" } */ #define 123 /* { dg-error "macro names must be identifiers| invalid macro name| Not an identifier" } */ /* 18.5: No argument. */ #define /* { dg-error "no macro name given| No identifier" } */ /* 18.6: Empty parameter list. */ #define math( op, a, ) op( (a), (b)) /* { dg-error "parameter name missing| badly punctuated parameter list| Empty parameter" } */ /* 18.7: Duplicate parameter names. */ #define math( op, a, a) op( (a), (b)) /* { dg-error "duplicate macro parameter| duplicate argument name| Duplicate parameter name" } */ /* 18.8: Argument is not an identifier. */ #define NUMARGS( 1, +, 2) (1 + 2) /* { dg-error "may not appear in macro parameter list| invalid character in macro parameter name| Illegal parameter" } */ /* 18.9: No space between macro name and replacement text. */ /* C90 (Corrigendum 1) forbids this if and only the replacement text begins with a non-basic-character. C99 forbids this even when the replacement text begins with basic- character. */ /* From ISO 9899:1990 / Corrigendum 1. */ #define THIS$AND$THAT(a, b) ((a) + (b)) /* { dg-error "ISO C requires whitespace after the macro name| '\\$' in identifier| No space between macro name" } */ /* Note: the following definition is legal (object-like macro). #define THIS $AND$THAT(a, b) ((a) + (b)) */ mcpp-2.7.2/cpp-test/test-t/n_bool.C0000644000175000017500000000144410216765467013756 00000000000000/* n_bool.C */ /* * On C++: 'true' and 'false' are evaluated 1 and 0 respectively. * and logical AND, logical OR are evaluated boolean. */ /* Valid block; */ #define MACRO 1 #define MACRO3 3 #if MACRO == true Valid block 1 #else non-Valid block; #endif #if (MACRO && MACRO3) == true Valid block 2 #else non-Valid block; #endif /* { dg-do preprocess } { dg-options "-std=c++98" } { dg-final { if ![file exist n_bool.i] { return } } } { dg-final { if \{ [grep n_bool.i "Valid block 1"] != "" \} \{ } } { dg-final { if \{ [grep n_bool.i "Valid block 2"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_bool.C: boolean literal" } } */ mcpp-2.7.2/cpp-test/test-t/e_12_8.c0000644000175000017500000000046510216765467013525 00000000000000/* e_12_8.c: Out of range of integer pp-token in #if expression. */ /* { dg-do preprocess } */ /* 12.8: Preprocessing number perhaps out of range of unsigned long. */ #if 123456789012345678901 /* { dg-error "(C|c)onstant (\"\[0-9\]*\" is |)(out of range|is too large for its type)" } */ #endif mcpp-2.7.2/cpp-test/test-t/e_14.c0000644000175000017500000000057710216765467013304 00000000000000/* e_14.c: Illegal #if expressions. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic-errors -w" } */ #define A 1 #define B 1 /* 14.1: String literal is not allowed in #if expression. */ #if "string" /* { dg-error "not (valid|allowed) in (#if|preprocessor)( expressions|)| Can't use a string literal" } */ #endif /* The second error ? */ mcpp-2.7.2/cpp-test/test-t/unspcs.c0000644000175000017500000000267710216765467014072 00000000000000/* * unspcs.c: * 1998/08 kmatsui * * These texts are unportable ones, because the order of the evaluation is * unspecified. Good preprocessor will warn at these texts even if the * results are valid. Good preprocessor will also document the order of * evaluation and the behavior on invalid results. * Note: Order of evaluation of sub-expressions (other than operands of &&, * ||, ? :) of #if expression is also unspecified. The order, however, never * affects the result, because #if expression never cause side effect, so no * warning is necessary. Precedence and grouping rules of operators are other * things than order of evaluation, and shall be obeyed by preprocessor. * * 2003/03 Rewritten for testsuite. kmatsui */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic -Wall" } */ #define str( a) # a #define xstr( a) str( a) /* s.1.1: Order of evaluation of #, ## operators. */ #define MAKWIDESTR( s) L ## # s /* { dg-warning "Macro with mixing of ## and # operators isn't portable" } */ /* Either of L"name"; or L# name; ("L#" is not a valid pp-token). */ MAKWIDESTR( name); /* s.1.2: Order of evaluation of ## operators. */ #define glue3( a, b, c) a ## b ## c /* { dg-warning "Macro with multiple ## operators isn't portable" } */ /* "1.a" or undefined, since .a is not a valid pp-token, while 1. and 1.a are valid pp-tokens. */ xstr( glue3( 1, ., a)); mcpp-2.7.2/cpp-test/test-t/n_cplus.C0000644000175000017500000000032710216765467014150 00000000000000/* n_cplus.C: C++98 pre-defined macro __cplusplus. */ /* 199711L */ #if __cplusplus < 199711L #error __cplusplus not conforms to C++98 #endif /* { dg-do preprocess } { dg-options "-std=c++98" } */ mcpp-2.7.2/cpp-test/test-t/e_27_7.c0000644000175000017500000000076410216765467013534 00000000000000/* e_27_7.c: Error of rescanning. */ /* { dg-do preprocess } */ #define sub( x, y) (x - y) /* 27.7: */ #define TWO_TOKENS a,b #define SUB( x, y) sub( x, y) /* Too many arguments error while rescanning after once replaced to: sub( a,b, 1); */ SUB( TWO_TOKENS, 1); /* { dg-error "passed 3 arguments, but takes just 2| used with too many \\(3\\) args| More than necessary 2 argument\\(s\\) in macro call" "too many arguments in rescanning" { target *-*-* } 12 } */ mcpp-2.7.2/cpp-test/test-t/u_concat.c0000644000175000017500000000075210216765467014342 00000000000000/* u_concat.c: Invalid pp-token generated by ## operator. */ /* { dg-do preprocess } */ #define _VARIANT_BOOL /##/ /* * The following line intends to be commented out. '//' generated by the * macro is, however, not a valid pp-token. Since any comment is removed * before macro definition or macro expansion, a comment is never generated * by macro. */ _VARIANT_BOOL bool; /* { dg-error "does not give a valid preprocessing token| Not a valid preprocessing token" } */ mcpp-2.7.2/cpp-test/test-t/u_line.c0000644000175000017500000000125410216765467014020 00000000000000/* u_line.c: Undefined behaviors on out-of-range #line number. */ /* { dg-do preprocess } */ /* { dg-options "-std=c99 -pedantic-errors" } */ /* C99: Line number argument of #line directive should be in range of [1..2147483647] */ #line 0 /* { dg-error "out of range" } */ #line 11 /* Restore to correct line number */ #line 2147483647 /* valid here */ /* line 2147483647 */ /* line 2147483648 ? : out of range */ __LINE__; /* 2147483649 ? or -2147483647 ?, maybe warned as an out-of-range */ /* { dg-warning "out of range| got beyond range\n\[\^ \]* warning: Line number \"\[\-0-9\]*\" is out of range" "" { target *-*-* } 0 } */ mcpp-2.7.2/cpp-test/test-t/pragmas.h0000644000175000017500000000117610216765467014207 00000000000000/* pragmas.h based on the proposal to C99 by Bill Homer */ #if defined(Machine_A) /* Request fastest calling sequence for machine A */ # define Fast_call \ _Pragma("fast_call") #elif defined(Machine_B) /* Request fastest calling sequence for machine B */ # define Fast_call \ _Pragma("vfunction") #else # define Fast_call #endif #if defined(Machine_B) /* Vectorization hint (ignore vector dependencies) */ # define Independent _Pragma("ivdep") #elif defined(Machine_C) /* Parallelization hint (iterations are independent) */ # define Independent _Pragma("independent") #else # define Independent #endif mcpp-2.7.2/cpp-test/test-t/n_8_2.c0000644000175000017500000000024210216765467013446 00000000000000/* n_8_2.c: Argument of #error is optional. */ /* { dg-do preprocess } */ /* 8.2: #error should be executed. */ #error /* { dg-error "#error" } */ mcpp-2.7.2/cpp-test/test-t/e_16.c0000644000175000017500000000060410216765467013275 00000000000000/* e_16.c: Trailing junk of #else, #endif. */ /* { dg-do preprocess } */ /* 16.1: Trailing junk of #else. */ #define MACRO_0 0 #if MACRO_0 #else MACRO_0 /* { dg-error "extra tokens|text following| Excessive token sequence" } */ /* 16.2: Trailing junk of #endif. */ #endif MACRO_0 /* { dg-error "extra tokens|text following| Excessive token sequence" } */ mcpp-2.7.2/cpp-test/test-t/n_22.c0000644000175000017500000000161010216765467013301 00000000000000/* n_22.c: Tokenization of preprocessing number. */ #define EXP 1 /* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */ /* 12E+EXP; */ 12E+EXP; /* 22.2: .2e-EXP is also a preprocessing number. */ /* .2e-EXP; */ .2e-EXP; /* 22.3: + or - is allowed only following E or e, 12+EXP is not a preprocessing number. */ /* Three tokens: 12 + 1; */ 12+EXP; /* { dg-do preprocess } { dg-final { if ![file exist n_22.i] { return } } } { dg-final { if \{ [grep n_22.i "12E\\+EXP"] != "" \} \{ } } { dg-final { if \{ [grep n_22.i "\.2e-EXP"] != "" \} \{ } } { dg-final { if \{ [grep n_22.i "12\[ \]*\\+\[ \]*1"] != "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_22.c: tokenization of pp-number" } } */ mcpp-2.7.2/cpp-test/test-t/e_ucn.c0000644000175000017500000000145610216765467013642 00000000000000/* e_ucn.c: Errors of Universal-character-name sequense. */ /* { dg-do preprocess } */ /* { dg-options "-std=c99 -pedantic-errors" } */ #define macro\U0000001F /* violation of constraint */ /* { dg-error "universal-character-name| UCN cannot specify the value" "" { target *-*-* } 6 } */ #define macro\uD800 /* violation of constraint (only C, not for C++) */ /* { dg-error "universal-character-name| UCN cannot specify the value" "" { target *-*-* } 8 } */ #define macro\u123 /* too short sequence (violation of syntax rule) */ /* { dg-error "incomplete universal-character-name| Illegal UCN sequence" "" { target *-*-* } 10 } */ #define macro\U1234567 /* also too short sequence */ /* { dg-error "incomplete universal-character-name| Illegal UCN sequence" "" { target *-*-* } 12 } */ mcpp-2.7.2/cpp-test/test-t/e_17_5.c0000644000175000017500000000115110216765467013520 00000000000000/* e_17_5.c: Imbalance of #if - #endif in included files. */ /* { dg-do preprocess } */ /* 17.5: Error of #endif without #if in an included file. */ #if 1 #include "unbal1.h" /* { dg-error "e_17_5.c:7:\n\[\^ \]*( error:|) (#endif without #if|unbalanced `#endif')| Not in a #if \\(#ifdef\\) section in a source file" "" { target *-*-* } 0 } */ /* 17.6: Error of unterminated #if section in an included file. */ #include "unbal2.h" /* { dg-error "e_17_5.c:11:\n\[\^ \]*( error:|) unterminated (#else|`#else')| End of file within #if \\(#ifdef\\) section" "" { target *-*-* } 0 } */ #endif mcpp-2.7.2/cpp-test/test-t/n_nularg.c0000644000175000017500000000266110216765467014355 00000000000000/* n_nularg.c: Empty argument of macro call. */ #define ARG( a) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( , )", ""); */ SHOWS( APPEND( , )); /* { dg-do preprocess } { dg-options "-std=c99 -w" } { dg-final { if ![file exist n_nularg.i] { return } } } { dg-final { if \{ [grep n_nularg.i "printf\\( \"%s : %d\\\\n\", \"math\\( sub, , y\\)\", *\\( *- *y *\\) *\\)" ] != "" \} \{ } } { dg-final { if \{ [grep n_nularg.i "printf\\( \"%s : %s\\\\n\", \"EMPTY\", *\"\" *\\)" ] != "" \} \{ } } { dg-final { if \{ [grep n_nularg.i "printf\\( \"%s : %s\\\\n\", \"APPEND\\( CON, 1\\)\", *\"CON1\" *\\)" ] != "" \} \{ } } { dg-final { if \{ [grep n_nularg.i "printf\\( \"%s : %s\\\\n\", \"APPEND\\( , \\)\", *\"\" *\\)" ] != "" \} \{ } } { dg-final { return \} \} \} \} } } { dg-final { fail "n_nularg.c: empty argument" } } */ mcpp-2.7.2/cpp-test/test-t/nest5.h0000644000175000017500000000006510216765467013607 00000000000000/* nest5.h */ nest = 5; #include "nest6.h" mcpp-2.7.2/cpp-test/test-t/nest4.h0000644000175000017500000000006510216765467013606 00000000000000/* nest4.h */ nest = 4; #include "nest5.h" mcpp-2.7.2/cpp-test/test-t/e_14_9.c0000644000175000017500000000030510216765467013521 00000000000000/* e_14_9.c: Out of range in #if expression (division by 0). */ /* { dg-do preprocess } */ /* 14.9: Divided by 0. */ #if 1 / 0 /* { dg-error "(D|d)ivision by zero" } */ #endif mcpp-2.7.2/cpp-test/test-t/n_1.c0000644000175000017500000000127310216765467013223 00000000000000/* n_1.c: Conversion of trigraph sequences. */ /* 1.1: The following 9 sequences are valid trigraph sequences. */ /* [ ] \ ^ { } | ~ #; */ ??( ??) ??/ ??' ??< ??> ??! ??- ??=; /* 1.2: In directive line. */ /* ab | cd; */ ??= define OR( a, b) a ??! b OR( ab, cd); /* { dg-do preprocess } { dg-final { if ![file exist n_1.i] { return } } } { dg-final { if \{ [grep n_1.i "\[ \] \\ \^ \{ \} \| ~ #"] != "" \} \{ } } { dg-final { if \{ [grep n_1.i "ab *\| *cd"] != "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_1.c: trigraphs conversion" } } */ mcpp-2.7.2/cpp-test/test-t/e_31.c0000644000175000017500000000077210216765467013300 00000000000000/* e_31.c: Illegal macro calls. */ /* { dg-do preprocess } */ #define sub( a, b) (a - b) /* 31.1: Too many arguments error. */ sub( x, y, z); /* { dg-error "passed 3 arguments, but takes just 2| used with too many \\(3\\) args| More than necessary 2 argument\\(s\\) in macro call" } */ /* 31.2: Too few arguments error. */ sub( x); /* { dg-error "requires 2 arguments, but only 1 given| used with just one arg| Less than necessary 2 argument\\(s\\) in macro call" } */ mcpp-2.7.2/cpp-test/test-t/n_ucn2.c0000644000175000017500000000103110216765467013722 00000000000000/* n_ucn2.c: Universal-character-name */ /* UCN in pp-number */ #define mkint( a) a ## 1\u5B57 int mkint( abc) = 0; /* int abc1\u5B57 = 0; */ /* { dg-do preprocess } { dg-options "-std=c99" } { dg-final { if ![file exist n_ucn2.i] { return } } } { dg-final { if \{ [grep n_ucn2.i "int *abc1\\\\u5\[Bb\]57 *= *0"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_ucn2.c: UCN in pp-number" } } */ mcpp-2.7.2/cpp-test/test-t/n_29.c0000644000175000017500000000105710216765467013315 00000000000000/* n_29.c: #undef directive. */ /* 29.1: Undefined macro is not a macro. */ /* DEFINED; */ #define DEFINED #undef DEFINED DEFINED; /* 29.2: Undefining undefined name is not an error. */ #undef UNDEFINED /* { dg-do preprocess } { dg-final { if ![file exist n_29.i] { return } } } { dg-final { if \{ [grep n_29.i "DEFINED"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_29.c: #undef" } } */ mcpp-2.7.2/cpp-test/test-t/e_14_3.c0000644000175000017500000000164410216765467013522 00000000000000/* e_14_3.c: Illegal #if expressions-3. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic-errors -w" } */ #define A 1 #define B 1 /* 14.3: Unterminated #if expression. */ #if 0 < /* { dg-error "no right operand| (parse|syntax) error| Unterminated expression" } */ #endif #if ( (A == B) /* { dg-error "missing '\\)' in expression| (parse|syntax) error| Missing \"\\)\"" } */ #endif /* 14.4: Unbalanced parenthesis in #if defined operator. */ #if defined ( MACRO /* { dg-error "missing '\\)' after \"defined\"| Bad defined syntax" } */ #endif /* 14.5: No argument. */ #if /* { dg-error "#if with no expression| (parse|syntax) error| No argument" } */ #endif /* 14.6: Macro expanding to 0 token in #if expression. */ #define ZERO_TOKEN #if ZERO_TOKEN /* { dg-error "#if with no expression| (parse|syntax) error| Unterminated expression" } */ #endif mcpp-2.7.2/cpp-test/test-t/u_1_25.c0000644000175000017500000000124210216765467013534 00000000000000/* u_1_25.c: Miscelaneous undefined macros. */ /* { dg-do preprocess } */ #define str( a) # a #define sub( x, y) (x - y) #define SUB sub /* u.1.25: Macro argument otherwise parsed as a directive. */ /* "#define NAME"; or other undefined behaviour. */ str( #define NAME /* { dg-error "directives may not be used \[a-z \]*\n\[\^ \]* unterminated| embedding a directive within macro arguments | directive-like line" "" { target *-*-* } 12 } */ ); #if 0 /* Added by C90: Corrigendum 1 (1994) and deleted by C99 */ /* u.1.26: Expanded macro replacement list end with name of function-like macro. */ SUB( a, b); #endif mcpp-2.7.2/cpp-test/test-t/u_1_17.c0000644000175000017500000000135110216765467013536 00000000000000/* u_1_17.c: Undefined behaviors on out-of-range #line number. */ /* { dg-do preprocess } */ /* u.1.17: Line number argument of #line directive should be in range of [1,32767]. */ #line 0 /* { dg-error "line number out of range| Line number \"0\" is out of range" } */ #line 32767 /* valid here */ /* line 32767 */ __LINE__; /* { dg-warning "line number out of range| got beyond range\n\[^ \]* warning: Line number" "" { target *-*-* } 0 } */ #line 13 /* Restore to correct line number */ /* u.1.18: Line number argument of #line directive should be written in decimal digits. */ #line 0x1000 /* { dg-error "not a decimal integer| invalid format | isn't a decimal digits sequence" } */ mcpp-2.7.2/cpp-test/test-t/n_6.c0000644000175000017500000000175110216765467013231 00000000000000/* n_6.c: #include directive. */ /* 6.1: Header-name quoted by " and " as well as by < and > can include standard headers. */ /* Note: Standard headers can be included any times. */ #include "ctype.h" #include /* 6.2: Macro is allowed in #include line. */ #define HEADER "header.h" /* Before file inclusion: #include "header.h" */ #include HEADER /* xyz */ MACRO_xyz /* 6.3: With macro nonsence but legal. */ #undef MACRO_zyx #define ZERO_TOKEN #include ZERO_TOKEN HEADER ZERO_TOKEN /* zyx */ MACRO_zyx /* { dg-do preprocess } { dg-options "-std=c89 -w" } { dg-final { if ![file exist n_6.i] { return } } } { dg-final { if \{ [grep n_6.i "xyz"] != "" \} \{ } } { dg-final { if \{ [grep n_6.i "zyx"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_6.c: #includes" } } */ mcpp-2.7.2/cpp-test/test-t/unbal6.h0000644000175000017500000000013510216765467013736 00000000000000/* unbal6.h */ #define UNBAL6( a, b) ((a) + (b)) UNBAL6 ( x , mcpp-2.7.2/cpp-test/test-t/n_26.c0000644000175000017500000000250410216765467013310 00000000000000/* n_26.c: The name once replaced is not furthur replaced. */ /* 26.1: Directly recursive object-like macro definition. */ /* Z(0); */ #define Z Z(0) Z; /* 26.2: Intermediately recursive object-like macro definition. */ /* AB; */ #define AB BA #define BA AB AB; /* 26.3: Directly recursive function-like macro definition. */ /* x + f(x); */ #define f(a) a + f(a) f( x); /* 26.4: Intermediately recursive function-like macro definition. */ /* x + x + g( x); */ #define g(a) a + h( a) #define h(a) a + g( a) g( x); /* 26.5: Rescanning encounters the non-replaced macro name. */ /* Z(0) + f( Z(0)); */ f( Z); /* { dg-do preprocess } { dg-final { if ![file exist n_26.i] { return } } } { dg-final { if \{ [grep n_26.i "Z\\(0\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_26.i "AB"] != "" \} \{ } } { dg-final { if \{ [grep n_26.i "x *\\+ f\\( *x *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_26.i "x *\\+ *x *\\+ *g\\( *x *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_26.i "Z\\(0\\) *\\+ f\\( *Z\\(0\\) *\\)"] != "" \} \{ } } { dg-final { return \} \} \} \} \} } } { dg-final { fail "n_26.c: recursive macro" } } */ mcpp-2.7.2/cpp-test/test-t/n_1_3_run.c0000644000175000017500000000142210216765467014325 00000000000000/* n_1_3_run.c: Trigraph-like sequences. */ #include #include int main( void) { /* 1.3: Any sequence other than the specified 9 sequences is not a trigraph.*/ char quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ', '?', '?', '%', ' ', '?', '?', '^', ' ', '?', '#', '\0' }; assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0); return 0; } /* { dg-do run } * { dg-options "-ansi -no-integrated-cpp" } */ /* * Note: It is troublesome and unreadable to write preprocessor output of * many '?' sequence for DajaGnu. So, we test this testcase by strcmp(). * Note: -no-integrated-cpp is necessary for MCPP on GCC 3. GCC 2, however, * does not recognize this option. Remove this option on GCC 2. */ mcpp-2.7.2/cpp-test/test-t/n_pragma.c0000644000175000017500000000234710216765467014335 00000000000000/* n_pragma.c: _Pragma() operator */ /* based on the proposal to C99 by Bill Homer */ #define Machine_B #include "pragmas.h" /* #pragma vfunction */ Fast_call void f(int n, double * a, double * b) { /* #pragma ivdep */ Independent while(n-- > 0) { *a++ += *b++; } } #define f(N, A, B) \ { int n = (N), double * a = (A), double * b = (B); \ Independent while(n-- > 0) { *a++ += *b++; } \ } #define EXPRAG(x) _Pragma(#x) #define PRAGMA(x) EXPRAG(x) #define LIBFUNC xyz int libfunc() { ... } /* Direct the linker to define alternate entry points for libfunc. */ /* #pragma duplicate libfunc as (lib_func,xyz) */ PRAGMA( duplicate libfunc as (lib_func,LIBFUNC) ) /* { dg-do preprocess } { dg-options "-std=c99" } { dg-final { if ![file exist n_pragma.i] { return } } } { dg-final { if \{ [grep n_pragma.i "#pragma ivdep"] != "" \} \{ } } { dg-final { if \{ [grep n_pragma.i "#pragma vfunction"] != "" \} \{ } } { dg-final { if \{ [grep n_pragma.i "#pragma duplicate libfunc as \\(lib_func,xyz\\)"] != "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_pragma.c: _Pragma operator" } } */ mcpp-2.7.2/cpp-test/test-t/n_24.c0000644000175000017500000000173310216765467013311 00000000000000/* n_24.c: # operator in macro definition / 1. */ #define str( a) # a /* 24.1: */ /* "a+b"; */ str( a+b); /* 24.2: White spaces between tokens of operand are converted to one space. */ /* "ab + cd"; */ str( ab /* comment */ + cd ); /* 24.5: Token separator inserted by macro expansion should be removed. (Meanwhile, tokens should not be merged. See 21.2.) */ #define xstr( a) str( a) #define f(a) a /* "x-y"; */ xstr( x-f(y)); /* { dg-do preprocess } { dg-final { if ![file exist n_24.i] { return } } } { dg-final { if \{ [grep n_24.i "\"a\\+b\""] != "" \} \{ } } { dg-final { if \{ [grep n_24.i "\"ab \\+ cd\""] != "" \} \{ } } { dg-final { if \{ [grep n_24.i "\"x-y\""] != "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_24.c: #operator" } } */ mcpp-2.7.2/cpp-test/test-t/n_13.c0000644000175000017500000000150010216765467013277 00000000000000/* n_13.c: Valid operators in #if expression. */ /* Valid operators are (precedence in this order) : defined, (unary)+, (unary)-, ~, !, *, /, %, +, -, <<, >>, <, >, <=, >=, ==, !=, &, ^, |, &&, ||, ? : */ /* 13.1: Bit shift. */ #if 1 << 2 != 4 || 8 >> 1 != 4 #error Bad arithmetic of <<, >> operators. #endif /* 13.2: Bitwise operators. */ #if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 #error Bad arithmetic of ^, |, & operators. #endif /* 13.3: Result of ||, && operators is either of 1 or 0. */ #if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 #error Bad arithmetic of ||, && operators. #endif /* 13.4: ?, : operator. */ #if (0 ? 1 : 2) != 2 #error Bad arithmetic of ?: operator. #endif /* { dg-do preprocess } */ mcpp-2.7.2/cpp-test/test-t/e_29_3.c0000644000175000017500000000111110216765467013515 00000000000000/* e_29_3.c: #undef errors. */ /* { dg-do preprocess } */ /* 29.3: Not an identifier. */ #undef "string" /* { dg-error "macro names must be identifiers| invalid macro name| Not an identifier" } */ #undef 123 /* { dg-error "macro names must be identifiers| invalid macro name| Not an identifier" } */ /* 29.4: Excessive token sequence. */ #undef MACRO_0 Junk /* { dg-error "extra tokens| garbage after| Excessive token sequence" } */ /* 29.5: No argument. */ #undef /* { dg-error "no macro name| invalid macro name| No identifier" } */ mcpp-2.7.2/cpp-test/test-t/n_ucn1.c0000644000175000017500000000232010216765467013723 00000000000000/* n_ucn1.c: Universal-character-name */ /* UCN in character constant */ #if '\u5B57' UCN-16bits is implemented #endif #if '\U00006F22' UCN-32bits is implemented #endif /* UCN in string literal */ "abc\u6F22\u5B57xyz"; /* i.e. "abcxyx"; */ /* UCN in identifier */ #define macro\u5B57 9 #define macro\U00006F22 99 macro\u5B57 /* 9 */ macro\U00006F22 = macro\U00006f22 /* 99 = 99 */ /* '6F22' and '6f22' have the same value */ /* { dg-do preprocess } { dg-options "-std=c99 -w" } { dg-final { if ![file exist n_ucn1.i] { return } } } { dg-final { if \{ [grep n_ucn1.i "UCN-16bits is implemented"] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1.i "UCN-32bits is implemented"] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1.i "\"abc\\\\u6\[Ff\]22\\\\u5\[Bb\]57xyz\""] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1.i "9"] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1.i "99 *= *99"] != "" \} \{ } } { dg-final { return \} \} \} \} \} } } { dg-final { fail "n_ucn1.c: UCN in tokens" } } */ mcpp-2.7.2/cpp-test/test-t/u_cplus.C0000644000175000017500000000037510216765467014162 00000000000000/* u_cplus.C: C++: #undef or #define __cplusplus causes undefined behavior. */ /* { dg-do preprocess } */ /* { dg-options "-std=c++98 -pedantic-errors" } */ #undef __cplusplus /* { dg-error "undefining | shouldn't be undefined" } */ mcpp-2.7.2/cpp-test/test-t/u_1_13.c0000644000175000017500000000045210216765467013533 00000000000000/* u_1_13.c: Undefined behaviors on undefined #include syntax or header- name. */ /* { dg-do preprocess } */ /* u.1.13: Excessive argument in #include directive. */ #include Junk /* { dg-error "extra tokens | `#include' expects | Excessive token sequence" } */ mcpp-2.7.2/cpp-test/test-t/n_13_8.c0000644000175000017500000000200510216765467013527 00000000000000/* n_13_8.t: Grouping of sub-expressions in #if expression. */ /* 13.8: Unary operators are grouped from right to left. */ #if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) #error Bad grouping of -, +, !, ~ in #if expression. #endif /* 13.9: ?: operators are grouped from right to left. */ #if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 #error Bad grouping of ? : in #if expression. #endif /* 13.10: Other operators are grouped from left to right. */ #if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) #error Bad grouping of >>, << in #if expression. #endif /* 13.11: Test of precedence. */ #if 3*10/2 >> !0*2 >> !+!-9 != 1 #error Bad grouping of -, +, !, *, /, >> in #if expression. #endif /* 13.12: Overall test. Grouped as: ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) ? 7 : 0) != 7 evaluated to FALSE. */ #if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 #error Bad arithmetic of #if expression. #endif /* { dg-do preprocess } */ mcpp-2.7.2/cpp-test/test-t/n_2.c0000644000175000017500000000253010216765467013221 00000000000000/* n_2.c: Line splicing by sequence. */ /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ /* ab + cd + ef; */ #define FUNC( a, b, c) \ a + b + c FUNC( ab, cd, ef); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ /* gh + ij + kl; */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c FUNC( gh, ij, kl); /* 2.3: In a string literal. */ /* "abcde" */ "abc\ de" /* 2.4: in midst of an identifier. */ /* abcde */ abc\ de /* 2.5: by trigraph. */ /* ghijk */ ghi??/ jk /* { dg-do preprocess } { dg-final { if ![file exist n_2.i] { return } } } { dg-final { if \{ [grep n_2.i "ab *\\+ *cd *\\+ *ef"] != "" \} \{ } } { dg-final { if \{ [grep n_2.i "gh *\\+ *ij *\\+ *kl"] != "" \} \{ } } { dg-final { if \{ [grep n_2.i "\"abcde\""] != "" \} \{ } } { dg-final { if \{ [grep n_2.i "abcde"] != "" \} \{ } } { dg-final { if \{ [grep n_2.i "ghijk"] != "" \} \{ } } { dg-final { return \} \} \} \} \} } } { dg-final { fail "n_2.c: deletion" } } */ mcpp-2.7.2/cpp-test/test-t/n_32.c0000644000175000017500000000057010216765467013306 00000000000000/* n_32.c: Escape sequence in character constant in #if expression. */ /* 32.1: Character octal escape sequence. */ #if '\123' != 83 #error Bad evaluation of octal escape sequence. #endif /* 32.2: Character hexadecimal escape sequence. */ #if '\x1b' != '\033' #error Bad evaluation of hexadecimal escape sequence. #endif /* { dg-do preprocess } */ mcpp-2.7.2/cpp-test/test-t/m4095.h0000644000175000017500000014010310216765467013325 00000000000000/* m4095.h */ #define AAA #define AAB #define AAC #define AAD #define AAE #define AAF #define AAG #define AAH #define AAI #define AAJ #define AAK #define AAL #define AAM #define AAN #define AAO #define AAP #define AAQ #define AAR #define AAS #define AAT #define AAU #define AAV #define AAW #define AAX #define AAY #define AAZ #define ABA #define ABB #define ABC #define ABD #define ABE #define ABF #define ABG #define ABH #define ABI #define ABJ #define ABK #define ABL #define ABM #define ABN #define ABO #define ABP #define ABQ #define ABR #define ABS #define ABT #define ABU #define ABV #define ABW #define ABX #define ABY #define ABZ #define ACA #define ACB #define ACC #define ACD #define ACE #define ACF #define ACG #define ACH #define ACI #define ACJ #define ACK #define ACL #define ACM #define ACN #define ACO #define ACP #define ACQ #define ACR #define ACS #define ACT #define ACU #define ACV #define ACW #define ACX #define ACY #define ACZ #define ADA #define ADB #define ADC #define ADD #define ADE #define ADF #define ADG #define ADH #define ADI #define ADJ #define ADK #define ADL #define ADM #define ADN #define ADO #define ADP #define ADQ #define ADR #define ADS #define ADT #define ADU #define ADV #define ADW #define ADX #define ADY #define ADZ #define AEA #define AEB #define AEC #define AED #define AEE #define AEF #define AEG #define AEH #define AEI #define AEJ #define AEK #define AEL #define AEM #define AEN #define AEO #define AEP #define AEQ #define AER #define AES #define AET #define AEU #define AEV #define AEW #define AEX #define AEY #define AEZ #define AFA #define AFB #define AFC #define AFD #define AFE #define AFF #define AFG #define AFH #define AFI #define AFJ #define AFK #define AFL #define AFM #define AFN #define AFO #define AFP #define AFQ #define AFR #define AFS #define AFT #define AFU #define AFV #define AFW #define AFX #define AFY #define AFZ #define AGA #define AGB #define AGC #define AGD #define AGE #define AGF #define AGG #define AGH #define AGI #define AGJ #define AGK #define AGL #define AGM #define AGN #define AGO #define AGP #define AGQ #define AGR #define AGS #define AGT #define AGU #define AGV #define AGW #define AGX #define AGY #define AGZ #define AHA #define AHB #define AHC #define AHD #define AHE #define AHF #define AHG #define AHH #define AHI #define AHJ #define AHK #define AHL #define AHM #define AHN #define AHO #define AHP #define AHQ #define AHR #define AHS #define AHT #define AHU #define AHV #define AHW #define AHX #define AHY #define AHZ #define AIA #define AIB #define AIC #define AID #define AIE #define AIF #define AIG #define AIH #define AII #define AIJ #define AIK #define AIL #define AIM #define AIN #define AIO #define AIP #define AIQ #define AIR #define AIS #define AIT #define AIU #define AIV #define AIW #define AIX #define AIY #define AIZ #define AJA #define AJB #define AJC #define AJD #define AJE #define AJF #define AJG #define AJH #define AJI #define AJJ #define AJK #define AJL #define AJM #define AJN #define AJO #define AJP #define AJQ #define AJR #define AJS #define AJT #define AJU #define AJV #define AJW #define AJX #define AJY #define AJZ #define AKA #define AKB #define AKC #define AKD #define AKE #define AKF #define AKG #define AKH #define AKI #define AKJ #define AKK #define AKL #define AKM #define AKN #define AKO #define AKP #define AKQ #define AKR #define AKS #define AKT #define AKU #define AKV #define AKW #define AKX #define AKY #define AKZ #define ALA #define ALB #define ALC #define ALD #define ALE #define ALF #define ALG #define ALH #define ALI #define ALJ #define ALK #define ALL #define ALM #define ALN #define ALO #define ALP #define ALQ #define ALR #define ALS #define ALT #define ALU #define ALV #define ALW #define ALX #define ALY #define ALZ #define AMA #define AMB #define AMC #define AMD #define AME #define AMF #define AMG #define AMH #define AMI #define AMJ #define AMK #define AML #define AMM #define AMN #define AMO #define AMP #define AMQ #define AMR #define AMS #define AMT #define AMU #define AMV #define AMW #define AMX #define AMY #define AMZ #define ANA #define ANB #define ANC #define AND #define ANE #define ANF #define ANG #define ANH #define ANI #define ANJ #define ANK #define ANL #define ANM #define ANN #define ANO #define ANP #define ANQ #define ANR #define ANS #define ANT #define ANU #define ANV #define ANW #define ANX #define ANY #define ANZ #define AOA #define AOB #define AOC #define AOD #define AOE #define AOF #define AOG #define AOH #define AOI #define AOJ #define AOK #define AOL #define AOM #define AON #define AOO #define AOP #define AOQ #define AOR #define AOS #define AOT #define AOU #define AOV #define AOW #define AOX #define AOY #define AOZ #define APA #define APB #define APC #define APD #define APE #define APF #define APG #define APH #define API #define APJ #define APK #define APL #define APM #define APN #define APO #define APP #define APQ #define APR #define APS #define APT #define APU #define APV #define APW #define APX #define APY #define APZ #define AQA #define AQB #define AQC #define AQD #define AQE #define AQF #define AQG #define AQH #define AQI #define AQJ #define AQK #define AQL #define AQM #define AQN #define AQO #define AQP #define AQQ #define AQR #define AQS #define AQT #define AQU #define AQV #define AQW #define AQX #define AQY #define AQZ #define ARA #define ARB #define ARC #define ARD #define ARE #define ARF #define ARG #define ARH #define ARI #define ARJ #define ARK #define ARL #define ARM #define ARN #define ARO #define ARP #define ARQ #define ARR #define ARS #define ART #define ARU #define ARV #define ARW #define ARX #define ARY #define ARZ #define ASA #define ASB #define ASC #define ASD #define ASE #define ASF #define ASG #define ASH #define ASI #define ASJ #define ASK #define ASL #define ASM #define ASN #define ASO #define ASP #define ASQ #define ASR #define ASS #define AST #define ASU #define ASV #define ASW #define ASX #define ASY #define ASZ #define ATA #define ATB #define ATC #define ATD #define ATE #define ATF #define ATG #define ATH #define ATI #define ATJ #define ATK #define ATL #define ATM #define ATN #define ATO #define ATP #define ATQ #define ATR #define ATS #define ATT #define ATU #define ATV #define ATW #define ATX #define ATY #define ATZ #define AUA #define AUB #define AUC #define AUD #define AUE #define AUF #define AUG #define AUH #define AUI #define AUJ #define AUK #define AUL #define AUM #define AUN #define AUO #define AUP #define AUQ #define AUR #define AUS #define AUT #define AUU #define AUV #define AUW #define AUX #define AUY #define AUZ #define AVA #define AVB #define AVC #define AVD #define AVE #define AVF #define AVG #define AVH #define AVI #define AVJ #define AVK #define AVL #define AVM #define AVN #define AVO #define AVP #define AVQ #define AVR #define AVS #define AVT #define AVU #define AVV #define AVW #define AVX #define AVY #define AVZ #define AWA #define AWB #define AWC #define AWD #define AWE #define AWF #define AWG #define AWH #define AWI #define AWJ #define AWK #define AWL #define AWM #define AWN #define AWO #define AWP #define AWQ #define AWR #define AWS #define AWT #define AWU #define AWV #define AWW #define AWX #define AWY #define AWZ #define AXA #define AXB #define AXC #define AXD #define AXE #define AXF #define AXG #define AXH #define AXI #define AXJ #define AXK #define AXL #define AXM #define AXN #define AXO #define AXP #define AXQ #define AXR #define AXS #define AXT #define AXU #define AXV #define AXW #define AXX #define AXY #define AXZ #define AYA #define AYB #define AYC #define AYD #define AYE #define AYF #define AYG #define AYH #define AYI #define AYJ #define AYK #define AYL #define AYM #define AYN #define AYO #define AYP #define AYQ #define AYR #define AYS #define AYT #define AYU #define AYV #define AYW #define AYX #define AYY #define AYZ #define AZA #define AZB #define AZC #define AZD #define AZE #define AZF #define AZG #define AZH #define AZI #define AZJ #define AZK #define AZL #define AZM #define AZN #define AZO #define AZP #define AZQ #define AZR #define AZS #define AZT #define AZU #define AZV #define AZW #define AZX #define AZY #define AZZ #define BAA #define BAB #define BAC #define BAD #define BAE #define BAF #define BAG #define BAH #define BAI #define BAJ #define BAK #define BAL #define BAM #define BAN #define BAO #define BAP #define BAQ #define BAR #define BAS #define BAT #define BAU #define BAV #define BAW #define BAX #define BAY #define BAZ #define BBA #define BBB #define BBC #define BBD #define BBE #define BBF #define BBG #define BBH #define BBI #define BBJ #define BBK #define BBL #define BBM #define BBN #define BBO #define BBP #define BBQ #define BBR #define BBS #define BBT #define BBU #define BBV #define BBW #define BBX #define BBY #define BBZ #define BCA #define BCB #define BCC #define BCD #define BCE #define BCF #define BCG #define BCH #define BCI #define BCJ #define BCK #define BCL #define BCM #define BCN #define BCO #define BCP #define BCQ #define BCR #define BCS #define BCT #define BCU #define BCV #define BCW #define BCX #define BCY #define BCZ #define BDA #define BDB #define BDC #define BDD #define BDE #define BDF #define BDG #define BDH #define BDI #define BDJ #define BDK #define BDL #define BDM #define BDN #define BDO #define BDP #define BDQ #define BDR #define BDS #define BDT #define BDU #define BDV #define BDW #define BDX #define BDY #define BDZ #define BEA #define BEB #define BEC #define BED #define BEE #define BEF #define BEG #define BEH #define BEI #define BEJ #define BEK #define BEL #define BEM #define BEN #define BEO #define BEP #define BEQ #define BER #define BES #define BET #define BEU #define BEV #define BEW #define BEX #define BEY #define BEZ #define BFA #define BFB #define BFC #define BFD #define BFE #define BFF #define BFG #define BFH #define BFI #define BFJ #define BFK #define BFL #define BFM #define BFN #define BFO #define BFP #define BFQ #define BFR #define BFS #define BFT #define BFU #define BFV #define BFW #define BFX #define BFY #define BFZ #define BGA #define BGB #define BGC #define BGD #define BGE #define BGF #define BGG #define BGH #define BGI #define BGJ #define BGK #define BGL #define BGM #define BGN #define BGO #define BGP #define BGQ #define BGR #define BGS #define BGT #define BGU #define BGV #define BGW #define BGX #define BGY #define BGZ #define BHA #define BHB #define BHC #define BHD #define BHE #define BHF #define BHG #define BHH #define BHI #define BHJ #define BHK #define BHL #define BHM #define BHN #define BHO #define BHP #define BHQ #define BHR #define BHS #define BHT #define BHU #define BHV #define BHW #define BHX #define BHY #define BHZ #define BIA #define BIB #define BIC #define BID #define BIE #define BIF #define BIG #define BIH #define BII #define BIJ #define BIK #define BIL #define BIM #define BIN #define BIO #define BIP #define BIQ #define BIR #define BIS #define BIT #define BIU #define BIV #define BIW #define BIX #define BIY #define BIZ #define BJA #define BJB #define BJC #define BJD #define BJE #define BJF #define BJG #define BJH #define BJI #define BJJ #define BJK #define BJL #define BJM #define BJN #define BJO #define BJP #define BJQ #define BJR #define BJS #define BJT #define BJU #define BJV #define BJW #define BJX #define BJY #define BJZ #define BKA #define BKB #define BKC #define BKD #define BKE #define BKF #define BKG #define BKH #define BKI #define BKJ #define BKK #define BKL #define BKM #define BKN #define BKO #define BKP #define BKQ #define BKR #define BKS #define BKT #define BKU #define BKV #define BKW #define BKX #define BKY #define BKZ #define BLA #define BLB #define BLC #define BLD #define BLE #define BLF #define BLG #define BLH #define BLI #define BLJ #define BLK #define BLL #define BLM #define BLN #define BLO #define BLP #define BLQ #define BLR #define BLS #define BLT #define BLU #define BLV #define BLW #define BLX #define BLY #define BLZ #define BMA #define BMB #define BMC #define BMD #define BME #define BMF #define BMG #define BMH #define BMI #define BMJ #define BMK #define BML #define BMM #define BMN #define BMO #define BMP #define BMQ #define BMR #define BMS #define BMT #define BMU #define BMV #define BMW #define BMX #define BMY #define BMZ #define BNA #define BNB #define BNC #define BND #define BNE #define BNF #define BNG #define BNH #define BNI #define BNJ 0x0400 #ifndef X0400 #define BNK #define BNL #define BNM #define BNN #define BNO #define BNP #define BNQ #define BNR #define BNS #define BNT #define BNU #define BNV #define BNW #define BNX #define BNY #define BNZ #define BOA #define BOB #define BOC #define BOD #define BOE #define BOF #define BOG #define BOH #define BOI #define BOJ #define BOK #define BOL #define BOM #define BON #define BOO #define BOP #define BOQ #define BOR #define BOS #define BOT #define BOU #define BOV #define BOW #define BOX #define BOY #define BOZ #define BPA #define BPB #define BPC #define BPD #define BPE #define BPF #define BPG #define BPH #define BPI #define BPJ #define BPK #define BPL #define BPM #define BPN #define BPO #define BPP #define BPQ #define BPR #define BPS #define BPT #define BPU #define BPV #define BPW #define BPX #define BPY #define BPZ #define BQA #define BQB #define BQC #define BQD #define BQE #define BQF #define BQG #define BQH #define BQI #define BQJ #define BQK #define BQL #define BQM #define BQN #define BQO #define BQP #define BQQ #define BQR #define BQS #define BQT #define BQU #define BQV #define BQW #define BQX #define BQY #define BQZ #define BRA #define BRB #define BRC #define BRD #define BRE #define BRF #define BRG #define BRH #define BRI #define BRJ #define BRK #define BRL #define BRM #define BRN #define BRO #define BRP #define BRQ #define BRR #define BRS #define BRT #define BRU #define BRV #define BRW #define BRX #define BRY #define BRZ #define BSA #define BSB #define BSC #define BSD #define BSE #define BSF #define BSG #define BSH #define BSI #define BSJ #define BSK #define BSL #define BSM #define BSN #define BSO #define BSP #define BSQ #define BSR #define BSS #define BST #define BSU #define BSV #define BSW #define BSX #define BSY #define BSZ #define BTA #define BTB #define BTC #define BTD #define BTE #define BTF #define BTG #define BTH #define BTI #define BTJ #define BTK #define BTL #define BTM #define BTN #define BTO #define BTP #define BTQ #define BTR #define BTS #define BTT #define BTU #define BTV #define BTW #define BTX #define BTY #define BTZ #define BUA #define BUB #define BUC #define BUD #define BUE #define BUF #define BUG #define BUH #define BUI #define BUJ #define BUK #define BUL #define BUM #define BUN #define BUO #define BUP #define BUQ #define BUR #define BUS #define BUT #define BUU #define BUV #define BUW #define BUX #define BUY #define BUZ #define BVA #define BVB #define BVC #define BVD #define BVE #define BVF #define BVG #define BVH #define BVI #define BVJ #define BVK #define BVL #define BVM #define BVN #define BVO #define BVP #define BVQ #define BVR #define BVS #define BVT #define BVU #define BVV #define BVW #define BVX #define BVY #define BVZ #define BWA #define BWB #define BWC #define BWD #define BWE #define BWF #define BWG #define BWH #define BWI #define BWJ #define BWK #define BWL #define BWM #define BWN #define BWO #define BWP #define BWQ #define BWR #define BWS #define BWT #define BWU #define BWV #define BWW #define BWX #define BWY #define BWZ #define BXA #define BXB #define BXC #define BXD #define BXE #define BXF #define BXG #define BXH #define BXI #define BXJ #define BXK #define BXL #define BXM #define BXN #define BXO #define BXP #define BXQ #define BXR #define BXS #define BXT #define BXU #define BXV #define BXW #define BXX #define BXY #define BXZ #define BYA #define BYB #define BYC #define BYD #define BYE #define BYF #define BYG #define BYH #define BYI #define BYJ #define BYK #define BYL #define BYM #define BYN #define BYO #define BYP #define BYQ #define BYR #define BYS #define BYT #define BYU #define BYV #define BYW #define BYX #define BYY #define BYZ #define BZA #define BZB #define BZC #define BZD #define BZE #define BZF #define BZG #define BZH #define BZI #define BZJ #define BZK #define BZL #define BZM #define BZN #define BZO #define BZP #define BZQ #define BZR #define BZS #define BZT #define BZU #define BZV #define BZW #define BZX #define BZY #define BZZ #define CAA #define CAB #define CAC #define CAD #define CAE #define CAF #define CAG #define CAH #define CAI #define CAJ #define CAK #define CAL #define CAM #define CAN #define CAO #define CAP #define CAQ #define CAR #define CAS #define CAT #define CAU #define CAV #define CAW #define CAX #define CAY #define CAZ #define CBA #define CBB #define CBC #define CBD #define CBE #define CBF #define CBG #define CBH #define CBI #define CBJ #define CBK #define CBL #define CBM #define CBN #define CBO #define CBP #define CBQ #define CBR #define CBS #define CBT #define CBU #define CBV #define CBW #define CBX #define CBY #define CBZ #define CCA #define CCB #define CCC #define CCD #define CCE #define CCF #define CCG #define CCH #define CCI #define CCJ #define CCK #define CCL #define CCM #define CCN #define CCO #define CCP #define CCQ #define CCR #define CCS #define CCT #define CCU #define CCV #define CCW #define CCX #define CCY #define CCZ #define CDA #define CDB #define CDC #define CDD #define CDE #define CDF #define CDG #define CDH #define CDI #define CDJ #define CDK #define CDL #define CDM #define CDN #define CDO #define CDP #define CDQ #define CDR #define CDS #define CDT #define CDU #define CDV #define CDW #define CDX #define CDY #define CDZ #define CEA #define CEB #define CEC #define CED #define CEE #define CEF #define CEG #define CEH #define CEI #define CEJ #define CEK #define CEL #define CEM #define CEN #define CEO #define CEP #define CEQ #define CER #define CES #define CET #define CEU #define CEV #define CEW #define CEX #define CEY #define CEZ #define CFA #define CFB #define CFC #define CFD #define CFE #define CFF #define CFG #define CFH #define CFI #define CFJ #define CFK #define CFL #define CFM #define CFN #define CFO #define CFP #define CFQ #define CFR #define CFS #define CFT #define CFU #define CFV #define CFW #define CFX #define CFY #define CFZ #define CGA #define CGB #define CGC #define CGD #define CGE #define CGF #define CGG #define CGH #define CGI #define CGJ #define CGK #define CGL #define CGM #define CGN #define CGO #define CGP #define CGQ #define CGR #define CGS #define CGT #define CGU #define CGV #define CGW #define CGX #define CGY #define CGZ #define CHA #define CHB #define CHC #define CHD #define CHE #define CHF #define CHG #define CHH #define CHI #define CHJ #define CHK #define CHL #define CHM #define CHN #define CHO #define CHP #define CHQ #define CHR #define CHS #define CHT #define CHU #define CHV #define CHW #define CHX #define CHY #define CHZ #define CIA #define CIB #define CIC #define CID #define CIE #define CIF #define CIG #define CIH #define CII #define CIJ #define CIK #define CIL #define CIM #define CIN #define CIO #define CIP #define CIQ #define CIR #define CIS #define CIT #define CIU #define CIV #define CIW #define CIX #define CIY #define CIZ #define CJA #define CJB #define CJC #define CJD #define CJE #define CJF #define CJG #define CJH #define CJI #define CJJ #define CJK #define CJL #define CJM #define CJN #define CJO #define CJP #define CJQ #define CJR #define CJS #define CJT #define CJU #define CJV #define CJW #define CJX #define CJY #define CJZ #define CKA #define CKB #define CKC #define CKD #define CKE #define CKF #define CKG #define CKH #define CKI #define CKJ #define CKK #define CKL #define CKM #define CKN #define CKO #define CKP #define CKQ #define CKR #define CKS #define CKT #define CKU #define CKV #define CKW #define CKX #define CKY #define CKZ #define CLA #define CLB #define CLC #define CLD #define CLE #define CLF #define CLG #define CLH #define CLI #define CLJ #define CLK #define CLL #define CLM #define CLN #define CLO #define CLP #define CLQ #define CLR #define CLS #define CLT #define CLU #define CLV #define CLW #define CLX #define CLY #define CLZ #define CMA #define CMB #define CMC #define CMD #define CME #define CMF #define CMG #define CMH #define CMI #define CMJ #define CMK #define CML #define CMM #define CMN #define CMO #define CMP #define CMQ #define CMR #define CMS #define CMT #define CMU #define CMV #define CMW #define CMX #define CMY #define CMZ #define CNA #define CNB #define CNC #define CND #define CNE #define CNF #define CNG #define CNH #define CNI #define CNJ #define CNK #define CNL #define CNM #define CNN #define CNO #define CNP #define CNQ #define CNR #define CNS #define CNT #define CNU #define CNV #define CNW #define CNX #define CNY #define CNZ #define COA #define COB #define COC #define COD #define COE #define COF #define COG #define COH #define COI #define COJ #define COK #define COL #define COM #define CON #define COO #define COP #define COQ #define COR #define COS #define COT #define COU #define COV #define COW #define COX #define COY #define COZ #define CPA #define CPB #define CPC #define CPD #define CPE #define CPF #define CPG #define CPH #define CPI #define CPJ #define CPK #define CPL #define CPM #define CPN #define CPO #define CPP #define CPQ #define CPR #define CPS #define CPT #define CPU #define CPV #define CPW #define CPX #define CPY #define CPZ #define CQA #define CQB #define CQC #define CQD #define CQE #define CQF #define CQG #define CQH #define CQI #define CQJ #define CQK #define CQL #define CQM #define CQN #define CQO #define CQP #define CQQ #define CQR #define CQS #define CQT #define CQU #define CQV #define CQW #define CQX #define CQY #define CQZ #define CRA #define CRB #define CRC #define CRD #define CRE #define CRF #define CRG #define CRH #define CRI #define CRJ #define CRK #define CRL #define CRM #define CRN #define CRO #define CRP #define CRQ #define CRR #define CRS #define CRT #define CRU #define CRV #define CRW #define CRX #define CRY #define CRZ #define CSA #define CSB #define CSC #define CSD #define CSE #define CSF #define CSG #define CSH #define CSI #define CSJ #define CSK #define CSL #define CSM #define CSN #define CSO #define CSP #define CSQ #define CSR #define CSS #define CST #define CSU #define CSV #define CSW #define CSX #define CSY #define CSZ #define CTA #define CTB #define CTC #define CTD #define CTE #define CTF #define CTG #define CTH #define CTI #define CTJ #define CTK #define CTL #define CTM #define CTN #define CTO #define CTP #define CTQ #define CTR #define CTS #define CTT #define CTU #define CTV #define CTW #define CTX #define CTY #define CTZ #define CUA #define CUB #define CUC #define CUD #define CUE #define CUF #define CUG #define CUH #define CUI #define CUJ #define CUK #define CUL #define CUM #define CUN #define CUO #define CUP #define CUQ #define CUR #define CUS #define CUT #define CUU #define CUV #define CUW #define CUX #define CUY #define CUZ #define CVA #define CVB #define CVC #define CVD #define CVE #define CVF #define CVG #define CVH #define CVI #define CVJ #define CVK #define CVL #define CVM #define CVN #define CVO #define CVP #define CVQ #define CVR #define CVS #define CVT #define CVU #define CVV #define CVW #define CVX #define CVY #define CVZ #define CWA #define CWB #define CWC #define CWD #define CWE #define CWF #define CWG #define CWH #define CWI #define CWJ #define CWK #define CWL #define CWM #define CWN #define CWO #define CWP #define CWQ #define CWR #define CWS #define CWT #define CWU #define CWV #define CWW #define CWX #define CWY #define CWZ #define CXA #define CXB #define CXC #define CXD #define CXE #define CXF #define CXG #define CXH #define CXI #define CXJ #define CXK #define CXL #define CXM #define CXN #define CXO #define CXP #define CXQ #define CXR #define CXS #define CXT #define CXU #define CXV #define CXW #define CXX #define CXY #define CXZ #define CYA #define CYB #define CYC #define CYD #define CYE #define CYF #define CYG #define CYH #define CYI #define CYJ #define CYK #define CYL #define CYM #define CYN #define CYO #define CYP #define CYQ #define CYR #define CYS #define CYT #define CYU #define CYV #define CYW #define CYX #define CYY #define CYZ #define CZA #define CZB #define CZC #define CZD #define CZE #define CZF #define CZG #define CZH #define CZI #define CZJ #define CZK #define CZL #define CZM #define CZN #define CZO #define CZP #define CZQ #define CZR #define CZS #define CZT #define CZU #define CZV #define CZW #define CZX #define CZY #define CZZ #define DAA #define DAB #define DAC #define DAD #define DAE #define DAF #define DAG #define DAH #define DAI #define DAJ #define DAK #define DAL #define DAM #define DAN #define DAO #define DAP #define DAQ #define DAR #define DAS 0x07ff #ifndef X07FF #define DAT #define DAU #define DAV #define DAW #define DAX #define DAY #define DAZ #define DBA #define DBB #define DBC #define DBD #define DBE #define DBF #define DBG #define DBH #define DBI #define DBJ #define DBK #define DBL #define DBM #define DBN #define DBO #define DBP #define DBQ #define DBR #define DBS #define DBT #define DBU #define DBV #define DBW #define DBX #define DBY #define DBZ #define DCA #define DCB #define DCC #define DCD #define DCE #define DCF #define DCG #define DCH #define DCI #define DCJ #define DCK #define DCL #define DCM #define DCN #define DCO #define DCP #define DCQ #define DCR #define DCS #define DCT #define DCU #define DCV #define DCW #define DCX #define DCY #define DCZ #define DDA #define DDB #define DDC #define DDD #define DDE #define DDF #define DDG #define DDH #define DDI #define DDJ #define DDK #define DDL #define DDM #define DDN #define DDO #define DDP #define DDQ #define DDR #define DDS #define DDT #define DDU #define DDV #define DDW #define DDX #define DDY #define DDZ #define DEA #define DEB #define DEC #define DED #define DEE #define DEF #define DEG #define DEH #define DEI #define DEJ #define DEK #define DEL #define DEM #define DEN #define DEO #define DEP #define DEQ #define DER #define DES #define DET #define DEU #define DEV #define DEW #define DEX #define DEY #define DEZ #define DFA #define DFB #define DFC #define DFD #define DFE #define DFF #define DFG #define DFH #define DFI #define DFJ #define DFK #define DFL #define DFM #define DFN #define DFO #define DFP #define DFQ #define DFR #define DFS #define DFT #define DFU #define DFV #define DFW #define DFX #define DFY #define DFZ #define DGA #define DGB #define DGC #define DGD #define DGE #define DGF #define DGG #define DGH #define DGI #define DGJ #define DGK #define DGL #define DGM #define DGN #define DGO #define DGP #define DGQ #define DGR #define DGS #define DGT #define DGU #define DGV #define DGW #define DGX #define DGY #define DGZ #define DHA #define DHB #define DHC #define DHD #define DHE #define DHF #define DHG #define DHH #define DHI #define DHJ #define DHK #define DHL #define DHM #define DHN #define DHO #define DHP #define DHQ #define DHR #define DHS #define DHT #define DHU #define DHV #define DHW #define DHX #define DHY #define DHZ #define DIA #define DIB #define DIC #define DID #define DIE #define DIF #define DIG #define DIH #define DII #define DIJ #define DIK #define DIL #define DIM #define DIN #define DIO #define DIP #define DIQ #define DIR #define DIS #define DIT #define DIU #define DIV #define DIW #define DIX #define DIY #define DIZ #define DJA #define DJB #define DJC #define DJD #define DJE #define DJF #define DJG #define DJH #define DJI #define DJJ #define DJK #define DJL #define DJM #define DJN #define DJO #define DJP #define DJQ #define DJR #define DJS #define DJT #define DJU #define DJV #define DJW #define DJX #define DJY #define DJZ #define DKA #define DKB #define DKC #define DKD #define DKE #define DKF #define DKG #define DKH #define DKI #define DKJ #define DKK #define DKL #define DKM #define DKN #define DKO #define DKP #define DKQ #define DKR #define DKS #define DKT #define DKU #define DKV #define DKW #define DKX #define DKY #define DKZ #define DLA #define DLB #define DLC #define DLD #define DLE #define DLF #define DLG #define DLH #define DLI #define DLJ #define DLK #define DLL #define DLM #define DLN #define DLO #define DLP #define DLQ #define DLR #define DLS #define DLT #define DLU #define DLV #define DLW #define DLX #define DLY #define DLZ #define DMA #define DMB #define DMC #define DMD #define DME #define DMF #define DMG #define DMH #define DMI #define DMJ #define DMK #define DML #define DMM #define DMN #define DMO #define DMP #define DMQ #define DMR #define DMS #define DMT #define DMU #define DMV #define DMW #define DMX #define DMY #define DMZ #define DNA #define DNB #define DNC #define DND #define DNE #define DNF #define DNG #define DNH #define DNI #define DNJ #define DNK #define DNL #define DNM #define DNN #define DNO #define DNP #define DNQ #define DNR #define DNS #define DNT #define DNU #define DNV #define DNW #define DNX #define DNY #define DNZ #define DOA #define DOB #define DOC #define DOD #define DOE #define DOF #define DOG #define DOH #define DOI #define DOJ #define DOK #define DOL #define DOM #define DON #define DOO #define DOP #define DOQ #define DOR #define DOS #define DOT #define DOU #define DOV #define DOW #define DOX #define DOY #define DOZ #define DPA #define DPB #define DPC #define DPD #define DPE #define DPF #define DPG #define DPH #define DPI #define DPJ #define DPK #define DPL #define DPM #define DPN #define DPO #define DPP #define DPQ #define DPR #define DPS #define DPT #define DPU #define DPV #define DPW #define DPX #define DPY #define DPZ #define DQA #define DQB #define DQC #define DQD #define DQE #define DQF #define DQG #define DQH #define DQI #define DQJ #define DQK #define DQL #define DQM #define DQN #define DQO #define DQP #define DQQ #define DQR #define DQS #define DQT #define DQU #define DQV #define DQW #define DQX #define DQY #define DQZ #define DRA #define DRB #define DRC #define DRD #define DRE #define DRF #define DRG #define DRH #define DRI #define DRJ #define DRK #define DRL #define DRM #define DRN #define DRO #define DRP #define DRQ #define DRR #define DRS #define DRT #define DRU #define DRV #define DRW #define DRX #define DRY #define DRZ #define DSA #define DSB #define DSC #define DSD #define DSE #define DSF #define DSG #define DSH #define DSI #define DSJ #define DSK #define DSL #define DSM #define DSN #define DSO #define DSP #define DSQ #define DSR #define DSS #define DST #define DSU #define DSV #define DSW #define DSX #define DSY #define DSZ #define DTA #define DTB #define DTC #define DTD #define DTE #define DTF #define DTG #define DTH #define DTI #define DTJ #define DTK #define DTL #define DTM #define DTN #define DTO #define DTP #define DTQ #define DTR #define DTS #define DTT #define DTU #define DTV #define DTW #define DTX #define DTY #define DTZ #define DUA #define DUB #define DUC #define DUD #define DUE #define DUF #define DUG #define DUH #define DUI #define DUJ #define DUK #define DUL #define DUM #define DUN #define DUO #define DUP #define DUQ #define DUR #define DUS #define DUT #define DUU #define DUV #define DUW #define DUX #define DUY #define DUZ #define DVA #define DVB #define DVC #define DVD #define DVE #define DVF #define DVG #define DVH #define DVI #define DVJ #define DVK #define DVL #define DVM #define DVN #define DVO #define DVP #define DVQ #define DVR #define DVS #define DVT #define DVU #define DVV #define DVW #define DVX #define DVY #define DVZ #define DWA #define DWB #define DWC #define DWD #define DWE #define DWF #define DWG #define DWH #define DWI #define DWJ #define DWK #define DWL #define DWM #define DWN #define DWO #define DWP #define DWQ #define DWR #define DWS #define DWT #define DWU #define DWV #define DWW #define DWX #define DWY #define DWZ #define DXA #define DXB #define DXC #define DXD #define DXE #define DXF #define DXG #define DXH #define DXI #define DXJ #define DXK #define DXL #define DXM #define DXN #define DXO #define DXP #define DXQ #define DXR #define DXS #define DXT #define DXU #define DXV #define DXW #define DXX #define DXY #define DXZ #define DYA #define DYB #define DYC #define DYD #define DYE #define DYF #define DYG #define DYH #define DYI #define DYJ #define DYK #define DYL #define DYM #define DYN #define DYO #define DYP #define DYQ #define DYR #define DYS #define DYT #define DYU #define DYV #define DYW #define DYX #define DYY #define DYZ #define DZA #define DZB #define DZC #define DZD #define DZE #define DZF #define DZG #define DZH #define DZI #define DZJ #define DZK #define DZL #define DZM #define DZN #define DZO #define DZP #define DZQ #define DZR #define DZS #define DZT #define DZU #define DZV #define DZW #define DZX #define DZY #define DZZ #define EAA #define EAB #define EAC #define EAD #define EAE #define EAF #define EAG #define EAH #define EAI #define EAJ #define EAK #define EAL #define EAM #define EAN #define EAO #define EAP #define EAQ #define EAR #define EAS #define EAT #define EAU #define EAV #define EAW #define EAX #define EAY #define EAZ #define EBA #define EBB #define EBC #define EBD #define EBE #define EBF #define EBG #define EBH #define EBI #define EBJ #define EBK #define EBL #define EBM #define EBN #define EBO #define EBP #define EBQ #define EBR #define EBS #define EBT #define EBU #define EBV #define EBW #define EBX #define EBY #define EBZ #define ECA #define ECB #define ECC #define ECD #define ECE #define ECF #define ECG #define ECH #define ECI #define ECJ #define ECK #define ECL #define ECM #define ECN #define ECO #define ECP #define ECQ #define ECR #define ECS #define ECT #define ECU #define ECV #define ECW #define ECX #define ECY #define ECZ #define EDA #define EDB #define EDC #define EDD #define EDE #define EDF #define EDG #define EDH #define EDI #define EDJ #define EDK #define EDL #define EDM #define EDN #define EDO #define EDP #define EDQ #define EDR #define EDS #define EDT #define EDU #define EDV #define EDW #define EDX #define EDY #define EDZ #define EEA #define EEB #define EEC #define EED #define EEE #define EEF #define EEG #define EEH #define EEI #define EEJ #define EEK #define EEL #define EEM #define EEN #define EEO #define EEP #define EEQ #define EER #define EES #define EET #define EEU #define EEV #define EEW #define EEX #define EEY #define EEZ #define EFA #define EFB #define EFC #define EFD #define EFE #define EFF #define EFG #define EFH #define EFI #define EFJ #define EFK #define EFL #define EFM #define EFN #define EFO #define EFP #define EFQ #define EFR #define EFS #define EFT #define EFU #define EFV #define EFW #define EFX #define EFY #define EFZ #define EGA #define EGB #define EGC #define EGD #define EGE #define EGF #define EGG #define EGH #define EGI #define EGJ #define EGK #define EGL #define EGM #define EGN #define EGO #define EGP #define EGQ #define EGR #define EGS #define EGT #define EGU #define EGV #define EGW #define EGX #define EGY #define EGZ #define EHA #define EHB #define EHC #define EHD #define EHE #define EHF #define EHG #define EHH #define EHI #define EHJ #define EHK #define EHL #define EHM #define EHN #define EHO #define EHP #define EHQ #define EHR #define EHS #define EHT #define EHU #define EHV #define EHW #define EHX #define EHY #define EHZ #define EIA #define EIB #define EIC #define EID #define EIE #define EIF #define EIG #define EIH #define EII #define EIJ #define EIK #define EIL #define EIM #define EIN #define EIO #define EIP #define EIQ #define EIR #define EIS #define EIT #define EIU #define EIV #define EIW #define EIX #define EIY #define EIZ #define EJA #define EJB #define EJC #define EJD #define EJE #define EJF #define EJG #define EJH #define EJI #define EJJ #define EJK #define EJL #define EJM #define EJN #define EJO #define EJP #define EJQ #define EJR #define EJS #define EJT #define EJU #define EJV #define EJW #define EJX #define EJY #define EJZ #define EKA #define EKB #define EKC #define EKD #define EKE #define EKF #define EKG #define EKH #define EKI #define EKJ #define EKK #define EKL #define EKM #define EKN #define EKO #define EKP #define EKQ #define EKR #define EKS #define EKT #define EKU #define EKV #define EKW #define EKX #define EKY #define EKZ #define ELA #define ELB #define ELC #define ELD #define ELE #define ELF #define ELG #define ELH #define ELI #define ELJ #define ELK #define ELL #define ELM #define ELN #define ELO #define ELP #define ELQ #define ELR #define ELS #define ELT #define ELU #define ELV #define ELW #define ELX #define ELY #define ELZ #define EMA #define EMB #define EMC #define EMD #define EME #define EMF #define EMG #define EMH #define EMI #define EMJ #define EMK #define EML #define EMM #define EMN #define EMO #define EMP #define EMQ #define EMR #define EMS #define EMT #define EMU #define EMV #define EMW #define EMX #define EMY #define EMZ #define ENA #define ENB #define ENC #define END #define ENE #define ENF #define ENG #define ENH #define ENI #define ENJ #define ENK #define ENL #define ENM #define ENN #define ENO #define ENP #define ENQ #define ENR #define ENS #define ENT #define ENU #define ENV #define ENW #define ENX #define ENY #define ENZ #define EOA #define EOB #define EOC #define EOD #define EOE #define EOF #define EOG #define EOH #define EOI #define EOJ #define EOK #define EOL #define EOM #define EON #define EOO #define EOP #define EOQ #define EOR #define EOS #define EOT #define EOU #define EOV #define EOW #define EOX #define EOY #define EOZ #define EPA #define EPB #define EPC #define EPD #define EPE #define EPF #define EPG #define EPH #define EPI #define EPJ #define EPK #define EPL #define EPM #define EPN #define EPO #define EPP #define EPQ #define EPR #define EPS #define EPT #define EPU #define EPV #define EPW #define EPX #define EPY #define EPZ #define EQA #define EQB #define EQC #define EQD #define EQE #define EQF #define EQG #define EQH #define EQI #define EQJ #define EQK #define EQL #define EQM #define EQN #define EQO #define EQP #define EQQ #define EQR #define EQS #define EQT #define EQU #define EQV #define EQW #define EQX #define EQY #define EQZ #define ERA #define ERB #define ERC #define ERD #define ERE #define ERF #define ERG #define ERH #define ERI #define ERJ #define ERK #define ERL #define ERM #define ERN #define ERO #define ERP #define ERQ #define ERR #define ERS #define ERT #define ERU #define ERV #define ERW #define ERX #define ERY #define ERZ #define ESA #define ESB #define ESC #define ESD #define ESE #define ESF #define ESG #define ESH #define ESI #define ESJ #define ESK #define ESL #define ESM #define ESN #define ESO #define ESP #define ESQ #define ESR #define ESS #define EST #define ESU #define ESV #define ESW #define ESX #define ESY #define ESZ #define ETA #define ETB #define ETC #define ETD #define ETE #define ETF #define ETG #define ETH #define ETI #define ETJ #define ETK #define ETL #define ETM #define ETN #define ETO #define ETP #define ETQ #define ETR #define ETS #define ETT #define ETU #define ETV #define ETW #define ETX #define ETY #define ETZ #define EUA #define EUB #define EUC #define EUD #define EUE #define EUF #define EUG #define EUH #define EUI #define EUJ #define EUK #define EUL #define EUM #define EUN #define EUO #define EUP #define EUQ #define EUR #define EUS #define EUT #define EUU #define EUV #define EUW #define EUX #define EUY #define EUZ #define EVA #define EVB #define EVC #define EVD #define EVE #define EVF #define EVG #define EVH #define EVI #define EVJ #define EVK #define EVL #define EVM #define EVN #define EVO #define EVP #define EVQ #define EVR #define EVS #define EVT #define EVU #define EVV #define EVW #define EVX #define EVY #define EVZ #define EWA #define EWB #define EWC #define EWD #define EWE #define EWF #define EWG #define EWH #define EWI #define EWJ #define EWK #define EWL #define EWM #define EWN #define EWO #define EWP #define EWQ #define EWR #define EWS #define EWT #define EWU #define EWV #define EWW #define EWX #define EWY #define EWZ #define EXA #define EXB #define EXC #define EXD #define EXE #define EXF #define EXG #define EXH #define EXI #define EXJ #define EXK #define EXL #define EXM #define EXN #define EXO #define EXP #define EXQ #define EXR #define EXS #define EXT #define EXU #define EXV #define EXW #define EXX #define EXY #define EXZ #define EYA #define EYB #define EYC #define EYD #define EYE #define EYF #define EYG #define EYH #define EYI #define EYJ #define EYK #define EYL #define EYM #define EYN #define EYO #define EYP #define EYQ #define EYR #define EYS #define EYT #define EYU #define EYV #define EYW #define EYX #define EYY #define EYZ #define EZA #define EZB #define EZC #define EZD #define EZE #define EZF #define EZG #define EZH #define EZI #define EZJ #define EZK #define EZL #define EZM #define EZN #define EZO #define EZP #define EZQ #define EZR #define EZS #define EZT #define EZU #define EZV #define EZW #define EZX #define EZY #define EZZ #define FAA #define FAB #define FAC #define FAD #define FAE #define FAF #define FAG #define FAH #define FAI #define FAJ #define FAK #define FAL #define FAM #define FAN #define FAO #define FAP #define FAQ #define FAR #define FAS #define FAT #define FAU #define FAV #define FAW #define FAX #define FAY #define FAZ #define FBA #define FBB #define FBC #define FBD #define FBE #define FBF #define FBG #define FBH #define FBI #define FBJ #define FBK #define FBL #define FBM #define FBN #define FBO #define FBP #define FBQ #define FBR #define FBS #define FBT #define FBU #define FBV #define FBW #define FBX #define FBY #define FBZ #define FCA #define FCB #define FCC #define FCD #define FCE #define FCF #define FCG #define FCH #define FCI #define FCJ #define FCK #define FCL #define FCM #define FCN #define FCO #define FCP #define FCQ #define FCR #define FCS #define FCT #define FCU #define FCV #define FCW #define FCX #define FCY #define FCZ #define FDA #define FDB #define FDC #define FDD #define FDE #define FDF #define FDG #define FDH #define FDI #define FDJ #define FDK #define FDL #define FDM #define FDN #define FDO #define FDP #define FDQ #define FDR #define FDS #define FDT #define FDU #define FDV #define FDW #define FDX #define FDY #define FDZ #define FEA #define FEB #define FEC #define FED #define FEE #define FEF #define FEG #define FEH #define FEI #define FEJ #define FEK #define FEL #define FEM #define FEN #define FEO #define FEP #define FEQ #define FER #define FES #define FET #define FEU #define FEV #define FEW #define FEX #define FEY #define FEZ #define FFA #define FFB #define FFC #define FFD #define FFE #define FFF #define FFG #define FFH #define FFI #define FFJ #define FFK #define FFL #define FFM #define FFN #define FFO #define FFP #define FFQ #define FFR #define FFS #define FFT #define FFU #define FFV #define FFW #define FFX #define FFY #define FFZ #define FGA #define FGB #define FGC #define FGD #define FGE #define FGF #define FGG #define FGH #define FGI #define FGJ #define FGK #define FGL #define FGM #define FGN #define FGO #define FGP #define FGQ #define FGR #define FGS #define FGT #define FGU #define FGV #define FGW #define FGX #define FGY #define FGZ #define FHA #define FHB #define FHC #define FHD #define FHE #define FHF #define FHG #define FHH #define FHI #define FHJ #define FHK #define FHL #define FHM #define FHN #define FHO #define FHP #define FHQ #define FHR #define FHS #define FHT #define FHU #define FHV #define FHW #define FHX #define FHY #define FHZ #define FIA #define FIB #define FIC #define FID #define FIE #define FIF #define FIG #define FIH #define FII #define FIJ #define FIK #define FIL #define FIM #define FIN #define FIO #define FIP #define FIQ #define FIR #define FIS #define FIT #define FIU #define FIV #define FIW #define FIX #define FIY #define FIZ #define FJA #define FJB #define FJC #define FJD #define FJE #define FJF #define FJG #define FJH #define FJI #define FJJ #define FJK #define FJL #define FJM #define FJN #define FJO #define FJP #define FJQ #define FJR #define FJS #define FJT #define FJU #define FJV #define FJW #define FJX #define FJY #define FJZ #define FKA #define FKB #define FKC #define FKD #define FKE #define FKF #define FKG #define FKH #define FKI #define FKJ #define FKK #define FKL #define FKM #define FKN #define FKO #define FKP #define FKQ #define FKR #define FKS #define FKT #define FKU #define FKV #define FKW #define FKX #define FKY #define FKZ #define FLA #define FLB #define FLC #define FLD #define FLE #define FLF #define FLG #define FLH #define FLI #define FLJ #define FLK #define FLL #define FLM #define FLN #define FLO #define FLP #define FLQ #define FLR #define FLS #define FLT #define FLU #define FLV #define FLW #define FLX #define FLY #define FLZ #define FMA #define FMB #define FMC #define FMD #define FME #define FMF #define FMG #define FMH #define FMI #define FMJ #define FMK #define FML #define FMM #define FMN #define FMO #define FMP #define FMQ #define FMR #define FMS #define FMT #define FMU #define FMV #define FMW #define FMX #define FMY #define FMZ #define FNA #define FNB #define FNC #define FND #define FNE #define FNF #define FNG #define FNH #define FNI #define FNJ #define FNK #define FNL #define FNM #define FNN #define FNO #define FNP #define FNQ #define FNR #define FNS #define FNT #define FNU #define FNV #define FNW #define FNX #define FNY #define FNZ #define FOA #define FOB #define FOC #define FOD #define FOE #define FOF #define FOG #define FOH #define FOI #define FOJ #define FOK #define FOL #define FOM #define FON #define FOO #define FOP #define FOQ #define FOR #define FOS #define FOT #define FOU #define FOV #define FOW #define FOX #define FOY #define FOZ #define FPA #define FPB #define FPC #define FPD #define FPE #define FPF #define FPG #define FPH #define FPI #define FPJ #define FPK #define FPL #define FPM #define FPN #define FPO #define FPP #define FPQ #define FPR #define FPS #define FPT #define FPU #define FPV #define FPW #define FPX #define FPY #define FPZ #define FQA #define FQB #define FQC #define FQD #define FQE #define FQF #define FQG #define FQH #define FQI #define FQJ #define FQK #define FQL #define FQM #define FQN #define FQO #define FQP #define FQQ #define FQR #define FQS #define FQT #define FQU #define FQV #define FQW #define FQX #define FQY #define FQZ #define FRA #define FRB #define FRC #define FRD #define FRE #define FRF #define FRG #define FRH #define FRI #define FRJ #define FRK #define FRL #define FRM #define FRN #define FRO #define FRP #define FRQ #define FRR #define FRS #define FRT #define FRU #define FRV #define FRW #define FRX #define FRY #define FRZ #define FSA #define FSB #define FSC #define FSD #define FSE #define FSF #define FSG #define FSH #define FSI #define FSJ #define FSK #define FSL #define FSM #define FSN #define FSO #define FSP #define FSQ #define FSR #define FSS #define FST #define FSU #define FSV #define FSW #define FSX #define FSY #define FSZ #define FTA #define FTB #define FTC #define FTD #define FTE #define FTF #define FTG #define FTH #define FTI #define FTJ #define FTK #define FTL #define FTM #define FTN #define FTO #define FTP #define FTQ #define FTR #define FTS #define FTT #define FTU #define FTV #define FTW #define FTX #define FTY #define FTZ #define FUA #define FUB #define FUC #define FUD #define FUE #define FUF #define FUG #define FUH #define FUI #define FUJ #define FUK #define FUL #define FUM #define FUN #define FUO #define FUP #define FUQ #define FUR #define FUS #define FUT #define FUU #define FUV #define FUW #define FUX #define FUY #define FUZ #define FVA #define FVB #define FVC #define FVD #define FVE #define FVF #define FVG #define FVH #define FVI #define FVJ #define FVK #define FVL #define FVM #define FVN #define FVO #define FVP #define FVQ #define FVR #define FVS #define FVT #define FVU #define FVV #define FVW #define FVX #define FVY #define FVZ #define FWA #define FWB #define FWC #define FWD #define FWE #define FWF #define FWG #define FWH #define FWI #define FWJ #define FWK #define FWL #define FWM #define FWN #define FWO #define FWP #define FWQ #define FWR #define FWS #define FWT #define FWU #define FWV #define FWW #define FWX #define FWY #define FWZ #define FXA #define FXB #define FXC #define FXD #define FXE #define FXF #define FXG #define FXH #define FXI #define FXJ #define FXK #define FXL #define FXM #define FXN #define FXO #define FXP #define FXQ #define FXR #define FXS #define FXT #define FXU #define FXV #define FXW #define FXX #define FXY #define FXZ #define FYA #define FYB #define FYC #define FYD #define FYE #define FYF #define FYG #define FYH #define FYI #define FYJ #define FYK #define FYL #define FYM #define FYN #define FYO #define FYP #define FYQ #define FYR #define FYS #define FYT #define FYU #define FYV #define FYW #define FYX #define FYY #define FYZ #define FZA #define FZB #define FZC #define FZD #define FZE #define FZF #define FZG #define FZH #define FZI #define FZJ #define FZK #define FZL #define FZM #define FZN #define FZO #define FZP #define FZQ #define FZR #define FZS #define FZT #define FZU #define FZV #define FZW #define FZX #define FZY #define FZZ #define GAA #define GAB #define GAC #define GAD #define GAE #define GAF #define GAG #define GAH #define GAI #define GAJ #define GAK #define GAL #define GAM #define GAN #define GAO #define GAP #define GAQ #define GAR #define GAS #define GAT #define GAU #define GAV #define GAW #define GAX #define GAY #define GAZ #define GBA #define GBB #define GBC #define GBD #define GBE #define GBF #define GBG #define GBH #define GBI #define GBJ #define GBK #define GBL #define GBM 0x0fff #endif #endif mcpp-2.7.2/cpp-test/test-t/u_1_28.c0000644000175000017500000000114110216765467013535 00000000000000/* u_1_28.c: Macro expanding to name identical to directive. */ /* { dg-do preprocess } */ #define D define /* u.1.28: There are following two ways of preprocessing. 1: "D" isn't expanded, because # is the first token of the line. Preprocessor reports that "D" is an unknown directive. 2: "D" is expanded, because that is not a directive. Compiler-phase will diagnose the output of preprocess. Anyway, preprocessor should not interprete this line as a preprocessing directive. */ #D A B /* { dg-error "invalid preprocessing directive| Unknown #directive" } */ mcpp-2.7.2/cpp-test/test-t/n_24_3_run.c0000644000175000017500000000161610720554425014405 00000000000000/* n_24_3_run.c: # operator in macro definition. */ #include #include #include #define str( a) # a int main( void) { /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ assert( strcmp( str( '"' + "' \""), "'\"' + \"' \\\"\"") == 0); /* 24.4: Line splicing by is done prior to token parsing. */ assert( strcmp( str( "ab\ c"), "\"abc\"") == 0); return 0; } /* { dg-do run } * { dg-options "-ansi -no-integrated-cpp -w" } */ /* * Note: DejaGnu cannot handle the preprocessor output which contains a * doubly stringized string literal. * So, we test this testcase with strcmp(). * Note: -no-integrated-cpp is necessary for MCPP on GCC 3. GCC 2, however, * does not recognize this option. Remove this option on GCC 2. */ mcpp-2.7.2/cpp-test/test-t/n_18.c0000644000175000017500000000212010216765467013303 00000000000000/* n_18.c: #define directive. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) #define ZERO_TOKEN /* 18.1: Definition of an object-like macro. */ /* (1-1); */ OBJ_LIKE; /* Macro defined to no token. */ /* ; */ ZERO_TOKEN; /* 18.2: Definition of a function-like macro. */ /* ( c ); */ FTN_LIKE( c); /* 18.3: Spelling in string identical to parameter is not a parameter. */ /* "n1:n2"; */ #define STR( n1, n2) "n1:n2" STR( 1, 2); /* { dg-do preprocess } { dg-final { if ![file exist n_18.i] { return } } } { dg-final { if \{ [grep n_18.i "\\(1-1\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_18.i "^\[ \]*;\[ \]*$"] != "" \} \{ } } { dg-final { if \{ [grep n_18.i "\\( *c *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_18.i "\"n1:n2\""] != "" \} \{ } } { dg-final { return \} \} \} \} } } { dg-final { fail "n_18.c: #define directive" } } */ mcpp-2.7.2/cpp-test/test-t/i_32_3.c0000644000175000017500000000057510216765467013530 00000000000000/* i_32_3.c: Character constant in #if expression. */ /* In ASCII character set. */ /* 32.3: */ #if 'a' != 0x61 #error Not ASCII character set, or bad evaluation of character constant. #endif /* 32.4: '\a' and '\v' */ #if '\a' != 7 || '\v' != 11 #error Not ASCII character set, or bad evaluation of escape sequences. #endif /* { dg-do preprocess } */ mcpp-2.7.2/cpp-test/test-t/n_5.c0000644000175000017500000000126210216765467013225 00000000000000/* n_5.t: Spaces or tabs are allowed at any place in pp-directive line, including between the top of a pp-directive line and '#', and between the '#' and the directive. */ /* 5.1: */ /* |**|[TAB]# |**|[TAB]define |**| MACRO_abcde[TAB]|**| abcde |**| */ /**/ # /**/ define /**/ MACRO_abcde /**/ abcde /**/ /* abcde */ MACRO_abcde /* { dg-do preprocess } { dg-final { if ![file exist n_5.i] { return } } } { dg-final { if \{ [grep n_5.i "abcde"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_5.c: spaces and tabs in directive line" } } */ mcpp-2.7.2/cpp-test/test-t/n_ucn1_cplus.C0000644000175000017500000000234210216765467015075 00000000000000/* n_ucn1_cplus.C: Universal-character-name */ /* UCN in character constant */ #if '\u5B57' UCN-16bits is implemented #endif #if '\U00006F22' UCN-32bits is implemented #endif /* UCN in string literal */ "abc\u6F22\u5B57xyz"; /* i.e. "abcxyx"; */ /* UCN in identifier */ #define macro\u5B57 9 #define macro\U00006F22 99 macro\u5B57 /* 9 */ macro\U00006F22 = macro\U00006f22 /* 99 = 99 */ /* '6F22' and '6f22' have the same value */ /* { dg-do preprocess } { dg-options "-std=c++98 -w" } { dg-final { if ![file exist n_ucn1_cplus.i] { return } } } { dg-final { if \{ [grep n_ucn1_cplus.i "UCN-16bits is implemented"] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1_cplus.i "UCN-32bits is implemented"] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1_cplus.i "\"abc\\\\u6\[Ff\]22\\\\u5\[Bb\]57xyz\""] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1_cplus.i "9"] != "" \} \{ } } { dg-final { if \{ [grep n_ucn1_cplus.i "99 *= *99"] != "" \} \{ } } { dg-final { return \} \} \} \} \} } } { dg-final { fail "n_ucn1_cplus.C: UCN in tokens" } } */ mcpp-2.7.2/cpp-test/test-t/e_35_2.c0000644000175000017500000000033510216765467013520 00000000000000/* e_35_2.c: Out of range of character constant. */ /* { dg-do preprocess } */ /* 35.2: */ /* Perhaps out of range. */ #if 'abcdefghi' /* { dg-error "character constant too long| out of range" } */ #endif mcpp-2.7.2/cpp-test/test-t/n_stdmac.c0000644000175000017500000000121310216765467014330 00000000000000/* n_stdmac.c: C99 Standard pre-defined macros. */ /* 199901L */ __STDC_VERSION__ /* 1 or 0 */ __STDC_HOSTED__ /* { dg-do preprocess } { dg-options "-std=c99" } { dg-final { if ![file exist n_stdmac.i] { return } } } { dg-final { if \{ [grep n_stdmac.i "199901L"] != "" \} \{ } } { dg-final { if \{ [grep n_stdmac.i "1|0"] != "" \} \{ } } { dg-final { if \{ [grep n_stdmac.i "__STDC_HOSTED__"] == "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_stdmac.c: standard pre-defined macro in C99" } } */ mcpp-2.7.2/cpp-test/test-t/e_31_3.c0000644000175000017500000000063310216765467013516 00000000000000/* e_31_3.c: Macro call in control line should complete in the line. */ /* { dg-do preprocess } */ #define glue( a, b) a ## b #define str( s) # s #define xstr( s) str( s) /* 31.3: Unterminated macro call. */ #include xstr( glue( header, .h)) /* [ dg-error "unterminated argument list| (U|u)nterminated macro call" "" { target *-*-* } 10 } */ /* { dg-excess-errors "" } */ mcpp-2.7.2/cpp-test/test-t/u_1_17s.c0000644000175000017500000000104510216765467013721 00000000000000/* u_1_17s.c: Undefined behavior on out-of-range #line number. */ /* { dg-do preprocess } */ /* u.1.17s: Line number argument of #line directive should be in range of [1,32767]. */ #line 32768 /* { dg-error "line number out of range| Line number \"32768\" is out of range of \[^ \]*\n\[\^ \]* warning: Line number" } */ /* * Note: DejaGnu sometimes fails to handle one of the dg-error lines of * #line 0 and #line 32768, when those are tested in a single testcase file. * So, we separated this testcase from u_1_17.c. */ mcpp-2.7.2/cpp-test/test-t/vers2.h0000644000175000017500000000031210216765467013605 00000000000000/* vers2.h */ /* comment */ # /**/ pragma /**/ once /**/ #include #include /* * , might have the line * #pragma once * near the beginning. */ mcpp-2.7.2/cpp-test/test-t/ifdef15.h0000644000175000017500000000115710216765467013777 00000000000000/* ifdef15.h */ #ifdef X01 #else #ifdef X02 #else #ifdef X03 #else #ifdef X04 #else #ifdef X05 #else #ifdef X06 #else #ifdef X07 #else #ifdef X08 #else #ifdef X09 #else #ifdef X0A #else #ifdef X0B #else #ifdef X0C #else #ifdef X0D #else #ifdef X0E #else #ifdef X0F ifdef_nest = 0x0f; #else #include "ifdef31.h" #endif /* X0F */ #endif /* X0E */ #endif /* X0D */ #endif /* X0C */ #endif /* X0B */ #endif /* X0A */ #endif /* X09 */ #endif /* X08 */ #endif /* X07 */ #endif /* X06 */ #endif /* X05 */ #endif /* X04 */ #endif /* X03 */ #endif /* X02 */ #endif /* X01 */ mcpp-2.7.2/cpp-test/test-t/e_14_2.c0000644000175000017500000000104610216765467013515 00000000000000/* e_14_2.c: Illegal #if expressions-2. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic-errors -w" } */ #define A 1 #define B 1 /* 14.2: Operators =, +=, ++, etc. are not allowed in #if expression.*/ #if A = B /* { dg-error "is not valid| (parse|syntax) error| Can't use the operator" } */ #endif #if A++ B /* { dg-error "is not (valid|allowed)| Can't use the operator" } */ #endif #if A.B /* { dg-error "is not valid| (parse|syntax) error| empty #if expression| Can't use the operator" } */ #endif mcpp-2.7.2/cpp-test/test-t/n_cnvucn.C0000644000175000017500000000124410453737206014306 00000000000000/* n_cnvucn.C: C++ Conversion from multi-byte character to UCN. */ /* This conversion takes place in the translation phase 1. */ #define str( a) # a /* "\"\u6F22\u5B57\"" or "\"\\u6F22\\u5B57\"" */ str( "") /* { dg-do preprocess } { dg-options "-std=c++98 -finput-charset=EUC-JP" } { dg-final { if ![file exist n_cnvucn.i] { return } } } { dg-final { if \{ [grep n_cnvucn.i "\"\\\"\\\\u6F22\\\\u5B57\\\"\"|\"\\\"\\\\\\\\u6F22\\\\\\\\u5B57\\\"\""] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_cnvucn.C: UCN conversion" } } */ mcpp-2.7.2/cpp-test/test-t/nest2.h0000644000175000017500000000006510216765467013604 00000000000000/* nest2.h */ nest = 2; #include "nest3.h" mcpp-2.7.2/cpp-test/test-t/n_7.c0000644000175000017500000000161610216765467013232 00000000000000/* n_7.c: #line directive. */ /* 7.1: Line number and filename. */ /* 1234; "cpp"; */ #line 1234 "cpp" __LINE__; __FILE__; /* 7.2: Filename argument is optional. */ /* 2345; "cpp"; */ #line 2345 __LINE__; __FILE__; /* 7.3: Argument with macro. */ /* 3456; "n_7.c" or "prefix/n_7.c"; */ #define LINE_AND_FILENAME 3456 "n_7.c" #line LINE_AND_FILENAME __LINE__; __FILE__; /* { dg-do preprocess } { dg-final { if ![file exist n_7.i] { return } } } { dg-final { if \{ [grep n_7.i "1234 *; *\"cpp\" *;"] != "" \} \{ } } { dg-final { if \{ [grep n_7.i "2345 *; *\"cpp\" *;"] != "" \} \{ } } { dg-final { if \{ [grep n_7.i "3456 *; *\"\[^ \]*n_7.c\" *;"] != "" \} \{ } } { dg-final { return \} \} \} } } { dg-final { fail "n_7.c: #lines" } } */ mcpp-2.7.2/cpp-test/test-t/e_7_4.c0000644000175000017500000000047210216765467013443 00000000000000/* e_7_4.c: #line error. */ /* { dg-do preprocess } */ /* 7.4: string literal in #line directive shall be a character string literal. */ #line 123 L"wide" /* { dg-error "not a valid filename| invalid format| Not a file name" } */ /* 10; "e_7_4.c"; */ __LINE__; __FILE__; mcpp-2.7.2/cpp-test/test-t/n_28.c0000644000175000017500000000305710216765467013316 00000000000000/* n_28.c: __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and __STDC_VERSION__ are predefined. */ /* 28.1: */ /* "n_28.c"; or "path/n_28.c" */ __FILE__; /* 28.2: */ /* 10; */ __LINE__; /* 28.3: */ /* "Aug 1 2001"; */ __DATE__; /* 28.4: */ /* "21:42:22"; */ __TIME__; /* 28.5: */ /* 1; */ __STDC__; /* 28.6: */ /* 199409L; */ /* In C99, the value of this macro is 199901L */ __STDC_VERSION__; /* 28.7: __LINE__, __FILE__ in an included file. */ /* 3; "line.h"; or "path/line.h"; */ #include "line.h" /* { dg-do preprocess } { dg-options "-std=iso9899:199409" } { dg-final { if ![file exist n_28.i] { return } } } { dg-final { if \{ [grep n_28.i "n_28\.c"] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "^\[ \]*10\[ \]*;"] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "\"\[ADFJMNOS\]\[aceopu\]\[bcglnprtvy\] \[ 123\]\[0-9\] 20\[0-9\]\[0-9\]\""] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "\"\[0-2\]\[0-9\]:\[0-5\]\[0-9\]:\[0-6\]\[0-9\]\""] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "^\[ \]*1\[ \]*;"] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "199409L"] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "^\[ \]*3\[ \]*;"] != "" \} \{ } } { dg-final { if \{ [grep n_28.i "line\.h"] != "" \} \{ } } { dg-final { return \} \} \} \} \} \} \} \} } } { dg-final { fail "n_28.c: standard predefined macros" } } */ mcpp-2.7.2/cpp-test/test-t/n_4.c0000644000175000017500000000127610216765467013231 00000000000000/* n_4.c: Special tokens. */ /* 4.1: Digraph spellings in directive line. */ /* "abc"; */ %: define stringize( a) %: a stringize( abc); /* 4.2: Digraph spellings are retained in stringization. */ /* "<:"; */ stringize( <:); /* { dg-do preprocess } { dg-options "-std=iso9899:199409" } { dg-final { if ![file exist n_4.i] { return } } } { dg-final { if \{ [grep n_4.i "\"abc\""] != "" \} \{ } } { dg-final { if \{ [grep n_4.i "\"<:\""] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_4.c: digraphs conversion" } } */ mcpp-2.7.2/cpp-test/test-t/n_dslcom.c0000644000175000017500000000072510216765467014345 00000000000000/* n_dslcom.c: // is a comment of C++ and C99. */ /* a; */ a; // is a comment of C++ and C99 /* { dg-do preprocess } { dg-options "-std=c99" } { dg-final { if ![file exist n_dslcom.i] { return } } } { dg-final { if \{ [grep n_dslcom.i "^\[ \]*a;\[ \]*$"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_dslcom.c: double slash comment" } } */ mcpp-2.7.2/cpp-test/test-t/i_35.c0000644000175000017500000000041610216765467013303 00000000000000/* i_35.c: Multi-character character constant. */ /* In ASCII character set. */ /* 35.1: */ #if ('ab' != '\x61\x62') || ('\aa' != '\7\x61') #error Bad handling of multi-character character constant. #endif /* { dg-do preprocess } { dg-options -w } */ mcpp-2.7.2/cpp-test/test-t/e_19_3.c0000644000175000017500000000241310216765467013522 00000000000000/* e_19_3.c: Redefinitions of macros. */ /* { dg-do preprocess } */ /* Excerpts from ISO C 3.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* The following redefinitions should be diagnosed. */ /* 19.3: */ /* different token sequence */ #define OBJ_LIKE (0) /* { dg-error "redefined\n\[\^ \]*( error:|) this is the location | The macro is redefined" } */ /* (1-1); */ OBJ_LIKE; /* 19.4: */ #undef OBJ_LIKE #define OBJ_LIKE (1-1) /* different white space */ #define OBJ_LIKE (1 - 1) /* { dg-error "redefined\n\[\^ \]*( error:|) this is the location | The macro is redefined" } */ /* 19.5: */ /* different parameter usage */ #define FTN_LIKE(b) ( a ) /* { dg-error "redefined\n\[\^ \]*( error:|) this is the location | The macro is redefined" } */ /* ( x ); */ FTN_LIKE(x); /* 19.6: */ #undef FTN_LIKE #define FTN_LIKE(a) ( a ) /* different parameter spelling */ #define FTN_LIKE(b) ( b ) /* { dg-error "redefined\n\[\^ \]*( error:|) this is the location | The macro is redefined" } */ /* 19.7: Not in ISO C "Examples" */ #define FTN_LIKE OBJ_LIKE /* { dg-error "redefined\n\[\^ \]*( error:|) this is the location | The macro is redefined" } */ mcpp-2.7.2/cpp-test/test-t/header.h0000644000175000017500000000010110216765467013770 00000000000000/* header.h */ #define MACRO_xyz xyz #define MACRO_zyx zyx mcpp-2.7.2/cpp-test/test-t/ifdef31.h0000644000175000017500000000122310216765467013767 00000000000000/* ifdef31.h */ #ifdef X10 #else #ifdef X11 #else #ifdef X12 #else #ifdef X13 #else #ifdef X14 #else #ifdef X15 #else #ifdef X16 #else #ifdef X17 #else #ifdef X18 #else #ifdef X19 #else #ifdef X1A #else #ifdef X1B #else #ifdef X1C #else #ifdef X1D #else #ifdef X1E #else #ifdef X1F ifdef_nest = 0x1f; #else #include "ifdef63.h" #endif /* X1F */ #endif /* X1E */ #endif /* X1D */ #endif /* X1C */ #endif /* X1B */ #endif /* X1A */ #endif /* X19 */ #endif /* X18 */ #endif /* X17 */ #endif /* X16 */ #endif /* X15 */ #endif /* X14 */ #endif /* X13 */ #endif /* X12 */ #endif /* X11 */ #endif /* X10 */ mcpp-2.7.2/cpp-test/test-t/warn_2.c0000644000175000017500000000105310216765467013732 00000000000000/* warn_2.c */ /* * The following texts are legal but suspicious ones. Good preprocessor * will warn at these texts. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic -Wall" } */ /* w.2.1: Negative number converted to positive in #if expression. */ #if -1 < 0U /* { dg-warning "changes sign when promoted| converted to positive" } */ #endif /* w.2.2: Out of range of unsigned type (wraps around and never overflow) in #if expression. */ #if 0U - 1 /* { dg-warning "out of range" } */ #endif mcpp-2.7.2/cpp-test/test-t/u_1_14.c0000644000175000017500000000116410216765467013535 00000000000000/* u_1_14.c: Undefined behaviors on undefined #line syntax. */ /* { dg-do preprocess } */ /* u.1.14: #line directive without an argument of line number. */ #line "filename" /* { dg-error "not a positive integer| invalid format | Not a line number" } */ /* u.1.15: #line directive with the second argument of other than string literal. */ #line 1234 filename /* { dg-error "not a valid filename| invalid format | Not a file name" } */ /* u.1.16: Excessive argument in #line directive. */ #line 2345 "filename" Junk /* { dg-error "extra tokens| garbage | Excessive token sequence" } */ mcpp-2.7.2/cpp-test/test-t/e_vargs.c0000644000175000017500000000170111000136435014143 00000000000000/* e_vargs.c: Error of variable arguments macro */ /* { dg-do preprocess } */ /* { dg-options "-std=c99 -pedantic-errors" } */ /* e_vargs1: Erroneous usage of __VA_ARGS__ */ /* __VA_ARGS__ should not be defined. */ #define __VA_ARGS__ (x, y, z) /* { dg-error "__VA_ARGS__| shouldn't be defined" "" { target *-*-* } 9 } */ /* * __VA_ARGS__ should be the parameter name in replacement list * corresponding to '...'. */ #define wrong_macro( a, b, __VA_ARGS__) (a + b - __VA_ARGS__) /* { dg-error "variadic macro\n\[\^ \]*( error:|) __VA_ARGS__| reserved name `__VA_ARGS__'| Illegal parameter" "" { target *-*-* } 16 } */ /* e_vargs2: Erroneous macro invocation of variable arguments */ /* No argument to correspond __VA_ARGS__ */ #define debug( ...) fprintf( stderr, __VA_ARGS__) debug(); /* { dg-warning "Empty argument" "" { target *-*-* } 22 } */ /* dg-warning, not dg-error to avoid a problem of GCC 4.3 testsuite */ mcpp-2.7.2/cpp-test/test-t/n_llong.c0000644000175000017500000000075510216765467014202 00000000000000/* n_llong.c: long long in #if expression */ #if 12345678901234567890U < 13345678901234567890U "long long #if expression is implemented." #else "long long #if expression is not implemented." #endif #if 12345678901234567890ULL < 13345678901234567890ULL Valid block #else Block to be skipped #endif #if (0x7FFFFFFFFFFFFFFFULL - 0x6FFFFFFFFFFFFFFFULL) >> 60 == 1 Valid block #else Block to be skipped #endif /* { dg-do preprocess } { dg-options "-std=c99" } */ mcpp-2.7.2/cpp-test/test-t/u_1_5.c0000644000175000017500000000144210216765467013454 00000000000000/* u_1_5.c: Undefined behaviors on illegal characters. */ /* { dg-do preprocess } */ /* u.1.5: Illegal characters (in other than string literal, character constant, header-name or comment). */ #if 1 ||2 /* 0x1e ^ ^ 0x1f */ /* { dg-error "invalid character| Invalid token| is not valid | Illegal control character 0x1e, \[a-z \]*\n\[\^ \]* error: Illegal" "" { target *-*-* } 7 } */ #endif /* Maybe the second error. */ /* u.1.6: [VT], [FF] in directive line. */ #if 1 || 2 /* [VT] ^ ^ [FF] */ /* { dg-error "vertical tab in preprocessing directive| Converted 0x0b to a space" "" { target *-*-* } 13 } */ /* { dg-error "form feed in preprocessing directive| Converted 0x0c to a space" "" { target *-*-* } 13 } */ #endif /* Maybe the second error. */ mcpp-2.7.2/cpp-test/test-t/e_4_3.c0000644000175000017500000000044710216765467013441 00000000000000/* e_4_3.c: Illegal pp-token. */ /* { dg-do preprocess } */ /* 4.3: Empty character constant is an error. */ #if '' == 0 /* { dg-error "empty character constant| Empty character constant '', skipped the line\n\[^ \]* error:" "" } */ #endif /* Maybe the second error */ mcpp-2.7.2/cpp-test/test-t/n_1_3_run.c.gcc20000644000175000017500000000137710216765467015153 00000000000000/* n_1_3_run.c: Trigraph-like sequences. */ #include #include int main( void) { /* 1.3: Any sequence other than the specified 9 sequences is not a trigraph.*/ char quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ', '?', '?', '%', ' ', '?', '?', '^', ' ', '?', '#', '\0' }; assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0); return 0; } /* { dg-do run } * { dg-options "-ansi" } */ /* * Note: It is troublesome and unreadable to write preprocessor output of * many '?' sequence for DajaGnu. So, we test this testcase by strcmp(). * Note: -no-integrated-cpp is necessary for MCPP on GCC 3. GCC 2, however, * does not recognize this option. Remove this option on GCC 2. */ mcpp-2.7.2/cpp-test/test-t/line.h0000644000175000017500000000005010216765467013472 00000000000000/* line.h */ __LINE__; __FILE__; mcpp-2.7.2/cpp-test/test-t/n_21.c0000644000175000017500000000130510216765467013301 00000000000000/* n_21.c: Tokenization (No preprocessing tokens are merged implicitly). */ /* 21.1: */ /* - - -a; */ #define MINUS - -MINUS-a; /* 21.2: */ #define sub( a, b) a-b /* '(a)-(b)' is better */ #define Y -y /* '(-y)' is better */ /* x- -y; */ sub( x, Y); /* { dg-do preprocess } { dg-final { if ![file exist n_21.i] { return } } } { dg-final { if \{ [grep n_21.i "- +- +- *a"] != "" \} \{ } } { dg-final { if \{ [grep n_21.i "x *- +- *y"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_21.c: tokenization of expanded macro" } } */ mcpp-2.7.2/cpp-test/test-t/e_33_2.c0000644000175000017500000000074010216765467013516 00000000000000/* e_33_2.c: Out of range of numerical escape sequence in wide-char. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic-errors -Wall" } */ /* 33.2: Value of a numerical escape sequence in wide-character constant should be in the range of wchar_t. */ #if L'\xabcdef012' == 0xbcdef012 /* Perhaps out of range. */ /* { dg-error "escape sequence out of range| (16|32) bits can't represent escape sequence" "" { target *-*-* } 8 } */ #endif mcpp-2.7.2/cpp-test/test-t/n_19.c0000644000175000017500000000136410216765467013315 00000000000000/* n_19.c: Valid re-definitions of macros. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* 19.1: */ #define OBJ_LIKE /* white space */ (1-1) /* other */ /* 19.2: */ #define FTN_LIKE( a )( /* note the white space */ \ a /* other stuff on this line */ ) /* ( c ); */ FTN_LIKE( c); /* { dg-do preprocess } { dg-final { if ![file exist n_19.i] { return } } } { dg-final { if \{ [grep n_19.i "\\( *c *\\)"] != "" \} \{ } } { dg-final { return \} } } { dg-final { fail "n_19.c: valid re-definition of macros" } } */ mcpp-2.7.2/cpp-test/test-t/nest10.h0000644000175000017500000000004310216765467013657 00000000000000/* nest10.h */ #include "nest11.h" mcpp-2.7.2/cpp-test/test-t/n_25.c0000644000175000017500000000316110216765467013307 00000000000000/* n_25.c: Macro arguments are pre-expanded (unless the argument is an operand of # or ## operator) separately, that is, are macro-replaced completely prior to rescanning. */ #define MACRO_0 0 #define MACRO_1 1 #define ZERO_TOKEN #define TWO_ARGS a,b #define sub( x, y) (x - y) #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) #define str( a) # a /* 25.1: "TWO_ARGS" is read as one argument to "sub" then expanded to "a,b", then "x" is substituted by "a,b". */ /* (a,b - 1); */ sub( TWO_ARGS, 1); /* 25.2: An argument pre-expanded to 0-token. */ /* ( - 1); */ sub( ZERO_TOKEN, 1); /* 25.3: "glue( a, b)" is pre-expanded. */ /* abc; */ xglue( glue( a, b), c); /* 25.4: Operands of ## operator are not pre-expanded. */ /* MACRO_0MACRO_1; */ glue( MACRO_0, MACRO_1); /* 25.5: Operand of # operator is not pre-expanded. */ /* "ZERO_TOKEN"; */ #define ZERO_TOKEN str( ZERO_TOKEN); /* { dg-do preprocess } { dg-final { if ![file exist n_25.i] { return } } } { dg-final { if \{ [grep n_25.i "\\( *a *, *b *- *1 *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_25.i "\\( *- *1 *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_25.i "abc"] != "" \} \{ } } { dg-final { if \{ [grep n_25.i "MACRO_0MACRO_1"] != "" \} \{ } } { dg-final { if \{ [grep n_25.i "\"ZERO_TOKEN\""] != "" \} \{ } } { dg-final { return \} \} \} \} \} } } { dg-final { fail "n_25.c: pre-expansion of macro arguments" } } */ mcpp-2.7.2/cpp-test/test-t/e_14_10.c0000644000175000017500000000151510441602535013557 00000000000000/* e_14_10.c: Overflow of constant expression in #if directive. */ /* { dg-do preprocess } { dg-options "-ansi -pedantic-errors" } { dg-excess-errors "" } */ /* 14.10: */ /* In C99, #if expression is evaluated in intmax_t */ #if __STDC_VERSION__ < 199901L #include #if LONG_MAX - LONG_MIN /* { dg-error "integer overflow in preprocessor expression| Result of \"-\" is out of range" } */ #endif #if LONG_MAX + 1 > SHRT_MAX /* { dg-error "integer overflow in preprocessor expression| Result of \"\\+\" is out of range" } */ #endif #if LONG_MIN - 1 /* { dg-error "integer overflow in preprocessor expression| Result of \"-\" is out of range" } */ #endif #if LONG_MAX * 2 /* { dg-error "integer overflow in preprocessor expression| Result of \"\\*\" is out of range" } */ #endif #endif mcpp-2.7.2/cpp-test/test-t/u_1_12.c0000644000175000017500000000043310216765467013531 00000000000000/* u_1_12.c: Undefined behaviors on undefined #include syntax or header- name. */ /* { dg-do preprocess } */ /* u.1.12: Argument of #include other than header-name. */ #include filename /* { dg-error "(#include|`#include') expects | Not a header name" } */ mcpp-2.7.2/cpp-test/test-t/n_13_5.c0000644000175000017500000000130410216765467013525 00000000000000/* n_13_5.c: Arithmetic conversion in #if expressions. */ /* 13.5: The usual arithmetic conversion is not performed on bit shift. */ #if -1 << 3U > 0 #error Bad conversion of bit shift operands. #endif /* 13.6: Usual arithmetic conversions. */ #if -1 <= 0U /* -1 is converted to unsigned long. */ #error Bad arithmetic conversion. #endif #if -1 * 1U <= 0 #error Bad arithmetic conversion. #endif /* Second and third operands of conditional operator are converted to the #error same type, thus -1 is converted to unsigned long. */ #if (1 ? -1 : 0U) <= 0 #error Bad arithmetic conversion. #endif /* { dg-do preprocess } { dg-options "-ansi -w" } */ mcpp-2.7.2/cpp-test/test-t/e_32_5.c0000644000175000017500000000061110216765467013515 00000000000000/* e_32_5.c: Range error of character constant. */ /* { dg-do preprocess } */ /* 32.5: Value of a numerical escape sequence in character constant should be in the range of char. */ /* Out of range */ #if '\x123' == 0x123 /* { dg-error "escape sequence out of range| hex character constant does not fit in a byte| 8 bits can't represent escape sequence" } */ #endif mcpp-2.7.2/cpp-test/test-t/long4095.h0000644000175000017500000001057410216765467014040 00000000000000/* long4095.c: logical source line of 4095 bytes long. */ typedef int wchar_t; \ typedef struct { \ rune_t min; \ rune_t max; \ rune_t map; \ unsigned long *types; \ } _RuneEntry; \ \ typedef struct { \ int nranges; \ _RuneEntry *ranges; \ } _RuneRange; \ \ typedef struct { \ char magic[8]; \ char encoding[32]; \ \ rune_t (*sgetrune) \ (const char *, unsigned int, char const **) ; \ int (*sputrune) \ (rune_t, char *, unsigned int, char **) ; \ rune_t invalid_rune; \ \ unsigned long runetype[ (1 <<8 ) ]; \ rune_t maplower[ (1 <<8 ) ]; \ rune_t mapupper[ (1 <<8 ) ]; \ _RuneRange runetype_ext; \ _RuneRange maplower_ext; \ _RuneRange mapupper_ext; \ \ void *variable; \ int variable_len; \ } _RuneLocale; \ \ \ \ extern _RuneLocale _DefaultRuneLocale; \ extern _RuneLocale *_CurrentRuneLocale; \ \ unsigned long ___runetype ( int ) ; \ int ___tolower ( int ) ; \ int ___toupper ( int ) ; \ \ \ int __istype ( int , unsigned long) ; \ int __isctype ( int , unsigned long) ; \ int toupper ( int ) ; \ int tolower ( int ) ; \ \ extern int errno; \ \ void *memchr (const void *, int, size_t) ; \ int memcmp (const void *, const void *, size_t) ; \ void *memcpy (void *, const void *, size_t) ; \ void *memmove (void *, const void *, size_t) ; \ void *memset (void *, int, size_t) ; \ char *strcat (char *, const char *) ; \ char *strchr (const char *, int) ; \ int strcmp (const char *, const char *) ; \ int strcoll (const char *, const char *) ; \ char *strcpy (char *, const char *) ; \ size_t strcspn (const char *, const char *) ; \ char *strerror (int) ; \ size_t strlen (const char *) ; \ char *strncat (char *, const char *, size_t) ; \ int strncmp (const char *, const char *, size_t) ; \ char *strncpy (char *, const char *, size_t) ; \ char *strpbrk (const char *, const char *) ; \ char *strrchr (const char *, int) ; \ size_t strspn (const char *, const char *) ; \ char *strstr (const char *, const char *) ; \ char *strtok (char *, const char *) ; \ size_t strxfrm (char *, const char *, size_t) ; \ \ \ \ int bcmp (const void *, const void *, size_t) ; \ void bcopy (const void *, void *, size_t) ; \ void bzero (void *, size_t) ; \ int ffs (int) ; \ char *index (const char *, int) ; \ void *memccpy (void *, const void *, int, size_t) ; \ char *rindex (const char *, int) ; \ int strcasecmp (const char *, const char *) ; \ char *strdup (const char *) ; \ void strmode (int, char *) ; \ int strncasecmp (const char *, const char *, size_t) ; \ char *strsep (char **, const char *) ; \ void swab (const void *, void *, size_t) ; \ \ \ typedef struct { \ int quot; \ int rem; \ } div_t; \ \ typedef struct { \ long quot; \ long rem; \ } ldiv_t; \ extern int __mb_cur_max; \ \ \ void \ abort (void) ; \ int \ abs (int) ; \ int atexit (void (*)(void)) ; \ double atof (const char *) ; \ int atoi (const char *) ; \ long atol (const char *) ; \ void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *)) ; \ void *calloc (size_t, size_t) ; \ div_t \ div (int, int) ; \ void \ exit (int) ; \ void free (void *) ; \ char *getenv (const char *) ; \ long \ labs (long) ; \ ldiv_t \ ldiv (long, long) ; \ void *malloc (size_t) ; \ void qsort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ int rand (void) ; \ void *realloc (void *, size_t) ; \ void srand (unsigned) ; \ double strtod (const char *, char **) ; \ long strtol (const char *, char **, int) ; \ unsigned long \ strtoul (const char *, char **, int) ; \ int system (const char *) ; \ \ \ int mblen (const char *, size_t) ; \ size_t mbstowcs (wchar_t *, const char *, size_t) ; \ int wctomb (char *, wchar_t) ; \ int mbtowc (wchar_t *, const char *, size_t) ; \ size_t wcstombs (char *, const wchar_t *, size_t) ; \ \ \ int putenv (const char *) ; \ int setenv (const char *, const char *, int) ; \ \ \ \ double drand48 (void) ; \ double erand48 (unsigned short[3]) ; \ long lrand48 (void) ; \ long nrand48 (unsigned short[3]) ; \ long mrand48 (void) ; \ long jrand48 (unsigned short[3]) ; \ void srand48 (long) ; \ unsigned short *seed48 (unsigned short[3]) ; \ void lcong48 (unsigned short[7]) ; \ \ void *alloca (size_t) ; \ \ char *getbsize (int *, long *) ; \ char *cgetcap (char *, char *, int) ; \ int cgetclose (void) ; \ \ mcpp-2.7.2/cpp-test/test-t/e_24_6.c0000644000175000017500000000046610216765467013527 00000000000000/* e_24_6.c: Operand of # operator in function-like macro definition shall be a parameter name. */ /* { dg-do preprocess } */ /* 24.6: */ #define FUNC( a) # b /* { dg-error "not followed by a macro parameter| should be followed by a macro argument name| Not a formal parameter" } */ mcpp-2.7.2/cpp-test/test-t/n_1_3_run.c.gcc30000644000175000017500000000142210216765467015143 00000000000000/* n_1_3_run.c: Trigraph-like sequences. */ #include #include int main( void) { /* 1.3: Any sequence other than the specified 9 sequences is not a trigraph.*/ char quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ', '?', '?', '%', ' ', '?', '?', '^', ' ', '?', '#', '\0' }; assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0); return 0; } /* { dg-do run } * { dg-options "-ansi -no-integrated-cpp" } */ /* * Note: It is troublesome and unreadable to write preprocessor output of * many '?' sequence for DajaGnu. So, we test this testcase by strcmp(). * Note: -no-integrated-cpp is necessary for MCPP on GCC 3. GCC 2, however, * does not recognize this option. Remove this option on GCC 2. */ mcpp-2.7.2/cpp-test/test-t/n_vargs.c0000644000175000017500000000263210216765467014205 00000000000000/* n_vargs.c: Macro of variable arguments */ /* from C99 Standard 6.10.3 Examples */ #define debug( ...) fprintf( stderr, __VA_ARGS__) #define showlist( ...) puts( #__VA_ARGS__) #define report( test, ...) ((test) ? puts( #test) \ : printf( __VA_ARGS__)) { /* fprintf( stderr, "Flag"); */ debug( "Flag"); /* fprintf( stderr, "X = %d\n", x); */ debug( "X = %d\n", x); /* puts( "The first, second, and third items."); */ showlist( The first, second, and third items.); /* ((x>y) ? puts( "x>y") : printf( "x is %d but y is %d", x, y)); */ report( x>y, "x is %d but y is %d", x, y); } /* { dg-do preprocess } { dg-options "-std=c99" } { dg-final { if ![file exist n_vargs.i] { return } } } { dg-final { if \{ [grep n_vargs.i "fprintf\\( stderr, *\"Flag\" *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_vargs.i "fprintf\\( stderr, *\"X = %d\\\\n\", x *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_vargs.i "puts\\( \"The first, second, and third items\.\" *\\)"] != "" \} \{ } } { dg-final { if \{ [grep n_vargs.i "\\(\\( *x>y *\\) \[?\] puts\\( \"x>y\" *\\) : printf\\( *\"x is %d but y is %d\", x, y *\\)\\)"] != "" \} \{ } } { dg-final { return \} \} \} \} } } { dg-final { fail "n_vargs.c: macro of variable arguments" } } */ mcpp-2.7.2/cpp-test/test-t/warn_3.c0000644000175000017500000001270510216765467013741 00000000000000/* warn_3.c */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic -Wall" } */ /* { dg-excess-errors "" } */ /* * The following texts are legal but non-portable ones, since these requires * translation limits greater than the minima quaranteed by C90. Good * preprocessor will warn at these texts (at least when user wants), unless * it diagnose these as errors. */ /* w.3.1: Number of parameters in macro: more than 31. */ #define glue63( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ o0 ## o1 ## o2 ## o3 ## p0 ## p1 ## p2 /* w.3.2: Number of arguments in macro call: more than 31. */ /* A0B0C0D0E0F0G0H0O0O1O2O3P0P1P2; */ glue63( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3); /* { dg-warning "More than 31 (parameters|arguments)" "" { target *-*-* } 0 } */ /* w.3.3: Initial significant characters in an identifier: more than 31. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; /* { dg-warning "Identifier longer than 31 characters" "" { target *-*-* } 34 } */ /* w.3.4: Nested conditional inclusion: more than 8 levels. */ #define X0F /* nest = 0x0f; */ #include "ifdef15.h" /* { dg-warning "More than 8 nesting of #if" "" { target *-*-* } 0 } */ /* w.3.5: Nested source file inclusion: more than 8 levels. */ #define X0F /* nest = 0x0f; */ #include "nest1.h" /* { dg-warning "More than 8 nesting of #include" "" { target *-*-* } 0 } */ /* w.3.6: Parenthesized expression: more than 32 levels. */ /* nest = 63; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif /* { dg-warning "More than 32 nesting of parens" "" { target *-*-* } 0 } */ /* w.3.7: Characters in a string (after concatenation): more than 509. */ char *string1023 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" ; /* { dg-warning "string length `\[0-9\]*' is greater than the length `509'| Quotation longer than 509 bytes" "" { target *-*-* } 0 } */ /* w.3.8: Characters in a logical source line: more than 509. */ int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int g123456789012345678901234567890 = 123456; \ int h123456789012345678901234567890 = 123457; \ int i123456789012345678901234567890 = 123458; \ int j123456789012345678901234567890 = 123459; \ int k123456789012345678901234567890 = 123460; \ int l123456789012345678901234567890 = 123461; \ int m123456789012345678901234567890 = 123462; \ int n123456789012345678901234567890 = 123463; \ int o123456789012345678901234567890 = 123464; \ int p123456789012345678901234567890 = 123465; \ int q123456789012345678901234567890 = 123466; \ int r123456789012345678901234567890 = 123467; \ int s123456789012345678901234567890 = 123468; \ int t1234567890123456 = 123469; /* { dg-warning "Logical source line longer than 509 bytes" "" { target *-*-* } 0 } */ /* w.3.9: Macro definitions: more than 1024 (including predefined ones). */ #define X0400 #include "m4095.h" /* 0x0400; */ BNJ; /* { dg-warning "More than 1024 macros defined" "" { target *-*-* } 0 } */ mcpp-2.7.2/cpp-test/test-t/warn_1_1.c0000644000175000017500000000062310216765467014153 00000000000000/* warn_1_1.c */ /* * The following text is legal but suspicious one. Good preprocessor * will warn at this text. */ /* { dg-do preprocess } */ /* { dg-options "-ansi -pedantic -Wall" } */ /* w.1.1: "/*" in comment. */ /* { dg-warning "(\"/\\*\"|`/\\*') within comment" } */ /* comment /* nested comment and no closing */ /* { dg-warning "(\"/\\*\"|`/\\*') within comment" } */ mcpp-2.7.2/cpp-test/test-t/unbal2.h0000644000175000017500000000011410216765467013727 00000000000000/* unbal2.h */ #define UNBAL2 1 #if UNBAL2 /* line 5 */ #else mcpp-2.7.2/cpp-test/test-t/n_3_4.c0000644000175000017500000000106510216765467013447 00000000000000/* n_3_4.c: Handling of comment and . */ /* 3.4: Comment and in #error line. */ #error Message of first physical line. \ Message of second physical and first logical line. /* this comment splices the lines */ Message of forth physical and third logical line. /* { dg-do preprocess } { dg-options "-ansi -w" } { dg-error "Message of first physical line\. *Message of second physical and first logical line\. *Message of forth physical and third logical line\." "n_3_4.c" { target *-*-* } 0 } */ mcpp-2.7.2/cpp-test/test-t/nest11.h0000644000175000017500000000004310216765467013660 00000000000000/* nest11.h */ #include "nest12.h" mcpp-2.7.2/cpp-test/test-t/n_23.c0000644000175000017500000000125210216765467013304 00000000000000/* n_23.c: ## operator in macro definition. */ #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) /* 23.1: */ /* xy; */ glue( x, y); /* 23.2: Generate a preprocessing number. */ /* .12e+2; */ #define EXP 2 xglue( .12e+, EXP); /* { dg-do preprocess } { dg-final { if ![file exist n_23.i] { return } } } { dg-final { if \{ [grep n_23.i "xy"] != "" \} \{ } } { dg-final { if \{ [grep n_23.i "\.12e\\+2"] != "" \} \{ } } { dg-final { return \} \} } } { dg-final { fail "n_23.c: ## operator" } } */ mcpp-2.7.2/src/0000777000175000017500000000000011114177233010255 500000000000000mcpp-2.7.2/src/main_libmcpp.c0000644000175000017500000000022410777561563013006 00000000000000/* most simple sample source to use libmcpp */ #include "mcpp_lib.h" int main (int argc, char *argv[]) { return mcpp_lib_main (argc, argv); } mcpp-2.7.2/src/Makefile.am0000644000175000017500000000301211064625645012232 00000000000000## Process this file with automake to produce Makefile.in if MCPP_LIB bin_PROGRAMS = mcpp mcpp_SOURCES = main_libmcpp.c mcpp_DEPENDENCIES = libmcpp.la mcpp_LDADD = -lmcpp lib_LTLIBRARIES = libmcpp.la libmcpp_la_SOURCES = system.H configed.H internal.H main.c directive.c \ eval.c expand.c mbchar.c support.c system.c libmcpp_la_LDFLAGS = -no-undefined -version-info 3:0:3 include_HEADERS = mcpp_lib.h mcpp_out.h main.lo directive.lo eval.lo expand.lo mbohar.lo support.lo system.lo \ : system.H internal.H mcpp_lib.h mcpp_out.h system.H : configed.H else bin_PROGRAMS = mcpp mcpp_SOURCES = system.H configed.H internal.H main.c directive.c eval.c \ expand.c mbchar.c support.c system.c mcpp_out.h mcpp_CFLAGS = $(AM_CFLAGS) ## dummy to avoid conflict with MCPP_LIB main.o directive.o eval.o expand.o mbohar.o support.o system.o : \ system.H internal.H mcpp_out.h system.H : configed.H endif if REPLACE_CPP if GNUC if MINGW cc1_PROGRAMS = cc1 cc1_SOURCES = cc1.c cc1dir = $(bindir) endif install-exec-hook: @if test x"$(gcc_path)" = x""; then exit 1; fi @$(srcdir)/set_mcpp.sh '$(gcc_path)' $(gcc_maj_ver) $(gcc_min_ver) \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(CPPFLAGS)' 'x$(EXEEXT)' \ '$(LN_S)' '$(inc_dir)' $(host_system) $(Target_Cpu) \ $(target_cc) uninstall-hook: @$(srcdir)/unset_mcpp.sh '$(gcc_path)' $(gcc_maj_ver) $(gcc_min_ver)\ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(EXEEXT)' '$(LN_S)' \ '$(inc_dir)' $(host_system) $(target_cc) endif endif mcpp-2.7.2/src/mbchar.c0000644000175000017500000010027510764507505011607 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * M B C H A R . C * C h a r a c t e r h a n d l i n g R o u t i n e s * * Character handling and multi-byte character handling routines are * placed here. */ #if PREPROCESSED #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif /* * Tables of character types and multi-byte character types. * * Some of these character attributes will be overwritten by * execution time option '-@post' or '-@old'. * Warning on erroneous sequence will be issued from the caller routines: * scan_quote(), scan_id() or scan_number(). */ /* Non-ASCII characters are always checked by mb_read(). */ #define NA 0x4000 /* Non-ASCII characters */ /* Horizontal spaces (' ', '\t' and TOK_SEP) */ #define HSPA (SPA | HSP) short * char_type; /* Pointer to one of the following type_*[]. */ #define EJ1 0x100 /* 1st byte of EUC_JP */ #define EJ2 0x200 /* 2nd byte of EUC_JP */ #define GB1 0x400 /* 1st byte of GB2312 */ #define GB2 0x800 /* 2nd byte of GB2312 */ #define KS1 0x1000 /* 1st byte of KSC5601 */ #define KS2 0x2000 /* 2nd byte of KSC5601 */ #define EJ12 (EJ1 | EJ2) /* 1st byte or 2nd byte of EUC_JP */ #define GB12 (GB1 | GB2) #define KS12 (KS1 | KS2) #define EJ1N (NA | EJ1) #define EU12N (NA | EJ12 | GB12 | KS12) /* 1st or 2nd byte of EUC_JP, GB2312 or KSC5601, or any other non-ASCII */ static short type_euc[ UCHARMAX + 1] = { /* * For EUC_JP, GB2312, KSC5601 or other similar multi-byte char encodings. */ /* Character type codes */ /* 0, 1, 2, 3, 4, 5, 6, 7, */ /* 8, 9, A, B, C, D, E, F, Hex */ 000, 000, 000, 000, 000, 000, 000, 000, /* 00 */ 000, HSPA, SPA, SPA, SPA, SPA, 000, 000, /* 08 */ 000, 000, 000, 000, 000, 000, 000, 000, /* 10 */ /* 0x17-0x1A and 0x1F will be cleared in some modes by chk_opts() */ 000, LET, LET, 000, 000, 000, 000, HSPA, /* 18 */ HSPA, PUNC, QUO, PUNC, 000, PUNC, PUNC, QUO, /* 20 !"#$%&' */ PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, DOT, PUNC, /* 28 ()*+,-./ */ DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, /* 30 01234567 */ DIG, DIG, PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, /* 38 89:;<=>? */ 000, LET, LET, LET, LET, LET, LET, LET, /* 40 @ABCDEFG */ LET, LET, LET, LET, LET, LET, LET, LET, /* 48 HIJKLMNO */ LET, LET, LET, LET, LET, LET, LET, LET, /* 50 PQRSTUVW */ LET, LET, LET, PUNC, 000, PUNC, PUNC, LET, /* 58 XYZ[\]^_ */ 000, LET, LET, LET, LET, LET, LET, LET, /* 60 `abcdefg */ LET, LET, LET, LET, LET, LET, LET, LET, /* 68 hijklmno */ LET, LET, LET, LET, LET, LET, LET, LET, /* 70 pqrstuvw */ LET, LET, LET, PUNC, PUNC, PUNC, PUNC, 000, /* 78 xyz{|}~ */ NA, NA, NA, NA, NA, NA, NA, NA, /* 80 .. 87 */ NA, NA, NA, NA, NA, NA, EJ1N, NA, /* 88 .. 8F */ NA, NA, NA, NA, NA, NA, NA, NA, /* 90 .. 97 */ NA, NA, NA, NA, NA, NA, NA, NA, /* 98 .. 9F */ NA, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* A0 .. A7 */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* A8 .. AF */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* B0 .. B7 */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* B8 .. BF */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* C0 .. C7 */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* C8 .. CF */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* D0 .. D7 */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* D8 .. DF */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* E0 .. E7 */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* E8 .. EF */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, /* F0 .. F7 */ EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, EU12N, NA, /* F8 .. FF */ }; static short type_bsl[ UCHARMAX + 1] = { /* * For SJIS, BIGFIVE or other similar encodings which may have '\\' value as * the second byte of multi-byte character. */ #define SJ1 0x100 /* 1st byte of SJIS */ #define SJ2 0x200 /* 2nd byte of SJIS */ #define BF1 0x400 /* 1st byte of BIGFIVE */ #define BF2 0x800 /* 2nd byte of BIGFIVE */ #define SB2 (SJ2 | BF2) #define SJ2N (NA | SJ2) #define SB2N (NA | SJ2 | BF2) #define SJ12N (NA | SJ1 | SJ2) #define BF12N (NA | BF1 | BF2) #define SB12N (NA | SJ1 | SJ2 | BF1 | BF2) #define S2B12N (NA | SJ2 | BF1 | BF2) #define LSB2 (LET | SB2) #define PSB2 (PUNC| SB2) /* Character type codes */ /* 0, 1, 2, 3, 4, 5, 6, 7, */ /* 8, 9, A, B, C, D, E, F, Hex */ 000, 000, 000, 000, 000, 000, 000, 000, /* 00 */ 000, HSPA, SPA, SPA, SPA, SPA, 000, 000, /* 08 */ 000, 000, 000, 000, 000, 000, 000, 000, /* 10 */ /* 0x17-0x1A and 0x1F will be cleared in some modes by chk_opts() */ 000, LET, LET, 000, 000, 000, 000, HSPA, /* 18 */ HSPA, PUNC, QUO, PUNC, 000, PUNC, PUNC, QUO, /* 20 !"#$%&' */ PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, DOT, PUNC, /* 28 ()*+,-./ */ DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, /* 30 01234567 */ DIG, DIG, PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, /* 38 89:;<=>? */ SB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, /* 40 @ABCDEFG */ LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, /* 48 HIJKLMNO */ LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, /* 50 PQRSTUVW */ LSB2, LSB2, LSB2, PSB2, SB2, PSB2, PSB2, LSB2, /* 58 XYZ[\]^_ */ SB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, /* 60 `abcdefg */ LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, /* 68 hijklmno */ LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, LSB2, /* 70 pqrstuvw */ LSB2, LSB2, LSB2, PSB2, PSB2, PSB2, PSB2, 000, /* 78 xyz{|}~ */ SB2N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, /* 80 .. 87 */ SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, /* 88 .. 8F */ SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, /* 90 .. 97 */ SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, SJ12N, /* 98 .. 9F */ SJ2N, S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* A0 .. A7 */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* A8 .. AF */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* B0 .. B7 */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* B8 .. BF */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* C0 .. C7 */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* C8 .. CF */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* D0 .. D7 */ S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N,S2B12N, /* D8 .. DF */ SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, /* E0 .. E7 */ SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, /* E8 .. EF */ SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, SB12N, /* F0 .. F7 */ SB12N, SB12N, SB12N, SB12N, SB12N, BF12N, BF12N, NA, /* F8 .. FF */ }; /* * For ISO2022_JP multi-byte character encoding. */ #define IS1 0x100 /* 1st byte of shift-sequence */ #define IS2 0x200 /* 2nd byte of shift-sequence */ #define IS3 0x400 /* 3rd byte of shift-sequence */ #define IS4 0x800 /* 4th byte of shift-sequence */ #define IJP 0x1000 /* 1st or 2nd byte of ISO-2022-JP (ISO-2022-JP1) */ #define PIJP (PUNC | IJP) #define QIJP (QUO | IJP) #define DTJP (DOT | IJP) #define DGJP (DIG | IJP) #define LIJP (LET | IJP) #define JPS2 (IJP | IS2) #define PJPS23 (PIJP | IS2 | IS3) #define LJPS3 (LIJP | IS3) #define LJPS4 (LIJP | IS4) static short type_iso2022_jp[ UCHARMAX + 1] = { /* Character type codes */ /* 0, 1, 2, 3, 4, 5, 6, 7, */ /* 8, 9, A, B, C, D, E, F, Hex */ 000, 000, 000, 000, 000, 000, 000, 000, /* 00 */ 000, HSPA, SPA, SPA, SPA, SPA, 000, 000, /* 08 */ 000, 000, 000, 000, 000, 000, 000, 000, /* 10 */ /* 0x17-0x1A and 0x1F will be cleared in some modes by chk_opts() */ 000, LET, LET, IS1, 000, 000, 000, HSPA, /* 18 */ HSPA, PIJP, QIJP, PIJP, JPS2, PIJP, PIJP, QIJP, /* 20 !"#$%&' */ PJPS23,PIJP, PIJP, PIJP, PIJP, PIJP, DTJP, PIJP, /* 28 ()*+,-./ */ DGJP, DGJP, DGJP, DGJP, DGJP, DGJP, DGJP, DGJP, /* 30 01234567 */ DGJP, DGJP, PIJP, PIJP, PIJP, PIJP, PIJP, PIJP, /* 38 89:;<=>? */ IJP, LIJP, LJPS3, LIJP, LJPS4, LIJP, LIJP, LIJP, /* 40 @ABCDEFG */ LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, /* 48 HIJKLMNO */ LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, /* 50 PQRSTUVW */ LIJP, LIJP, LIJP, PIJP, IJP, PIJP, PIJP, LIJP, /* 58 XYZ[\]^_ */ IJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, /* 60 `abcdefg */ LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, /* 68 hijklmno */ LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, LIJP, /* 70 pqrstuvw */ LIJP, LIJP, LIJP, PIJP, PIJP, PIJP, PIJP, 000, /* 78 xyz{|}~ */ NA, NA, NA, NA, NA, NA, NA, NA, /* 80 .. 87 */ NA, NA, NA, NA, NA, NA, NA, NA, /* 88 .. 8F */ NA, NA, NA, NA, NA, NA, NA, NA, /* 90 .. 97 */ NA, NA, NA, NA, NA, NA, NA, NA, /* 98 .. 9F */ NA, NA, NA, NA, NA, NA, NA, NA, /* A0 .. A7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* A8 .. AF */ NA, NA, NA, NA, NA, NA, NA, NA, /* B0 .. B7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* B8 .. BF */ NA, NA, NA, NA, NA, NA, NA, NA, /* C0 .. C7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* C8 .. CF */ NA, NA, NA, NA, NA, NA, NA, NA, /* D0 .. D7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* D8 .. DF */ NA, NA, NA, NA, NA, NA, NA, NA, /* E0 .. E7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* E8 .. EF */ NA, NA, NA, NA, NA, NA, NA, NA, /* F0 .. F7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* F8 .. FF */ }; /* * For UTF8 multi-byte character encoding. */ #define U2_1 0x100 /* 1st byte of 2-byte encoding of UTF8 */ #define U3_1 0x200 /* 1st byte of 3-byte encoding of UTF8 */ #define U4_1 0x400 /* 1st byte of 4-byte encoding of UTF8 */ #define UCONT 0x800 /* Continuation of a 2, 3, or 4 byte UTF8 sequence */ #define U2_1N (NA | U2_1) #define U3_1N (NA | U3_1) #define U4_1N (NA | U4_1) #define UCONTN (NA | UCONT) static short type_utf8[ UCHARMAX + 1] = { /* Character type codes */ /* 0, 1, 2, 3, 4, 5, 6, 7, */ /* 8, 9, A, B, C, D, E, F, Hex */ 000, 000, 000, 000, 000, 000, 000, 000, /* 00 */ 000, HSPA, SPA, SPA, SPA, SPA, 000, 000, /* 08 */ 000, 000, 000, 000, 000, 000, 000, 000, /* 10 */ /* 0x17-0x1A and 0x1F will be cleared in some modes by chk_opts() */ 000, LET, LET, 000, 000, 000, 000, HSPA, /* 18 */ HSPA, PUNC, QUO, PUNC, 000, PUNC, PUNC, QUO, /* 20 !"#$%&' */ PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, DOT, PUNC, /* 28 ()*+,-./ */ DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, /* 30 01234567 */ DIG, DIG, PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, /* 38 89:;<=>? */ 000, LET, LET, LET, LET, LET, LET, LET, /* 40 @ABCDEFG */ LET, LET, LET, LET, LET, LET, LET, LET, /* 48 HIJKLMNO */ LET, LET, LET, LET, LET, LET, LET, LET, /* 50 PQRSTUVW */ LET, LET, LET, PUNC, 000, PUNC, PUNC, LET, /* 58 XYZ[\]^_ */ 000, LET, LET, LET, LET, LET, LET, LET, /* 60 `abcdefg */ LET, LET, LET, LET, LET, LET, LET, LET, /* 68 hijklmno */ LET, LET, LET, LET, LET, LET, LET, LET, /* 70 pqrstuvw */ LET, LET, LET, PUNC, PUNC, PUNC, PUNC, 000, /* 78 xyz{|}~ */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* 80 .. 87 */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* 88 .. 8F */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* 90 .. 97 */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* 98 .. 9F */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* A0 .. A7 */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* A8 .. AF */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* B0 .. B7 */ UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN,UCONTN, /* B8 .. BF */ NA, NA, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, /* C0 .. C7 */ U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, /* C8 .. CF */ U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, /* D0 .. D7 */ U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, U2_1N, /* D8 .. DF */ U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, /* E0 .. E7 */ U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, U3_1N, /* E8 .. EF */ U4_1N, U4_1N, U4_1N, U4_1N, U4_1N, NA, NA, NA, /* F0 .. F7 */ NA, NA, NA, NA, NA, NA, NA, NA, /* F8 .. FF */ }; #define SETLOCALE 2 /* #pragma setlocale (not __setlocale) */ #define NUM_ENCODING 8 #define NUM_ALIAS 6 /* Names of encoding recognized. Table for search_encoding(). */ static const char * const encoding_name[ NUM_ENCODING][ NUM_ALIAS] = { /* Visual C full, Visual C short , 4 miscellaneous */ { "english", "c" , "c", "en", "latin", "iso8859"}, { "", "" , "eucjp", "euc", "ujis", ""}, { "chinesesimplified", "chs" , "gb2312", "cngb", "euccn", ""}, { "korean", "kor" , "ksc5601", "ksx1001", "wansung", "euckr"}, { "japanese", "jpn" , "sjis", "shiftjis", "mskanji", ""}, { "chinesetraditional", "cht" , "bigfive", "big5", "cnbig5", "euctw"}, { "", "" , "iso2022jp", "iso2022jp1", "jis", ""}, { "", "" , "utf8", "utf", "", ""}, }; static int mbstart; static int mb2; static size_t mb_read_2byte( int c1, char ** in_pp, char ** out_pp); /* For 2-byte encodings of mbchar */ static const char * search_encoding( char * norm, int alias); /* Search encoding_name[][] table */ static void strip_bar( char * string); /* Remove '_', '-' or '.' in the string */ static void conv_case( char * name, char * lim, int upper); /* Convert to upper/lower case */ static size_t mb_read_iso2022_jp( int c1, char ** in_pp, char ** out_pp); /* For ISO2022_JP encoding */ static size_t mb_read_utf8( int c1, char ** in_pp, char ** out_pp); /* For UTF8 mbchar encoding */ #define NAMLEN 20 #define UPPER 1 /* To upper */ #define LOWER 0 /* To lower */ const char * set_encoding( char * name, /* Name of encoding specified */ char * env, /* Name of environment variable */ int pragma /* 2: #pragma setlocale, 1: #pragma __setlocale, 0: not #pragma */ ) /* * Search the encoding specified and re-initialize mbchar settings. */ { const char * unknown_encoding = "Unknown encoding: %s%.0ld%.0s"; /* _W1_ */ const char * too_long = "Too long encoding name: %s%.0ld%.0s"; /* _E_ */ const char * loc = ""; int alias; char norm[ NAMLEN]; /* * Normalized name (removed 'xxxxx.', stripped '_', '-', '.' * and lowered. */ if (strlen( name) >= NAMLEN) { if ((env || pragma) && (warn_level & 1)) { cwarn( too_long, name, 0L, NULL); } else { mcpp_fprintf( ERR, too_long, name); mcpp_fputc( '\n', ERR); } } strcpy( norm, name); if (norm[ 5] == '.') memmove( norm, norm + 5, strlen( norm + 5) + 1); /* Remove initial 'xxxxx.' as 'ja_JP.', 'en_US.' or any other */ conv_case( norm, norm + strlen( norm), LOWER); strip_bar( norm); if (strlen( name) == 0) { /* "" */ mbchar = MBCHAR; /* Restore to the default encoding */ } else if (memcmp( norm, "iso8859", 7) == 0 /* iso8859* */ || memcmp( norm, "latin", 5) == 0 /* latin* */ || memcmp( norm, "en", 2) == 0) { /* en* */ mbchar = 0; /* No multi-byte character */ } else { alias = 2; #if COMPILER == MSC if (pragma == SETLOCALE) /* #pragma setlocale */ alias = 0; #endif loc = search_encoding( norm, alias); /* Search the name */ } if (loc == NULL) { if ((env || pragma) && (warn_level & 1)) { cwarn( unknown_encoding, name, 0L, NULL); } else { /* -m option */ mcpp_fprintf( ERR, unknown_encoding, name); mcpp_fputc( '\n', ERR); } } else { mb_init(); /* Re-initialize */ } return loc; } static const char * search_encoding( char * norm, /* The name of encoding specified */ int alias /* The number of alias to start searching */ ) { const char * loc; int lo, al; for (lo = 0; lo < NUM_ENCODING; lo++) { for (al = alias ; al < NUM_ALIAS; al++) { loc = encoding_name[ lo][ al]; if (str_eq( loc, norm)) { switch (lo) { case 0 : mbchar = 0; break; case 1 : mbchar = EUC_JP; break; case 2 : mbchar = GB2312; break; case 3 : mbchar = KSC5601; break; case 4 : mbchar = SJIS; break; case 5 : mbchar = BIGFIVE; break; case 6 : mbchar = ISO2022_JP; break; case 7 : mbchar = UTF8; break; } return loc; } } } return NULL; } static void strip_bar( char * string ) /* * Strip '_', '-' or '.' in the string. */ { char * cp = string; while (*cp != EOS) { if (*cp == '_' || *cp == '-' || *cp == '.') memmove( cp, cp + 1, strlen( cp)); else cp++; } } static void conv_case( char * name, /* (diretory) Name */ char * lim, /* End of (directory) name */ int upper /* TRUE if to upper */ ) /* Convert a string to upper-case letters or lower-case letters in-place */ { int c; char * sp; for (sp = name; sp < lim; sp++) { c = *sp & UCHARMAX; #if MBCHAR if ((char_type[ c] & mbstart)) { char tmp[ PATHMAX+1]; char * tp = tmp; *tp++ = *sp++; mb_read( c, &sp, &tp); } else #endif { if (upper) *sp = toupper( c); else *sp = tolower( c); } } } void mb_init( void) /* * Initialize multi-byte character settings. * First called prior to setting the 'mcpp_mode'. * Will be called again each time the multibyte character encoding is changed. */ { /* * Select the character classification table, select the multi-byte * character reading routine and decide whether multi-byte character * may contain the byte of value 0x5c. */ switch (mbchar) { case 0 : case EUC_JP : case GB2312 : case KSC5601 : char_type = type_euc; bsl_in_mbchar = FALSE; mb_read = mb_read_2byte; break; case SJIS : case BIGFIVE : char_type = type_bsl; bsl_in_mbchar = TRUE; mb_read = mb_read_2byte; break; case ISO2022_JP : char_type = type_iso2022_jp; bsl_in_mbchar = TRUE; mb_read = mb_read_iso2022_jp; break; case UTF8 : char_type = type_utf8; bsl_in_mbchar = FALSE; mb_read = mb_read_utf8; break; } /* Set the bit patterns for character classification. */ switch (mbchar) { case 0 : mbstart = 0; break; case EUC_JP : mbstart = EJ1; mb2 = EJ2; break; case GB2312 : mbstart = GB1; mb2 = GB2; break; case KSC5601: mbstart = KS1; mb2 = KS2; break; case SJIS : mbstart = SJ1; mb2 = SJ2; break; case BIGFIVE: mbstart = BF1; mb2 = BF2; break; case ISO2022_JP : mbstart = IS1; break; case UTF8 : mbstart = (U2_1 | U3_1 | U4_1); break; } switch (mbchar) { case 0 : mbchk = 0; break; case EUC_JP : case GB2312 : case KSC5601: case SJIS : case BIGFIVE: case UTF8 : mbchk = NA; break; case ISO2022_JP : mbchk = (IS1 | NA); break; } /* * Set special handling for some encodings to supplement some compiler's * deficiency. */ switch (mbchar) { case SJIS : #if ! SJIS_IS_ESCAPE_FREE bsl_need_escape = TRUE; #endif break; case BIGFIVE: #if ! BIGFIVE_IS_ESCAPE_FREE bsl_need_escape = TRUE; #endif break; case ISO2022_JP : #if ! ISO2022_JP_IS_ESCAPE_FREE bsl_need_escape = TRUE; #endif break; default : bsl_need_escape = FALSE; break; } /* * Modify magic characters in character type table. * char_type[] table should be rewritten in accordance with the 'mcpp_mode' * whenever the encoding is changed. */ if (mcpp_mode) { /* If mcpp_mode is already set */ char_type[ DEF_MAGIC] = standard ? LET : 0; char_type[ IN_SRC] = (mcpp_mode == STD) ? LET : 0; char_type[ TOK_SEP] = (mcpp_mode == STD || mcpp_mode == OLD_PREP) ? HSPA: 0; /* TOK_SEP equals to COM_SEP */ } } static size_t mb_read_2byte( int c1, /* The 1st byte of mbchar sequence (already read) */ char ** in_pp, /* Pointer to input */ char ** out_pp /* Pointer to output */ ) /* * Multi-byte character reading routine for 2-byte encodings. */ { int error = FALSE; size_t len = 0; /* Number of multi-byte characters read. */ char * in_p = *in_pp; char * out_p = *out_pp; if (! (char_type[ c1 & UCHARMAX] & mbstart)) return MB_ERROR; /* Not a multi-byte character */ do { if (! (char_type[ (*out_p++ = *in_p++) & UCHARMAX] & mb2)) { error = TRUE; break; } len++; } while (char_type[ (*out_p++ = *in_p++) & UCHARMAX] & mbstart); *in_pp = --in_p; *(--out_p) = EOS; *out_pp = out_p; return error ? (len | MB_ERROR) : len; } static size_t mb_read_iso2022_jp( int c1, /* The 1st byte of the sequence already read (always 0x1b). */ char ** in_pp, char ** out_pp ) /* * Multi-byte character reading routine for ISO2022_JP. */ { int error = FALSE; size_t len = 0; char * in_p = *in_pp; char * out_p = *out_pp; int c2, c3, c4; if (! (char_type[ c1 & UCHARMAX] & mbstart)) return MB_ERROR; do { *out_p++ = c2 = *in_p++; if (! (char_type[ c2 & UCHARMAX] & IS2)) { error = TRUE; break; } *out_p++ = c3 = *in_p++; if (! (char_type[ c3 & UCHARMAX] & IS3)) { error = TRUE; break; } switch (c2) { case 0x24 : switch (c3) { case 0x42 : /* 0x1b 0x24 0x42: JIS X 0208-1983 */ break; case 0x28 : *out_p++ = c4 = *in_p++; if (! (char_type[ c4 & UCHARMAX] & IS4)) error = TRUE; /* else: 0x1b 0x24 0x28 0x44: JIS X 0212 */ break; default : error = TRUE; } break; case 0x28 : switch (c3) { case 0x42 : /* 0x1b 0x28 0x42: ASCII */ c1 = *out_p++ = *in_p++ & UCHARMAX; continue; default : error = TRUE; } break; } if (error) break; while (char_type[ c1 = *out_p++ = (*in_p++ & UCHARMAX)] & IJP) { if (! (char_type[ *out_p++ = (*in_p++ & UCHARMAX)] & IJP)) { error = TRUE; break; } len++; /* String of multi-byte characters */ } if (error) break; } while (char_type[ c1] & IS1); /* 0x1b: start of shift-sequence */ *in_pp = --in_p; *(--out_p) = EOS; *out_pp = out_p; return error ? (len | MB_ERROR) : len; } static size_t mb_read_utf8( int c1, char ** in_pp, char ** out_pp ) /* * Multi-byte character reading routine for UTF8. */ { int error = FALSE; size_t len = 0; char * in_p = *in_pp; char * out_p = *out_pp; if (! (char_type[ c1 & UCHARMAX] & mbstart)) return MB_ERROR; do { unsigned int codepoint; int i, bytes; if ((char_type[ c1 & UCHARMAX] & U4_1) == U4_1) bytes = 4; /* 4-byte character */ else if ((char_type[ c1 & UCHARMAX] & U3_1) == U3_1) bytes = 3; /* 3-byte character */ else if ((char_type[ c1 & UCHARMAX] & U2_1) == U2_1) bytes = 2; /* 2-byte character */ /* Must ensure that the sequence is not reserved as a surrogate */ codepoint = ((2 << (6-bytes)) - 1) & c1; /* mask off top bits */ /* All bytes left in the sequence must be in 0x80 - 0xBF */ for (i = bytes - 1; i && !error; i--) { codepoint = (codepoint << 6) + ((*in_p) & 0x3fU); if (! (char_type[ (*out_p++ = *in_p++) & UCHARMAX] & UCONT)) error = TRUE; } /* Check for overlong/underlong sequences */ if ((bytes == 2 && (codepoint < 0x80 || codepoint > 0x7FF)) || (bytes == 3 && (codepoint < 0x800 || codepoint > 0xFFFF)) || (bytes == 4 && (codepoint < 0x10000 || codepoint > 0x10FFFF))) error = TRUE; if ((codepoint >= 0xD800 && codepoint <= 0xDFFF) /* Check for reserved surrogate codepoints */ || (codepoint >= 0xFFFE && codepoint <= 0xFFFF)) /* Illegal */ error = TRUE; #if 0 printf( "codepoint:0x%x\n", codepoint); #endif if (error) break; len++; } while (char_type[ (*out_p++ = c1 = *in_p++) & UCHARMAX] & mbstart); /* Start of the next multi-byte character */ *in_pp = --in_p; *(--out_p) = EOS; *out_pp = out_p; return error ? (len | MB_ERROR) : len; } uexpr_t mb_eval( char ** seq_pp ) /* * Evaluate the value of a multi-byte character. * This routine does not check the legality of the sequence. * This routine is called from eval_char(). * This routine is never called in POST_STD mode. */ { char * seq = *seq_pp; uexpr_t val = 0; int c, c1; if (! (char_type[ c = *seq++ & UCHARMAX] & mbstart)) { *seq_pp = seq; return c; /* Not a multi-byte character */ } switch (mbchar) { case EUC_JP : case GB2312 : case KSC5601: case SJIS : case BIGFIVE: val = (c << 8) + (*seq++ & UCHARMAX); /* Evaluate the 2-byte sequence */ break; case ISO2022_JP : if (char_type[ c & UCHARMAX] & IS1) { /* Skip shift-sequence */ if (char_type[ c = *seq++ & UCHARMAX] & IS2) { if (char_type[ c1 = *seq++ & UCHARMAX] & IS3) { if (c1 == 0x28) seq++; if (c == 0x28 && c1 == 0x42) { /* Shift-out sequence */ val = 0; break; } c = *seq++ & UCHARMAX; } } } val = (c << 8) + (*seq++ & UCHARMAX); /* Evaluate the 2-bytes */ break; case UTF8 : /* Evaluate the sequence of 2, 3 or 4 bytes as it is */ val = (c << 8) + (*seq++ & UCHARMAX); if (char_type[ c & UCHARMAX] & U3_1) { val = (val << 8) + (*seq++ & UCHARMAX); } else if (char_type[ c & UCHARMAX] & U4_1) { val = (val << 8) + (*seq++ & UCHARMAX); val = (val << 8) + (*seq++ & UCHARMAX); } break; } *seq_pp = seq; return val; } int last_is_mbchar( const char * in, /* Input physical line */ int len /* Length of the line minus 2 */ ) /* * Return 2, if the last char of the line is second byte of SJIS or BIGFIVE, * else return 0. */ { const char * cp = in + len; const char * const endp = in + len; /* -> the char befor '\n' */ if ((mbchar & (SJIS | BIGFIVE)) == 0) return 0; while (in <= --cp) { /* Search backwardly */ if ((char_type[ *cp & UCHARMAX] & mbstart) == 0) break; /* Not the first byte of MBCHAR */ } if ((endp - cp) & 1) return 0; else return 2; } mcpp-2.7.2/src/testmain.c0000644000175000017500000000522411002371155012157 00000000000000/* * testmain.c: A sample source to show how to use mcpp as a subroutine. * 2006/11 Contributed by Juergen Mueller. * Refer to mcpp-porting.html section 3.12 for compiling mcpp as a subroutine. * * 2007/03 Updated to enable testing of memory buffer output. * 2008/04 The macro MCPP_LIB is no longer necessary. */ #include #include #include #include "mcpp_lib.h" int main(int argc, char *argv[]) { int i, j; char ** tmp_argv; tmp_argv = (char **) malloc(sizeof(char *) * (argc + 1)); if (tmp_argv == NULL) { return(0); } /* * assume strict order: and * each option and its argument are specified without intervening spaces * such as '-I/dir' or '-otmp.i' (not '-I /dir' nor '-o tmp.i'). */ for (i = 0; i < argc; ++i) { tmp_argv[i] = argv[i]; /* copy options */ if ( (*argv[i] != '-') && (*argv[i] != '/') && (i > 0)) { break; } } /* this works only if called function does not manipulate pointer array! */ /* * Note that mcpp no longer uses freopen() since 2008/04/20, so you can * output multiple input to different files, though this sample output * to stdout, which may be redirected. */ for (j = i; i < argc; ++i) { int retval; char * result; clock_t start, finish; tmp_argv[j] = argv[i]; /* process each file */ fprintf(stderr, "\n%s\n", argv[i]); start = clock(); /* get start time */ #if OUT2MEM /* Use memory buffer */ mcpp_use_mem_buffers( 1); /* enable memory output */ retval = mcpp_lib_main(j + 1, tmp_argv); /* call MCPP */ result = mcpp_get_mem_buffer( OUT); /* get the output */ if (result) fputs( result, stdout); result = mcpp_get_mem_buffer( ERR); /* get the diagnostics */ if (result) fputs( result, stderr); #if 0 /* debug output is the same with normal output by default */ result = mcpp_get_mem_buffer( DBG); /* get the debug output */ if (result) fputs( result, stdout); /* appended to output */ #endif #else /* Normal output to file */ retval = mcpp_lib_main(j + 1, tmp_argv); #endif finish = clock(); /* get finish time */ fprintf(stderr, "\nReturned status:%d, Elapsed time: %.3f seconds.\n", retval, (double)(finish - start) / (double)CLOCKS_PER_SEC); } free(tmp_argv); return(0); } mcpp-2.7.2/src/unset_mcpp.sh0000755000175000017500000000461211065662214012713 00000000000000#!/bin/sh # script to set GNU CPP or CC1, CC1PLUS to be called from gcc # ./unset_mcpp.sh $gcc_path $gcc_maj_ver $gcc_min_ver $cpp_call $CC $CXX # x$EXEEXT $LN_S $inc_dir $host_system $target_cc gcc_maj_ver=$2 gcc_min_ver=$3 cpp_call=$4 CC=$5 CXX=$6 LN_S=$8 inc_dir=$9 host_system=${10} target_cc=${11} cpp_name=`echo $cpp_call | sed 's,.*/,,'` cpp_path=`echo $cpp_call | sed "s,/$cpp_name,,"` gcc_path=`echo $1 | sed "s,/${CC}\$,,"` EXEEXT=`echo $7 | sed 's/^x//'` if test x$EXEEXT != x; then cpp_base=`echo $cpp_name | sed "s/$EXEEXT//"` else cpp_base=$cpp_name fi echo " rm -fr $inc_dir/mcpp-gcc*" rm -fr $inc_dir/mcpp-gcc* if test $host_system = SYS_CYGWIN; then echo " rm -fr $inc_dir/mingw" rm -fr $inc_dir/mingw fi echo " cd $cpp_path" cd $cpp_path if (test -h $cpp_name || test $host_system = SYS_MINGW) \ && test -f ${cpp_base}_gnuc$EXEEXT; then rm -f $cpp_name mcpp.sh echo " mv ${cpp_base}_gnuc$EXEEXT $cpp_name" mv -f ${cpp_base}_gnuc$EXEEXT $cpp_name if test x$cpp_base = xcc1; then rm -f cc1plus$EXEEXT mcpp_plus.sh echo " mv cc1plus_gnuc$EXEEXT cc1plus$EXEEXT" mv -f cc1plus_gnuc$EXEEXT cc1plus$EXEEXT fi fi if test x$gcc_maj_ver = x2; then exit 0 fi echo " cd $gcc_path" cd $gcc_path if test $host_system = SYS_MAC && test x${target_cc} != x; then CC_=$target_cc CXX_=`echo $target_cc | sed 's/gcc/g++/'` else CC_=$CC CXX_=$CXX fi for cc in $CC_ $CXX_ do if test $host_system != SYS_MINGW; then ref=`readlink $cc` fi if test x$ref = x; then ref=$cc fi ccache=`grep ccache $ref` if test x$ccache != x; then ## search the real $cc in $PATH for path in `echo $PATH | sed 's/:/ /g'` do if test -f $path/$cc$EXEEXT && test $gcc_path != $path; then break; fi done gcc_path=$path echo " cd $gcc_path" cd $gcc_path ref=`readlink $cc` fi if test x$ref = x$cc.sh || test $host_system = SYS_MINGW; then entity=`grep $gcc_path $cc.sh | sed "s,$gcc_path/,," | sed "s/_proper.*$//"` rm -f $entity echo " mv ${entity}_proper$EXEEXT $entity$EXEEXT" mv -f ${entity}_proper$EXEEXT $entity$EXEEXT if test $entity != $cc; then echo " $LN_S $entity $cc" $LN_S -f $entity $cc fi rm -f $cc.sh fi done mcpp-2.7.2/src/directive.c0000644000175000017500000017351310775171141012331 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * D I R E C T I V E . C * P r o c e s s D i r e c t i v e L i n e s * * The routines to handle directives other than #include and #pragma * are placed here. */ #if PREPROCESSED #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif static int do_if( int hash, const char * directive_name); /* #if, #elif, #ifdef, #ifndef */ static void sync_linenum( void); /* Synchronize number of newlines */ static long do_line( void); /* Process #line directive */ static int get_parm( void); /* Get parameters of macro, its nargs, names, lengths */ static int get_repl( const char * macroname); /* Get replacement text embedding parameter number */ static char * is_formal( const char * name, int conv); /* If formal parameter, save the number */ static char * def_stringization( char * repl_cur); /* Define stringization */ static char * mgtoken_save( const char * macroname); /* Prefix DEF_MAGIC to macro name in repl-text */ static char * str_parm_scan( char * string_end); /* Scan the parameter in quote */ static void do_undef( void); /* Process #undef directive */ static void dump_repl( const DEFBUF * dp, FILE * fp, int gcc2_va); /* Dump replacement text */ /* * Generate (by hand-inspection) a set of unique values for each directive. * MCPP won't compile if there are hash conflicts. */ #define L_if ('i' ^ (EOS << 1)) #define L_ifdef ('i' ^ ('d' << 1)) #define L_ifndef ('i' ^ ('n' << 1)) #define L_elif ('e' ^ ('i' << 1)) #define L_else ('e' ^ ('s' << 1)) #define L_endif ('e' ^ ('d' << 1)) #define L_define ('d' ^ ('f' << 1)) #define L_undef ('u' ^ ('d' << 1)) #define L_line ('l' ^ ('n' << 1)) #define L_include ('i' ^ ('c' << 1)) #if COMPILER == GNUC #define L_include_next ('i' ^ ('c' << 1) ^ ('_' << 1)) #endif #if SYSTEM == SYS_MAC #define L_import ('i' ^ ('p' << 1)) #endif #define L_error ('e' ^ ('r' << 1)) #define L_pragma ('p' ^ ('a' << 1)) static const char * const not_ident = "Not an identifier \"%s\""; /* _E_ */ static const char * const no_arg = "No argument"; /* _E_ */ static const char * const excess = "Excessive token sequence \"%s\""; /* _E_ _W1_ */ void directive( void) /* * Process #directive lines. Each directive have their own subroutines. */ { const char * const many_nesting = "More than %.0s%ld nesting of #if (#ifdef) sections%s"; /* _F_ _W4_ _W8_ */ const char * const not_in_section = "Not in a #if (#ifdef) section in a source file"; /* _E_ _W1_ */ const char * const illeg_dir = "Illegal #directive \"%s%.0ld%s\""; /* _E_ _W1_ _W8_ */ const char * const in_skipped = " (in skipped block)"; /* _W8_ */ FILEINFO * file; int token_type; int hash; int c; char * tp; in_directive = TRUE; if (keep_comments) { mcpp_fputc( '\n', OUT); /* Possibly flush out comments */ newlines--; } c = skip_ws(); if (c == '\n') /* 'null' directive */ goto ret; token_type = scan_token( c, (workp = work_buf, &workp), work_end); if (in_asm && (token_type != NAM || (! str_eq( identifier, "asm") && ! str_eq( identifier, "endasm")))) /* In #asm block, ignore #anything other than #asm or #endasm */ goto skip_line; if (token_type != NAM) { if (mcpp_mode == OLD_PREP && token_type == NUM) { /* # 123 [fname]*/ strcpy( identifier, "line"); } else { if (compiling) { if (option_flags.lang_asm) { if (warn_level & 1) cwarn( illeg_dir, work_buf, 0L, NULL); } else { cerror( illeg_dir, work_buf, 0L, NULL); } } else if (warn_level & 8) { cwarn( illeg_dir, work_buf, 0L, in_skipped); } goto skip_line; } } hash = (identifier[ 1] == EOS) ? identifier[ 0] : (identifier[ 0] ^ (identifier[ 2] << 1)); if (strlen( identifier) > 7) hash ^= (identifier[ 7] << 1); /* hash is set to a unique value corresponding to the directive.*/ switch (hash) { case L_if: tp = "if"; break; case L_ifdef: tp = "ifdef"; break; case L_ifndef: tp = "ifndef"; break; case L_elif: tp = "elif"; break; case L_else: tp = "else"; break; case L_endif: tp = "endif"; break; case L_define: tp = "define"; break; case L_undef: tp = "undef"; break; case L_line: tp = "line"; break; case L_include: tp = "include"; break; #if COMPILER == GNUC case L_include_next: tp = "include_next"; break; #endif #if SYSTEM == SYS_MAC case L_import: tp = "import"; break; #endif case L_error: tp = "error"; break; case L_pragma: tp = "pragma"; break; default: tp = NULL; break; } if (tp != NULL && ! str_eq( identifier, tp)) { /* Hash conflict*/ hash = 0; /* Unknown directive, will */ tp = NULL; /* be handled by do_old() */ } if (! compiling) { /* Not compiling now */ switch (hash) { case L_elif : if (! standard) { if (warn_level & 8) do_old(); /* Unknown directive */ goto skip_line; /* Skip the line */ } /* Else fall through */ case L_else : /* Test the #if's nest, if 0, compile */ case L_endif: /* Un-nest #if */ break; case L_if : /* These can't turn */ case L_ifdef: /* compilation on, but */ case L_ifndef : /* we must nest #if's.*/ if (&ifstack[ BLK_NEST] < ++ifptr) goto if_nest_err; if (standard && (warn_level & 8) && &ifstack[ std_limits.blk_nest + 1] == ifptr) cwarn( many_nesting, NULL, (long) std_limits.blk_nest , in_skipped); ifptr->stat = 0; /* !WAS_COMPILING */ ifptr->ifline = src_line; /* Line at section start*/ goto skip_line; default : /* Other directives */ if (tp == NULL && (warn_level & 8)) do_old(); /* Unknown directive ? */ goto skip_line; /* Skip the line */ } } macro_line = 0; /* Reset error flag */ file = infile; /* Remember the current file */ switch (hash) { case L_if: case L_ifdef: case L_ifndef: if (&ifstack[ BLK_NEST] < ++ifptr) goto if_nest_err; if (standard && (warn_level & 4) && &ifstack[ std_limits.blk_nest + 1] == ifptr) cwarn( many_nesting, NULL , (long) std_limits.blk_nest, NULL); ifptr->stat = WAS_COMPILING; ifptr->ifline = src_line; goto ifdo; case L_elif: if (! standard) { do_old(); /* Unrecognized directive */ break; } if (ifptr == &ifstack[0]) goto nest_err; if (ifptr == infile->initif) { goto in_file_nest_err; } if (ifptr->stat & ELSE_SEEN) goto else_seen_err; if ((ifptr->stat & (WAS_COMPILING | TRUE_SEEN)) != WAS_COMPILING) { compiling = FALSE; /* Done compiling stuff */ goto skip_line; /* Skip this group */ } hash = L_if; ifdo: c = do_if( hash, tp); if (mcpp_debug & IF) { mcpp_fprintf( DBG , "#if (#elif, #ifdef, #ifndef) evaluate to %s.\n" , compiling ? "TRUE" : "FALSE"); mcpp_fprintf( DBG, "line %ld: %s", src_line, infile->buffer); } if (c == FALSE) { /* Error */ compiling = FALSE; /* Skip this group */ goto skip_line; /* Prevent an extra error message */ } break; case L_else: if (ifptr == &ifstack[0]) goto nest_err; if (ifptr == infile->initif) { if (standard) goto in_file_nest_err; else if (warn_level & 1) cwarn( not_in_section, NULL, 0L, NULL); } if (ifptr->stat & ELSE_SEEN) goto else_seen_err; ifptr->stat |= ELSE_SEEN; ifptr->elseline = src_line; if (ifptr->stat & WAS_COMPILING) { if (compiling || (ifptr->stat & TRUE_SEEN) != 0) compiling = FALSE; else compiling = TRUE; } if ((mcpp_debug & MACRO_CALL) && (ifptr->stat & WAS_COMPILING)) { sync_linenum(); mcpp_fprintf( OUT, "/*else %ld:%c*/\n", src_line , compiling ? 'T' : 'F'); /* Show that #else is seen */ } break; case L_endif: if (ifptr == &ifstack[0]) goto nest_err; if (ifptr <= infile->initif) { if (standard) goto in_file_nest_err; else if (warn_level & 1) cwarn( not_in_section, NULL, 0L, NULL); } if (! compiling && (ifptr->stat & WAS_COMPILING)) wrong_line = TRUE; compiling = (ifptr->stat & WAS_COMPILING); if ((mcpp_debug & MACRO_CALL) && compiling) { sync_linenum(); mcpp_fprintf( OUT, "/*endif %ld*/\n", src_line); /* Show that #if block has ended */ } --ifptr; break; case L_define: do_define( FALSE, 0); break; case L_undef: do_undef(); break; case L_line: if ((c = do_line()) > 0) { src_line = c; sharp( NULL, 0); /* Putout the new line number and file name */ infile->line = --src_line; /* Next line number is 'src_line' */ newlines = -1; } else { /* Error already diagnosed by do_line() */ skip_nl(); } break; case L_include: in_include = TRUE; if (do_include( FALSE) == TRUE && file != infile) newlines = -1; /* File has been included. Clear blank lines */ in_include = FALSE; break; case L_error: if (! standard) { do_old(); /* Unrecognized directive */ break; } cerror( infile->buffer, NULL, 0L, NULL); /* _E_ */ break; case L_pragma: if (! standard) { do_old(); /* Unrecognized directive */ break; } do_pragma(); newlines = -1; /* Do not putout excessive '\n' */ break; default: /* Non-Standard or unknown directives */ do_old(); break; } switch (hash) { case L_if : case L_elif : case L_define : case L_line : goto skip_line; /* To prevent duplicate error message */ #if COMPILER == GNUC case L_include_next : if (file != infile) /* File has been included */ newlines = -1; #endif #if SYSTEM == SYS_MAC case L_import : if (file != infile) /* File has been included */ newlines = -1; #endif case L_error : if (standard) goto skip_line; /* Else fall through */ case L_include : case L_pragma : if (standard) break; /* Already read over the line */ /* Else fall through */ default : /* L_else, L_endif, L_undef, etc. */ if (mcpp_mode == OLD_PREP) { /* * Ignore the rest of the #directive line so you can write * #if foo * #endif foo */ ; } else if (skip_ws() != '\n') { #if COMPILER == GNUC if (standard && hash != L_endif) #else if (standard) #endif cerror( excess, infile->bptr-1, 0L, NULL); else if (warn_level & 1) cwarn( excess, infile->bptr-1, 0L, NULL); } skip_nl(); } goto ret; in_file_nest_err: cerror( not_in_section, NULL, 0L, NULL); goto skip_line; nest_err: cerror( "Not in a #if (#ifdef) section", NULL, 0L, NULL); /* _E_ */ goto skip_line; else_seen_err: cerror( "Already seen #else at line %.0s%ld" /* _E_ */ , NULL, ifptr->elseline, NULL); skip_line: skip_nl(); /* Ignore rest of line */ goto ret; if_nest_err: cfatal( many_nesting, NULL, (long) BLK_NEST, NULL); ret: in_directive = FALSE; keep_comments = option_flags.c && compiling && !no_output; keep_spaces = option_flags.k && compiling; /* keep_spaces is on for #define line even if no_output is TRUE */ if (! wrong_line) newlines++; } static int do_if( int hash, const char * directive_name) /* * Process an #if (#elif), #ifdef or #ifndef. The latter two are straight- * forward, while #if needs a subroutine to evaluate the expression. * do_if() is called only if compiling is TRUE. If false, compilation is * always supressed, so we don't need to evaluate anything. This supresses * unnecessary warnings. */ { int c; int found; DEFBUF * defp; if ((c = skip_ws()) == '\n') { unget_ch(); cerror( no_arg, NULL, 0L, NULL); return FALSE; } if (mcpp_debug & MACRO_CALL) { sync_linenum(); mcpp_fprintf( OUT, "/*%s %ld*/", directive_name, src_line); } if (hash == L_if) { /* #if or #elif */ unget_ch(); found = (eval_if() != 0L); /* Evaluate expression */ if (mcpp_debug & MACRO_CALL) in_if = FALSE; /* 'in_if' is dynamically set in eval_lex() */ hash = L_ifdef; /* #if is now like #ifdef */ } else { /* #ifdef or #ifndef */ if (scan_token( c, (workp = work_buf, &workp), work_end) != NAM) { cerror( not_ident, work_buf, 0L, NULL); return FALSE; /* Next token is not an identifier */ } found = ((defp = look_id( identifier)) != NULL); /* Look in table*/ if (mcpp_debug & MACRO_CALL) { if (found) mcpp_fprintf( OUT, "/*%s*/", defp->name); } } if (found == (hash == L_ifdef)) { compiling = TRUE; ifptr->stat |= TRUE_SEEN; } else { compiling = FALSE; } if (mcpp_debug & MACRO_CALL) { mcpp_fprintf( OUT, "/*i %c*/\n", compiling ? 'T' : 'F'); /* Report wheather the directive is evaluated TRUE or FALSE */ } return TRUE; } static void sync_linenum( void) /* * Put out newlines or #line line to synchronize line number with the * annotations about #if, #elif, #ifdef, #ifndef, #else or #endif on -K option. */ { if (wrong_line || newlines > 10) { sharp( NULL, 0); } else { while (newlines-- > 0) mcpp_fputc('\n', OUT); } newlines = -1; } static long do_line( void) /* * Parse the line to update the line number and "filename" field for the next * input line. * Values returned are as follows: * -1: syntax error or out-of-range error (diagnosed by do_line(), * eval_num()). * [1,32767]: legal line number for C90, [1,2147483647] for C99. * Line number [32768,2147483647] in C90 mode is only warned (not an error). * do_line() always absorbs the line (except the ). */ { const char * const not_digits = "Line number \"%s\" isn't a decimal digits sequence"; /* _E_ _W1_ */ const char * const out_of_range = "Line number \"%s\" is out of range of [1,%ld]"; /* _E_ _W1_ */ int token_type; VAL_SIGN * valp; char * save; int c; if ((c = skip_ws()) == '\n') { cerror( no_arg, NULL, 0L, NULL); unget_ch(); /* Push back */ return -1L; /* Line number is not changed */ } if (standard) { token_type = get_unexpandable( c, FALSE); if (macro_line == MACRO_ERROR) /* Unterminated macro */ return -1L; /* already diagnosed. */ if (token_type == NO_TOKEN) /* Macro expanded to 0 token */ goto no_num; if (token_type != NUM) goto illeg_num; } else if (scan_token( c, (workp = work_buf, &workp), work_end) != NUM) { goto illeg_num; } for (workp = work_buf; *workp != EOS; workp++) { if (! isdigit( *workp & UCHARMAX)) { if (standard) { cerror( not_digits, work_buf, 0L, NULL); return -1L; } else if (warn_level & 1) { cwarn( not_digits, work_buf, 0L, NULL); } } } valp = eval_num( work_buf); /* Evaluate number */ if (valp->sign == VAL_ERROR) { /* Error diagnosed by eval_num()*/ return -1; } else if (standard && (std_limits.line_num < valp->val || valp->val <= 0L)) { if (valp->val < LINE99LIMIT && valp->val > 0L) { if (warn_level & 1) cwarn( out_of_range, work_buf, std_limits.line_num, NULL); } else { cerror( out_of_range, work_buf, std_limits.line_num, NULL); return -1L; } } if (standard) { token_type = get_unexpandable( skip_ws(), FALSE); if (macro_line == MACRO_ERROR) return -1L; if (token_type != STR) { if (token_type == NO_TOKEN) { /* Filename is absent */ return (long) valp->val; } else { /* Expanded macro should be a quoted string */ goto not_fname; } } } else { if ((c = skip_ws()) == '\n') { unget_ch(); return (long) valp->val; } if (scan_token( c, (workp = work_buf, &workp), work_end) != STR) goto not_fname; } #if COMPILER == GNUC if (memcmp( workp - 3, "//", 2) == 0) { /* "/cur-dir//" */ save = infile->filename; /* Do not change the file name */ } else #endif { *(workp - 1) = EOS; /* Ignore right '"' */ save = save_string( &work_buf[ 1]); /* Ignore left '"' */ } if (standard) { if (get_unexpandable( skip_ws(), FALSE) != NO_TOKEN) { cerror( excess, work_buf, 0L, NULL); free( save); return -1L; } } else if (mcpp_mode == OLD_PREP) { skip_nl(); unget_ch(); } else if ((c = skip_ws()) == '\n') { unget_ch(); } else { if (warn_level & 1) { scan_token( c, (workp = work_buf, &workp), work_end); cwarn( excess, work_buf, 0, NULL); } skip_nl(); unget_ch(); } if (infile->filename) free( infile->filename); infile->filename = save; /* New file name */ /* Note that this does not change infile->real_fname */ return (long) valp->val; /* New line number */ no_num: cerror( "No line number", NULL, 0L, NULL); /* _E_ */ return -1L; illeg_num: cerror( "Not a line number \"%s\"", work_buf, 0L, NULL); /* _E_ */ return -1L; not_fname: cerror( "Not a file name \"%s\"", work_buf, 0L, NULL); /* _E_ */ return -1L; } /* * M a c r o D e f i n i t i o n s */ /* * look_id() Looks for the name in the defined symbol table. Returns a * pointer to the definition if found, or NULL if not present. * install_macro() Installs the definition. Updates the symbol table. * undefine() Deletes the definition from the symbol table. */ /* * Global work_buf[] are used to store #define parameter lists and * parms[].name point to them. * 'nargs' contains the actual number of parameters stored. */ typedef struct { char * name; /* -> Start of each parameter */ size_t len; /* Length of parameter name */ } PARM; static PARM parms[ NMACPARS]; static int nargs; /* Number of parameters */ static char * token_p; /* Pointer to the token scanned */ static char * repl_base; /* Base of buffer for repl-text */ static char * repl_end; /* End of buffer for repl-text */ static const char * const no_ident = "No identifier"; /* _E_ */ #if COMPILER == GNUC static int gcc2_va_arg; /* GCC2-spec variadic macro */ #endif DEFBUF * do_define( int ignore_redef, /* Do not redefine */ int predefine /* Predefine compiler-specific name */ /* * Note: The value of 'predefine' should be one of 0, DEF_NOARGS_PREDEF * or DEF_NOARGS_PREDEF_OLD, the other values cause errors. */ ) /* * Called from directive() when a #define is scanned or called from * do_options() when a -D option is scanned. This module parses formal * parameters by get_parm() and the replacement text by get_repl(). * * There is some special case code to distinguish * #define foo bar -- object-like macro * from #define foo() bar -- function-like macro with no parameter * * Also, we make sure that * #define foo foo * expands to "foo" but doesn't put MCPP into an infinite loop. * * A warning is printed if you redefine a symbol with a non-identical * text. I.e, * #define foo 123 * #define foo 123 * is ok, but * #define foo 123 * #define foo +123 * is not. * * The following subroutines are called from do_define(): * get_parm() parsing and remembering parameter names. * get_repl() parsing and remembering replacement text. * * The following subroutines are called from get_repl(): * is_formal() is called when an identifier is scanned. It checks through * the array of formal parameters. If a match is found, the * identifier is replaced by a control byte which will be used * to locate the parameter when the macro is expanded. * def_stringization() is called when '#' operator is scanned. It surrounds * the token to stringize with magic-codes. * * modes other than STD ignore difference of parameter names in macro * redefinition. */ { const char * const predef = "\"%s\" shouldn't be redefined"; /* _E_ */ char repl_list[ NMACWORK + IDMAX]; /* Replacement text */ char macroname[ IDMAX + 1]; /* Name of the macro defining */ DEFBUF * defp; /* -> Old definition */ DEFBUF ** prevp; /* -> Pointer to previous def in list */ int c; int redefined; /* TRUE if redefined */ int dnargs = 0; /* defp->nargs */ int cmp; /* Result of name comparison */ size_t def_start, def_end; /* Column of macro definition */ repl_base = repl_list; repl_end = & repl_list[ NMACWORK]; c = skip_ws(); if ((mcpp_debug & MACRO_CALL) && src_line) /* Start of definition */ def_start = infile->bptr - infile->buffer - 1; if (c == '\n') { cerror( no_ident, NULL, 0L, NULL); unget_ch(); return NULL; } else if (scan_token( c, (workp = work_buf, &workp), work_end) != NAM) { cerror( not_ident, work_buf, 0L, NULL); return NULL; } else { prevp = look_prev( identifier, &cmp); /* Find place in the macro list to insert the definition */ defp = *prevp; if (standard) { if (cmp || defp->push) { /* Not known or 'pushed' macro */ if (str_eq( identifier, "defined") || ((stdc_val || cplus_val) && str_eq( identifier, "__VA_ARGS__"))) { cerror( "\"%s\" shouldn't be defined", identifier, 0L, NULL); /* _E_ */ return NULL; } redefined = FALSE; /* Quite new definition */ } else { /* It's known: */ if (ignore_redef) return defp; dnargs = (defp->nargs == DEF_NOARGS_STANDARD || defp->nargs == DEF_NOARGS_PREDEF || defp->nargs == DEF_NOARGS_PREDEF_OLD) ? DEF_NOARGS : defp->nargs; if (dnargs <= DEF_NOARGS_DYNAMIC /* __FILE__ and such */ || dnargs == DEF_PRAGMA /* _Pragma() pseudo-macro */ ) { cerror( predef, identifier, 0L, NULL); return NULL; } else { redefined = TRUE; /* Remember this fact */ } } } else { if (cmp) { redefined = FALSE; /* Quite new definition */ } else { /* It's known: */ if (ignore_redef) return defp; dnargs = (defp->nargs == DEF_NOARGS_STANDARD || defp->nargs == DEF_NOARGS_PREDEF || defp->nargs == DEF_NOARGS_PREDEF_OLD) ? DEF_NOARGS : defp->nargs; redefined = TRUE; } } } strcpy( macroname, identifier); /* Remember the name */ in_define = TRUE; /* Recognize '#', '##' */ if (get_parm() == FALSE) { /* Get parameter list */ in_define = FALSE; return NULL; /* Syntax error */ } if (get_repl( macroname) == FALSE) { /* Get replacement text */ in_define = FALSE; return NULL; /* Syntax error */ } if ((mcpp_debug & MACRO_CALL) && src_line) { /* Remember location on source */ char * cp; cp = infile->bptr - 1; /* Before '\n' */ while (char_type[ *cp & UCHARMAX] & HSP) cp--; /* Trailing space */ cp++; /* Just after the last token */ def_end = cp - infile->buffer; /* End of definition */ } in_define = FALSE; if (redefined) { if (dnargs != nargs || ! str_eq( defp->repl, repl_list) || (mcpp_mode == STD && ! str_eq( defp->parmnames, work_buf)) ) { /* Warn if differently redefined */ if (warn_level & 1) { cwarn( "The macro is redefined", NULL, 0L, NULL); /* _W1_ */ if (! option_flags.no_source_line) dump_a_def( " previously macro", defp, FALSE, TRUE , fp_err); } } else { /* Identical redefinition */ return defp; } } /* Else new or re-definition*/ defp = install_macro( macroname, nargs, work_buf, repl_list, prevp, cmp , predefine); if ((mcpp_debug & MACRO_CALL) && src_line) { /* Get location on source file */ LINE_COL s_line_col, e_line_col; s_line_col.line = src_line; s_line_col.col = def_start; get_src_location( & s_line_col); /* Convert to pre-line-splicing data */ e_line_col.line = src_line; e_line_col.col = def_end; get_src_location( & e_line_col); /* Putout the macro definition information embedded in comment */ mcpp_fprintf( OUT, "/*m%s %ld:%d-%ld:%d*/\n", defp->name , s_line_col.line, s_line_col.col , e_line_col.line, e_line_col.col); wrong_line = TRUE; /* Need #line later */ } if (mcpp_mode == STD && cplus_val && id_operator( macroname) && (warn_level & 1)) /* These are operators, not identifiers, in C++98 */ cwarn( "\"%s\" is defined as macro", macroname /* _W1_ */ , 0L, NULL); return defp; } static int get_parm( void) /* * Get parameters i.e. numbers into nargs, name into work_buf[], name-length * into parms[].len. parms[].name point into work_buf. * Return TRUE if the parameters are legal, else return FALSE. * In STD mode preprocessor must remember the parameter names, only for * checking the validity of macro redefinitions. This is required by the * Standard (what an overhead !). */ { const char * const many_parms = "More than %.0s%ld parameters"; /* _E_ _W4_ */ const char * const illeg_parm = "Illegal parameter \"%s\""; /* _E_ */ const char * const misplaced_ellip = "\"...\" isn't the last parameter"; /* _E_ */ int token_type; int c; parms[ 0].name = workp = work_buf; work_buf[ 0] = EOS; #if COMPILER == GNUC gcc2_va_arg = FALSE; #endif /* POST_STD mode */ insert_sep = NO_SEP; /* Clear the inserted token separator */ c = get_ch(); if (c == '(') { /* With arguments? */ nargs = 0; /* Init parms counter */ if (skip_ws() == ')') return TRUE; /* Macro with 0 parm */ else unget_ch(); do { /* Collect parameters */ if (nargs >= NMACPARS) { cerror( many_parms, NULL, (long) NMACPARS, NULL); return FALSE; } parms[ nargs].name = workp; /* Save its start */ if ((token_type = scan_token( c = skip_ws(), &workp, work_end)) != NAM) { if (c == '\n') { break; } else if (c == ',' || c == ')') { cerror( "Empty parameter", NULL, 0L, NULL); /* _E_ */ return FALSE; } else if (standard && (stdc_val || cplus_val) && token_type == OPE && openum == OP_ELL) { /* * Enable variable argument macro which is a feature of * C99. We enable this even on C90 or C++ for GCC * compatibility. */ if (skip_ws() != ')') { cerror( misplaced_ellip, NULL, 0L, NULL); return FALSE; } parms[ nargs++].len = 3; nargs |= VA_ARGS; goto ret; } else { cerror( illeg_parm, parms[ nargs].name, 0L, NULL); return FALSE; /* Bad parameter syntax */ } } if (standard && (stdc_val || cplus_val) && str_eq( identifier, "__VA_ARGS__")) { cerror( illeg_parm, parms[ nargs].name, 0L, NULL); return FALSE; /* __VA_ARGS__ should not be used as a parameter */ } if (is_formal( parms[ nargs].name, FALSE)) { cerror( "Duplicate parameter name \"%s\"" /* _E_ */ , parms[ nargs].name, 0L, NULL); return FALSE; } parms[ nargs].len = (size_t) (workp - parms[ nargs].name); /* Save length of param */ *workp++ = ','; nargs++; } while ((c = skip_ws()) == ','); /* Get another parameter*/ *--workp = EOS; /* Remove excessive ',' */ if (c != ')') { /* Must end at ) */ #if COMPILER == GNUC /* Handle GCC2 variadic params like par... */ char * tp = workp; if (mcpp_mode == STD &&(token_type = scan_token( c, &workp, work_end)) == OPE && openum == OP_ELL) { if ((c = skip_ws()) != ')') { cerror( misplaced_ellip, NULL, 0L, NULL); return FALSE; } *tp = EOS; /* Remove "..." */ nargs |= VA_ARGS; gcc2_va_arg = TRUE; goto ret; } #endif unget_ch(); /* Push back '\n' */ cerror( "Missing \",\" or \")\" in parameter list \"(%s\"" /* _E_ */ , work_buf, 0L, NULL); return FALSE; } } else { /* * DEF_NOARGS is needed to distinguish between * "#define foo" and "#define foo()". */ nargs = DEF_NOARGS; /* Object-like macro */ unget_ch(); } ret: #if NMACPARS > NMACPARS90MIN if ((warn_level & 4) && (nargs & ~AVA_ARGS) > std_limits.n_mac_pars) cwarn( many_parms, NULL , (long) std_limits.n_mac_pars, NULL); #endif return TRUE; } static int get_repl( const char * macroname ) /* * Get replacement text i.e. names of formal parameters are converted to * the magic numbers, and operators #, ## is converted to magic characters. * Return TRUE if replacement list is legal, else return FALSE. * Any token separator in the text is converted to a single space, no token * sepatator is inserted by MCPP. Those are required by the Standard for * stringizing of an argument by # operator. * In POST_STD mode, inserts a space between any tokens in source (except a * macro name and the next '(' in macro definition), hence presence or absence * of token separator makes no difference. */ { const char * const mixed_ops = "Macro with mixing of ## and # operators isn't portable"; /* _W4_ */ const char * const multiple_cats = "Macro with multiple ## operators isn't portable"; /* _W4_ */ char * prev_token = NULL; /* Preceding token */ char * prev_prev_token = NULL; /* Pre-preceding token */ int multi_cats = FALSE; /* Multiple ## operators*/ int c; int token_type; /* Type of token */ char * temp; char * repl_cur = repl_base; /* Pointer into repl-text buffer*/ *repl_cur = EOS; token_p = NULL; if (mcpp_mode == STD) { c = get_ch(); unget_ch(); if (((char_type[ c] & SPA) == 0) && (nargs < 0) && (warn_level & 1)) cwarn( "No space between macro name \"%s\" and repl-text"/* _W1_ */ , macroname, 0L, NULL); } c = skip_ws(); /* Get to the body */ while (c != '\n') { if (standard) { prev_prev_token = prev_token; prev_token = token_p; } token_p = repl_cur; /* Remember the pointer */ token_type = scan_token( c, &repl_cur, repl_end); switch (token_type) { case OPE: /* Operator or punctuator */ if (! standard) break; switch (openum) { case OP_CAT: /* ## */ if (prev_token == NULL) { cerror( "No token before ##" /* _E_ */ , NULL, 0L, NULL); return FALSE; } else if (*prev_token == CAT) { cerror( "## after ##", NULL, 0L, NULL); /* _E_ */ return FALSE; } else if (prev_prev_token && *prev_prev_token == CAT) { multi_cats = TRUE; } else if (prev_prev_token && *prev_prev_token == ST_QUOTE && (warn_level & 4)) { /* # parm ## */ cwarn( mixed_ops, NULL, 0L, NULL); } repl_cur = token_p; *repl_cur++ = CAT; /* Convert to CAT */ break; case OP_STR: /* # */ if (nargs < 0) /* In object-like macro */ break; /* '#' is an usual char */ if (prev_token && *prev_token == CAT && (warn_level & 4)) /* ## # */ cwarn( mixed_ops, NULL, 0L, NULL); repl_cur = token_p; /* Overwrite on # */ if ((temp = def_stringization( repl_cur)) == NULL) { return FALSE; /* Error */ } else { repl_cur = temp; } break; default: /* Any operator as it is */ break; } break; case NAM: /* * Replace this name if it's a parm. Note that the macro name is a * possible replacement token. We stuff DEF_MAGIC in front of the * token which is treated as a LETTER by the token scanner and eaten * by the macro expanding routine. This prevents the macro expander * from looping if someone writes "#define foo foo". */ temp = is_formal( identifier, TRUE); if (temp == NULL) { /* Not a parameter name */ if (! standard) break; if ((stdc_val || cplus_val) && str_eq( identifier, "__VA_ARGS__")) { #if COMPILER == GNUC if (gcc2_va_arg) { cerror( "\"%s\" cannot be used in GCC2-spec variadic macro" /* _E_ */ , identifier, 0L, NULL); return FALSE; } #endif cerror( "\"%s\" without corresponding \"...\"" /* _E_ */ , identifier, 0L, NULL); return FALSE; } if ((temp = mgtoken_save( macroname)) != NULL) repl_cur = temp; /* Macro name */ } else { /* Parameter name */ repl_cur = temp; #if COMPILER == GNUC if (mcpp_mode == STD && (nargs & VA_ARGS) && *(repl_cur - 1) == (nargs & ~AVA_ARGS)) { if (! str_eq( identifier, "__VA_ARGS__") && (warn_level & 2)) cwarn( "GCC2-spec variadic macro is defined" /* _W2_ */ , NULL, 0L, NULL); if (prev_token && *prev_token == CAT && prev_prev_token && *prev_prev_token == ',') /* ", ## __VA_ARGS__" is sequence peculiar */ /* to GCC3-spec variadic macro. */ /* Or ", ## last_arg" is sequence peculiar */ /* to GCC2-spec variadic macro. */ nargs |= GVA_ARGS; /* Mark as sequence peculiar to GCC */ /* This will be warned at expansion time */ } #endif } break; case STR: /* String in mac. body */ case CHR: /* Character constant */ if (mcpp_mode == OLD_PREP) repl_cur = str_parm_scan( repl_cur); break; case SEP: if (mcpp_mode == OLD_PREP && c == COM_SEP) repl_cur--; /* Skip comment now */ break; default: /* Any token as it is */ break; } if ((c = get_ch()) == ' ' || c == '\t') { *repl_cur++ = ' '; /* Space */ while ((c = get_ch()) == ' ' || c == '\t') ; /* Skip excessive spaces */ } } while (repl_base < repl_cur && (*(repl_cur - 1) == ' ' || *(repl_cur - 1) == '\t')) repl_cur--; /* Remove trailing spaces */ *repl_cur = EOS; /* Terminate work */ unget_ch(); /* For syntax check */ if (standard) { if (token_p && *token_p == CAT) { cerror( "No token after ##", NULL, 0L, NULL); /* _E_ */ return FALSE; } if (multi_cats && (warn_level & 4)) cwarn( multiple_cats, NULL, 0L, NULL); if ((nargs & VA_ARGS) && stdc_ver < 199901L && (warn_level & 2)) /* Variable arg macro is the spec of C99, not C90 nor C++98 */ cwarn( "Variable argument macro is defined", /* _W2_ */ NULL, 0L, NULL); } return TRUE; } static char * is_formal( const char * name, int conv /* Convert to magic number? */ ) /* * If the identifier is a formal parameter, save the MAC_PARM and formal * offset, returning the advanced pointer into the replacement text. * Else, return NULL. */ { char * repl_cur; const char * va_arg = "__VA_ARGS__"; PARM parm; size_t len; int i; len = strlen( name); for (i = 0; i < (nargs & ~AVA_ARGS); i++) { /* For each parameter */ parm = parms[ i]; if ((len == parm.len /* Note: parms[].name are comma separated */ && memcmp( name, parm.name, parm.len) == 0) || (standard && (nargs & VA_ARGS) && i == (nargs & ~AVA_ARGS) - 1 && conv && str_eq( name, va_arg))) { /* __VA_ARGS__ */ /* If it's known */ #if COMPILER == GNUC if (gcc2_va_arg && str_eq( name, va_arg)) return NULL; /* GCC2 variadic macro */ #endif if (conv) { repl_cur = token_p; /* Overwrite on the name*/ *repl_cur++ = MAC_PARM; /* Save the signal */ *repl_cur++ = i + 1; /* Save the parm number */ return repl_cur; /* Return "gotcha" */ } else { return parm.name; /* Duplicate parm name */ } } } return NULL; /* Not a formal param */ } static char * def_stringization( char * repl_cur) /* * Define token stringization. * We store a magic cookie (which becomes surrouding " on expansion) preceding * the parameter as an operand of # operator. * Return the current pointer into replacement text if the token following # * is a parameter name, else return NULL. */ { int c; char * temp; *repl_cur++ = ST_QUOTE; /* Prefix */ if (char_type[ c = get_ch()] & HSP) { /* There is a space */ *repl_cur++ = ' '; while (char_type[ c = get_ch()] & HSP) /* Skip excessive spaces*/ ; } token_p = repl_cur; /* Remember the pointer */ if (scan_token( c, &repl_cur, repl_end) == NAM) { if ((temp = is_formal( identifier, TRUE)) != NULL) { repl_cur = temp; return repl_cur; } } cerror( "Not a formal parameter \"%s\"", token_p, 0L, NULL); /* _E_ */ return NULL; } static char * mgtoken_save( const char * macroname) /* * A magic cookie is inserted if the token is identical to the macro name, * so the expansion doesn't recurse. * Return the advanced pointer into the replacement text or NULL. */ { char * repl_cur; if (str_eq( macroname, identifier)) { /* Macro name in body */ repl_cur = token_p; /* Overwrite on token */ *repl_cur++ = DEF_MAGIC; /* Save magic marker */ repl_cur = stpcpy( repl_cur, identifier); /* And save the token */ return repl_cur; } else { return NULL; } } static char * str_parm_scan( char * string_end) /* * String parameter scan. * This code -- if enabled -- recognizes a formal parameter in a string * literal or in a character constant. * #define foo(bar, v) printf("%bar\n", v) * foo( d, i) * expands to: * printf("%d\n", i) * str_parm_scan() return the advanced pointer into the replacement text. * This has been superceded by # stringizing and string concatenation. * This routine is called only in OLD_PREP mode. */ { int delim; int c; char * tp; char * wp; /* Pointer into the quoted literal */ delim = *token_p; unget_string( ++token_p, NULL); /* Pseudo-token-parsing in a string literal */ wp = token_p; while ((c = get_ch()) != delim) { token_p = wp; if (scan_token( c, &wp, string_end) != NAM) continue; if ((tp = is_formal( token_p, TRUE)) != NULL) wp = tp; } *wp++ = delim; return wp; } static void do_undef( void) /* * Remove the symbol from the defined list. * Called from directive(). */ { DEFBUF * defp; int c; if ((c = skip_ws()) == '\n') { cerror( no_ident, NULL, 0L, NULL); unget_ch(); return; } if (scan_token( c, (workp = work_buf, &workp), work_end) != NAM) { cerror( not_ident, work_buf, 0L, NULL); skip_nl(); unget_ch(); } else { if ((defp = look_id( identifier)) == NULL) { if (warn_level & 8) cwarn( "\"%s\" wasn't defined" /* _W8_ */ , identifier, 0L, NULL); } else if (standard && (defp->nargs <= DEF_NOARGS_STANDARD /* Standard predef */ || defp->nargs == DEF_PRAGMA)) { /* _Pragma() pseudo-macro */ cerror( "\"%s\" shouldn't be undefined" /* _E_ */ , identifier, 0L, NULL); } else if (standard) { c = skip_ws(); unget_ch(); if (c != '\n') /* Trailing junk */ return; else undefine( identifier); } else { undefine( identifier); } } } /* * C P P S y m b o l T a b l e s * * SBSIZE defines the number of hash-table slots for the symbol table. * It must be a power of 2. */ /* Symbol table queue headers. */ static DEFBUF * symtab[ SBSIZE]; static long num_of_macro = 0; #if MCPP_LIB void init_directive( void) /* Initialize static variables. */ { num_of_macro = 0; } #endif DEFBUF * look_id( const char * name) /* * Look for the identifier in the symbol table. * If found, return the table pointer; Else return NULL. */ { DEFBUF ** prevp; int cmp; prevp = look_prev( name, &cmp); if (standard) return ((cmp == 0 && (*prevp)->push == 0) ? *prevp : NULL); else return ((cmp == 0) ? *prevp : NULL); } DEFBUF ** look_prev( const char * name, /* Name of the macro */ int * cmp /* Result of comparison */ ) /* * Look for the place to insert the macro definition. * Return a pointer to the previous member in the linked list. */ { const char * np; DEFBUF ** prevp; DEFBUF * dp; size_t s_name; int hash; for (hash = 0, np = name; *np != EOS; ) hash += *np++; hash += s_name = (size_t)(np - name); s_name++; prevp = & symtab[ hash & SBMASK]; *cmp = -1; /* Initialize */ while ((dp = *prevp) != NULL) { if ((*cmp = memcmp( dp->name, name, s_name)) >= 0) break; prevp = &dp->link; } return prevp; } DEFBUF * look_and_install( const char * name, /* Name of the macro */ int numargs, /* The numbers of parms */ const char * parmnames, /* Names of parameters concatenated */ const char * repl /* Replacement text */ ) /* * Look for the name and (re)define it. * Returns a pointer to the definition block. * Returns NULL if the symbol was Standard-predefined. */ { DEFBUF ** prevp; /* Place to insert definition */ DEFBUF * defp; /* New definition block */ int cmp; /* Result of comparison of new name and old */ prevp = look_prev( name, &cmp); defp = install_macro( name, numargs, parmnames, repl, prevp, cmp, 0); return defp; } DEFBUF * install_macro( const char * name, /* Name of the macro */ int numargs, /* The numbers of parms */ const char * parmnames, /* Names of parameters concatenated */ const char * repl, /* Replacement text */ DEFBUF ** prevp, /* The place to insert definition */ int cmp, /* Result of comparison of new name and old */ int predefine /* Predefined macro without leading '_' */ ) /* * Enter this name in the lookup table. * Returns a pointer to the definition block. * Returns NULL if the symbol was Standard-predefined. * Note that predefinedness can be specified by either of 'numargs' or * 'predefine'. */ { DEFBUF * dp; DEFBUF * defp; size_t s_name, s_parmnames, s_repl; defp = *prevp; /* Old definition, if cmp == 0 */ if (cmp == 0 && defp->nargs < DEF_NOARGS - 1) return NULL; /* Standard predefined */ if (parmnames == NULL || repl == NULL || (predefine && numargs > 0) || (predefine && predefine != DEF_NOARGS_PREDEF && predefine != DEF_NOARGS_PREDEF_OLD)) /* Shouldn't happen */ cfatal( "Bug: Illegal macro installation of \"%s\"" /* _F_ */ , name, 0L, NULL); /* Use "" instead of NULL */ s_name = strlen( name); if (mcpp_mode == STD) s_parmnames = strlen( parmnames) + 1; else s_parmnames = 0; s_repl = strlen( repl) + 1; dp = (DEFBUF *) xmalloc( sizeof (DEFBUF) + s_name + s_parmnames + s_repl); if (cmp || (standard && (*prevp)->push)) { /* New definition */ dp->link = defp; /* Insert to linked list */ *prevp = dp; } else { /* Redefinition */ dp->link = defp->link; /* Replace old def with new */ *prevp = dp; free( defp); } dp->nargs = predefine ? predefine : numargs; if (standard) { dp->push = 0; dp->parmnames = (char *)dp + sizeof (DEFBUF) + s_name; dp->repl = dp->parmnames + s_parmnames; if (mcpp_mode == STD) memcpy( dp->parmnames, parmnames, s_parmnames); } else { dp->repl = (char *)dp + sizeof (DEFBUF) + s_name; } memcpy( dp->name, name, s_name + 1); memcpy( dp->repl, repl, s_repl); /* Remember where the macro is defined */ dp->fname = cur_fullname; /* Full-path-list of current file */ dp->mline = src_line; if (standard && cmp && ++num_of_macro == std_limits.n_macro + 1 && std_limits.n_macro && (warn_level & 4)) /* '&& std_limits.n_macro' to avoid warning before initialization */ cwarn( "More than %.0s%ld macros defined" /* _W4_ */ , NULL , std_limits.n_macro, NULL); return dp; } int undefine( const char * name /* Name of the macro */ ) /* * Delete the macro definition from the symbol table. * Returns TRUE, if deleted; * Else returns FALSE (when the macro was not defined or was Standard * predefined). */ { DEFBUF ** prevp; /* Preceding definition in list */ DEFBUF * dp; /* Definition to delete */ int cmp; /* 0 if defined, else not defined */ prevp = look_prev( name, &cmp); dp = *prevp; /* Definition to delete */ if (cmp || dp->nargs <= DEF_NOARGS_STANDARD) return FALSE; /* Not defined or Standard predefined */ if (standard && dp->push) return FALSE; /* 'Pushed' macro */ *prevp = dp->link; /* Link the previous and the next */ if ((mcpp_debug & MACRO_CALL) && dp->mline) { /* Notice this directive unless the macro is predefined */ mcpp_fprintf( OUT, "/*undef %ld*//*%s*/\n", src_line, dp->name); wrong_line = TRUE; } free( dp); /* Delete the definition */ if (standard) num_of_macro--; return TRUE; } static void dump_repl( const DEFBUF * dp, FILE * fp, int gcc2_va ) /* * Dump replacement text. */ { int numargs = dp->nargs; char * cp1; size_t i; int c; const char * cp; for (cp = dp->repl; (c = *cp++ & UCHARMAX) != EOS; ) { switch (c) { case MAC_PARM: /* Parameter */ c = (*cp++ & UCHARMAX) - 1; if (standard) { PARM parm = parms[ c]; if ((numargs & VA_ARGS) && c == (numargs & ~AVA_ARGS) - 1) { mcpp_fputs( gcc2_va ? parm.name : "__VA_ARGS__" , FP2DEST( fp)); /* gcc2_va is possible only in STD mode */ } else { if (mcpp_mode == STD) { for (i = 0, cp1 = parm.name; i < parm.len; i++) mcpp_fputc( *cp1++, FP2DEST( fp)); } else { mcpp_fputc( 'a' + c % 26, FP2DEST( fp)); if (c > 26) mcpp_fputc( '0' + c / 26, FP2DEST( fp)); } } } else { mcpp_fputc( 'a' + c % 26, FP2DEST( fp)); if (c > 26) mcpp_fputc( '0' + c / 26, FP2DEST( fp)); } break; case DEF_MAGIC: if (! standard) mcpp_fputc( c, FP2DEST( fp)); /* Else skip */ break; case CAT: if (standard) mcpp_fputs( "##", FP2DEST( fp)); else mcpp_fputc( c, FP2DEST( fp)); break; case ST_QUOTE: if (standard) mcpp_fputs( "#", FP2DEST( fp)); else mcpp_fputc( c, FP2DEST( fp)); break; case COM_SEP: /* * Though TOK_SEP coincides to COM_SEP, this cannot appear in * Standard mode. */ if (mcpp_mode == OLD_PREP) mcpp_fputs( "/**/", FP2DEST( fp)); break; default: mcpp_fputc( c, FP2DEST( fp)); break; } } } /* * If the compiler is so-called "one-pass" compiler, compiler-predefined * macros are commented out to avoid redefinition. */ #if ONE_PASS #define CAN_REDEF DEF_NOARGS #else #define CAN_REDEF DEF_NOARGS_PREDEF #endif void dump_a_def( const char * why, const DEFBUF * dp, int newdef, /* TRUE if parmnames are currently in parms[] */ int comment, /* Show location of the definition in comment */ FILE * fp ) /* * Dump a macro definition. */ { char * cp, * cp1; int numargs = dp->nargs & ~AVA_ARGS; int commented; /* To be commented out */ int gcc2_va = FALSE; /* GCC2-spec variadic */ int i; if (standard && numargs == DEF_PRAGMA) /* _Pragma pseudo-macro */ return; if ((numargs < CAN_REDEF) || (standard && dp->push)) commented = TRUE; else commented = FALSE; if (! comment && commented) /* For -dM option */ return; if (why) mcpp_fprintf( FP2DEST( fp), "%s \"%s\" defined as: ", why, dp->name); mcpp_fprintf( FP2DEST( fp), "%s#define %s", commented ? "/* " : "", dp->name); /* Macro name */ if (numargs >= 0) { /* Parameter list */ if (mcpp_mode == STD) { const char * appendix = null; if (! newdef) { /* Make parms[] for dump_repl() */ for (i = 0, cp = dp->parmnames; i < numargs; i++, cp = cp1 + 1) { if ((cp1 = strchr( cp, ',')) == NULL) /* The last arg */ parms[ i].len = strlen( cp); else parms[ i].len = (size_t) (cp1 - cp); parms[ i].name = cp; } } #if COMPILER == GNUC if ((dp->nargs & VA_ARGS) && memcmp( parms[ numargs - 1].name, "...", 3) != 0) { appendix = "..."; /* Append ... so as to become 'args...' */ gcc2_va = TRUE; } #endif mcpp_fprintf( FP2DEST( fp), "(%s%s)", dp->parmnames, appendix); } else { if (newdef) { mcpp_fprintf( FP2DEST( fp), "(%s)", parms[ 0].name); } else if (numargs == 0) { mcpp_fputs( "()", FP2DEST( fp)); } else { /* Print parameter list automatically made as: */ /* a, b, c, ..., a0, b0, c0, ..., a1, b1, c1, ... */ mcpp_fputc( '(', FP2DEST( fp)); for (i = 0; i < numargs; i++) { /* Make parameter list */ mcpp_fputc( 'a' + i % 26, FP2DEST( fp)); if (i >= 26) mcpp_fputc( '0' + i / 26, FP2DEST( fp)); if (i + 1 < numargs) mcpp_fputc( ',', FP2DEST( fp)); } mcpp_fputc( ')', FP2DEST( fp)); } } } if (*dp->repl) { mcpp_fputc( ' ', FP2DEST( fp)); dump_repl( dp, fp, gcc2_va); /* Replacement text */ } if (commented) /* Standard predefined or one-pass-compiler-predefined */ mcpp_fputs( " */", FP2DEST( fp)); if (comment) /* Not -dM option */ mcpp_fprintf( FP2DEST( fp), " \t/* %s:%ld\t*/", dp->fname, dp->mline); mcpp_fputc( '\n', FP2DEST( fp)); } void dump_def( int comment, /* Location of definition in comment */ int K_opt /* -K option is specified */ ) /* * Dump all the current macro definitions to output stream. */ { DEFBUF * dp; DEFBUF ** symp; sharp( NULL, 0); /* Report the current source file & line */ if (comment) mcpp_fputs( "/* Currently defined macros. */\n", OUT); for (symp = symtab; symp < &symtab[ SBSIZE]; symp++) { if ((dp = *symp) != NULL) { do { if (K_opt) mcpp_fprintf( OUT, "/*m%s*/\n", dp->name); else dump_a_def( NULL, dp, FALSE, comment, fp_out); } while ((dp = dp->link) != NULL); } } wrong_line = TRUE; /* Line number is out of sync */ } #if MCPP_LIB void clear_symtable( void) /* * Free all the macro definitions. */ { DEFBUF * next; DEFBUF * dp; DEFBUF ** symp; for (symp = symtab; symp < &symtab[ SBSIZE]; symp++) { for (next = *symp; next != NULL; ) { dp = next; next = dp->link; free( dp); /* Free the symbol */ } *symp = NULL; } } #endif mcpp-2.7.2/src/system.H0000644000175000017500000003624110761262407011641 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * S Y S T E M . H * S y s t e m D e p e n d e n t * D e f i n i t i o n s f o r M C P P * * Definitions in this file may be edited to configure MCPP for particular * operating systems and compiler configurations. * * Note: MCPP assumes the system implement the Ascii character set. * If this is not the case, you will have to do some editing here and there. */ #define SYSTEM_H #if HAVE_CONFIG_H #include "configed.H" #else #include "noconfig.H" #endif /* Some system has a wrong definition of UCHAR_MAX. See cpp-test.html#5.1.3 */ #if UCHARMAX < -255 /* The definition of UCHARMAX (possibly UCHAR_MAX too) is wrong. */ /* Define it as a signed int value, not as an unsigned value. */ #undef UCHARMAX #define UCHARMAX ((1 << CHAR_BIT) - 1) #endif /* * PART 1 and PART 2 are defined in the above header files. */ /* * P A R T 1 Configurations for target-operating-system * and target-compiler. */ /* * P A R T 2 Configurations for host-compiler. */ /* * P A R T 3 Configurations for default settings, typedefs and * translation limits. */ /* * The variable 'mcpp_mode' specifies the mode of preprocessing as one of * OLD_PREP, KR, STD, or POST_STD. * Those modes have many differences each other -- * i.e. handling of translation phases; handling of some * preprocessing tokens; availability of some directives; way of * macro expansion; * -- as follows. * * KR Actual arguments of a macro are expanded (after substitution) * with rest of the replacement text and the subsequent source text. * ## in macro definition has no significance to cpp. The surrounding * tokens are macro-expanded separately. Also, # has no significance * to cpp. The following token is expanded. * Directly or intermediately recursive macro call causes an error. * sequence is deleted only in string literals * and in #define directive lines. * sizeof (type) can be used in #if line. * KR corresponds to the "K&R 1st." * * OLD_PREP In addition to the KR specifications, this mode has the * following characteristics (and some others). * Converts comment to 0 space instead of 1 space. * Expands the parameter like spelling in string literal as a macro. * Does not check unmatched pair of '"' or '\''. * OLD_PREP corresponts to "Reiser model" cpp. * * STD Standard conforming mode. * sequence is always deleted after trigraph * conversion and before tokenization. * Digraph sequences are recognized as tokens. * Actual arguments of a macro are expanded separately prior to * re-scanning of the replacement text. * The name in the replacement text once expanded is not re-expanded, * thus preventing recursive death. * ## in macro definition concatenates tokens. The tokens are not * expanded. The concatenated token is expanded by rescanning. * # in macro definition stringizes the following argument. The argument * is not expanded. \ is inserted before " and \ in or surrounding * the string literal or character constant. * An expanded macro is surrounded by spaces to prevent unintended * token merging. * * POST_STD This mode simplifies the behavior of STD mode as follows. * 1. Digraph sequences are converted in translation phase 1, as * alternate characters rather than as tokens. * 2. A space is inserted as a token separator between any tokens in * a source (except a macro name and the next '(' in macro * definition): thus simplifying tokenization, test of macro * redefinition and macro expansion, especially "stringization". * 3. Test of macro redefinition ignores difference of parameter names, * test of which has little utility and not a little overhead. * 4. #if expression forbids character constants, which have little * portability, little utility and not a little overhead. * 5. Rescanning of a macro expansion is limited in the replacement * text, rest of the source file is not scanned, thus making the * syntax of "function-like" macro call more similar to that of * function call. * 6. Argument of #include directive in form is an obsolescent * feature. * 7. '$' or so are not treated specially in #define directive. * 8. Trigraphs, UCN (universal-character name) are not recognized. * 9. Multi-byte characters in an identifier are not recognized. * * The following specifications are available when mode is STD or POST_STD. * preprocessing number token, digraphs, * #pragma (#pragma MCPP put_defines, #pragma MCPP warning * , #pragma MCPP debug) directive, * #error directive, * #if defined operator, #elif directive, * predefined macros __FILE__, __LINE__, __DATE__, __TIME__ * , __STDC__, __STDC_VERSION__, __STDC_HOSTED__, * wide character constant, wide character string literal, * _Pragma() operator, variable-arguments macro, * macro as an argument of #include, #line directives, * escape sequences \x[hex-digits], \a, \v, * '+' option (C++ preprocessing), * 'S' option (re-defines __STDC__ as , unpredefine some macros), * 'V' option (re-defines __STDC_VERSION__ or __cplusplus as ), * 'h' option (re-defines __STDC_HOSTED__ as ). * The following specifications are available only in STD mode. * Trigraphs and UCN, * Multi-byte characters in an identifier. * The following specifications are available only in KR and OLD_PREP modes. * #assert, #asm, #endasm, #put_defines, #debug and some other older * directives, * argument of #line directive other than decimal-digits. */ /* The values of 'mcpp_mode'. */ #define OLD_PREP 1 /* "Reiser" cpp mode */ #define KR 2 /* K&R 1st mode */ #define STD 3 /* Standard moce */ #define POST_STD 9 /* Special mode of MCPP */ /* * TRIGRAPHS_INIT Initial value for the -3 option. If TRUE -3 * disables trigraphs, if FALSE -3 enables them. * DIGRAPHS_INIT Initial value for the -2 option. If TRUE -2 * disables digraphs, if FALSE -2 enables them. * OK_UCN Enable recognition of Universal-Character-Name sequence * by -V199901L option. * OK_MBIDENT Enable multi-byte characters in identifier by -V199901L * option. * EXPAND_PRAGMA Enable macro expansion of #pragma line (even in modes * other than C99). * expr_t, uexpr_t Type of maximum integer: * long long (unsigned long long) or longer. * EXPR_MAX should be defined to the maximum value of uexpr_t. */ #define TRIGRAPHS_INIT FALSE #define DIGRAPHS_INIT FALSE #ifndef EXPAND_PRAGMA #define EXPAND_PRAGMA FALSE #endif #define OK_UCN TRUE #define OK_MBIDENT FALSE #if HAVE_INTMAX_T #if HAVE_STDINT_H #include "stdint.h" #elif HAVE_INTTYPES_H #include "inttypes.h" #endif typedef intmax_t expr_t; typedef uintmax_t uexpr_t; #else #if HAVE_LONG_LONG #if (HOST_COMPILER == MSC && _MSC_VER < 1500) || HOST_COMPILER == BORLANDC typedef __int64 expr_t; typedef unsigned __int64 uexpr_t; #else typedef long long expr_t; typedef unsigned long long uexpr_t; #endif #else /* !HAVE_LONG_LONG */ typedef unsigned long uexpr_t; typedef long expr_t; #endif /* HAVE_LONG_LONG */ #endif /* HAVE_INTMAX_T */ #if HAVE_INTMAX_T #define EXPR_MAX UINTMAX_MAX #elif HAVE_LONG_LONG #if (HOST_COMPILER == MSC && _MSC_VER < 1400) || HOST_COMPILER == BORLANDC #define EXPR_MAX 0xFFFFFFFFFFFFFFFFui64 #else #define EXPR_MAX 0xFFFFFFFFFFFFFFFFULL #endif #else #define EXPR_MAX 4294967295UL #endif /* * Translation limits. * The following definitions are used to allocate memory for work buffers. * * NWORK Output buffer size. Set this size according to your compiler- * proper. Length of string literal should be less than NWORK * - 1. * Nevertheless, when COMPILER == GNUC || COMPILER == MSC, mcpp * uses NMACWORK as output buffer size because GNUC and Visual C * can accept very long line. * NBUFF Input buffer size after line concatenation by * . * NMACWORK Internal work buffer size for macro definition and expansion. * IDMAX The longest identifier length. * NMACPARS The maximum number of #define parameters. * NOTE: Must be NMACPARS <= UCHARMAX. * NEXP The maximum nesting depth of #if expressions. * BLK_NEST The number of nested #if's permitted. * INCLUDE_NEST The maximum nesting depth of #include. This is needed to * prevent infinite recursive inclusion. * RESCAN_LIMIT The maximum rescan times of macro expansion in STD or POST_STD * modes. * PRESTD_RESCAN_LIMIT The maximum rescan times of macro expansion in KR or * OLD_PREP modes.. * * NBUFF should not be smaller than NWORK. * NMACWORK should not be smaller than NWORK * 2. * * SBSIZE defines the number of hash-table slots for the macro symbol table. * It must be a power of 2. * * MKDEP_INIT The initial maximum number of filenames in a dependency line * of output of -M* option. The maximum number is dynamically * enlarged in execution. */ #ifndef IDMAX #define IDMAX 0x400 #endif #ifndef NMACPARS #define NMACPARS 0xFF #endif #ifndef NEXP #define NEXP 0x100 #endif #ifndef BLK_NEST #define BLK_NEST 0x100 #endif #ifndef INCLUDE_NEST #define INCLUDE_NEST 0x100 #endif #ifndef RESCAN_LIMIT #define RESCAN_LIMIT 0x40 #endif #ifndef PRESTD_RESCAN_LIMIT #define PRESTD_RESCAN_LIMIT 0x100 #endif #ifndef NBUFF #define NBUFF 0x10000 /* Must be NWORK <= NBUFF */ #endif #ifndef NWORK #define NWORK NBUFF /* 0x1000, 0x4000, 0x10000, .. */ #endif #ifndef NMACWORK #define NMACWORK (NWORK * 4) /* Must be NWORK * 2 <= NMACWORK */ #endif #ifndef SBSIZE #define SBSIZE 0x400 #endif #ifndef MKDEP_INIT #define MKDEP_INIT 0x100 #endif #if UCHARMAX < NMACPARS #error "NMACPARS should not be greater than UCHARMAX" #endif #if NBUFF < NWORK #error "NBUFF must be same or greater than NWORK" #endif #if NMACWORK < NWORK * 2 #error "NMACWORK must be same or greater than NWORK * 2" #endif #define SBMASK (SBSIZE - 1) #if (SBSIZE ^ SBMASK) != ((SBSIZE * 2) - 1) #error "SBSIZE must be a power of 2 !" #endif /* * Translation limits required by the Standard. * * *90MIN limits specified by C90. * *99MIN limits specified by C99. * *_CPLUS_MIN limits recommended by C++ (ISO 1998/07 Standard). * * SLEN*MIN Characters in a logical source line * and characters in a string literal or wide string literal * (after concatenation). * IDLEN*MIN Significant initial characters in an internal identifier * or a macro name. * NMACPARS*MIN Parameters in one macro definition. * Arguments in one macro invocation. * EXP_NEST*MIN Nesting levels of parenthesized expressions in a full * expression. * BLK_NEST*MIN Nesting levels of conditional inclusion. * INCLUDE_NEST*MIN Nesting levels for #include files. * NMACRO*MIN Macro identifiers simultaneously defined in one translation * unit. */ #define SLEN90MIN 0x1FD #define IDLEN90MIN 0x1F #define NMACPARS90MIN 0x1F #define EXP_NEST90MIN 0x20 #define BLK_NEST90MIN 8 #define INCLUDE_NEST90MIN 8 #define NMACRO90MIN 0x400 #define SLEN99MIN 0xFFF #define IDLEN99MIN 0x3F #define NMACPARS99MIN 0x7F #define EXP_NEST99MIN 0x3F #define BLK_NEST99MIN 0x3F #define INCLUDE_NEST99MIN 0xF #define NMACRO99MIN 0xFFF #define SLEN_CPLUS_MIN 0x10000 #define IDLEN_CPLUS_MIN 0x400 #define NMACPARS_CPLUS_MIN 0x100 #define EXP_NEST_CPLUS_MIN 0x100 #define BLK_NEST_CPLUS_MIN 0x100 #define INCLUDE_NEST_CPLUS_MIN 0x100 #define NMACRO_CPLUS_MIN 0x10000 /* LINE99LIMIT means the line number limit of C99 */ #define LINE99LIMIT 0x7FFFFFFF /* * STDC This macro is used for the predefined __STDC__. * STDC_VERSION is used for the value of __STDC_VERSION__. * STDC_HOSTED is used for the value of __STDC_HOSTED__. */ #if IDMAX < IDLEN90MIN || NBUFF < SLEN90MIN + 3 || NWORK < SLEN90MIN + 2 || NMACPARS < NMACPARS90MIN || NEXP < EXP_NEST90MIN || BLK_NEST < BLK_NEST90MIN #define STDC 0 #endif #ifndef STDC #define STDC 1 /* 1 : for ISO 9899:1990 or later */ #endif #ifndef STDC_VERSION #define STDC_VERSION 0L /* 199409L : For conforming implementation to ISO 9899:1990 / Amendment 1:1995 199901L : For C99 */ #endif #ifndef STDC_HOSTED #define STDC_HOSTED 1 /* 1 : for hosted implementation, 0 : for free-standing implementation (C99 specification) */ #endif /* * CPLUS specifies the default value of the pre-defined macro __cplusplus * for C++ processing. * The value can be changed by -V option. */ #define CPLUS 1 /* 199711L for C++ Standard */ mcpp-2.7.2/src/mcpp_lib.h0000644000175000017500000000203311067603432012127 00000000000000/* mcpp_lib.h: declarations of libmcpp exported (visible) functions */ #ifndef _MCPP_LIB_H #define _MCPP_LIB_H #ifndef _MCPP_OUT_H #include "mcpp_out.h" /* declaration of OUTDEST */ #endif #if _WIN32 || _WIN64 || __CYGWIN__ || __CYGWIN64__ || __MINGW32__ \ || __MINGW64__ #if DLL_EXPORT || (__CYGWIN__ && PIC) #define DLL_DECL __declspec( dllexport) #elif DLL_IMPORT #define DLL_DECL __declspec( dllimport) #else #define DLL_DECL #endif #else #define DLL_DECL #endif extern DLL_DECL int mcpp_lib_main( int argc, char ** argv); extern DLL_DECL void mcpp_reset_def_out_func( void); extern DLL_DECL void mcpp_set_out_func( int (* func_fputc) ( int c, OUTDEST od), int (* func_fputs) ( const char * s, OUTDEST od), int (* func_fprintf)( OUTDEST od, const char * format, ...) ); extern DLL_DECL void mcpp_use_mem_buffers( int tf); extern DLL_DECL char * mcpp_get_mem_buffer( OUTDEST od); #endif /* _MCPP_LIB_H */ mcpp-2.7.2/src/internal.H0000644000175000017500000006260011055250034012115 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * I N T E R N A L . H * I n t e r n a l D e f i n i t i o n s f o r M C P P * * In general, definitions in this file should not be changed by implementor. */ #ifndef SYSTEM_H #error "system.H" must be included prior to "internal.H" #endif #include "mcpp_out.h" #if MCPP_LIB #include "mcpp_lib.h" /* External interface when used as library */ #endif #define EOS '\0' /* End of string */ #define CHAR_EOF 0 /* Returned by get_ch() on eof */ #define VA_ARGS (UCHARMAX + 1) /* Signal of variable arguments */ #define GVA_ARGS (VA_ARGS * 2) /* GCC-specific variable args */ #define AVA_ARGS (VA_ARGS | GVA_ARGS)/* Any variable arguments */ #define DEF_PRAGMA (-1 - AVA_ARGS) /* _Pragma() pseudo-macro */ #define DEF_NOARGS (-2 - AVA_ARGS) /* #define foo vs #define foo() */ #define DEF_NOARGS_PREDEF_OLD (DEF_NOARGS - 1) /* Compiler-predefined macro without leading '_' */ #define DEF_NOARGS_PREDEF (DEF_NOARGS - 2)/* Compiler-predefined macro */ #define DEF_NOARGS_STANDARD (DEF_NOARGS - 3)/* Standard predefined macro */ #define DEF_NOARGS_DYNAMIC (DEF_NOARGS - 4)/* Standard dynamically defined */ /* * These magic characters must be control characters which can't be used * in source file. */ /* for '#pragma MCPP debug macro_call' and -K option in STD mode. */ #define MAC_INF 0x18 /* Magic for macro informations */ /* In STD and POST_STD modes (IN_SRC and TOK_SEP are for STD mode only). */ #define DEF_MAGIC 0x19 /* Magic to prevent recursive expansion */ #define IN_SRC 0x1A /* Magic of name from source */ #define RT_END 0x1C /* Magic of macro rescan boundary */ #define ST_QUOTE 0x1D /* Magic for stringizing */ #define CAT 0x1E /* Token concatenation delim. */ #define TOK_SEP 0x1F /* Magic to wrap expanded macro */ /* In OLD_PREP mode. */ #define COM_SEP 0x1F /* Comment of 0-length */ #define MAC_PARM 0x7F /* Macro parameter signal */ /* Special character types */ #define LET 1 /* Letter (alphabet and _) */ #define DIG 2 /* Digit */ #define DOT 4 /* . might start a number */ #define PUNC 8 /* Punctuators and operators */ #define QUO 0x10 /* Both flavors of quotation ",'*/ #define SPA 0x20 /* White spaces */ #define HSP 0x40 /* Horizontal white spaces (' ', '\t', TOK_SEP) */ /* * Codes for operators used in #if expression. * The value of the scanned operator is stored in 'openum'. */ #define INV 0 /* Invalid, must be zero */ #define OP_EOE INV /* End of expression */ #define VAL 1 /* Value (operand) */ #define OP_LPA 2 /* ( */ /* The following are unary. */ #define FIRST_UNOP OP_PLU /* First unary operator */ #define OP_PLU 3 /* + */ #define OP_NEG 4 /* - */ #define OP_COM 5 /* ~ */ #define OP_NOT 6 /* ! */ #define LAST_UNOP OP_NOT /* Last unary operator */ /* The following are binary. */ #define FIRST_BINOP OP_MUL /* First binary operator */ #define OP_MUL 7 /* * */ #define OP_DIV 8 /* / */ #define OP_MOD 9 /* % */ #define OP_ADD 10 /* + */ #define OP_SUB 11 /* - */ #define OP_SL 12 /* << */ #define OP_SR 13 /* >> */ #define OP_LT 14 /* < */ #define OP_LE 15 /* <= */ #define OP_GT 16 /* > */ #define OP_GE 17 /* >= */ #define OP_EQ 18 /* == */ #define OP_NE 19 /* != */ #define OP_AND 20 /* & */ #define OP_XOR 21 /* ^ */ #define OP_OR 22 /* | */ #define OP_ANA 23 /* && */ #define OP_ORO 24 /* || */ #define OP_QUE 25 /* ? */ #define OP_COL 26 /* : */ #define LAST_BINOP OP_COL /* Last binary operator */ /* Parenthesis */ #define OP_RPA 27 /* ) */ #define OP_END 28 /* End of expression marker */ #define OP_FAIL (OP_END + 1) /* For error returns */ /* * The following are operators used in macro definition only. */ /* In STD and POST_STD modes. */ #define OP_STR 30 /* # */ #define OP_CAT 31 /* ## */ #define OP_ELL 32 /* ... */ /* * The following are C source operators or punctuators, * not preprocessing operators. * Note: "sizeof", "defined" are read as identifier for convenience. */ #define OP_1 33 /* Any other single byte ops or puncs */ /* =, ., ;, [, ], {, }, ',' */ #define OP_2 34 /* Any other two bytes operators */ /* &=, |=, ++, +=, --, -=, ->, %=, *=, /=, ^=, */ #define OP_3 35 /* Three bytes operators : <<=, >>= */ /* * The following are operators spelled in digraphs. */ /* In STD and POST_STD modes. */ #define OP_LBRACE_D 0x40 /* <% i.e. { */ #define OP_RBRACE_D 0x41 /* %> i.e. } */ #define OP_LBRCK_D 0x42 /* <: i.e. [ */ #define OP_RBRCK_D 0x43 /* :> i.e. ] */ #define OP_SHARP_D 0x44 /* %: i.e. # */ #define OP_DSHARP_D 0x45 /* %:%: i.e. ## */ #define OP_DIGRAPH 0x40 /* (OP_*_D & OP_DIGRAPH) == 0x40 */ /* * The following are for lexical scanning only. */ /* Token types */ #define NO_TOKEN 0 #define NAM 65 /* Identifier (name, keyword) */ #define NUM 66 /* Preprocessing number */ #define STR 67 /* Character string literal */ #define CHR 69 /* Integer character constant */ /* In STD and POST_STD modes. */ #define WSTR 68 /* Wide string literal */ #define WCHR 70 /* Wide character constant */ #define OPE 71 /* Operator or punctuator */ #define SPE 72 /* Unknown token (@ or others) */ #define SEP 73 /* Token separator or magics */ /* * The following are values of 'mcpp_debug' variable which is set by the * arguments of '#pragma MCPP debug' directive. */ #define PATH 1 #define TOKEN 2 #define EXPAND 4 #define MACRO_CALL 8 #define IF 16 #define EXPRESSION 32 #define GETC 64 #define MEMORY 128 /* MAC_* represent macro information types for -K option. */ #define MAC_CALL_START 1 #define MAC_CALL_END 2 #define MAC_ARG_START 3 #define MAC_ARG_END 4 /* MB_ERROR signals wrong multi-byte character sequence. */ #define MB_ERROR 0x8000 #if MCPP_LIB && HOST_COMPILER == GNUC \ && (SYS_FAMILY == SYS_UNIX && SYSTEM != SYS_CYGWIN) /* For GCC 4.* on UNIXes */ #pragma GCC visibility push( hidden) /* Hide these names from outside */ #endif /* * The DEFBUF structure stores information about #defined macros. * Note that DEFBUF->parmnames is parameter names catenated with commas, * which is saved for the check of redefinition for STD mode. * 'parmnames' and 'repl' are allocated to the area succeding to name. */ typedef struct defbuf { struct defbuf * link; /* Pointer to next def in chain */ short nargs; /* Number of parameters */ char * parmnames; /* -> Parameter names catenated by ',' */ char * repl; /* Pointer to replacement text */ const char * fname; /* Macro is defined in the source file */ long mline; /* at the line. */ char push; /* Push level indicator */ char name[1]; /* Macro name */ } DEFBUF; /* * The FILEINFO structure stores information about open files and macros * being expanded. */ typedef struct fileinfo { char * bptr; /* Current pointer into buffer */ long line; /* Current line number of file */ FILE * fp; /* Source file if non-null */ long pos; /* Position next to #include */ struct fileinfo * parent; /* Link to includer */ struct ifinfo * initif; /* Initial ifstack (return there on EOF)*/ int sys_header; /* System header file or not */ int include_opt; /* Specified by -include option */ const char ** dirp; /* Include directory the file resides */ const char * src_dir; /* Directory of source file */ const char * real_fname; /* Real file name */ const char * full_fname; /* Real full path list */ char * filename; /* File/macro name (maybe changed) */ char * buffer; /* Buffer of current input line */ #if MCPP_LIB /* Save output functions during push/pop of #includes */ int (* last_fputc) ( int c, OUTDEST od); int (* last_fputs) ( const char * s, OUTDEST od); int (* last_fprintf)( OUTDEST od, const char * format, ...); #endif } FILEINFO; /* * IFINFO stores information of conditional compilation. */ typedef struct ifinfo { int stat; /* State of compilation */ long ifline; /* Line #if started */ long elseline; /* Line #else started */ } IFINFO; /* * These bits are set in IFINFO.stat */ #define WAS_COMPILING 1 /* TRUE if compile set at entry */ #define ELSE_SEEN 2 /* TRUE when #else processed */ #define TRUE_SEEN 4 /* TRUE when #if TRUE processed */ #define compiling ifstack[0].stat #define FP2DEST(fp) \ (fp == fp_out) ? OUT : \ ((fp == fp_err) ? ERR : \ ((fp == fp_debug) ? DBG : \ ((OUTDEST) -1))) /* VAL_SIGN structure stores information about evaluated number. */ typedef struct val_sign { expr_t val; /* Value */ int sign; /* Signed, unsigned, error */ } VAL_SIGN; /* Values of VAL_SIGN.sign. */ #define SIGNED 1 #define UNSIGNED 0 #define VAL_ERROR (-1) /* LINE_COL stores information of line and column data */ typedef struct line_col { long line; size_t col; } LINE_COL; /* Value of macro_line on macro call error. */ #define MACRO_ERROR (-1L) /* * Values of insert_sep (flag of insertion of token separator). * Used only in POST_STD mode. */ #define NO_SEP 0 /* No separator is inserted */ #define INSERT_SEP 1 /* Next get_ch() insert a separator */ #define INSERTED_SEP 2 /* Last get_ch() Inserted a separator */ #define str_eq(s1, s2) (strcmp(s1, s2) == 0) #ifndef IO_SUCCESS #define IO_SUCCESS 0 #endif #ifndef IO_ERROR #define IO_ERROR (errno ? errno : 1) #endif /* * Externs */ /* The minimum translation limits specified by the Standards. */ extern struct std_limits_ { long str_len; /* Least maximum of string len. */ size_t id_len; /* Least maximum of ident len. */ int n_mac_pars; /* Least maximum of num of pars.*/ int exp_nest; /* Least maximum of expr nest */ int blk_nest; /* Least maximum of block nest */ int inc_nest; /* Least maximum of include nest*/ long n_macro; /* Least maximum of num of macro*/ long line_num; /* Maximum source line number */ } std_limits; /* The boolean flags specified by the execution options. */ extern struct option_flags_ { int c; /* -C option (keep comments) */ int k; /* -k option (keep white spaces)*/ int z; /* -z option (no-output of included file) */ int p; /* -P option (no #line output) */ int q; /* -Q option (diag to mcpp.err) */ int v; /* -v option (verbose) */ int trig; /* -3 option (toggle trigraphs) */ int dig; /* -2 option (toggle digraphs) */ int lang_asm; /* -a option (assembler source) */ int no_source_line; /* Do not output line in diag. */ int dollar_in_name; /* Allow $ in identifiers */ } option_flags; extern int mcpp_mode; /* Mode of preprocessing */ extern int stdc_val; /* Value of __STDC__ */ extern long stdc_ver; /* Value of __STDC_VERSION__ */ extern long cplus_val; /* Value of __cplusplus for C++ */ extern int stdc2; /* cplus_val or (stdc_ver >= 199901L) */ extern int stdc3; /* (stdc_ver or cplus_val) >= 199901L */ extern int standard; /* mcpp_mode is STD or POST_STD */ extern int std_line_prefix; /* #line in C source style */ extern int warn_level; /* Level of warning */ extern int errors; /* Error counter */ extern long src_line; /* Current source line number */ extern int wrong_line; /* Force #line to compiler */ extern int newlines; /* Count of blank lines */ extern int keep_comments; /* Don't remove comments */ extern int keep_spaces; /* Don't remove white spaces */ extern int include_nest; /* Nesting level of #include */ extern const char * null; /* "" string for convenience */ extern const char ** inc_dirp; /* Directory of #includer */ extern const char * cur_fname; /* Current source file name */ extern int no_output; /* Don't output included file */ extern int in_directive; /* In process of #directive */ extern int in_define; /* In #define line */ extern int in_getarg; /* Collecting arguments of macro*/ extern int in_include; /* In #include line */ extern int in_if; /* In #if and non-skipped expr. */ extern long macro_line; /* Line number of macro call */ extern char * macro_name; /* Currently expanding macro */ extern int openum; /* Number of operator or punct. */ extern IFINFO * ifptr; /* -> current ifstack item */ extern FILEINFO * infile; /* Current input file or macro */ extern FILE * fp_in; /* Input stream to preprocess */ extern FILE * fp_out; /* Output stream preprocessed */ extern FILE * fp_err; /* Diagnostics stream */ extern FILE * fp_debug; /* Debugging information stream */ extern int insert_sep; /* Inserted token separator flag*/ extern int mkdep; /* Output source file dependency*/ extern int mbchar; /* Encoding of multi-byte char */ extern int mbchk; /* Possible multi-byte char */ extern int bsl_in_mbchar; /* 2nd byte of mbchar has '\\' */ extern int bsl_need_escape;/* '\\' in mbchar should be escaped */ extern int mcpp_debug; /* Class of debug information */ extern long in_asm; /* In #asm - #endasm block */ extern jmp_buf error_exit; /* Exit on fatal error */ extern char * cur_fullname; /* Full name of current source */ extern short * char_type; /* Character classifier */ extern char * workp; /* Free space in work[] */ extern char * const work_end; /* End of work[] buffer */ extern char identifier[]; /* Lastly scanned name */ extern IFINFO ifstack[]; /* Information of #if nesting */ extern char work_buf[]; /* Temporary buffer for directive line and macro expansion */ /* main.c */ extern void un_predefine( int clearall); /* Undefine predefined macros */ /* directive.c */ extern void directive( void); /* Process #directive line */ extern DEFBUF * do_define( int ignore_redef, int predefine); /* Do #define directive */ extern DEFBUF * look_id( const char * name); /* Look for a #define'd thing */ extern DEFBUF ** look_prev( const char * name, int * cmp); /* Look for place to insert def.*/ extern DEFBUF * look_and_install( const char * name, int numargs , const char * parmnames, const char * repl); /* Look and insert macro def. */ extern DEFBUF * install_macro( const char * name, int numargs , const char * parmnames, const char * repl, DEFBUF ** prevp, int cmp , int predefine); /* Install a def to symbol table*/ extern int undefine( const char * name); /* Delete from symbol table */ extern void dump_a_def( const char * why, const DEFBUF * dp, int newdef , int comment, FILE * fp); /* Dump a specific macro def */ extern void dump_def( int comment, int K_opt); /* Dump current macro defs */ /* eval.c */ extern expr_t eval_if( void); /* Evaluate #if expression */ extern VAL_SIGN * eval_num( const char * nump); /* Evaluate preprocessing number*/ /* expand.c */ extern char * (* expand_macro)( DEFBUF * defp, char * out, char * out_end , LINE_COL line_col, int * pragma_op); /* Expand a macro completely */ extern void expand_init( int compat, int strict_ansi); /* Initialize expand_macro() */ extern DEFBUF * is_macro( char ** cp); /* The sequence is a macro call?*/ /* mbchar.c */ extern size_t (* mb_read)( int c1, char ** in_pp, char ** out_pp); /* Read mbchar sequence */ extern const char * set_encoding( char * name, char * env, int pragma); /* Multi-byte char encoding */ extern void mb_init( void); /* Initialize mbchar variables */ extern uexpr_t mb_eval( char ** seq_pp); /* Evaluate mbchar in #if */ extern int last_is_mbchar( const char * in, int len); /* The line ends with MBCHAR ? */ /* support.c */ extern int get_unexpandable( int c, int diag); /* Get next unexpandable token */ extern void skip_nl( void); /* Skip to the end of the line */ extern int skip_ws( void); /* Skip over white-spaces */ extern int scan_token( int c, char ** out_pp, char * out_end); /* Get the next token */ extern char * scan_quote( int delim, char * out, char * out_end, int diag); /* Scan a quoted literal */ extern int id_operator( const char * name); /* Check identifier-like ops */ extern void expanding( const char * name, int to_be_freed); /* Save macro name expanding */ extern void clear_exp_mac( void); /* Clear expanding macro infs */ extern int get_ch( void); /* Get the next char from input */ extern int cnv_trigraph( char * in); /* Do trigraph replacement */ extern int cnv_digraph( char * in); /* Convert digraphs to usual tok*/ extern void unget_ch( void); /* Push back the char to input */ extern FILEINFO * unget_string( const char * text, const char * name); /* Push back the string to input*/ extern char * save_string( const char * text); /* Stuff string in malloc mem. */ extern FILEINFO * get_file( const char * name, const char * src_dir , const char * fullname, size_t bufsize, int include_opt); /* New FILEINFO initialization */ extern char * (xmalloc)( size_t size); /* Get memory or die */ extern char * (xrealloc)( char * ptr, size_t size); /* Reallocate memory or die */ extern LINE_COL * get_src_location( LINE_COL * p_line_col); /* Get location on source file */ extern void cfatal( const char * format, const char * arg1, long arg2 , const char * arg3); /* Print a fatal error and exit */ extern void cerror( const char * format, const char * arg1, long arg2 , const char * arg3); /* Print an error message */ extern void cwarn( const char * format, const char * arg1, long arg2 , const char * arg3); /* Print a warning message */ extern void dump_string( const char * why, const char * text); /* Dump text readably */ extern void dump_unget( const char * why); /* Dump all ungotten junk */ /* Support for alternate output mechanisms (e.g. memory buffers) */ extern int (* mcpp_fputc)( int c, OUTDEST od), (* mcpp_fputs)( const char * s, OUTDEST od), (* mcpp_fprintf)( OUTDEST od, const char * format, ...); /* system.c */ extern void do_options( int argc, char ** argv, char ** in_pp , char ** out_pp); /* Process command line args */ extern void init_sys_macro( void); /* Define system-specific macro */ extern void at_start( void); /* Commands prior to main input */ extern void put_depend( const char * filename); /* Output source dependency line*/ extern int do_include( int next); /* Process #include directive */ extern void add_file( FILE * fp, const char * src_dir , const char * filename, const char * fullname, int include_opt); /* Chain the included file */ extern void sharp( FILEINFO * sharp_file, int marker); /* Output # line number */ extern void do_pragma( void); /* Process #pragma directive */ extern void put_asm( void); /* Putout an asm code line */ extern void do_old( void); /* Process older directives */ extern void at_end( void); /* Do the final commands */ extern void print_heap( void); /* Print blocks of heap memory */ #if ! HOST_HAVE_STPCPY extern char * stpcpy( char * dest, const char * src); /* Non-Standard library function*/ #endif #if MCPP_LIB /* Setting to use mcpp as a subroutine */ /* directive.c */ extern void clear_symtable( void); /* Free all macro definitions */ /* system.c */ extern void clear_filelist( void); /* Free filename and directory list */ /* The following 5 functions are to Initialize static variables. */ /* directive.c */ extern void init_directive( void); /* eval.c */ extern void init_eval( void); /* support.c */ extern void init_support( void); /* system.c */ extern void init_system( void); #if HOST_COMPILER == GNUC && (SYS_FAMILY == SYS_UNIX && SYSTEM != SYS_CYGWIN) #pragma GCC visibility pop #endif #endif #if HOST_HAVE_STPCPY extern char * stpcpy( char * dest, const char * src); #endif mcpp-2.7.2/src/main.c0000644000175000017500000012126011104255246011263 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * M A I N . C * M C P P M a i n P r o g r a m * * The main routine and it's supplementary routines are placed here. * The post-preprocessing routines are also placed here. */ #if PREPROCESSED /* Use "pre-preprocessed" header */ #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif /* Function pointer to expand_macro() functions. */ char * (*expand_macro)( DEFBUF * defp, char * out, char * out_end , LINE_COL line_col, int * pragma_op); /* The boolean flags specified by the execution options. */ struct option_flags_ option_flags = { FALSE, /* c: -C (keep comments) */ FALSE, /* k: -k (keep horizontal white spaces) */ FALSE, /* z: -z (no output of included files) */ FALSE, /* p: -P (no #line output) */ FALSE, /* q: -Q (output diagnosis to mcpp.err) */ FALSE, /* v: -v (verbose, affects macro notification) */ TRIGRAPHS_INIT, /* trig: -3 (toggle trigraphs) */ DIGRAPHS_INIT, /* dig: -2 (toggle digraphs recognition) */ /* * lang_asm allows the following non-standard features. * 1. #non-directive. * 2. in a string-literal. * 3. invalid pp-token generated by ## operator. * lang_asm is not available in POST_STD mode. * When COMPILER == GNUC, -x assembler-with-cpp or -lang-asm options * are used instead of -a. */ FALSE, /* lang_asm: -a (assembler source) */ FALSE /* no_source_line: -j (no source line in diag) */ }; int mcpp_mode = STD; /* Mode of preprocessing */ long cplus_val = 0L; /* Value of __cplusplus for C++ */ long stdc_ver = 0L; /* Value of __STDC_VERSION__ */ int stdc_val = 0; /* Value of __STDC__ */ int stdc2; /* cplus_val || stdc_ver >= 199901L */ int stdc3; /* cplus_val >= 199901L || stdc_ver >= 199901L. (cplus_val >= 199901L) specifies compatible mode to C99 (extended feature of this preprocessor) */ int standard = TRUE; /* TRUE, if mcpp_mode is STD or POST_STD */ int std_line_prefix = STD_LINE_PREFIX; /* Output line and file information in C source style */ /* * Commonly used global variables: * src_line is the current input line number. * wrong_line is set in many places when the actual output line is out of * sync with the numbering, e.g, when expanding a macro with an * embedded newline. * identifier holds the last identifier scanned (which might be a candidate * for macro expansion). * errors is the running mcpp error counter. * infile is the head of a linked list of input files (extended by * #include and macros being expanded). 'infile' always points * to the current file/macro. 'infile->parent' to the includer, * etc. 'infile->fp' is NULL if this input stream is not a file. * inc_dirp Directory of #includer with trailing PATH_DELIM. This points * to one of incdir[] or to the current directory (represented as * "". This should not be NULL. */ long src_line; /* Current line number */ int wrong_line; /* Force #line to compiler */ int newlines; /* Count of blank lines */ int errors = 0; /* Cpp error counter */ int warn_level = -1; /* Level of warning (have to initialize)*/ FILEINFO * infile = NULL; /* Current input file */ int include_nest = 0; /* Nesting level of #include */ const char * null = ""; /* "" string for convenience */ const char ** inc_dirp; /* Directory of #includer */ const char * cur_fname; /* Current source file name */ /* cur_fname is not rewritten by #line directive */ char * cur_fullname; /* Full path of current source file (i.e. infile->full_fname) */ int no_source_line; /* Do not output line in diag. */ char identifier[ IDMAX + IDMAX/8]; /* Current identifier */ int mcpp_debug = 0; /* != 0 if debugging now */ /* * in_directive is set TRUE while a directive line is scanned by directive(). * It modifies the behavior of squeeze_ws() in expand.c so that newline is * not skipped even if getting macro arguments. */ int in_directive = FALSE; /* TRUE scanning directive line */ int in_define = FALSE; /* TRUE scanning #define line */ int in_getarg = FALSE; /* TRUE collecting macro arguments */ int in_include = FALSE; /* TRUE scanning #include line */ int in_if = FALSE; /* TRUE scanning #if and in non-skipped expr. */ long in_asm = 0L; /* Starting line of #asm - #endasm block*/ /* * macro_line is set to the line number of start of a macro call while * expanding the macro, else set to 0. Line number is remembered for * diagnostics of unterminated macro call. On unterminated macro call * macro_line is set to MACRO_ERROR. */ long macro_line = 0L; /* * macro_name is the currently expanding macro. */ char * macro_name; /* * openum is the return value of scan_op() in support.c. */ int openum; /* * mkdep means to output source file dependency line, specified by -M* * option. The OR of the following values is used. * MD_MKDEP (1) : Output dependency line. * MD_SYSHEADER(2) : Print also system headers or headers with * absolute path not only user headers. * MD_FILE (4) : Output to the file named *.d instead of fp_out. * Normal output is done to fp_out as usual. */ int mkdep = 0; /* * If option_flags.z is TRUE, no_output is incremented when a file is * #included, and decremented when the file is finished. * If no_output is larger than 0, processed files are not output, meanwhile * the macros in the files are defined. * If mkdep != 0 && (mkdep & MD_FILE) == 0, no_output is set to 1 initially. */ int no_output = 0; /* * keep_comments is set TRUE by the -C option. If TRUE, comments are written * directly to the output stream. option_flags.c contains the permanent state * of the -C option. keep_comments is always falsified when compilation is * supressed by a false #if or when no_output is TRUE. */ int keep_comments = 0; /* Write out comments flag */ /* * keep_spaces is set to TRUE by the -k option. If TRUE, spaces and tabs in * an input line are written out to the output line without squeezing to one * space. option_flags.k contains the permanent state of the -k option. * keep_spaces is falsified when compilation is suppressed by a false #if. */ int keep_spaces = 0; /* Keep white spaces of line*/ /* * ifstack[] holds information about nested #if's. It is always accessed via * ifptr->stat. The information is as follows: * WAS_COMPILING state of compiling flag at outer level. * ELSE_SEEN set TRUE when #else seen to prevent 2nd #else. * TRUE_SEEN set TRUE when #if or #elif succeeds * ifstack[0].stat holds the compiling flag. It is WAS_COMPILING if compila- * tion is currently enabled. Note that this must be initialized to * WAS_COMPILING. */ IFINFO ifstack[ BLK_NEST + 1] = { {WAS_COMPILING, 0L, 0L}, }; /* Note: '+1' is necessary for the initial state. */ IFINFO * ifptr = ifstack; /* -> current ifstack[] */ /* * In POST_STD mode, insert_sep is set to INSERT_SEP when : * 1. the next get_ch() shall insert a token separator. * 2. unget_ch() has been called when insert_sep == INSERTED_SEP. * set to INSERTED_SEP when : * get_ch() has been called when insert_sep == INSERT_SEP. * set to NO_SEP when : * get_ch() has been called when insert_sep == INSERTED_SEP. */ int insert_sep = NO_SEP; /* File pointers for input and output. */ FILE * fp_in; /* Input stream to preprocess */ FILE * fp_out; /* Output stream preprocessed */ FILE * fp_err; /* Diagnostics stream */ FILE * fp_debug; /* Debugging information stream */ /* Variables on multi-byte character encodings. */ int mbchar = MBCHAR; /* Encoding of multi-byte char */ int mbchk; /* Character type of possible multi-byte char */ int bsl_in_mbchar; /* 2nd byte of mbchar possibly has '\\' */ int bsl_need_escape; /* '\\' in MBCHAR should be escaped */ /* Function pointer to mb_read_*() functions. */ size_t (*mb_read)( int c1, char ** in_pp, char ** out_pp); jmp_buf error_exit; /* Exit on fatal error */ /* * Translation limits specified by C90, C99 or C++. */ struct std_limits_ std_limits = { /* The following three are temporarily set for do_options() */ NBUFF, /* Least maximum of string length */ IDMAX, /* Least maximum of identifier length */ NMACPARS, /* Least maximum of number of macro params */ }; /* * work_buf[] and workp are used to store one piece of text as a temporary * buffer. * To initialize storage, set workp = work_buf. Note that the work buffer is * used by several subroutines -- be sure that your data won't be overwritten. * work_buf[] is used for: * 1. macro expansion (def_special(), prescan(), catenate(), * stringize()). * 2. processing directive line (directive.c, eval.c, get_unexpandable(), * do_pragma() and its subroutines). * 3. processing _Pragma() operator (do_pragma_op()). * 4. miscellaneous (init_gcc_macro(), curfile()). */ char work_buf[ NWORK + IDMAX]; /* Work buffer */ char * workp; /* Pointer into work_buf[] */ char * const work_end = & work_buf[ NWORK]; /* End of buffer of work_buf[] */ /* * src_col is the current input column number, but is rarely used. * It is used to put spaces after #line line in keep_spaces mode * on some special cases. */ static int src_col = 0; /* Column number of source line */ #define MBCHAR_IS_ESCAPE_FREE (SJIS_IS_ESCAPE_FREE && \ BIGFIVE_IS_ESCAPE_FREE && ISO2022_JP_IS_ESCAPE_FREE) #if MCPP_LIB static void init_main( void); /* Initialize static variables */ #endif static void init_defines( void); /* Predefine macros */ static void mcpp_main( void); /* Main loop to process input lines */ static void do_pragma_op( void); /* Execute the _Pragma() operator */ static void put_seq( char * begin, char * seq); /* Put out the failed sequence */ static char * de_stringize( char * in, char * out); /* "De-stringize" for _Pragma() op. */ static void putout( char * out); /* May concatenate adjacent string */ #if COMPILER != GNUC && COMPILER != MSC static void devide_line( char * out); /* Devide long line for compiler */ #endif static void put_a_line( char * out); /* Put out the processed line */ #if ! HAVE_DIGRAPHS || ! MBCHAR_IS_ESCAPE_FREE static int post_preproc( char * out); /* Post-preprocess for older comps */ #if ! HAVE_DIGRAPHS static char * conv_a_digraph( char * cp); /* Convert a digraph in place */ #endif #if ! MBCHAR_IS_ESCAPE_FREE static char * esc_mbchar( char * str, char * str_end); /* Double \ as 2nd byte of SJIS */ #endif #endif #if MCPP_LIB static void init_main( void) /* Initialize global variables on re-entering. */ { mcpp_mode = STD; cplus_val = stdc_ver = 0L; stdc_val = 0; standard = TRUE; std_line_prefix = STD_LINE_PREFIX; errors = src_col = 0; warn_level = -1; infile = NULL; in_directive = in_define = in_getarg = in_include = in_if = FALSE; src_line = macro_line = in_asm = 0L; mcpp_debug = mkdep = no_output = keep_comments = keep_spaces = 0; include_nest = 0; insert_sep = NO_SEP; mbchar = MBCHAR; ifptr = ifstack; ifstack[0].stat = WAS_COMPILING; ifstack[0].ifline = ifstack[0].elseline = 0L; std_limits.str_len = NBUFF; std_limits.id_len = IDMAX; std_limits.n_mac_pars = NMACPARS; option_flags.c = option_flags.k = option_flags.z = option_flags.p = option_flags.q = option_flags.v = option_flags.lang_asm = option_flags.no_source_line = option_flags.dollar_in_name = FALSE; option_flags.trig = TRIGRAPHS_INIT; option_flags.dig = DIGRAPHS_INIT; } int mcpp_lib_main #else int main #endif ( int argc, char ** argv ) { char * in_file = NULL; char * out_file = NULL; char * stdin_name = ""; if (setjmp( error_exit) == -1) { errors++; goto fatal_error_exit; } #if MCPP_LIB /* Initialize global and static variables. */ init_main(); init_directive(); init_eval(); init_support(); init_system(); #endif fp_in = stdin; fp_out = stdout; fp_err = stderr; fp_debug = stdout; /* * Debugging information is output to stdout in order to * synchronize with preprocessed output. */ inc_dirp = &null; /* Initialize to current (null) directory */ cur_fname = cur_fullname = "(predefined)"; /* For predefined macros */ init_defines(); /* Predefine macros */ mb_init(); /* Should be initialized prior to get options */ do_options( argc, argv, &in_file, &out_file); /* Command line options */ /* Open input file, "-" means stdin. */ if (in_file != NULL && ! str_eq( in_file, "-")) { if ((fp_in = fopen( in_file, "r")) == NULL) { mcpp_fprintf( ERR, "Can't open input file \"%s\".\n", in_file); errors++; #if MCPP_LIB goto fatal_error_exit; #else return( IO_ERROR); #endif } } else { in_file = stdin_name; } /* Open output file, "-" means stdout. */ if (out_file != NULL && ! str_eq( out_file, "-")) { if ((fp_out = fopen( out_file, "w")) == NULL) { mcpp_fprintf( ERR, "Can't open output file \"%s\".\n", out_file); errors++; #if MCPP_LIB goto fatal_error_exit; #else return( IO_ERROR); #endif } fp_debug = fp_out; } if (option_flags.q) { /* Redirect diagnostics */ if ((fp_err = fopen( "mcpp.err", "a")) == NULL) { errors++; mcpp_fprintf( OUT, "Can't open \"mcpp.err\"\n"); #if MCPP_LIB goto fatal_error_exit; #else return( IO_ERROR); #endif } } init_sys_macro(); /* Initialize system-specific macros */ add_file( fp_in, NULL, in_file, in_file, FALSE); /* "open" main input file */ infile->dirp = inc_dirp; infile->sys_header = FALSE; cur_fullname = in_file; if (mkdep && str_eq( infile->real_fname, stdin_name) == FALSE) put_depend( in_file); /* Putout target file name */ at_start(); /* Do the pre-main commands */ mcpp_main(); /* Process main file */ if (mkdep) put_depend( NULL); /* Append '\n' to dependency line */ at_end(); /* Do the final commands */ fatal_error_exit: #if MCPP_LIB /* Free malloced memory */ if (mcpp_debug & MACRO_CALL) { if (in_file != stdin_name) free( in_file); } clear_filelist(); clear_symtable(); #endif if (fp_in != stdin) fclose( fp_in); if (fp_out != stdout) fclose( fp_out); if (fp_err != stderr) fclose( fp_err); if (mcpp_debug & MEMORY) print_heap(); if (errors > 0 && option_flags.no_source_line == FALSE) { mcpp_fprintf( ERR, "%d error%s in preprocessor.\n", errors, (errors == 1) ? "" : "s"); return IO_ERROR; } return IO_SUCCESS; /* No errors */ } /* * This is the table used to predefine target machine, operating system and * compiler designators. It may need hacking for specific circumstances. * The -N option supresses these definitions. */ typedef struct pre_set { const char * name; const char * val; } PRESET; static PRESET preset[] = { #ifdef SYSTEM_OLD { SYSTEM_OLD, "1"}, #endif #ifdef SYSTEM_SP_OLD { SYSTEM_SP_OLD, "1"}, #endif #ifdef COMPILER_OLD { COMPILER_OLD, "1"}, #endif #ifdef COMPILER_SP_OLD { COMPILER_SP_OLD, "1"}, #endif { NULL, NULL}, /* End of macros beginning with alphabet */ #ifdef SYSTEM_STD { SYSTEM_STD, "1"}, #endif #ifdef SYSTEM_STD1 { SYSTEM_STD1, "1"}, #endif #ifdef SYSTEM_STD2 { SYSTEM_STD2, "1"}, #endif #ifdef SYSTEM_EXT { SYSTEM_EXT, SYSTEM_EXT_VAL}, #endif #ifdef SYSTEM_EXT2 { SYSTEM_EXT2, SYSTEM_EXT2_VAL}, #endif #ifdef SYSTEM_SP_STD { SYSTEM_SP_STD, SYSTEM_SP_STD_VAL}, #endif #ifdef COMPILER_STD { COMPILER_STD, COMPILER_STD_VAL}, #endif #ifdef COMPILER_STD1 { COMPILER_STD1, COMPILER_STD1_VAL}, #endif #ifdef COMPILER_STD2 { COMPILER_STD2, COMPILER_STD2_VAL}, #endif #ifdef COMPILER_EXT { COMPILER_EXT, COMPILER_EXT_VAL}, #endif #ifdef COMPILER_EXT2 { COMPILER_EXT2, COMPILER_EXT2_VAL}, #endif #ifdef COMPILER_SP_STD { COMPILER_SP_STD, COMPILER_SP_STD_VAL}, #endif #ifdef COMPILER_SP1 { COMPILER_SP1, COMPILER_SP1_VAL}, #endif #ifdef COMPILER_SP2 { COMPILER_SP2, COMPILER_SP2_VAL}, #endif #ifdef COMPILER_SP3 { COMPILER_SP3, COMPILER_SP3_VAL}, #endif #ifdef COMPILER_CPLUS { COMPILER_CPLUS, COMPILER_CPLUS_VAL}, #endif { NULL, NULL}, /* End of macros with value of any integer */ }; static void init_defines( void) /* * Initialize the built-in #define's. * Called only on cpp startup prior to do_options(). * * Note: the built-in static definitions are removed by the -N option. */ { int n = sizeof preset / sizeof (PRESET); int nargs; PRESET * pp; /* Predefine the built-in symbols. */ nargs = DEF_NOARGS_PREDEF_OLD; for (pp = preset; pp < preset + n; pp++) { if (pp->name && *(pp->name)) look_and_install( pp->name, nargs, null, pp->val); else if (! pp->name) nargs = DEF_NOARGS_PREDEF; } look_and_install( "__MCPP", DEF_NOARGS_PREDEF, null, "2"); /* MCPP V.2.x */ /* This macro is predefined and is not undefined by -N option, */ /* yet can be undefined by -U or #undef. */ } void un_predefine( int clearall /* TRUE for -N option */ ) /* * Remove predefined symbols from the symbol table. */ { PRESET * pp; DEFBUF * defp; int n = sizeof preset / sizeof (PRESET); for (pp = preset; pp < preset + n; pp++) { if (pp->name) { if (*(pp->name) && (defp = look_id( pp->name)) != NULL && defp->nargs >= DEF_NOARGS_PREDEF) undefine( pp->name); } else if (clearall == FALSE) { /* -S option */ break; } } } /* * output[] and out_ptr are used for: * buffer to store preprocessed line (this line is put out or handed to * post_preproc() via putout() in some cases) */ static char output[ NMACWORK]; /* Buffer for preprocessed line */ static char * const out_end = & output[ NWORK - 2]; /* Limit of output line for other than GCC and VC */ static char * const out_wend = & output[ NMACWORK - 2]; /* Buffer end of output line */ static char * out_ptr; /* Current pointer into output[]*/ static void mcpp_main( void) /* * Main process for mcpp -- copies tokens from the current input stream * (main file or included file) to the output file. */ { int c; /* Current character */ char * wp; /* Temporary pointer */ DEFBUF * defp; /* Macro definition */ int line_top; /* Is in the line top, possibly spaces */ LINE_COL line_col; /* Location of macro call in source */ keep_comments = option_flags.c && !no_output; keep_spaces = option_flags.k; /* Will be turned off if !compiling */ line_col.col = line_col.line = 0L; /* * This loop is started "from the top" at the beginning of each line. * 'wrong_line' is set TRUE in many places if it is necessary to write * a #line record. (But we don't write them when expanding macros.) * * 'newlines' variable counts the number of blank lines that have been * skipped over. These are then either output via #line records or * by outputting explicit blank lines. * 'newlines' will be cleared on end of an included file by get_ch(). */ while (1) { /* For the whole input */ newlines = 0; /* Count empty lines */ while (1) { /* For each line, ... */ out_ptr = output; /* Top of the line buf */ c = get_ch(); if (src_col) break; /* There is a residual tokens on the line */ while (char_type[ c] & HSP) { /* ' ' or '\t' */ if (c != COM_SEP) *out_ptr++ = c; /* Retain line top white spaces */ /* Else skip 0-length comment */ c = get_ch(); } if (c == '#') { /* Is 1st non-space '#' */ directive(); /* Do a #directive */ } else if (mcpp_mode == STD && option_flags.dig && c == '%') { /* In POST_STD digraphs are already converted */ if (get_ch() == ':') { /* '%:' i.e. '#' */ directive(); /* Do a #directive */ } else { unget_ch(); if (! compiling) { skip_nl(); newlines++; } else { break; } } } else if (c == CHAR_EOF) { /* End of input */ break; } else if (! compiling) { /* #ifdef false? */ skip_nl(); /* Skip to newline */ newlines++; /* Count it, too. */ } else if (in_asm && ! no_output) { /* In #asm block */ put_asm(); /* Put out as it is */ } else if (c == '\n') { /* Blank line */ if (keep_comments) mcpp_fputc( '\n', OUT); /* May flush comments */ else newlines++; /* Wait for a token */ } else { break; /* Actual token */ } } if (c == CHAR_EOF) /* Exit process at */ break; /* end of input */ /* * If the loop didn't terminate because of end of file, we * know there is a token to compile. First, clean up after * absorbing newlines. newlines has the number we skipped. */ if (no_output) { wrong_line = FALSE; } else { if (wrong_line || newlines > 10) { sharp( NULL, 0); /* Output # line number */ if (keep_spaces && src_col) { while (src_col--) /* Adjust columns */ mcpp_fputc( ' ', OUT); src_col = 0; } } else { /* If just a few, stuff */ while (newlines-- > 0) /* them out ourselves */ mcpp_fputc('\n', OUT); } } /* * Process each token on this line. */ line_top = TRUE; while (c != '\n' && c != CHAR_EOF) { /* For the whole line */ /* * has_pragma is set to TRUE so as to execute _Pragma() operator * when the psuedo macro _Pragma() is found. */ int has_pragma; if ((mcpp_debug & MACRO_CALL) && ! in_directive) { line_col.line = src_line; /* Location in source */ line_col.col = infile->bptr - infile->buffer - 1; } if (scan_token( c, (wp = out_ptr, &wp), out_wend) == NAM && (defp = is_macro( &wp)) != NULL) { /* A macro */ wp = expand_macro( defp, out_ptr, out_wend, line_col , & has_pragma); /* Expand it completely */ if (line_top) { /* The first token is a macro */ char * tp = out_ptr; while (char_type[ *tp & UCHARMAX] & HSP) tp++; /* Remove excessive spaces */ memmove( out_ptr, tp, strlen( tp) + 1); wp -= (tp - out_ptr); } if (has_pragma) { /* Found _Pramga() */ do_pragma_op(); /* Do _Pragma() operator*/ out_ptr = output; /* Do the rest of line */ wrong_line = TRUE; /* Line-num out of sync */ } else { out_ptr = wp; } if (keep_spaces && wrong_line && infile && *(infile->bptr) != '\n' && *(infile->bptr) != EOS) { src_col = infile->bptr - infile->buffer; /* Remember the current colums */ break; /* Do sharp() now */ } } else { /* Not a macro call */ out_ptr = wp; /* Advance the place */ if (wrong_line) /* is_macro() swallowed */ break; /* the newline */ } while (char_type[ c = get_ch()] & HSP) { /* Horizontal space */ if (c != COM_SEP) /* Skip 0-length comment*/ *out_ptr++ = c; } line_top = FALSE; /* Read over some token */ } /* Loop for line */ putout( output); /* Output the line */ } /* Continue until EOF */ } static void do_pragma_op( void) /* * Execute the _Pragma() operator contained in an expanded macro. * Note: _Pragma() operator is also implemented as a special macro. Therefore * it is always searched as a macro. * There might be more than one _Pragma() in a expanded macro and those may be * surrounded by other token sequences. * Since all the macros have been expanded completely, any name identical to * macro should not be re-expanded. * However, a macro in the string argument of _Pragma() may be expanded by * do_pragma() after de_stringize(), if EXPAND_PRAGMA == TRUE. */ { FILEINFO * file; DEFBUF * defp; int prev = output < out_ptr; /* There is a previous sequence */ int token_type; char * cp1, * cp2; int c; file = unget_string( out_ptr, NULL); while (c = get_ch(), file == infile) { if (char_type[ c] & HSP) { *out_ptr++ = c; continue; } if (scan_token( c, (cp1 = out_ptr, &cp1), out_wend) == NAM && (defp = is_macro( &cp1)) != NULL && defp->nargs == DEF_PRAGMA) { /* _Pragma() operator */ if (prev) { putout( output); /* Putout the previous sequence */ cp1 = stpcpy( output, "pragma "); /* From top of buffer */ } /* is_macro() already read over possible spaces after _Pragma */ *cp1++ = get_ch(); /* '(' */ while (char_type[ c = get_ch()] & HSP) *cp1++ = c; if (((token_type = scan_token( c, (cp2 = cp1, &cp1), out_wend)) != STR && token_type != WSTR)) { /* Not a string literal */ put_seq( output, cp1); return; } workp = de_stringize( cp2, work_buf); while (char_type[ c = get_ch()] & HSP) *cp1++ = c; if (c != ')') { /* More than a string literal */ unget_ch(); put_seq( output, cp1); return; } strcpy( workp, "\n"); /* Terminate with */ unget_string( work_buf, NULL); do_pragma(); /* Do the #pragma "line" */ infile->bptr += strlen( infile->bptr); /* Clear sequence */ cp1 = out_ptr = output; /* From the top of buffer */ prev = FALSE; } else { /* Not pragma sequence */ out_ptr = cp1; prev = TRUE; } } unget_ch(); if (prev) putout( output); } static void put_seq( char * begin, /* Sequence already in buffer */ char * seq /* Sequence to be read */ ) /* * Put out the failed sequence as it is. */ { FILEINFO * file = infile; int c; cerror( "Operand of _Pragma() is not a string literal" /* _E_ */ , NULL, 0L, NULL); while (c = get_ch(), file == infile) *seq++ = c; unget_ch(); out_ptr = seq; putout( begin); } static char * de_stringize( char * in, /* Null terminated string literal */ char * out /* Output buffer */ ) /* * Make token sequence from a string literal for _Pragma() operator. */ { char * in_p; int c1, c; in_p = in; if (*in_p == 'L') in_p++; /* Skip 'L' prefix */ while ((c = *++in_p) != EOS) { if (c == '\\' && ((c1 = *(in_p + 1), c1 == '\\') || c1 == '"')) c = *++in_p; /* "De-escape" escape sequence */ *out++ = c; } *--out = EOS; /* Remove the closing '"' */ return out; } static void putout( char * out /* Output line (line-end is always 'out_ptr') */ ) /* * Put out a line with or without "post-preprocessing". */ { size_t len; *out_ptr++ = '\n'; /* Put out a newline */ *out_ptr = EOS; #if ! MBCHAR_IS_ESCAPE_FREE post_preproc( out); #elif ! HAVE_DIGRAPHS if (mcpp_mode == STD && option_flag.dig) post_preproc( out); #endif /* Else no post-preprocess */ #if COMPILER != GNUC && COMPILER != MSC /* GCC and Visual C can accept very long line */ len = strlen( out); if (len > NWORK - 1) devide_line( out); /* Devide a too long line */ else #endif put_a_line( out); } #if COMPILER != GNUC && COMPILER != MSC static void devide_line( char * out /* 'out' is 'output' in actual */ ) /* * Devide a too long line into output lines shorter than NWORK. * This routine is called from putout(). */ { FILEINFO * file; char * save; char * wp; int c; file = unget_string( out, NULL); /* To re-read the line */ wp = out_ptr = out; while ((c = get_ch()), file == infile) { if (char_type[ c] & HSP) { if (keep_spaces || out == out_ptr || (char_type[ *(out_ptr - 1) & UCHARMAX] & HSP)) { *out_ptr++ = c; wp++; } continue; } scan_token( c, &wp, out_wend); /* Read a token */ if (NWORK-2 < wp - out_ptr) { /* Too long a token */ cfatal( "Too long token %s", out_ptr, 0L, NULL); /* _F_ */ } else if (out_end <= wp) { /* Too long line */ if (mcpp_debug & MACRO_CALL) { /* -K option */ /* Other than GCC or Visual C */ /* scan_token() scans a comment as sequence of some */ /* tokens such as '/', '*', ..., '*', '/', since it */ /* does not expect comment. */ save = out_ptr; while ((save = strrchr( save, '/')) != NULL) { if (*(save - 1) == '*') { /* '*' '/' sequence */ out_ptr = save + 1; /* Devide at the end*/ break; /* of a comment*/ } } } save = save_string( out_ptr); /* Save the token */ *out_ptr++ = '\n'; /* Append newline */ *out_ptr = EOS; put_a_line( out); /* Putout the former tokens */ wp = out_ptr = stpcpy( out, save); /* Restore the token */ free( save); } else { /* Still in size */ out_ptr = wp; /* Advance the pointer */ } } unget_ch(); /* Push back the source character */ put_a_line( out); /* Putout the last tokens */ sharp( NULL, 0); /* Correct line number */ } #endif static void put_a_line( char * out ) /* * Finally put out the preprocessed line. */ { size_t len; char * out_p; char * tp; if (no_output) return; len = strlen( out); tp = out_p = out + len - 2; /* Just before '\n' */ while (char_type[ *out_p & UCHARMAX] & SPA) out_p--; /* Remove trailing white spaces */ if (out_p < tp) { *++out_p = '\n'; *++out_p = EOS; } if (mcpp_fputs( out, OUT) == EOF) cfatal( "File write error", NULL, 0L, NULL); /* _F_ */ } /* * Routines to P O S T - P R E P R O C E S S * * 1998/08 created kmatsui (revised 1998/09, 2004/02, 2006/07) * Supplementary phase for the older compiler-propers. * 1. Convert digraphs to usual tokens. * 2. Double '\\' of the second byte of multi-byte characters. * These conversions are done selectively according to the macros defined * in system.H. * 1. Digraphs are converted if ! HAVE_DIGRAPHS and digraph recoginition * is enabled by DIGRAPHS_INIT and/or -2 option on execution. * 2. '\\' of the second byte of SJIS (BIGFIVE or ISO2022_JP) is doubled * if bsl_need_escape == TRUE. */ #if HAVE_DIGRAPHS && MBCHAR_IS_ESCAPE_FREE /* No post_preproc() */ #else static int post_preproc( char * out ) /* * Convert digraphs and double '\\' of the second byte of SJIS (BIGFIVE or * ISO2022_JP). * Note: Output of -K option embeds macro informations into comments. * scan_token() does not recognize comment and parses it as '/', '*', etc. */ { #if ! HAVE_DIGRAPHS int di_count = 0; #endif int token_type; int c; char * str; char * cp = out; unget_string( out, NULL); while ((c = get_ch()) != '\n') { /* Not to read over to next line */ if (char_type[ c] & HSP) { *cp++ = c; continue; } str = cp; token_type = scan_token( c, &cp, out_wend); switch (token_type) { #if ! MBCHAR_IS_ESCAPE_FREE case WSTR : case WCHR : str++; /* Skip prefix 'L' */ /* Fall through */ case STR : case CHR : if (bsl_need_escape) cp = esc_mbchar( str, cp); break; #endif /* ! MBCHAR_IS_ESCAPE_FREE */ #if ! HAVE_DIGRAPHS case OPE : if (mcpp_mode == STD && (openum & OP_DIGRAPH)) { cp = conv_a_digraph( cp); /* Convert a digraph */ di_count++; } break; #endif } } *cp++ = '\n'; *cp = EOS; #if ! HAVE_DIGRAPHS if (mcpp_mode == STD && di_count && (warn_level & 16)) cwarn( "%.0s%ld digraph(s) converted" /* _W16_ */ , NULL, (long) di_count, NULL); #endif return 0; } #endif /* ! HAVE_DIGRAPHS || ! MBCHAR_IS_ESCAPE_FREE */ #if ! HAVE_DIGRAPHS static char * conv_a_digraph( char * cp /* The end of the digraph token */ ) /* * Convert a digraph to usual token in place. * This routine is never called in POST_STD mode. */ { cp -= 2; switch (openum) { case OP_LBRACE_D : *cp++ = '{'; break; case OP_RBRACE_D : *cp++ = '}'; break; case OP_LBRCK_D : *cp++ = '['; break; case OP_RBRCK_D : *cp++ = ']'; break; case OP_SHARP_D : /* Error of source */ *cp++ = '#'; break; case OP_DSHARP_D : /* Error of source */ cp -= 2; *cp++ = '#'; *cp++ = '#'; break; } return cp; } #endif /* ! HAVE_DIGRAPHS */ #if ! MBCHAR_IS_ESCAPE_FREE static char * esc_mbchar( char * str, /* String literal or character constant without 'L' */ char * str_end /* The end of the token */ ) /* * Insert \ before the byte of 0x5c('\\') of the SJIS, BIGFIVE or ISO2022_JP * multi-byte character code in string literal or character constant. * Insert \ also before the byte of 0x22('"') and 0x27('\'') of ISO2022_JP. * esc_mbchar() does in-place insertion. */ { char * cp; int delim; int c; if (! bsl_need_escape) return str_end; if ((delim = *str++) == 'L') delim = *str++; /* The quote character */ while ((c = *str++ & UCHARMAX) != delim) { if (char_type[ c] & mbchk) { /* MBCHAR */ cp = str; mb_read( c, &str, (workp = work_buf, &workp)); while (cp++ < str) { c = *(cp - 1); if (c == '\\' || c == '"' || c == '\'') { /* Insert \ before 0x5c, 0x22, 0x27 */ memmove( cp, cp - 1, (size_t) (str_end - cp) + 2); *(cp++ - 1) = '\\'; str++; str_end++; } } } else if (c == '\\' && ! (char_type[ *str & UCHARMAX] & mbchk)) { str++; /* Escape sequence */ } } return str_end; } #endif /* ! MBCHAR_IS_ESCAPE_FREE */ mcpp-2.7.2/src/noconfig.H0000644000175000017500000005050011066630420012102 00000000000000/* * noconfig.H * Configurations for MCPP not using config.h. * * WARNING: These are default settings. To configure for your system, you * must edit this file here and there. */ #define TRUE 1 #define FALSE 0 /* * 'Target' means the O.S. and the compiler to which cpp is implemented. * 'Host' means the O.S. and the compiler with which cpp is compiled. */ /* Define target operating-system. */ #define SYSTEM SYS_FREEBSD /* Define target compiler. */ #ifndef COMPILER #define COMPILER INDEPENDENT /* compiler-independent-build */ #endif /* Define host operating-system. */ #define HOST_SYSTEM SYSTEM /* Define host compiler. */ #define HOST_COMPILER GNUC /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ #define VERSION_MSG "GCC 3.4" #if 0 "LCC-Win32 2006-03" "Visual C 2005" "Visual C 2008" "BCC V.5.5" #endif /* * P A R T 1 Configurations for target-operating-system * and target-compiler. */ /* * Names of the SYSTEM (i.e. target operating system). This is needed so that * cpp can use appropriate filename conventions. */ #define SYS_UNKNOWN 0 #define SYS_UNIX 0x1000 #define SYS_LINUX 0x1800 /* (SYS_LINUX & 0xF000) == SYS_UNIX */ #define SYS_FREEBSD 0x1A00 /* (SYS_FREEBSD & 0xF000) == SYS_UNIX */ #define SYS_CYGWIN 0x1C00 /* (SYS_CYGWIN & 0xF000) == SYS_UNIX */ #define SYS_MAC 0x1E00 /* (SYS_MAC & 0xF000) == SYS_UNIX */ #define SYS_WIN 0x7000 #define SYS_WIN32 0x7400 /* (SYS_WIN32 & 0xF000) == SYS_WIN */ #define SYS_WIN64 0x7800 /* (SYS_WIN64 & 0xF000) == SYS_WIN */ #define SYS_MINGW 0x7C00 /* (SYS_MINGW & 0xF000) == SYS_WIN */ /* COMPILER */ #define COMPILER_UNKNOWN 0 #define MSC 0x7400 /* Microsoft C, Visual C++ */ #define BORLANDC 0x7440 /* Borland C */ #define LCC 0x74C0 /* LCC-Win32 */ #define GNUC 0x00E0 /* GNU C (GCC) */ #define INDEPENDENT 0xFFFF /* No target, compiler-independent build*/ #define SYS_FAMILY (SYSTEM & 0xF000) #define COMPILER_FAMILY (COMPILER & 0xF0) #define HOST_SYS_FAMILY (HOST_SYSTEM & 0xF000) /* Default MBCHAR (multi-byte character) encoding. */ #define EUC_JP 0x10 /* Extended UNIX code of JIS X 0208 */ #define GB2312 0x20 /* EUC-like encoding of Chinese GB 2312-80 */ #define KSC5601 0x30 /* EUC-like encoding of Korean KS C 5601 */ #define SJIS 0x80 /* Shift-JIS encoding of JIS X 0208 */ #define BIGFIVE 0x90 /* Encoding of Taiwanese Big Five */ #define ISO2022_JP 0x100 /* ISO-2022-JP (ISO-2022-JP1) encoding */ #define UTF8 0x1000 /* UTF-8 encoding */ /* * MBCHAR means multi-byte character encoding. * MBCHAR means the default encoding, and you can change the encoding by * #pragma MCPP setlocale, -e option or environment variable * LC_ALL, LC_CTYPE, LANG. * MBCHAR == 0 means not to recognize any multi-byte character encoding. */ /* * In order to predefine target-system-dependent macros, * several macros are defined here: * *_OLD define the macro beginning with an alphabetic letter, * *_STD, *_STD?, *_EXT, *_EXT2 define the macro beginning with an '_'. * *_STD1 define the macro beginning with '__' and ending with an alphanumeric * letter. * *_STD2 define the macro beginning with '__' and ending with '__'. * These may not be defined, if they are not needed. * They should not be #defined to no token or to "". * * SYSTEM_OLD, SYSTEM_STD1, SYSTEM_STD2, SYSTEM_EXT, SYSTEM_EXT2 * define the target operating system (by name). * SYSTEM_SP_OLD, SYSTEM_SP_STD define the target-OS specific macro name * COMPILER_OLD, COMPILER_STD1, COMPILER_STD2, COMPILER_EXT, COMPILER_EXT2 * , COMPILER_SP_OLD, COMPILER_SP_STD * define the target compiler (by name). * COMPILER_CPLUS defines the target C++ compiler. * COMPILER_SP1, COMPILER_SP2, COMPILER_SP3 * define the compiler-specific macros. * * _VAL specify the value of the . * If not specified, these values default to "1". * To define the value of no-token, specify as "" rather than no-token. * SYSTEM_OLD, SYSTEM_STD?, COMPILER_OLD have the value of "1". */ /* * target-compiler-dependent definitions: * * LINE_PREFIX defines the output line prefix, if not "#line 123". * This should be defined as "# " to represent "# 123" format * ("#line " represents "#line 123" format). * * C_INCLUDE_DIR1, C_INCLUDE_DIR2 may be defined if you have a compiler- * specific include directory which is to be searched *before* * the operating-system specific directories (e.g. /usr/include). * CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2, CPLUS_INCLUDE_DIR3 * , CPLUS_INCLUDE_DIR4 are for C++ include directory which exist * other than C include directory. * ENV_C_INCLUDE_DIR may be defined to the name of environment-variable for * C include directory. * ENV_CPLUS_INCLUDE_DIR is name of environment-variable for C++ include * directory which exists other than ENV_C_INCLUDE_DIR. * ENV_SEP is the separator (other than space) of include-paths in an * environment-variable. e.g. the ':' in * "/usr/abc/include:/usr/xyz/include" * * EMFILE should be defined to the macro to represent errno of 'too many * open files' if the macro is different from EMFILE. * * ONE_PASS should be set TRUE, if COMPILER is "one pass compiler". * * FNAME_FOLD means that target-system folds upper and lower cases of * directory and file-name. * * SEARCH_INIT specifies the default value of 'search_rule' (in system.c). * 'search_rule' holds searching rule of #include "header.h" to * search first before searching user specified or system- * specific include directories. * CURRENT means to search the directory relative to "current * directory" which is current at cpp invocation. * SOURCE means to search the directory relative to that of the * source file (i.e. "includer"). * (CURRENT & SOURCE) means to search current directory first * source directory next. * 'search_rule' is initialized to SEARCH_INIT. */ #define CURRENT 1 #define SOURCE 2 #if SYS_FAMILY == SYS_UNIX #define SYSTEM_OLD "unix" #define SYSTEM_STD1 "__unix" #define SYSTEM_STD2 "__unix__" #if SYSTEM == SYS_FREEBSD #define SYSTEM_EXT "__FreeBSD__" #define SYSTEM_EXT_VAL "6" /* V.5.*: 5, V.6.*:6 */ #endif #if SYSTEM == SYS_LINUX #define SYSTEM_EXT "__linux__" #endif #if SYSTEM == SYS_MAC /* Mac OS X */ #define SYSTEM_EXT "__APPLE__" #define FNAME_FOLD TRUE /* Case-insensitive file-system */ #define FRAMEWORK1 "/System/Library/Frameworks" #define FRAMEWORK2 "/Library/Frameworks" #endif /* SYSTEM == SYS_MAC */ #if SYSTEM == SYS_CYGWIN #define SYSTEM_EXT "__CYGWIN__" #define SYSTEM_EXT2 "__CYGWIN32__" #define MBCHAR SJIS #define FNAME_FOLD TRUE #define CYGWIN_ROOT_DIRECTORY "c:/pub/compilers/cygwin" #endif /* SYSTEM == SYS_CYGWIN */ #ifndef MBCHAR #define MBCHAR EUC_JP /* UTF8 if you like */ #endif #ifndef FNAME_FOLD #define FNAME_FOLD FALSE #endif #endif /* SYS_FAMILY == SYS_UNIX */ #if SYS_FAMILY == SYS_WIN #define SYSTEM_SP_STD "__FLAT__" #define SYSTEM_SP_STD_VAL "1" #ifndef MBCHAR #define MBCHAR SJIS /* Multi-byte char is encoded in SJIS */ #endif #if COMPILER == MSC #define CMP_NAME "Visual C++" #if _MSC_VER >= 1200 /* Visual C++ V.6.0 or later */ /* When HOST == TARGET */ #define ONE_PASS TRUE #endif #define COMPILER_EXT "_MSC_VER" #define COMPILER_EXT_VAL "1500" /* VC 6.0: "1200" */ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */ #define COMPILER_EXT2 "_MSC_FULL_VER" #define COMPILER_EXT2_VAL "150021022" /* VC 6.0: "12008804" */ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */ /* VC 2008: "150021022" */ #define COMPILER_SP1 "_MSC_EXTENSIONS" #define COMPILER_SP1_VAL "1" #define COMPILER_SP2 "_INTEGRAL_MAX_BITS" #define COMPILER_SP2_VAL "64" /* VC 2003, VC2005, VC2008: 64 */ #define TARGET_HAVE_LONG_LONG TRUE /* __int64 instead of long long (VC 2.0 through 8.0) */ #define EXPAND_PRAGMA TRUE #define HAVE_DIGRAPHS TRUE #define BIGFIVE_IS_ESCAPE_FREE TRUE #define SEARCH_INIT SOURCE #elif COMPILER == BORLANDC /* Borland C 5.* and C++Builder */ #define CMP_NAME "Borland C" #define ONE_PASS TRUE #define COMPILER_STD2 "__TURBOC__" #if __BORLANDC__ /* Borland C */ #define COMPILER_STD2_VAL "0x0550" /* BC 5.5: "0x0550", BC 5.9: "0x5930" */ #define COMPILER_EXT "__BORLANDC__" #define COMPILER_EXT_VAL "0x0550" /* BC 5.5: "0x0550", BC 5.9: "0x5930" */ #define COMPILER_CPLUS "__BCPLUSPLUS__" #define COMPILER_CPLUS_VAL "0x0550" /* BC 5.5: "0x0550", BC 5.9: "0x5930" */ #define EXPAND_PRAGMA TRUE #define SEARCH_INIT (CURRENT & SOURCE) #define TARGET_HAVE_LONG_LONG TRUE /* __int64 instead of long long */ #endif /* __BORLANDC__ */ #elif COMPILER == LCC #define CMP_NAME "LCC-Win32" #define COMPILER_STD2 "__LCC__" #define COMPILER_SP1 "__LCCDEBUGLEVEL" #define COMPILER_SP1_VAL "0" #define COMPILER_SP2 "__LCCOPTIMLEVEL" #define COMPILER_SP2_VAL "0" #define ONE_PASS TRUE #define TARGET_HAVE_LONG_LONG TRUE #define SJIS_IS_ESCAPE_FREE FALSE #endif #if SYSTEM == SYS_MINGW #define SYSTEM_EXT "__MINGW__" #define SYSTEM_EXT2 "__MINGW32__" #define MSYS_ROOT_DIRECTORY "c:/pub/compilers/msys/1.0" #define MINGW_DIRECTORY "c:/pub/compilers/mingw" #if COMPILER == GNUC #define SJIS_IS_ESCAPE_FREE FALSE #define INC_DIR C_INCLUDE_DIR2 #endif #endif /* SYSTEM == SYS_MINGW */ #ifndef SJIS_IS_ESCAPE_FREE #define SJIS_IS_ESCAPE_FREE TRUE /* or FALSE following your compiler */ #endif #endif /* SYS_FAMILY == SYS_WIN */ #if COMPILER_FAMILY == GNUC #define CMP_NAME "GCC" #define COMPILER_EXT "__GNUC__" #define COMPILER_EXT_VAL "3" /* "3" for V.3.* "4" for V.4.* */ #define COMPILER_EXT2 "__GNUC_MINOR__" #define COMPILER_EXT2_VAL "4" /* "4" for V.3.4, "1" for V.4.1 */ #define COMPILER_CPLUS "__GNUG__" #define COMPILER_CPLUS_VAL "3" /* "3" for V.3.*, "4" for V.4.* */ #define GCC_MAJOR_VERSION 3 /* Value of __GNUC__ as a digit */ #define LINE_PREFIX "# " #ifndef HAVE_DIGRAPHS #define HAVE_DIGRAPHS TRUE #endif #ifndef TARGET_HAVE_LONG_LONG #define TARGET_HAVE_LONG_LONG TRUE #endif #define STDC_VERSION 0L /* 199409L for V.2.9, 0L for V.3.*,V.4.* */ #define CPLUS_INCLUDE_DIR1 "/usr/include/c++/3.4" /* "/usr/include/c++/3.3.6" */ /* "/usr/include/c++/4.1.2" */ #define CPLUS_INCLUDE_DIR2 "/usr/include/c++/3.4/backward" /* "/usr/include/c++/3.3.6/i386-vine-linux" */ /* "/usr/include/c++/4.1.2/i486-linux-gnu" */ /* #define CPLUS_INCLUDE_DIR3 */ /* "/usr/include/c++/3.3.6/backward" */ /* "/usr/include/c++/4.1.2/backward" */ /* #define C_INCLUDE_DIR1 */ /* "/usr/lib/gcc-lib/i386-vine-linux/3.3.6/include" */ /* "/usr/lib/gcc/i486-linux-gnu/4.1.2/include" */ /* #define C_INCLUDE_DIR2 */ #ifndef INC_DIR #ifdef C_INCLUDE_DIR1 #define INC_DIR C_INCLUDE_DIR1 /* GNUC version specific dir */ #else #define INC_DIR "/usr/local/include" /* "/usr/include" */ #endif #endif #ifndef ENV_C_INCLUDE_DIR #define ENV_C_INCLUDE_DIR "C_INCLUDE_PATH" #define ENV_CPLUS_INCLUDE_DIR "CPLUS_INCLUDE_PATH" #endif #define SEARCH_INIT SOURCE /* Include directory relative to source */ /* * __SIZE_TYPE__, __PTRDIFF_TYPE__ and __WCHAR_TYPE__ are predefines of GCC. */ #if GCC_MAJOR_VERSION < 3 #define COMPILER_SP1 "__SIZE_TYPE__" #define COMPILER_SP2 "__PTRDIFF_TYPE__" #define COMPILER_SP3 "__WCHAR_TYPE__" #define COMPILER_SP1_VAL "unsigned int" #define COMPILER_SP2_VAL "int" #define COMPILER_SP3_VAL "int" /* SYS_FREEBSD: "int", SYS_CYGWIN, SYS_MINGW: "short unsigned int" , others: "long int" */ #endif /* GCC_MAJOR_VERSION < 3 */ /* On GCC V.3.*, V.4.*, these macros are known by mcpp_g*_predef_*.h files. */ #endif /* COMPILER_FAMILY == GNUC */ #if COMPILER == INDEPENDENT /* specifications of compiler-independent build */ #define LINE_PREFIX "#line " #define STD_LINE_PREFIX TRUE /* Output #line by C source format */ #define HAVE_DIGRAPHS TRUE /* Output digraphs as it is */ #define SEARCH_INIT SOURCE /* Include directory relative to source */ #define SJIS_IS_ESCAPE_FREE TRUE /* Do not treat SJIS specially */ #define BIGFIVE_IS_ESCAPE_FREE TRUE /* Do not treat specially */ #define ISO2022_JP_IS_ESCAPE_FREE TRUE /* Do not treat specially */ #define TARGET_HAVE_LONG_LONG TRUE /* dummy */ #define STDC_VERSION 199409L /* Initial value of __STDC_VERSION__ */ #endif /* * Each OS has some different target architectures. The followings define * the target CPU. * MCPP defines some predefined macros based on the CPU macro, and possibly * redefine them on an execution time by some options. */ #if defined (__x86_64__) || defined (__amd64__) || defined (_M_AMD64) \ || defined (_AMD64_) || defined (_X64_) #define CPU "x86_64" #elif defined (__ppc64__) || defined (__powerpc64__) #define CPU "ppc64" #elif defined (__ppc__) || defined (__powerpc__) #define CPU "ppc" #else /* Defaults to i386 */ #define CPU "i386" #endif /* * defaults */ #ifdef SYSTEM_EXT #ifndef SYSTEM_EXT_VAL #define SYSTEM_EXT_VAL "1" #endif #endif #ifdef SYSTEM_EXT2 #ifndef SYSTEM_EXT2_VAL #define SYSTEM_EXT2_VAL "1" #endif #endif #ifdef COMPILER_STD1 #ifndef COMPILER_STD1_VAL #define COMPILER_STD1_VAL "1" #endif #endif #ifdef COMPILER_STD2 #ifndef COMPILER_STD2_VAL #define COMPILER_STD2_VAL "1" #endif #endif #ifdef COMPILER_EXT #ifndef COMPILER_EXT_VAL #define COMPILER_EXT_VAL "1" #endif #endif #ifdef COMPILER_EXT2 #ifndef COMPILER_EXT2_VAL #define COMPILER_EXT2_VAL "1" #endif #endif #ifdef COMPILER_CPLUS #ifndef COMPILER_CPLUS_VAL #define COMPILER_CPLUS_VAL "1" #endif #endif #ifndef LINE_PREFIX #define LINE_PREFIX "#line " #define STD_LINE_PREFIX TRUE /* C source format */ #else #ifndef STD_LINE_PREFIX #define STD_LINE_PREFIX FALSE /* Compiler-dependent format */ #endif #endif #ifndef HAVE_DIGRAPHS #define HAVE_DIGRAPHS FALSE #endif #ifndef ENV_C_INCLUDE_DIR #define ENV_C_INCLUDE_DIR "INCLUDE" #endif #ifndef ENV_CPLUS_INCLUDE_DIR #define ENV_CPLUS_INCLUDE_DIR "CPLUS_INCLUDE" #endif #ifndef ENV_SEP #if SYS_FAMILY == SYS_WIN #define ENV_SEP ';' #else #define ENV_SEP ':' #endif #endif #ifndef ONE_PASS #define ONE_PASS FALSE #endif #ifndef FNAME_FOLD #define FNAME_FOLD TRUE #endif #ifndef SEARCH_INIT #define SEARCH_INIT CURRENT #endif /* * CHARBIT, UCHARMAX are respectively CHAR_BIT, UCHAR_MAX of target compiler. * CHARBIT should be defined to the number of bits per character. * It is needed only for processing of multi-byte character constants. * UCHARMAX should be defined to the maximum value of type unsigned char * or maximum value of unsigned int which is converted from type (signed) * char. * * LONGMAX should be defined to the LONG_MAX in . * ULONGMAX should be defined to the ULONG_MAX in or LONG_MAX * for the compiler which does not have unsigned long. */ #ifndef CHARBIT #define CHARBIT 8 #endif #ifndef UCHARMAX #define UCHARMAX 0xFF #endif #ifndef LONGMAX #define LONGMAX 0x7FFFFFFFL #endif #ifndef ULONGMAX #define ULONGMAX 0xFFFFFFFFUL #endif /* * Define MBCHAR (multi-byte character encoding) to SJIS, EUC_JP or other. */ #ifndef MBCHAR #define MBCHAR 0 #endif /* * SJIS_IS_ESCAPE_FREE means the compiler does not escape '0x5c' ('\\') in * shift-JIS encoded multi-byte character. SJIS_IS_ESCAPE_FREE == FALSE * enables cpp to insert * '\\' before '\\' of the 2nd byte of SJIS code in * literal. This insertion is for the compiler-proper which can't recognize * SJIS literal. * BIGFIVE_IS_ESCAPE_FREE means similar case on BIGFIVE encoding. * ISO2022_JP_IS_ESCAPE_FREE means similar case on ISO2022_JP encoding. */ #ifndef SJIS_IS_ESCAPE_FREE #define SJIS_IS_ESCAPE_FREE FALSE /* or TRUE following your compiler */ #endif #ifndef BIGFIVE_IS_ESCAPE_FREE #define BIGFIVE_IS_ESCAPE_FREE FALSE /* or TRUE following your compiler */ #endif #ifndef ISO2022_JP_IS_ESCAPE_FREE #define ISO2022_JP_IS_ESCAPE_FREE FALSE /* or TRUE following compiler */ #endif /* * P A R T 2 Configurations for host-compiler. * * WARNING: In case of HOST_COMPILER differs from COMPILER, you must * edit here and there of this part. */ #if HOST_COMPILER == GNUC #if __GNUC__ >= 3 #define HAVE_INTMAX_T TRUE #define HAVE_INTTYPES_H TRUE #define HAVE_STDINT_H TRUE #endif #define HOST_HAVE_LONG_LONG TRUE #if HOST_SYSTEM == SYS_LINUX #define HOST_HAVE_STPCPY TRUE #endif #if HOST_SYSTEM == SYS_MAC #define HOST_HAVE_STPCPY TRUE #endif #elif HOST_COMPILER == LCC #define HOST_HAVE_LONG_LONG TRUE #elif HOST_COMPILER == MSC #define HOST_HAVE_LONG_LONG TRUE #elif HOST_COMPILER == BORLANDC #if __BORLANDC__ >= 0x550 #define HOST_HAVE_LONG_LONG TRUE #endif #define HOST_HAVE_STPCPY TRUE #if __STDC__ #define stpcpy( dest, src) __stpcpy__( dest, src) #endif #endif #ifndef HAVE_INTMAX_T #define HAVE_INTMAX_T FALSE #endif /* The host compiler has the type long long int ? */ #ifndef HOST_HAVE_LONG_LONG #define HOST_HAVE_LONG_LONG FALSE #endif /* * This definitions should be set TRUE, if *both* of the target * and the host compilers have long long type. */ #if TARGET_HAVE_LONG_LONG && HOST_HAVE_LONG_LONG #define HAVE_LONG_LONG TRUE #endif /* * Define the format specifier of intmax_t or long long for * fprintf( fp_debug,). * Both of target COMPILER and HOST_COMPILER should have long long. */ #if HAVE_LONG_LONG #if HOST_COMPILER == BORLANDC \ || (HOST_COMPILER == MSC && _MSC_VER < 1400) \ || HOST_SYSTEM == SYS_MINGW #define LL_FORM "I64" /* Format specifier for __int64 */ #endif #ifndef LL_FORM #define LL_FORM "ll" /* C99: for long long, "j" for intmax_t */ #endif #endif #ifndef HOST_HAVE_STPCPY #define HOST_HAVE_STPCPY FALSE #endif /* * Declaration of standard library functions and macros. */ /* stdin, stdout, stderr, FILE, NULL, fgets(), fputs() and other functions. */ #include "stdio.h" /* PATHMAX is the maximum length of path-list on the host system. */ /* _POSIX_* only to get PATH_MAX */ #define _POSIX_ 1 #define _POSIX_SOURCE 1 #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 1 #define _POSIX_C_SOURCE_defined 1 #endif #include "limits.h" #undef _POSIX_ #undef _POSIX_SOURCE #ifdef _POSIX_C_SOURCE_defined #undef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE_defined #endif #ifdef PATH_MAX #define PATHMAX PATH_MAX /* Posix macro */ #else #define PATHMAX FILENAME_MAX #endif /* islower(), isupper(), toupper(), isdigit(), isxdigit(), iscntrl() */ #include "ctype.h" /* errno */ #include "errno.h" #include "string.h" #include "stdlib.h" #include "time.h" #include "setjmp.h" /* For debugging malloc systems by kmatsui */ #if KMMALLOC && _MEM_DEBUG #include "xalloc.h" #endif mcpp-2.7.2/src/config.h.in0000644000175000017500000001307011113211541012203 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define if '0x5c' in BIG5 multi-byte character is safe. */ #undef BIGFIVE_IS_ESCAPE_FREE /* Define the target compiler. */ #undef COMPILER /* Define the type of size_t. */ #undef COMPILER_SP1_VAL /* Define the type of ptrdiff_t. */ #undef COMPILER_SP2_VAL /* Define the type of wchar_t. */ #undef COMPILER_SP3_VAL /* Define the name of COMPILER-specific OLD-style predefined macro. */ #undef COMPILER_SP_OLD /* Define the value of COMPILER-specific OLD-style predefined macro. */ #undef COMPILER_SP_OLD_VAL /* Define the name of COMPILER-specific STD-style predefined macro. */ #undef COMPILER_SP_STD /* Define the value of COMPILER-specific STD-style predefined macro. */ #undef COMPILER_SP_STD_VAL /* Define compiler-specific C++ include directory 1. */ #undef CPLUS_INCLUDE_DIR1 /* Define compiler-specific C++ include directory 2. */ #undef CPLUS_INCLUDE_DIR2 /* Define compiler-specific C++ include directory 3. */ #undef CPLUS_INCLUDE_DIR3 /* Define compiler-specific C++ include directory 4. */ #undef CPLUS_INCLUDE_DIR4 /* Define the cpu-specific-macro. */ #undef CPU /* Define the name of CPU-specific OLD-style predefined macro. */ #undef CPU_SP_OLD /* Define the value of CPU-specific OLD-style predefined macro. */ #undef CPU_SP_OLD_VAL /* Define the name of CPU-specific STD-style predefined macro. */ #undef CPU_SP_STD /* Define the value of CPU-specific STD-style predefined macro. */ #undef CPU_SP_STD_VAL /* Define root directory of CYGWIN. */ #undef CYGWIN_ROOT_DIRECTORY /* Define compiler-specific C include directory 1. */ #undef C_INCLUDE_DIR1 /* Define compiler-specific C include directory 2. */ #undef C_INCLUDE_DIR2 /* Define compiler-specific C include directory 3. */ #undef C_INCLUDE_DIR3 /* Define if the argument of pragma is macro expanded. */ #undef EXPAND_PRAGMA /* Define if the cases of file name are folded. */ #undef FNAME_FOLD /* Define MacOS-specific framework directory 1. */ #undef FRAMEWORK1 /* Define MacOS-specific framework directory 2. */ #undef FRAMEWORK2 /* Define MacOS-specific framework directory 3. */ #undef FRAMEWORK3 /* Define gcc major version. */ #undef GCC_MAJOR_VERSION /* Define gcc minor version. */ #undef GCC_MINOR_VERSION /* Define if digraphs are available. */ #undef HAVE_DIGRAPHS /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if the system has the type `intmax_t'. */ #undef HAVE_INTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if the system has the type `long long'. */ #undef HAVE_LONG_LONG /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H_ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H_ /* Define the host compiler name. */ #undef HOST_CMP_NAME /* Define the host compiler. */ #undef HOST_COMPILER /* Define the host system. */ #undef HOST_SYSTEM /* Define include directory to install mcpp_g*.h header files. */ #undef INC_DIR /* Define if '0x5c' in ISO2022-JP multi-byte character is safe. */ #undef ISO2022_JP_IS_ESCAPE_FREE /* Define output format of line directive. */ #undef LINE_PREFIX /* Define printf length modifier for the longest integer. */ #undef LL_FORM /* Define if build libmcpp */ #undef MCPP_LIB /* Define /mingw directory. */ #undef MINGW_DIRECTORY /* Define root directory of MSYS. */ #undef MSYS_ROOT_DIRECTORY /* Define the suffix of object file. */ #undef OBJEXT /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define include preference. */ #undef SEARCH_INIT /* Define if '0x5c' in SJIS multi-byte character is safe. */ #undef SJIS_IS_ESCAPE_FREE /* Define the default value of __STDC__. */ #undef STDC /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define the default value of __STDC_VERSION__. */ #undef STDC_VERSION /* Define whether output format of line directive is C source style. */ #undef STD_LINE_PREFIX /* Define the target system. */ #undef SYSTEM /* Define the version of FreeBSD. */ #undef SYSTEM_EXT_VAL /* Define the name of SYSTEM-specific OLD-style predefined macro. */ #undef SYSTEM_SP_OLD /* Define the value of SYSTEM-specific OLD-style predefined macro. */ #undef SYSTEM_SP_OLD_VAL /* Define the name of SYSTEM-specific STD-style predefined macro. */ #undef SYSTEM_SP_STD /* Define the value of SYSTEM-specific STD-style predefined macro. */ #undef SYSTEM_SP_STD_VAL /* Version number of package */ #undef VERSION mcpp-2.7.2/src/set_mcpp.sh0000755000175000017500000001750011070642167012351 00000000000000#!/bin/sh # script to set MCPP to be called from gcc # ./set_mcpp.sh $gcc_path $gcc_maj_ver $gcc_min_ver $cpp_call $CC # $CXX x$CPPFLAGS x$EXEEXT $LN_S $inc_dir $host_system $cpu $target_cc gcc_maj_ver=$2 gcc_min_ver=$3 cpp_call=$4 CC=$5 CXX=$6 CPPFLAGS=`echo $7 | sed 's/^x//'` LN_S=$9 inc_dir=${10} host_system=${11} cpu=${12} if test $host_system = SYS_MAC; then target_cc=${13} target=`echo $target_cc | sed 's/-gcc.*$//'` fi cpp_name=`echo $cpp_call | sed 's,.*/,,'` cpp_path=`echo $cpp_call | sed "s,/$cpp_name,,"` gcc_path=`echo $1 | sed "s,/${CC}\$,,"` # remove ".exe" or such EXEEXT=`echo $8 | sed 's/^x//'` if test x$EXEEXT != x; then cpp_base=`echo $cpp_name | sed "s/${EXEEXT}//"` else cpp_base=$cpp_name fi if test $host_system = SYS_MINGW && test ! -f cc1$EXEEXT; then ## cc1.exe has not yet compiled echo " first do 'make COMPILER=GNUC mcpp cc1'; then do 'make COMPILER=GNUC install'" exit 1 fi if test x$cpp_base = xcc1; then # for GCC V.3.3 and later no_m64=0 else no_m64=1 fi gen_headers() { echo " mkdir -p $hdir" mkdir -p $hdir if test ! -f $hdir/gcc$gcc_maj_ver${gcc_min_ver}_predef_std.h; then echo " generating g*.h header files" $CC $CPPFLAGS -E -xc $arg -dM /dev/null | sort | \ grep ' *#define *_' \ > $hdir/gcc$gcc_maj_ver${gcc_min_ver}_predef_std.h $CC $CPPFLAGS -E -xc $arg -dM /dev/null | sort | \ grep -E ' *#define *[A-Za-z]+' \ > $hdir/gcc$gcc_maj_ver${gcc_min_ver}_predef_old.h $CXX $CPPFLAGS -E -xc++ $arg -dM /dev/null | sort | \ grep ' *#define *_' \ > $hdir/gxx$gcc_maj_ver${gcc_min_ver}_predef_std.h $CXX $CPPFLAGS -E -xc++ $arg -dM /dev/null | sort | \ grep -E ' *#define *[A-Za-z]+' \ > $hdir/gxx$gcc_maj_ver${gcc_min_ver}_predef_old.h fi } cwd=`pwd` echo " cd $inc_dir" cd $inc_dir if test $cpu = i386 || test $cpu = x86_64; then cpu32=i386 cpu64=x86_64 else if test $cpu = ppc || $cpu = ppc64; then cpu32=ppc cpu64=ppc64 fi fi arch_headers() { for arch in $cpu32 $cpu64 do ## generate headers for 2 architectures hdir=${idir}-$arch if test $host_system = SYS_MAC; then arg="-arch $arch" else if test $arch = $cpu; then arg="$ar" else if test $host_system = SYS_MINGW || test $no_m64; then continue; fi if test $cpu = $cpu64; then arg="$ar -m32" else arg="$ar -m64" fi # Test if the architecture is supported. $CC -E -xc $arg /dev/null > /dev/null if test $? != 0; then continue fi fi fi gen_headers done } idir=mcpp-gcc ar= arch_headers if test $host_system = SYS_CYGWIN; then ## CYGWIN has 'mingw' include directory for '-mno-cygwin' option idir=mingw/mcpp-gcc ar="-mno-cygwin" arch_headers fi # write shell-script so that call of 'cpp0', 'cc1 -E' or so is replaced to # call of mcpp echo " cd $cpp_path" cd $cpp_path # other than MinGW if test $host_system != SYS_MINGW; then echo '#!/bin/sh' > mcpp.sh # for GCC V.3.3 and later if test x$cpp_base = xcc1; then for cpp in cc1 cc1plus do if test $cpp = cc1; then shname=mcpp else shname=mcpp_plus fi if test $cpp = cc1plus; then echo '#!/bin/sh' > mcpp_plus.sh fi cat >> $shname.sh <<_EOF for i in \$@ do case \$i in -fpreprocessed|-traditional*) $cpp_path/${cpp}_gnuc "\$@" exit ;; esac done _EOF done fi # for GCC V.2, V.3 and V.4 mcpp_name=mcpp if test $host_system = SYS_MAC && test -f ${target}-mcpp; then mcpp_name=${target}-mcpp ## long name of Mac OS X cross-compiler fi echo $cpp_path/$mcpp_name '"$@"' >> mcpp.sh chmod a+x mcpp.sh if test x$cpp_base = xcc1; then echo $cpp_path/$mcpp_name -+ '"$@"' >> mcpp_plus.sh chmod a+x mcpp_plus.sh fi fi # backup GCC / cpp or cc1, cc1plus mcpp_installed=`$cpp_call -v /dev/null 2>&1 | grep "MCPP"` if test "x$mcpp_installed" = x; then # mcpp has not installed sym_link= if test $host_system = SYS_MINGW; then if test -f cc1_gnuc$EXEEXT; then sym_link=l ## cc1.exe already moved to cc1_gnuc.exe fi else if test -h $cpp_name; then sym_link=l fi fi if test x$sym_link != xl; then echo " mv $cpp_name ${cpp_base}_gnuc$EXEEXT" mv -f $cpp_name ${cpp_base}_gnuc$EXEEXT if test x$cpp_base = xcc1; then echo " mv cc1plus$EXEEXT cc1plus_gnuc$EXEEXT" mv -f cc1plus$EXEEXT cc1plus_gnuc$EXEEXT fi fi fi if test -f $cpp_name; then rm -f $cpp_name if test x$cpp_base = xcc1; then rm -f cc1plus$EXEEXT fi fi # make symbolic link of mcpp.sh to 'cpp0' or 'cc1', 'cc1plus' if test $host_system = SYS_MINGW; then echo " cp $cwd/cc1$EXEEXT" cp $cwd/cc1$EXEEXT . strip cc1$EXEEXT else echo " $LN_S mcpp.sh $cpp_name" $LN_S mcpp.sh $cpp_name fi if test x$cpp_base = xcc1; then if test $host_system = SYS_MINGW; then echo " cp cc1$EXEEXT cc1plus$EXEEXT" cp cc1$EXEEXT cc1plus$EXEEXT else echo " $LN_S mcpp_plus.sh cc1plus$EXEEXT" $LN_S mcpp_plus.sh cc1plus$EXEEXT fi fi if test x$gcc_maj_ver = x2; then exit 0 fi # for GCC V.3 or V.4 make ${CC}.sh and ${CXX}.sh to add -no-integrated-cpp # option echo " cd $gcc_path" cd $gcc_path if test $host_system = SYS_MAC && test x${target_cc} != x; then # cross-compiler on Mac OS X CC_=$target_cc CXX_=`echo $target_cc | sed 's/gcc/g++/'` else CC_=$CC CXX_=$CXX fi for cc in $CC_ $CXX_ do entity=$cc$EXEEXT if test $host_system != SYS_MINGW; then ref=$cc$EXEEXT while ref=`readlink $ref` do entity=$ref; done if test $entity = $cc.sh; then # gcc.sh already installed exit 0 fi fi ccache=`echo $entity | grep ccache` if test x$ccache != x; then ## CC (CXX) is a symbolic link to ccache ## search the real $cc in $PATH for path in `echo $PATH | sed 's/:/ /g'` do if test -f $path/$cc$EXEEXT && test $gcc_path != $path; then break; fi done gcc_path=$path echo " cd $gcc_path" cd $gcc_path entity=$cc ref=$cc while ref=`readlink $ref` do entity=$ref; done if test $entity = $cc.sh; then exit 0 fi fi if test x$EXEEXT != x; then entity_base=`echo $entity | sed "s/$EXEEXT//"` else entity_base=$entity fi if test $host_system != SYS_MINGW \ || test ! -f ${entity_base}_proper$EXEEXT; then echo " mv $entity ${entity_base}_proper$EXEEXT" mv -f $entity ${entity_base}_proper$EXEEXT fi if test x"`echo $entity | grep '^/'`" = x; then # not absolute path prefix_dir=$gcc_path/ else # absolute path prefix_dir= fi echo '#! /bin/sh' > $cc.sh echo $prefix_dir${entity_base}_proper -no-integrated-cpp '"$@"' >> $cc.sh chmod a+x $cc.sh echo " $LN_S $cc.sh $cc" $LN_S -f $cc.sh $cc if test $cc != $entity; then $LN_S -f $cc.sh $entity fi done mcpp-2.7.2/src/preproc.c0000644000175000017500000000023410365167246012020 00000000000000/* preproc.c: to "pre-preprocess" header files. */ #pragma MCPP preprocess #include "system.H" #include "internal.H" #pragma MCPP put_defines mcpp-2.7.2/src/support.c0000644000175000017500000030121211023436041012042 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * S U P P O R T . C * S u p p o r t R o u t i n e s * * The common routines used by several source files are placed here. */ /* * The following are global functions. * * get_unexpandable() Gets the next unexpandable token in the line, expanding * macros. * Called from #if, #line and #include processing routines. * skip_nl() Skips over a line. * skip_ws() Skips over white spaces but not skip over the end of the line. * skip_ws() skips also COM_SEP and TOK_SEP. * scan_token() Reads the next token of any type into the specified output * pointer, advances the pointer, returns the type of token. * scan_quote() Reads a string literal, character constant or header-name from * the input stream, writes out to the specified buffer and * returns the advanced output pointer. * get_ch() Reads the next byte from the current input stream, handling * end of (macro/file) input and embedded comments appropriately. * cnv_trigraph() Maps trigraph sequence to C character. * cnv_digraph() Maps digraph sequence to C character. * id_operator() See whether the identifier is an operator in C++. * unget_ch() Pushs last gotten character back on the input stream. * unget_string() Pushs sequence on the input stream. * save_string() Saves a string in malloc() memory. * get_file() Initializes a new FILEINFO structure, called when #include * opens a new file, or from unget_string(). * xmalloc() Gets a specified number of bytes from heap memory. * If malloc() returns NULL, exits with a message. * xrealloc() realloc(). If it fails, exits with a message. * get_src_location() Trace back line-column datum into pre-line-splicing * phase. A function for -K option. * cfatal(), cerror(), cwarn() * These routines format print messages to the user. * mcpp_fputc(), mcpp_fputs(), mcpp_fprintf() * Wrap library functions to support alternate output to memory * buffer. */ #if PREPROCESSED #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif static void scan_id( int c); /* Scan an identifier */ static char * scan_number( int c, char * out, char * out_end); /* Scan a preprocessing number */ static char * scan_number_prestd( int c, char * out, char * out_end); /* scan_number() for pre-Standard mode */ #if OK_UCN static char * scan_ucn( int cnt, char * out); /* Scan an UCN sequence */ #endif static char * scan_op( int c, char * out); /* Scan an operator or a punctuator */ static char * parse_line( void); /* Parse a logical line and convert comments */ static char * read_a_comment( char * sp, size_t * sizp); /* Read over a comment */ static char * get_line( int in_comment); /* Get a logical line from file, handle line-splicing */ static char * at_eof( int in_comment); /* Check erroneous end of file */ static void do_msg( const char * severity, const char * format , const char * arg1, long arg2, const char * arg3); /* Putout diagnostic message */ static char * cat_line( int del_bsl); /* Splice the line */ static void put_line( char * out, FILE * fp); /* Put out a logical line */ static void dump_token( int token_type, const char * cp); /* Dump a token and its type */ #define EXP_MAC_IND_MAX 16 /* Information of current expanding macros for diagnostic */ static struct { const char * name; /* Name of the macro just expanded */ int to_be_freed; /* Name should be freed later */ } expanding_macro[ EXP_MAC_IND_MAX]; static int exp_mac_ind = 0; /* Index into expanding_macro[] */ static int in_token = FALSE; /* For token scanning functions */ static int in_string = FALSE; /* For get_ch() and parse_line()*/ static int squeezews = FALSE; #define MAX_CAT_LINE 256 /* Information on line catenated by */ /* and by line-crossing comment. This is for -K option. */ typedef struct catenated_line { long start_line; /* Starting line of catenation */ long last_line; /* Ending line of catanation */ size_t len[ MAX_CAT_LINE + 1]; /* Length of successively catenated lines */ } CAT_LINE; static CAT_LINE bsl_cat_line; /* Datum on the last catenated line by */ static CAT_LINE com_cat_line; /* Datum on the last catenated line by a line-crossing comment */ #if MCPP_LIB static int use_mem_buffers = FALSE; void init_support( void) { in_token = in_string = squeezews = FALSE; bsl_cat_line.len[ 0] = com_cat_line.len[ 0] = 0; clear_exp_mac(); } typedef struct mem_buf { char * buffer; char * entry_pt; size_t size; size_t bytes_avail; } MEMBUF; static MEMBUF mem_buffers[ NUM_OUTDEST]; void mcpp_use_mem_buffers( int tf ) { int i; use_mem_buffers = tf ? TRUE : FALSE; for (i = 0; i < NUM_OUTDEST; ++i) { if (mem_buffers[ i].buffer) /* Free previously allocated memory buffer */ free( mem_buffers[ i].buffer); if (use_mem_buffers) { /* Output to memory buffers instead of files */ mem_buffers[ i].buffer = NULL; mem_buffers[ i].entry_pt = NULL; mem_buffers[ i].size = 0; mem_buffers[ i].bytes_avail = 0; } } } int using_mem_buffers( void) { return use_mem_buffers; } #define BUF_INCR_SIZE (NWORK * 2) #define MAX( a, b) (((a) > (b)) ? (a) : (b)) static char * append_to_buffer( MEMBUF * mem_buf_p, const char * string, size_t length ) { if (mem_buf_p->bytes_avail < length) { /* Need to allocate more memory */ size_t size = MAX( BUF_INCR_SIZE, length); if (mem_buf_p->buffer == NULL) { /* 1st append */ mem_buf_p->size = size; mem_buf_p->bytes_avail = size; mem_buf_p->buffer = xmalloc( mem_buf_p->size); mem_buf_p->entry_pt = mem_buf_p->buffer; } else { mem_buf_p->size += size; mem_buf_p->bytes_avail += size; mem_buf_p->buffer = xrealloc( mem_buf_p->buffer, mem_buf_p->size); mem_buf_p->entry_pt = mem_buf_p->buffer + mem_buf_p->size - mem_buf_p->bytes_avail; } } /* Append the string to the tail of the buffer */ memcpy( mem_buf_p->entry_pt, string, length); mem_buf_p->entry_pt += length; mem_buf_p->entry_pt[ 0] = '\0'; /* Terminate the string buffer */ mem_buf_p->bytes_avail -= length; return mem_buf_p->buffer; } static int mem_putc( int c, OUTDEST od ) { char string[ 1]; string[ 0] = (char) c; if (append_to_buffer( &(mem_buffers[ od]), string, 1) != NULL) return 0; else return !0; } static int mem_puts( const char * s, OUTDEST od ) { if (append_to_buffer( &(mem_buffers[od]), s, strlen(s)) != NULL) return 0; else return !0; } char * mcpp_get_mem_buffer( OUTDEST od ) { return mem_buffers[ od].buffer; } #endif /* MCPP_LIB */ #define DEST2FP(od) \ (od == OUT) ? fp_out : \ ((od == ERR) ? fp_err : \ ((od == DBG) ? fp_debug : \ (NULL))) /* * The following mcpp_*() wrapper functions are intended to centralize * the output generated by MCPP. They support memory buffer alternates to * each of the primary output streams: out, err, debug. The memory buffer * output option would be used in a setup where MCPP has been built as a * function call - i.e. mcpp_lib_main(). */ int mcpp_lib_fputc( int c, OUTDEST od ) { #if MCPP_LIB if (use_mem_buffers) { return mem_putc( c, od); } else { #endif FILE * stream = DEST2FP( od); return (stream != NULL) ? fputc( c, stream) : EOF; #if MCPP_LIB } #endif } int (* mcpp_fputc)( int c, OUTDEST od) = mcpp_lib_fputc; int mcpp_lib_fputs( const char * s, OUTDEST od ) { #if MCPP_LIB if (use_mem_buffers) { return mem_puts( s, od); } else { #endif FILE * stream = DEST2FP( od); return (stream != NULL) ? fputs( s, stream) : EOF; #if MCPP_LIB } #endif } int (* mcpp_fputs)( const char * s, OUTDEST od) = mcpp_lib_fputs; #include int mcpp_lib_fprintf( OUTDEST od, const char * format, ... ) { va_list ap; FILE * stream = DEST2FP( od); if (stream != NULL) { int rc; va_start( ap, format); #if MCPP_LIB if (use_mem_buffers) { static char mem_buffer[ NWORK]; rc = vsprintf( mem_buffer, format, ap); if (rc != 0) { rc = mem_puts( mem_buffer, od); } } else { #endif rc = vfprintf( stream, format, ap); #if MCPP_LIB } #endif va_end( ap); return rc; } else { return EOF; } } int (* mcpp_fprintf)( OUTDEST od, const char * format, ...) = mcpp_lib_fprintf; #if MCPP_LIB void mcpp_reset_def_out_func( void) { mcpp_fputc = mcpp_lib_fputc; mcpp_fputs = mcpp_lib_fputs; mcpp_fprintf = mcpp_lib_fprintf; } void mcpp_set_out_func( int (* func_fputc)( int c, OUTDEST od), int (* func_fputs)( const char * s, OUTDEST od), int (* func_fprintf)( OUTDEST od, const char * format, ...) ) { mcpp_fputc = func_fputc; mcpp_fputs = func_fputs; mcpp_fprintf = func_fprintf; } #endif int get_unexpandable( int c, /* First char of token */ int diag /* Flag of diagnosis */ ) /* * Get the next unexpandable token in the line, expanding macros. * Return the token type. The token is written in work_buf[]. * The once expanded macro is never expanded again. * Called only from the routines processing #if (#elif, #assert), #line and * #include directives in order to diagnose some subtle macro expansions. */ { DEFBUF * defp = NULL; FILEINFO * file; FILE * fp = NULL; LINE_COL line_col = { 0L, 0}; int token_type = NO_TOKEN; int has_pragma; while (c != EOS && c != '\n' /* In a line */ && (fp = infile->fp /* Preserve current state */ , (token_type = scan_token( c, (workp = work_buf, &workp), work_end)) == NAM) /* Identifier */ && fp != NULL /* In source ! */ && (defp = is_macro( NULL)) != NULL) { /* Macro */ expand_macro( defp, work_buf, work_end, line_col, & has_pragma); /* Expand macro */ if (has_pragma) cerror( "_Pragma operator found in directive line" /* _E_ */ , NULL, 0L, NULL); file = unget_string( work_buf, defp->name); /* Stack to re-read */ c = skip_ws(); /* Skip TOK_SEP */ if (file != infile && macro_line != MACRO_ERROR && (warn_level & 1)) { /* This diagnostic is issued even if "diag" is FALSE. */ cwarn( "Macro \"%s\" is expanded to 0 token" /* _W1_ */ , defp->name, 0L, NULL); if (! option_flags.no_source_line) dump_a_def( " macro", defp, FALSE, TRUE, fp_err); } } if (c == '\n' || c == EOS) { unget_ch(); return NO_TOKEN; } if (diag && fp == NULL && defp && (warn_level & 1)) { char tmp[ NWORK + 16]; char * tmp_end = tmp + NWORK; char * tmp_p; file = unget_string( infile->buffer, defp->name); /* To diagnose */ c = get_ch(); while (file == infile) { /* Search the expanded macro */ if (scan_token( c, (tmp_p = tmp, &tmp_p), tmp_end) != NAM) { c = get_ch(); continue; } if (standard && str_eq( identifier, "defined")) { cwarn( "Macro \"%s\" is expanded to \"defined\"" /* _W1_ */ , defp->name, 0L, NULL); break; } if (! standard && str_eq( identifier, "sizeof")) { cwarn( "Macro \"%s\" is expanded to \"sizeof\"" /* _W1_ */ , defp->name, 0L, NULL); break; } c = get_ch(); } if (file == infile) { infile->bptr += strlen( infile->bptr); get_ch(); } unget_ch(); if (token_type == OPE) { unget_string( work_buf, NULL); /* Set again 'openum' */ scan_token( get_ch(), (workp = work_buf, &workp), work_end); } } return token_type; } void skip_nl( void) /* * Skip to the end of the current input line. */ { insert_sep = NO_SEP; while (infile && infile->fp == NULL) { /* Stacked text */ infile->bptr += strlen( infile->bptr); get_ch(); /* To the parent */ } if (infile) infile->bptr += strlen( infile->bptr); /* Source line */ } int skip_ws( void) /* * Skip over horizontal whitespaces. */ { int c; do { c = get_ch(); } while (char_type[ c] & HSP); return c; } #define MBMASK 0xFF /* Mask to hide multibyte char */ int scan_token( int c, /* The first character of the token */ char ** out_pp, /* Pointer to pointer to output buf */ char * out_end /* End of output buffer */ ) /* * Scan the next token of any type. * The token is written out to the specified buffer and the output pointer * is advanced. Token is terminated by EOS. Return the type of token. * If the token is an identifier, the token is also in identifier[]. * If the token is a operator or punctuator, return OPE. * If 'c' is token separator, then return SEP. * If 'c' is not the first character of any known token and not a token * separator, return SPE. * In POST_STD mode, inserts token separator (a space) between any tokens of * source. */ { char * out = *out_pp; /* Output pointer */ int ch_type; /* Type of character */ int token_type = 0; /* Type of token */ int ch; if (standard) in_token = TRUE; /* While a token is scanned */ c = c & UCHARMAX; ch_type = char_type[ c] & MBMASK; switch (ch_type) { case LET: /* Probably an identifier */ switch (c) { case 'L': if (! standard) goto ident; ch = get_ch(); if (char_type[ ch] & QUO) { /* char_type[ ch] == QUO */ if (ch == '"') token_type = WSTR; /* Wide-char string literal */ else token_type = WCHR; /* Wide-char constant */ c = ch; *out++ = 'L'; break; /* Fall down to "case QUO:" */ } else { unget_ch(); } /* Fall through */ default: /* An identifier */ ident: scan_id( c); out = stpcpy( out, identifier); token_type = NAM; break; } if (token_type == NAM) break; /* Else fall through -- i.e. WSTR, WCHR */ case QUO: /* String or character constant */ out = scan_quote( c, out, out_end, FALSE); if (token_type == 0) { /* Without prefix L */ if (c == '"') token_type = STR; else token_type = CHR; } /* Else WSTR or WCHR */ break; case DOT: ch = get_ch(); unget_ch(); if ((char_type[ ch] & DIG) == 0) /* Operator '.' or '...' */ goto operat; /* Else fall through */ case DIG: /* Preprocessing number */ out = (standard ? scan_number( c, out, out_end) : scan_number_prestd( c, out, out_end)); token_type = NUM; break; case PUNC: operat: out = scan_op( c, out); /* Operator or punctuator */ token_type = OPE; /* Number is set in global "openum" */ break; default: /* Special tokens or special characters */ #if OK_UCN if (mcpp_mode == STD && c == '\\' && stdc2) { ch = get_ch(); unget_ch(); if (ch == 'U' || ch == 'u') goto ident; /* Universal-Characte-Name */ } #endif #if OK_MBIDENT if (mcpp_mode == STD && (char_type[ c] & mbchk) && stdc3) { char * bptr = infile->bptr; mb_read( c, &infile->bptr, &out); infile->bptr = bptr; out = *out_pp; goto ident; /* An identifier with multi-byte characters */ /* Mbchar cheking has been done in scan_quote() and others. */ } #endif if ((standard && (c == CAT || c == ST_QUOTE)) || (char_type[ c] & SPA)) token_type = SEP; /* Token separator or magic char*/ else token_type = SPE; /* Unkown token ($, @, multi-byte character or Latin */ *out++ = c; *out = EOS; break; } if (out_end < out) cfatal( "Buffer overflow scanning token \"%s\"" /* _F_ */ , *out_pp, 0L, NULL); if (mcpp_debug & TOKEN) dump_token( token_type, *out_pp); if (mcpp_mode == POST_STD && token_type != SEP && infile->fp != NULL && (char_type[ *infile->bptr & UCHARMAX] & SPA) == 0) insert_sep = INSERT_SEP; /* Insert token separator */ *out_pp = out; in_token = FALSE; /* Token scanning has been done */ return token_type; } static void scan_id( int c /* First char of id */ ) /* * Reads the next identifier and put it into identifier[]. * The caller has already read the first character of the identifier. */ { static char * const limit = &identifier[ IDMAX]; static int dollar_diagnosed = FALSE; /* Flag of diagnosing '$' */ #if OK_UCN int uc2 = 0, uc4 = 0; /* Count of UCN16, UCN32 */ #endif #if OK_MBIDENT int mb = 0; /* Count of MBCHAR */ #endif size_t len; /* Length of identifier */ char * bp = identifier; if (c == IN_SRC) { /* Magic character */ *bp++ = c; if ((mcpp_debug & MACRO_CALL) && ! in_directive) { *bp++ = get_ch(); /* Its 2-bytes */ *bp++ = get_ch(); /* argument */ } c = get_ch(); } do { if (bp < limit) *bp++ = c; #if OK_UCN if (mcpp_mode == STD && c == '\\' && stdc2) { int cnt; char * tp = bp; if ((c = get_ch()) == 'u') { cnt = 4; } else if (c == 'U') { cnt = 8; } else { unget_ch(); bp--; break; } *bp++ = c; if ((bp = scan_ucn( cnt, bp)) == NULL) /* Error */ return; if (cnt == 4) uc2++; else if (cnt == 8) uc4++; if (limit <= tp) /* Too long identifier */ bp = tp; /* Back the pointer */ goto next_c; } #endif /* OK_UCN */ #if OK_MBIDENT if (mcpp_mode == STD && (char_type[ c] & mbchk) && stdc3) { len = mb_read( c, &infile->bptr, &bp); if (len & MB_ERROR) { if (infile->fp) cerror( "Illegal multi-byte character sequence." /* _E_ */ , NULL, 0L, NULL); } else { mb += len; } } #endif /* OK_MBIDENT */ #if OK_UCN next_c: #endif c = get_ch(); } while ((char_type[ c] & (LET | DIG)) /* Letter or digit */ #if OK_UCN || (mcpp_mode == STD && c == '\\' && stdc2) #endif #if OK_MBIDENT || (mcpp_mode == STD && (char_type[ c] & mbchk) && stdc3) #endif ); unget_ch(); *bp = EOS; if (bp >= limit && (warn_level & 1)) /* Limit of token */ cwarn( "Too long identifier truncated to \"%s\"" /* _W1_ */ , identifier, 0L, NULL); len = bp - identifier; #if IDMAX > IDLEN90MIN /* UCN16, UCN32, MBCHAR are counted as one character for each. */ #if OK_UCN if (mcpp_mode == STD) len -= (uc2 * 5) - (uc4 * 9); #endif #if OK_MBIDENT if (mcpp_mode == STD) len -= mb; #endif if (standard && infile->fp && len > std_limits.id_len && (warn_level & 4)) cwarn( "Identifier longer than %.0s%ld characters \"%s\"" /* _W4_ */ , NULL, (long) std_limits.id_len, identifier); #endif /* IDMAX > IDLEN90MIN */ if (option_flags.dollar_in_name && dollar_diagnosed == FALSE && (warn_level & 2) && strchr( identifier, '$') != NULL) { cwarn( "'$' in identifier \"%s\"", identifier, 0L, NULL); /* _W2_ */ dollar_diagnosed = TRUE; /* Diagnose only once */ } } char * scan_quote( int delim, /* ', " or < (header-name) */ char * out, /* Output buffer */ char * out_end, /* End of output buffer */ int diag /* Diagnostic should be output */ ) /* * Scan off a string literal or character constant to the output buffer. * Report diagnosis if the quotation is terminated by newline or character * constant is empty (provided 'diag' is TRUE). * Return the next output pointer or NULL (on error). */ { const char * const skip_line = ", skipped the line"; /* _E_ */ const char * const unterm_string = "Unterminated string literal%s"; const char * const unterm_char = "Unterminated character constant %s%.0ld%s"; const char * const empty_const = "Empty character constant %s%.0ld%s"; const char * skip; size_t len; int c; char * out_p = out; /* Set again in case of called from routines other than scan_token(). */ if (standard) in_token = TRUE; *out_p++ = delim; if (delim == '<') delim = '>'; scan: while ((c = get_ch()) != EOS) { #if MBCHAR if (char_type[ c] & mbchk) { /* First of multi-byte character (or shift-sequence) */ char * bptr = infile->bptr; len = mb_read( c, &infile->bptr, (*out_p++ = c, &out_p)); if (len & MB_ERROR) { if (infile->fp != NULL && compiling && diag) { if (warn_level & 1) { char * buf; size_t chlen; buf = xmalloc( chlen = infile->bptr - bptr + 2); memcpy( buf, bptr, chlen - 1); buf[ chlen - 1] = EOS; cwarn( "Illegal multi-byte character sequence \"%s\" in quotation", /* _W1_ */ buf, 0L, NULL); free( buf); } } continue; } else { /* Valid multi-byte character (or sequence) */ goto chk_limit; } } #endif if (c == delim) { break; } else if (c == '\\' && delim != '>') { /* In string literal */ #if OK_UCN if (mcpp_mode == STD && stdc2) { int cnt; char * tp; *out_p++ = c; if ((c = get_ch()) == 'u') { cnt = 4; } else if (c == 'U') { cnt = 8; } else { goto escape; } *out_p++ = c; if ((tp = scan_ucn( cnt, out_p)) != NULL) out_p = tp; /* Else error */ continue; /* Error or not, anyway continue */ } #endif /* OK_UCN */ *out_p++ = c; /* Escape sequence */ c = get_ch(); escape: #if MBCHAR if (char_type[ c] & mbchk) { /* '\\' followed by multi-byte char */ unget_ch(); continue; } #endif if (! standard && c == '\n') { /* */ out_p--; /* Splice the lines */ if (cat_line( TRUE) == NULL) /* End of file */ break; c = get_ch(); } } else if (mcpp_mode == POST_STD && c == ' ' && delim == '>' && infile->fp == NULL) { continue; /* Skip space possibly inserted by macro expansion */ } else if (c == '\n') { break; } if (diag && iscntrl( c) && ((char_type[ c] & SPA) == 0) && (warn_level & 1)) cwarn( "Illegal control character %.0s0lx%02x in quotation" /* _W1_ */ , NULL, (long) c, NULL); *out_p++ = c; chk_limit: if (out_end < out_p) { *out_end = EOS; cfatal( "Too long quotation", NULL, 0L, NULL); /* _F_ */ } } if (c == '\n' || c == EOS) unget_ch(); if (c == delim) *out_p++ = delim; *out_p = EOS; if (diag) { /* At translation phase 3 */ skip = (infile->fp == NULL) ? NULL : skip_line; if (c != delim) { if (mcpp_mode == OLD_PREP /* Implicit closing of quote*/ && (delim == '"' || delim == '\'')) goto done; if (delim == '"') { if (mcpp_mode != POST_STD && option_flags.lang_asm) { /* STD, KR */ /* Concatenate the unterminated string to the next line */ if (warn_level & 1) cwarn( unterm_string , ", catenated to the next line" /* _W1_ */ , 0L, NULL); if (cat_line( FALSE) != NULL) goto scan; /* Splice the lines */ /* Else end of file */ } else { cerror( unterm_string, skip, 0L, NULL); /* _E_ */ } } else if (delim == '\'') { if (mcpp_mode != POST_STD && option_flags.lang_asm) { /* STD, KR */ if (warn_level & 1) cwarn( unterm_char, out, 0L, NULL); /* _W1_ */ goto done; } else { cerror( unterm_char, out, 0L, skip); /* _E_ */ } } else { cerror( "Unterminated header name %s%.0ld%s" /* _E_ */ , out, 0L, skip); } out_p = NULL; } else if (delim == '\'' && out_p - out <= 2) { if (mcpp_mode != POST_STD && option_flags.lang_asm) { /* STD, KR */ if (warn_level & 1) cwarn( empty_const, out, 0L, skip); /* _W1_ */ } else { cerror( empty_const, out, 0L, skip); /* _E_ */ out_p = NULL; goto done; } } else if (mcpp_mode == POST_STD && delim == '>' && (warn_level & 2)) { cwarn( "Header-name enclosed by <, > is an obsolescent feature %s" /* _W2_ */ , out, 0L, skip); } #if NWORK-2 > SLEN90MIN if (standard && out_p - out > std_limits.str_len && (warn_level & 4)) cwarn( "Quotation longer than %.0s%ld bytes" /* _W4_ */ , NULL, std_limits.str_len, NULL); #endif } done: in_token = FALSE; return out_p; } static char * cat_line( int del_bsl /* Delete the ? */ ) /* * If del_bsl == TRUE: * Delete sequence in string literal. * FALSE: Overwrite the with 'n'. * Return NULL on end of file. Called only from scan_quote(). * This routine is never called in POST_STD mode. */ { size_t len; char * save1, * save2; if (del_bsl) { /* Delete the */ infile->bptr -= 2; len = infile->bptr - infile->buffer; } else { /* Overwrite the with 'n' */ strcpy( infile->bptr, "\\n"); len = strlen( infile->buffer); } save1 = save_string( infile->buffer); save2 = get_line( FALSE); /* infile->buffer is overwritten */ if (save2 == NULL) { free( save1); return NULL; } save2 = save_string( infile->buffer); memcpy( infile->buffer, save1, len); strcpy( infile->buffer + len, save2); /* Catenate */ free( save1); free( save2); if (! del_bsl) len -= 2; infile->bptr = infile->buffer + len; return infile->bptr; } static char * scan_number( int c, /* First char of number */ char * out, /* Output buffer */ char * out_end /* Limit of output buffer */ ) /* * Read a preprocessing number. * By scan_token() we know already that the first c is from 0 to 9 or dot, * and if c is dot then the second character is digit. * Returns the advanced output pointer. * Note: preprocessing number permits non-numeric forms such as 3E+xy, * which are used in stringization or token-concatenation. */ { char * out_p = out; /* Current output pointer */ do { *out_p++ = c; if (c == 'E' || c == 'e' /* Sign should follow 'E', 'e', */ || (stdc3 && (c == 'P' || c == 'p')) /* 'P' or 'p'. */ ) { c = get_ch(); if (c == '+' || c == '-') { *out_p++ = c; c = get_ch(); } #if OK_UCN } else if (mcpp_mode == STD && c == '\\' && stdc3) { int cnt; char * tp; if ((c = get_ch()) == 'u') { cnt = 4; } else if (c == 'U') { cnt = 8; } else { unget_ch(); out_p--; break; } *out_p++ = c; if ((tp = scan_ucn( cnt, out_p)) == NULL) /* Error */ break; else out_p = tp; c = get_ch(); #endif /* OK_UCN */ #if OK_MBIDENT } else if (mcpp_mode == STD && (char_type[ c] & mbchk) && stdc3) { len = mb_read( c, &infile->bptr, &out_p); if (len & MB_ERROR) { if (infile->fp) cerror( "Illegal multi-byte character sequence." /* _E_ */ , NULL, 0L, NULL); } #endif /* OK_MBIDENT */ } else { c = get_ch(); } } while ((char_type[ c] & (DIG | DOT | LET)) /* Digit, dot or letter */ #if OK_UCN || (mcpp_mode == STD && c == '\\' && stdc3) #endif #if OK_MBIDENT || (mcpp_mode == STD && (char_type[ c] & mbchk) && stdc3) #endif ); *out_p = EOS; if (out_end < out_p) cfatal( "Too long pp-number token \"%s\"" /* _F_ */ , out, 0L, NULL); unget_ch(); return out_p; } /* Original version of DECUS CPP with slight modifications, */ /* too exact for Standard preprocessing. */ static char * scan_number_prestd( int c, /* First char of number */ char * out, /* Output buffer */ char * out_end /* Limit of output buffer */ ) /* * Process a number. We know that c is from 0 to 9 or dot. * Algorithm from Dave Conroy's Decus C. * Returns the advanced output pointer. */ { char * const out_s = out; /* For diagnostics */ int radix; /* 8, 10, or 16 */ int expseen; /* 'e' seen in floater */ int octal89; /* For bad octal test */ int dotflag; /* TRUE if '.' was seen */ expseen = FALSE; /* No exponent seen yet */ octal89 = FALSE; /* No bad octal yet */ radix = 10; /* Assume decimal */ if ((dotflag = (c == '.')) != FALSE) { /* . something? */ *out++ = '.'; /* Always out the dot */ if ((char_type[(c = get_ch())] & DIG) == 0) { /* If not a float numb, */ goto nomore; /* All done for now */ } } /* End of float test */ else if (c == '0') { /* Octal or hex? */ *out++ = c; /* Stuff initial zero */ radix = 8; /* Assume it's octal */ c = get_ch(); /* Look for an 'x' */ if (c == 'x' || c == 'X') { /* Did we get one? */ radix = 16; /* Remember new radix */ *out++ = c; /* Stuff the 'x' */ c = get_ch(); /* Get next character */ } } while (1) { /* Process curr. char. */ /* * Note that this algorithm accepts "012e4" and "03.4" * as legitimate floating-point numbers. */ if (radix != 16 && (c == 'e' || c == 'E')) { if (expseen) /* Already saw 'E'? */ break; /* Exit loop, bad nbr. */ expseen = TRUE; /* Set exponent seen */ radix = 10; /* Decimal exponent */ *out++ = c; /* Output the 'e' */ if ((c = get_ch()) != '+' && c != '-') continue; } else if (radix != 16 && c == '.') { if (dotflag) /* Saw dot already? */ break; /* Exit loop, two dots */ dotflag = TRUE; /* Remember the dot */ radix = 10; /* Decimal fraction */ } else { /* Check the digit */ switch (c) { case '8': case '9': /* Sometimes wrong */ octal89 = TRUE; /* Do check later */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': break; /* Always ok */ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': if (radix == 16) /* Alpha's are ok only */ break; /* if reading hex. */ default: /* At number end */ goto done; /* Break from for loop */ } /* End of switch */ } /* End general case */ *out++ = c; /* Accept the character */ c = get_ch(); /* Read another char */ } /* End of scan loop */ if (out_end < out) /* Buffer overflow */ goto nomore; /* * When we break out of the scan loop, c contains the first * character (maybe) not in the number. If the number is an * integer, allow a trailing 'L' for long. If not those, push * the trailing character back on the input stream. * Floating point numbers accept a trailing 'L' for "long double". */ done: if (! (dotflag || expseen)) { /* Not floating point */ /* * We know that dotflag and expseen are both zero, now: * dotflag signals "saw 'L'". */ for (;;) { switch (c) { case 'l': case 'L': if (dotflag) goto nomore; dotflag = TRUE; break; default: goto nomore; } *out++ = c; /* Got 'L' . */ c = get_ch(); /* Look at next, too. */ } } nomore: *out = EOS; if (out_end < out) goto overflow; unget_ch(); /* Not part of a number */ if (octal89 && radix == 8 && (warn_level & 1)) cwarn( "Illegal digit in octal number \"%s\"" /* _W1_ */ , out_s, 0L, NULL); return out; overflow: cfatal( "Too long number token \"%s\"", out_s, 0L, NULL); /* _F_ */ return out; } #if OK_UCN static char * scan_ucn( int cnt, /* Bytes of sequence */ char * out /* Output buffer */ ) /* * Scan an UCN sequence and put the sequence to 'out'. * Return the advanced pointer or NULL on failure. * This routine is never called in POST_STD mode. */ { uexpr_t value; /* Value of UCN */ int i, c; value = 0L; for (i = 0; i < cnt; i++) { c = get_ch(); if (! isxdigit( c)) { if (infile->fp) cerror( "Illegal UCN sequence" /* _E_ */ , NULL, 0L, NULL); *out = EOS; unget_ch(); return NULL; } c = tolower( c); *out++ = c; c = (isdigit( c) ? (c - '0') : (c - 'a' + 10)); value = (value << 4) | c; } if (infile->fp /* In source */ && ((value >= 0L && value <= 0x9FL && value != 0x24L && value != 0x40L && value != 0x60L) /* Basic source character */ || (stdc3 && (value >= 0xD800L && value <= 0xDFFFL)))) /* Reserved for special chars */ cerror( "UCN cannot specify the value %.0s\"%08lx\"" /* _E_ */ , NULL, (long) value, NULL); return out; } #endif /* OK_UCN */ static char * scan_op( int c, /* First char of the token */ char * out /* Output buffer */ ) /* * Scan C operator or punctuator into the specified buffer. * Return the advanced output pointer. * The code-number of the operator is stored to global variable 'openum'. * Note: '#' is not an operator nor a punctuator in other than directive line, * nevertheless is handled as a punctuator in this cpp for convenience. */ { int c2, c3, c4; *out++ = c; switch (c) { case '~': openum = OP_COM; break; case '(': openum = OP_LPA; break; case ')': openum = OP_RPA; break; case '?': openum = OP_QUE; break; case ';': case '[': case ']': case '{': case '}': case ',': openum = OP_1; break; default: openum = OP_2; /* Tentative guess */ } if (openum != OP_2) { /* Single byte operators */ *out = EOS; return out; } c2 = get_ch(); /* Possibly two bytes ops */ *out++ = c2; switch (c) { case '=': openum = ((c2 == '=') ? OP_EQ : OP_1); /* ==, = */ break; case '!': openum = ((c2 == '=') ? OP_NE : OP_NOT); /* !=, ! */ break; case '&': switch (c2) { case '&': openum = OP_ANA; break; /* && */ case '=': /* openum = OP_2; */ break; /* &= */ default : openum = OP_AND; break; /* & */ } break; case '|': switch (c2) { case '|': openum = OP_ORO; break; /* || */ case '=': /* openum = OP_2; */ break; /* |= */ default : openum = OP_OR; break; /* | */ } break; case '<': switch (c2) { case '<': c3 = get_ch(); if (c3 == '=') { openum = OP_3; /* <<= */ *out++ = c3; } else { openum = OP_SL; /* << */ unget_ch(); } break; case '=': openum = OP_LE; break; /* <= */ case ':': /* <: i.e. [ */ if (mcpp_mode == STD && option_flags.dig) openum = OP_LBRCK_D; else openum = OP_LT; break; case '%': /* <% i.e. { */ if (mcpp_mode == STD && option_flags.dig) openum = OP_LBRACE_D; else openum = OP_LT; break; default : openum = OP_LT; break; /* < */ } break; case '>': switch (c2) { case '>': c3 = get_ch(); if (c3 == '=') { openum = OP_3; /* >>= */ *out++ = c3; } else { openum = OP_SR; /* >> */ unget_ch(); } break; case '=': openum = OP_GE; break; /* >= */ default : openum = OP_GT; break; /* > */ } break; case '#': if (standard && (in_define || macro_line)) /* in #define or macro */ openum = ((c2 == '#') ? OP_CAT : OP_STR); /* ##, # */ else openum = OP_1; /* # */ break; case '+': switch (c2) { case '+': /* ++ */ case '=': /* openum = OP_2; */ break; /* += */ default : openum = OP_ADD; break; /* + */ } break; case '-': switch (c2) { case '-': /* -- */ case '=': /* -= */ /* openum = OP_2; */ break; case '>': if (cplus_val) { if ((c3 = get_ch()) == '*') { /* ->* */ openum = OP_3; *out++ = c3; } else { /* openum = OP_2; */ unget_ch(); } } /* else openum = OP_2; */ /* -> */ /* else openum = OP_2; */ break; default : openum = OP_SUB; break; /* - */ } break; case '%': switch (c2) { case '=': break; /* %= */ case '>': /* %> i.e. } */ if (mcpp_mode == STD && option_flags.dig) openum = OP_RBRACE_D; else openum = OP_MOD; break; case ':': if (mcpp_mode == STD && option_flags.dig) { if ((c3 = get_ch()) == '%') { if ((c4 = get_ch()) == ':') { /* %:%: i.e. ## */ openum = OP_DSHARP_D; *out++ = c3; *out++ = c4; } else { unget_ch(); unget_ch(); openum = OP_SHARP_D; /* %: i.e. # */ } } else { unget_ch(); openum = OP_SHARP_D; /* %: i.e. # */ } if (in_define) { /* in #define */ if (openum == OP_DSHARP_D) openum = OP_CAT; else openum = OP_STR; } } else { openum = OP_MOD; } break; default : openum = OP_MOD; break; /* % */ } break; case '*': if (c2 != '=') /* * */ openum = OP_MUL; /* else openum = OP_2; */ /* *= */ break; case '/': if (c2 != '=') /* / */ openum = OP_DIV; /* else openum = OP_2; */ /* /= */ break; case '^': if (c2 != '=') /* ^ */ openum = OP_XOR; /* else openum = OP_2; */ /* ^= */ break; case '.': if (standard) { if (c2 == '.') { c3 = get_ch(); if (c3 == '.') { openum = OP_ELL; /* ... */ *out++ = c3; break; } else { unget_ch(); openum = OP_1; } } else if (cplus_val && c2 == '*') { /* .* */ /* openum = OP_2 */ ; } else { /* . */ openum = OP_1; } } else { openum = OP_1; } break; case ':': if (cplus_val && c2 == ':') /* :: */ /* openum = OP_2 */ ; else if (mcpp_mode == STD && c2 == '>' && option_flags.dig) openum = OP_RBRCK_D; /* :> i.e. ] */ else /* : */ openum = OP_COL; break; default: /* Never reach here */ cfatal( "Bug: Punctuator is mis-implemented %.0s0lx%x" /* _F_ */ , NULL, (long) c, NULL); openum = OP_1; break; } switch (openum) { case OP_STR: if (mcpp_mode == STD && c == '%') break; /* %: */ case OP_1: case OP_NOT: case OP_AND: case OP_OR: case OP_LT: case OP_GT: case OP_ADD: case OP_SUB: case OP_MOD: case OP_MUL: case OP_DIV: case OP_XOR: case OP_COM: case OP_COL: /* Any single byte operator or punctuator */ unget_ch(); out--; break; default: /* Two or more bytes operators or punctuators */ break; } *out = EOS; return out; } int id_operator( const char * name ) /* * Check whether the name is identifier-like operator in C++. * Return the operator number if matched, return 0 if not matched. * Note: these identifiers are defined as macros in in C95. * This routine is never called in POST_STD mode. */ { typedef struct id_op { const char * name; int op_num; } ID_OP; ID_OP id_ops[] = { { "and", OP_ANA}, { "and_eq", OP_2}, { "bitand", OP_AND}, { "bitor", OP_OR}, { "compl", OP_COM}, { "not", OP_NOT}, { "not_eq", OP_NE}, { "or", OP_ORO}, { "or_eq", OP_2}, { "xor", OP_XOR}, { "xor_eq", OP_2}, { NULL, 0}, }; ID_OP * id_p = id_ops; while (id_p->name != NULL) { if (str_eq( name, id_p->name)) return id_p->op_num; id_p++; } return 0; } void expanding( const char * name, /* The name of (nested) macro just expanded. */ int to_be_freed /* The name should be freed later. */ ) /* * Remember used macro name for diagnostic. */ { if (exp_mac_ind < EXP_MAC_IND_MAX - 1) { exp_mac_ind++; } else { clear_exp_mac(); exp_mac_ind++; } expanding_macro[ exp_mac_ind].name = name; expanding_macro[ exp_mac_ind].to_be_freed = to_be_freed; } void clear_exp_mac( void) /* * Initialize expanding_macro[] freeing names registered in * name_to_be_freed[]. */ { int i; for (i = 1; i < EXP_MAC_IND_MAX; i++) { if (expanding_macro[ i].to_be_freed) { free( (void *) expanding_macro[ i].name); expanding_macro[ i].to_be_freed = FALSE; } } exp_mac_ind = 0; } int get_ch( void) /* * Return the next character from a macro or the current file. * Always return the value representable by unsigned char. */ { int len; int c; FILEINFO * file; /* * 'in_token' is set to TRUE while scan_token() is executed (and * scan_id(), scan_quote(), scan_number(), scan_ucn() and scan_op() * via scan_token()) in Standard mode to simplify tokenization. * Any token cannot cross "file"s. */ if (in_token) return (*infile->bptr++ & UCHARMAX); if ((file = infile) == NULL) return CHAR_EOF; /* End of all input */ if (mcpp_mode == POST_STD && file->fp) { /* In a source file */ switch (insert_sep) { case NO_SEP: break; case INSERT_SEP: /* Insert a token separator */ insert_sep = INSERTED_SEP; /* Remember this fact */ return ' '; /* for unget_ch(). */ case INSERTED_SEP: /* Has just inserted */ insert_sep = NO_SEP; /* Clear the flag */ break; } } if (! standard && squeezews) { if (*file->bptr == ' ') file->bptr++; /* Squeeze white spaces */ squeezews = FALSE; } if (mcpp_debug & GETC) { mcpp_fprintf( DBG, "get_ch(%s) '%c' line %ld, bptr = %d, buffer" , file->fp ? cur_fullname : file->real_fname ? file->real_fname : file->filename ? file->filename : "NULL" , *file->bptr & UCHARMAX , src_line, (int) (file->bptr - file->buffer)); dump_string( NULL, file->buffer); dump_unget( "get entrance"); } /* * Read a character from the current input logical line or macro. * At EOS, either finish the current macro (freeing temporary storage) * or get another logical line by parse_line(). * At EOF, exit the current file (#included) or, at EOF from the MCPP input * file, return CHAR_EOF to finish processing. * The character is converted to int with no sign-extension. */ if ((c = (*file->bptr++ & UCHARMAX)) != EOS) { if (standard) return c; /* Just a character */ if (! in_string && c == '\\' && *file->bptr == '\n' && in_define /* '\\''\n' is deleted in #define line, */ /* provided the '\\' is not the 2nd byte of mbchar. */ && ! last_is_mbchar( file->buffer, strlen( file->buffer) - 2 && ! keep_spaces) ) { if (*(file->bptr - 2) == ' ') squeezews = TRUE; } else { return c; } } /* * Nothing in current line or macro. Get next line (if input from a * file), or do end of file/macro processing, and reenter get_ch() to * restart from the top. */ if (file->fp && /* In source file */ parse_line() != NULL) /* Get line from file */ return get_ch(); /* * Free up space used by the (finished) file or macro and restart * input from the parent file/macro, if any. */ infile = file->parent; /* Unwind file chain */ free( file->buffer); /* Free buffer */ if (infile == NULL) { /* If at end of input */ free( file->filename); free( file->src_dir); free( file); /* full_fname is the same with filename for main file*/ return CHAR_EOF; /* Return end of file */ } if (file->fp) { /* Source file included */ free( file->filename); /* Free filename */ free( file->src_dir); /* Free src_dir */ fclose( file->fp); /* Close finished file */ /* Do not free file->real_fname and file->full_fname */ cur_fullname = infile->full_fname; cur_fname = infile->real_fname; /* Restore current fname*/ if (infile->pos != 0L) { /* Includer was closed */ infile->fp = fopen( cur_fullname, "r"); fseek( infile->fp, infile->pos, SEEK_SET); } /* Re-open the includer and restore the file-position */ len = (int) (infile->bptr - infile->buffer); infile->buffer = xrealloc( infile->buffer, NBUFF); /* Restore full size buffer to get the next line */ infile->bptr = infile->buffer + len; src_line = infile->line; /* Reset line number */ inc_dirp = infile->dirp; /* Includer's directory */ #if MCPP_LIB mcpp_set_out_func( infile->last_fputc, infile->last_fputs, infile->last_fprintf); #endif include_nest--; src_line++; /* Next line to #include*/ sharp( NULL, infile->include_opt ? 1 : (file->include_opt ? 0 : 2)); /* Need a #line now. Marker depends on include_opt. */ /* The file of include_opt should be marked as 1. */ /* Else if returned from include_opt file, it is the */ /* main input file, and should not be marked. */ /* Else, it is normal includer file, and marked as 2. */ src_line--; newlines = 0; /* Clear the blank lines*/ if (mcpp_debug & MACRO_CALL) /* Should be re-initialized */ com_cat_line.last_line = bsl_cat_line.last_line = 0L; } else if (file->filename) { /* Expanding macro */ if (macro_name) /* file->filename should be freed later */ expanding( file->filename, TRUE); else free( file->filename); } free( file); /* Free file space */ return get_ch(); /* Get from the parent */ } static char * parse_line( void) /* * ANSI (ISO) C: translation phase 3. * Parse a logical line. * Check illegal control characters. * Check unterminated string literal, character constant or comment. * Convert each comment to one space (or spaces of the comment length on * 'keep_spaces' mode).. * Squeeze succeding white spaces other than (including comments) to * one space (unless keep_spaces == TRUE). * The lines might be spliced by comments which cross the lines. */ { char * temp; /* Temporary buffer */ char * limit; /* Buffer end */ char * tp; /* Current pointer into temporary buffer */ char * sp; /* Pointer into input buffer */ size_t com_size; int c; if ((sp = get_line( FALSE)) == NULL) /* Next logical line */ return NULL; /* End of a file */ if (in_asm) { /* In #asm block */ while (char_type[ *sp++ & UCHARMAX] & SPA) ; if (*--sp == '#') /* Directive line */ infile->bptr = sp; return infile->bptr; /* Don't tokenize */ } tp = temp = xmalloc( (size_t) NBUFF); limit = temp + NBUFF - 2; while (char_type[ c = *sp++ & UCHARMAX] & HSP) { if (mcpp_mode != POST_STD) /* Preserve line top horizontal white spaces */ /* as they are for human-readability */ *tp++ = c; /* Else skip the line top spaces */ } sp--; while ((c = *sp++ & UCHARMAX) != '\n') { switch (c) { case '/': switch (*sp++) { case '*': /* Start of a comment */ com_start: if ((sp = read_a_comment( sp, &com_size)) == NULL) { free( temp); /* End of file with un- */ return NULL; /* terminated comment */ } if (keep_spaces && mcpp_mode != OLD_PREP) { if (tp + com_size >= limit - 1) /* Too long comment */ com_size = limit - tp - 1; /* Truncate */ while (com_size--) *tp++ = ' '; /* Spaces of the comment length */ break; } switch (mcpp_mode) { case POST_STD: if (temp < tp && *(tp - 1) != ' ') *tp++ = ' '; /* Squeeze white spaces */ break; case OLD_PREP: if (temp == tp || ! (char_type[ *(tp - 1) & UCHARMAX] & HSP)) *tp++ = COM_SEP; /* Convert to magic character */ break; default: if (temp == tp || ! (char_type[ *(tp - 1) & UCHARMAX] & HSP)) *tp++ = ' '; /* Squeeze white spaces */ break; } break; case '/': /* // */ if (! standard) goto not_comment; /* Comment when C++ or __STDC_VERSION__ >= 199901L */ /* Need not to convert to a space because '\n' follows */ if (! stdc2 && (warn_level & 2)) cwarn( "Parsed \"//\" as comment" /* _W2_ */ , NULL, 0L, NULL); if (keep_comments) { sp -= 2; while (*sp != '\n') /* Until end of line */ mcpp_fputc( *sp++, OUT); } goto end_line; default: /* Not a comment */ not_comment: *tp++ = '/'; sp--; /* To re-read */ break; } break; case '\r': /* Vertical white spaces*/ /* Note that [CR+LF] is already converted to [LF]. */ case '\f': case '\v': if (warn_level & 4) cwarn( "Converted %.0s0x%02lx to a space" /* _W4_ */ , NULL, (long) c, NULL); case '\t': /* Horizontal space */ case ' ': if (keep_spaces) { if (c == '\t') *tp++ = '\t'; else *tp++ = ' '; /* Convert to ' ' */ } else if (! (char_type[ *(tp - 1) & UCHARMAX] & HSP)) { *tp++ = ' '; /* Squeeze white spaces */ } else if (mcpp_mode == OLD_PREP && *(tp - 1) == COM_SEP) { *(tp - 1) = ' '; /* Replace COM_SEP with ' ' */ } break; case '"': /* String literal */ case '\'': /* Character constant */ infile->bptr = sp; if (standard) { tp = scan_quote( c, tp, limit, TRUE); } else { in_string = TRUE; /* Enable line splicing by scan_quote() */ tp = scan_quote( c, tp, limit, TRUE); /* (not by get_ch())*/ in_string = FALSE; } if (tp == NULL) { free( temp); /* Unbalanced quotation */ return parse_line(); /* Skip the line */ } sp = infile->bptr; break; default: if (iscntrl( c)) { cerror( /* Skip the control character */ "Illegal control character %.0s0x%lx, skipped the character" /* _E_ */ , NULL, (long) c, NULL); } else { /* Any valid character */ *tp++ = c; } break; } if (limit < tp) { *tp = EOS; cfatal( "Too long line spliced by comments" /* _F_ */ , NULL, 0L, NULL); } } end_line: if (temp < tp && (char_type[ *(tp - 1) & UCHARMAX] & HSP)) tp--; /* Remove trailing white space */ *tp++ = '\n'; *tp = EOS; infile->bptr = strcpy( infile->buffer, temp); /* Write back to buffer */ free( temp); if (macro_line != 0 && macro_line != MACRO_ERROR) { /* Expanding macro */ temp = infile->buffer; while (char_type[ *temp & UCHARMAX] & HSP) temp++; if (*temp == '#' /* This line starts with # token */ || (mcpp_mode == STD && *temp == '%' && *(temp + 1) == ':')) if (warn_level & 1) cwarn( "Macro started at line %.0s%ld swallowed directive-like line" /* _W1_ */ , NULL, macro_line, NULL); } return infile->buffer; } static char * read_a_comment( char * sp, /* Source */ size_t * sizp /* Size of the comment */ ) /* * Read over a comment (which may cross the lines). */ { int c; char * saved_sp; int cat_line = 0; /* Number of catenated lines */ if (keep_spaces) { saved_sp = sp - 2; /* '-2' for beginning / and * */ *sizp = 0; } if (keep_comments) /* If writing comments */ mcpp_fputs( "/*", OUT); /* Write the initializer*/ c = *sp++; while (1) { /* Eat a comment */ if (keep_comments) mcpp_fputc( c, OUT); switch (c) { case '/': if ((c = *sp++) != '*') /* Don't let comments */ continue; /* nest. */ if (warn_level & 1) cwarn( "\"/*\" within comment", NULL, 0L, NULL); /* _W1_ */ if (keep_comments) mcpp_fputc( c, OUT); /* Fall into * stuff */ case '*': if ((c = *sp++) != '/') /* If comment doesn't */ continue; /* end, look at next. */ if (keep_comments) { /* Put out comment */ mcpp_fputc( c, OUT); /* terminator, too. */ mcpp_fputc( '\n', OUT); /* Append '\n' to avoid */ /* trouble on some other tools such as rpcgen. */ wrong_line = TRUE; } if (keep_spaces) /* Save the length */ *sizp = *sizp + (sp - saved_sp); if ((mcpp_debug & MACRO_CALL) && compiling) { if (cat_line) { cat_line++; com_cat_line.len[ cat_line] /* Catenated length */ = com_cat_line.len[ cat_line - 1] + strlen( infile->buffer) - 1; /* '-1' for '\n' */ com_cat_line.last_line = src_line; } } return sp; /* End of comment */ case '\n': /* Line-crossing comment*/ if (keep_spaces) /* Save the length */ *sizp = *sizp + (sp - saved_sp) - 1; /* '-1' for '\n' */ if ((mcpp_debug & MACRO_CALL) && compiling) { /* Save location informations */ if (cat_line == 0) /* First line of catenation */ com_cat_line.start_line = src_line; if (cat_line >= MAX_CAT_LINE - 1) { *sizp = 0; /* Discard the too long comment */ cat_line = 0; if (warn_level & 4) cwarn( "Too long comment, discarded up to here" /* _W4_ */ , NULL, 0L, NULL); } cat_line++; com_cat_line.len[ cat_line] = com_cat_line.len[ cat_line - 1] + strlen( infile->buffer) - 1; } if ((saved_sp = sp = get_line( TRUE)) == NULL) return NULL; /* End of file within comment */ /* Never happen, because at_eof() supplement closing*/ wrong_line = TRUE; /* We'll need a #line later */ break; default: /* Anything else is */ break; /* just a character */ } /* End switch */ c = *sp++; } /* End comment loop */ return sp; /* Never reach here */ } static char * mcpp_fgets( char * s, int size, FILE * stream ) { return fgets( s, size, stream); } static char * get_line( int in_comment ) /* * ANSI (ISO) C: translation phase 1, 2. * Get the next logical line from source file. * Convert [CR+LF] to [LF]. */ { #if COMPILER == INDEPENDENT #define cr_warn_level 1 #else #define cr_warn_level 2 #endif static int cr_converted; int converted = FALSE; int len; /* Line length - alpha */ char * ptr; int cat_line = 0; /* Number of catenated lines */ if (infile == NULL) /* End of a source file */ return NULL; ptr = infile->bptr = infile->buffer; if ((mcpp_debug & MACRO_CALL) && src_line == 0) /* Initialize */ com_cat_line.last_line = bsl_cat_line.last_line = 0L; while (mcpp_fgets( ptr, (int) (infile->buffer + NBUFF - ptr), infile->fp) != NULL) { /* Translation phase 1 */ src_line++; /* Gotten next physical line */ if (standard && src_line == std_limits.line_num + 1 && (warn_level & 1)) cwarn( "Line number %.0s\"%ld\" got beyond range" /* _W1_ */ , NULL, src_line, NULL); if (mcpp_debug & (TOKEN | GETC)) { /* Dump it to DBG */ mcpp_fprintf( DBG, "\n#line %ld (%s)", src_line, cur_fullname); dump_string( NULL, ptr); } len = strlen( ptr); if (NBUFF - 1 <= ptr - infile->buffer + len && *(ptr + len - 1) != '\n') { /* The line does not yet end, though the buffer is full. */ if (NBUFF - 1 <= len) cfatal( "Too long source line" /* _F_ */ , NULL, 0L, NULL); else cfatal( "Too long logical line" /* _F_ */ , NULL, 0L, NULL); } if (*(ptr + len - 1) != '\n') /* Unterminated source line */ break; if (len >= 2 && *(ptr + len - 2) == '\r') { /* [CR+LF] */ *(ptr + len - 2) = '\n'; *(ptr + --len) = EOS; if (! cr_converted && (warn_level & cr_warn_level)) { cwarn( "Converted [CR+LF] to [LF]" /* _W1_ _W2_ */ , NULL, 0L, NULL); cr_converted = TRUE; } } if (standard) { if (option_flags.trig) converted = cnv_trigraph( ptr); if (mcpp_mode == POST_STD && option_flags.dig) converted += cnv_digraph( ptr); if (converted) len = strlen( ptr); /* Translation phase 2 */ len -= 2; if (len >= 0) { if ((*(ptr + len) == '\\') && ! last_is_mbchar( ptr, len)) { /* (not MBCHAR) */ ptr = infile->bptr += len; /* Splice the lines */ wrong_line = TRUE; if ((mcpp_debug & MACRO_CALL) && compiling) { /* Save location informations */ if (cat_line == 0) /* First line of catenation */ bsl_cat_line.start_line = src_line; if (cat_line < MAX_CAT_LINE) /* Record the catenated length */ bsl_cat_line.len[ ++cat_line] = strlen( infile->buffer) - 2; /* Else ignore */ } continue; } } #if NBUFF-2 > SLEN90MIN if (ptr - infile->buffer + len + 2 > std_limits.str_len + 1 && (warn_level & 4)) /* +1 for '\n' */ cwarn( "Logical source line longer than %.0s%ld bytes" /* _W4_ */ , NULL, std_limits.str_len, NULL); #endif } if ((mcpp_debug & MACRO_CALL) && compiling) { if (cat_line && cat_line < MAX_CAT_LINE) { bsl_cat_line.len[ ++cat_line] = strlen( infile->buffer) - 1; /* Catenated length: '-1' for '\n' */ bsl_cat_line.last_line = src_line; } } return infile->bptr = infile->buffer; /* Logical line */ } /* End of a (possibly included) source file */ if (ferror( infile->fp)) cfatal( "File read error", NULL, 0L, NULL); /* _F_ */ if ((ptr = at_eof( in_comment)) != NULL) /* Check at end of file */ return ptr; /* Partial line supplemented */ if (option_flags.z) { no_output--; /* End of included file */ keep_comments = option_flags.c && compiling && !no_output; } return NULL; } #define TRIOFFSET 10 int cnv_trigraph( char * in ) /* * Perform in-place trigraph replacement on a physical line. This was added * to the C90. In an input text line, the sequence ??[something] is * transformed to a character (which might not appear on the input keyboard). */ { const char * const tritext = "=(/)'-\0#[\\]^{|}~"; /* ^ ^ * +----------+ * this becomes this */ int count = 0; const char * tp; while ((in = strchr( in, '?')) != NULL) { if (*++in != '?') continue; while (*++in == '?') ; if ((tp = strchr( tritext, *in)) == NULL) continue; *(in - 2) = *(tp + TRIOFFSET); in--; memmove( in, in + 2, strlen( in + 1)); count++; } if (count && (warn_level & 16)) cwarn( "%.0s%ld trigraph(s) converted" /* _W16_ */ , NULL, (long) count, NULL); return count; } int cnv_digraph( char * in ) /* * Perform in-place digraph replacement on a physical line. * Called only in POST_STD mode. */ { int count = 0; int i; int c1, c2; while ((i = strcspn( in, "%:<")), (c1 = *(in + i)) != '\0') { in += i + 1; c2 = *in; switch (c1) { case '%' : switch (c2) { case ':' : *(in - 1) = '#'; break; case '>' : *(in - 1) = '}'; break; default : continue; } break; case ':' : switch (c2) { case '>' : *(in - 1) = ']'; break; default : continue; } break; case '<' : switch (c2) { case '%' : *(in - 1) = '{'; break; case ':' : *(in - 1) = '['; break; default : continue; } break; } memmove( in, in + 1, strlen( in)); count++; } if (count && (warn_level & 16)) cwarn( "%.0s%ld digraph(s) converted" /* _W16_ */ , NULL, (long) count, NULL); return count; } static char * at_eof( int in_comment ) /* * Check the partial line, unterminated comment, unbalanced #if block, * uncompleted macro call at end of a file or at end of input. * Supplement the line terminator, if possible. * Return the supplemented line or NULL on unrecoverable error. */ { const char * const format = "End of %s with %.0ld%s"; /* _E_ _W1_ */ const char * const unterm_if_format = "End of %s within #if (#ifdef) section started at line %ld"; /* _E_ _W1_ */ const char * const unterm_macro_format = "End of %s within macro call started at line %ld";/* _E_ _W1_ */ const char * const input = infile->parent ? "file" : "input"; /* _E_ _W1_ */ const char * const no_newline = "no newline, supplemented newline"; /* _W1_ */ const char * const unterm_com = "unterminated comment, terminated the comment"; /* _W1_ */ const char * const backsl = "\\, deleted the \\"; /* _W1_ */ const char * const unterm_asm_format = "End of %s with unterminated #asm block started at line %ld"; /* _E_ _W1_ */ size_t len; char * cp; cp = infile->buffer; len = strlen( cp); if (len && *(cp += (len - 1)) != '\n') { *++cp = '\n'; /* Supplement */ *++cp = EOS; if (mcpp_mode != OLD_PREP && (warn_level & 1)) cwarn( format, input, 0L, no_newline); return infile->bptr = infile->buffer; } if (standard && infile->buffer < infile->bptr) { /* No line after */ cp = infile->bptr; *cp++ = '\n'; /* Delete the \\ */ *cp = EOS; if (warn_level & 1) cwarn( format, input, 0L, backsl); return infile->bptr = infile->buffer; } if (in_comment) { /* End of file within a comment */ if (mcpp_mode != OLD_PREP && (warn_level & 1)) cwarn( format, input, 0L, unterm_com); /* The partial comment line has been already read by */ /* read_a_comment(), so supplement the next line. */ strcpy( infile->buffer, "*/\n"); return infile->bptr = infile->buffer; } if (infile->initif < ifptr) { IFINFO * ifp = infile->initif + 1; if (standard) { cerror( unterm_if_format, input, ifp->ifline, NULL); ifptr = infile->initif; /* Clear information of */ compiling = ifptr->stat; /* erroneous grouping */ } else if (mcpp_mode == KR && (warn_level & 1)) { cwarn( unterm_if_format, input, ifp->ifline, NULL); } } if (macro_line != 0 && macro_line != MACRO_ERROR && ((mcpp_mode == STD && in_getarg) || ! standard)) { if (standard) { cerror( unterm_macro_format, input, macro_line, NULL); macro_line = MACRO_ERROR; } else if (warn_level & 1) { cwarn( unterm_macro_format, input, macro_line, NULL); } } if (in_asm && mcpp_mode == KR && (warn_level & 1)) cwarn( unterm_asm_format, input, in_asm, NULL); return NULL; } void unget_ch( void) /* * Back the pointer to reread the last character. Fatal error (code bug) * if we back too far. unget_ch() may be called, without problems, at end of * file. Only one character may be ungotten. If you need to unget more, * call unget_string(). */ { if (in_token) { infile->bptr--; return; } if (infile != NULL) { if (mcpp_mode == POST_STD && infile->fp) { switch (insert_sep) { case INSERTED_SEP: /* Have just read an inserted separator */ insert_sep = INSERT_SEP; return; case INSERT_SEP: cfatal( "Bug: unget_ch() just after scan_token()" /* _F_ */ , NULL, 0L, NULL); break; default: break; } } --infile->bptr; if (infile->bptr < infile->buffer) /* Shouldn't happen */ cfatal( "Bug: Too much pushback", NULL, 0L, NULL); /* _F_ */ } if (mcpp_debug & GETC) dump_unget( "after unget"); } FILEINFO * unget_string( const char * text, /* Text to unget */ const char * name /* Name of the macro, if any*/ ) /* * Push a string back on the input stream. This is done by treating * the text as if it were a macro or a file. */ { FILEINFO * file; size_t size; if (text) size = strlen( text) + 1; else size = 1; file = get_file( name, NULL, NULL, size, FALSE); if (text) memcpy( file->buffer, text, size); else *file->buffer = EOS; return file; } char * save_string( const char * text ) /* * Store a string into free memory. */ { char * result; size_t size; size = strlen( text) + 1; result = xmalloc( size); memcpy( result, text, size); return result; } FILEINFO * get_file( const char * name, /* File or macro name */ const char * src_dir, /* Source file directory*/ const char * fullname, /* Full path list */ size_t bufsize, /* Line buffer size */ int include_opt /* Specified by -include opt (for GCC) */ ) /* * Common FILEINFO buffer initialization for a new file or macro. */ { FILEINFO * file; file = (FILEINFO *) xmalloc( sizeof (FILEINFO)); file->buffer = xmalloc( bufsize); file->bptr = file->buffer; /* Initialize line ptr */ file->buffer[ 0] = EOS; /* Force first read */ file->line = 0L; /* (Not used just yet) */ file->fp = NULL; /* No file yet */ file->pos = 0L; /* No pos to remember */ file->parent = infile; /* Chain files together */ file->initif = ifptr; /* Initial ifstack */ file->include_opt = include_opt; /* Specified by -include*/ file->dirp = NULL; /* No include dir yet */ file->real_fname = name; /* Save file/macro name */ file->full_fname = fullname; /* Full path list */ if (name) { file->filename = xmalloc( strlen( name) + 1); strcpy( file->filename, name); /* Copy for #line */ } else { file->filename = NULL; } if (src_dir) { file->src_dir = xmalloc( strlen( src_dir) + 1); strcpy( file->src_dir, src_dir); } else { file->src_dir = NULL; } #if MCPP_LIB file->last_fputc = mcpp_lib_fputc; file->last_fputs = mcpp_lib_fputs; file->last_fprintf = mcpp_lib_fprintf; #endif if (infile != NULL) { /* If #include file */ infile->line = src_line; /* Save current line */ #if MCPP_LIB infile->last_fputc = mcpp_fputc; infile->last_fputs = mcpp_fputs; infile->last_fprintf = mcpp_fprintf; #endif } infile = file; /* New current file */ return file; /* All done. */ } static const char * const out_of_memory = "Out of memory (required size is %.0s0x%lx bytes)"; /* _F_ */ char * (xmalloc)( size_t size ) /* * Get a block of free memory. */ { char * result; if ((result = (char *) malloc( size)) == NULL) { if (mcpp_debug & MEMORY) print_heap(); cfatal( out_of_memory, NULL, (long) size, NULL); } return result; } char * (xrealloc)( char * ptr, size_t size ) /* * Reallocate malloc()ed memory. */ { char * result; if ((result = (char *) realloc( ptr, size)) == NULL && size != 0) { /* 'size != 0' is necessary to cope with some */ /* implementation of realloc( ptr, 0) which returns NULL. */ if (mcpp_debug & MEMORY) print_heap(); cfatal( out_of_memory, NULL, (long) size, NULL); } return result; } LINE_COL * get_src_location( LINE_COL * p_line_col /* Line and column on phase 4 */ ) /* * Convert line-column datum of just after translation phase 3 into that of * phase 2, tracing back line splicing by a comment and . * Note: This conversion does not give correct datum on a line catenated by * both of and line-crossing-comment at the same time. * * com_cat_line and bsl_cat_line have data only on last catenated line. * com_cat_line.len[] and bsl_cat_line.len[] have the length of catenated * line, and len[ 0] is always 0, followed by len[ 1], len[ 2], ..., as * accumulated length of successively catenated lines. */ { long line; size_t col; size_t * cols; CAT_LINE * l_col_p; int i; line = p_line_col->line; col = p_line_col->col; for (i = 0; i <= 1; i++) { l_col_p = i ? & bsl_cat_line : & com_cat_line; if (l_col_p->last_line != line) continue; /* Else just catenated line */ cols = l_col_p->len + 1; while (*cols < col) cols++; if (col <= *cols) { cols--; col -= *cols; } line = l_col_p->start_line + (cols - l_col_p->len); } p_line_col->line = line; p_line_col->col = col + 1; /* col internally start at 0, output start at 1 */ return p_line_col; } static void put_line( char * out, FILE * fp ) /* * Put out a logical source line. * This routine is called only in OLD_PREP mode. */ { int c; while ((c = *out++) != EOS) { if (c != COM_SEP) /* Skip 0-length comment */ mcpp_fputc( c, FP2DEST( fp)); } } static void do_msg( const char * severity, /* "fatal", "error", "warning" */ const char * format, /* Format for the error message */ const char * arg1, /* String arg. for the message */ long arg2, /* Integer argument */ const char * arg3 /* Second string argument */ ) /* * Print filenames, macro names, line numbers and error messages. * Also print macro definitions on macro expansion problems. */ { FILEINFO * file; DEFBUF * defp; int i; size_t slen; const char * arg_s[ 2]; char * arg_t[ 2]; char * tp; const char * sp; int c; int ind; fflush( fp_out); /* Synchronize output and diagnostics */ arg_s[ 0] = arg1; arg_s[ 1] = arg3; for (i = 0; i < 2; i++) { /* Convert special characters to visible */ sp = arg_s[ i]; if (sp != NULL) slen = strlen( sp) + 1; else slen = 1; tp = arg_t[ i] = (char *) malloc( slen); /* Don't use xmalloc() so as not to cause infinite recursion */ if (sp == NULL || *sp == EOS) { *tp = EOS; continue; } while ((c = *sp++) != EOS) { switch (c) { case TOK_SEP: if (mcpp_mode == OLD_PREP) /* COM_SEP */ break; /* Skip magic characters */ /* Else fall through */ case RT_END: case CAT: case ST_QUOTE: case DEF_MAGIC: if (! standard) *tp++ = ' '; break; /* Skip the magic characters*/ case IN_SRC: if (! standard) *tp++ = ' '; if ((mcpp_debug & MACRO_CALL) && ! in_directive) sp += 2; /* Skip two more bytes */ break; case MAC_INF: if (mcpp_mode != STD) { *tp++ = ' '; /* Illegal control character, convert to a space*/ } else { switch (*sp++) { /* Skip the magic characters*/ case MAC_ARG_START : sp++; /* Fall through */ case MAC_CALL_START : sp += 2; break; case MAC_ARG_END : if (! option_flags.v) break; else sp++; /* Fall through */ case MAC_CALL_END : if (option_flags.v) sp += 2; break; } } break; case '\n': *tp++ = ' '; /* Convert '\n' to a space */ break; default: *tp++ = c; break; } } if (*(sp - 2) == '\n') tp--; *tp = EOS; } /* Print source location and diagnostic */ file = infile; while (file != NULL && (file->fp == NULL || file->fp == (FILE *)-1)) file = file->parent; /* Skip macro */ if (file != NULL) { file->line = src_line; mcpp_fprintf( ERR, "%s:%ld: %s: ", cur_fullname, src_line, severity); } mcpp_fprintf( ERR, format, arg_t[ 0], arg2, arg_t[ 1]); mcpp_fputc( '\n', ERR); if (option_flags.no_source_line) goto free_arg; /* Print source line, includers and expanding macros */ file = infile; if (file != NULL && file->fp != NULL) { if (mcpp_mode == OLD_PREP) { mcpp_fputs( " ", ERR); put_line( file->buffer, fp_err); } else { mcpp_fprintf( ERR, " %s", file->buffer); /* Current source line */ } file = file->parent; } while (file != NULL) { /* Print #includes, too */ if (file->fp == NULL) { /* Macro */ if (file->filename) { defp = look_id( file->filename); if ((defp->nargs > DEF_NOARGS_STANDARD) && ! (file->parent && file->parent->filename && str_eq( file->filename, file->parent->filename))) /* If the name is not duplicate of parent */ dump_a_def( " macro", defp, FALSE, TRUE, fp_err); } } else { /* Source file */ if (file->buffer[ 0] == '\0') strcpy( file->buffer, "\n"); if (mcpp_mode != OLD_PREP) { mcpp_fprintf( ERR, " from %s: %ld: %s", file->line ? file->full_fname /* Full-path-list */ : "", /* Included by -include */ file->line, /* Current line number */ file->buffer); /* The source line */ } else { mcpp_fprintf( ERR, " from %s: %ld: ", file->full_fname , file->line); put_line( file->buffer, fp_err); } } file = file->parent; } if (! macro_name) goto free_arg; /* Additional information of macro definitions */ expanding_macro[ 0].name = macro_name; for (ind = 0; ind <= exp_mac_ind; ind++) { int ind_done; for (ind_done = 0; ind_done < ind; ind_done++) if (str_eq( expanding_macro[ ind].name , expanding_macro[ ind_done].name)) break; /* Already reported */ if (ind_done < ind) continue; for (file = infile; file; file = file->parent) if (file->fp == NULL && file->filename && str_eq( expanding_macro[ ind].name, file->filename)) break; /* Already reported */ if (file) continue; if ((defp = look_id( expanding_macro[ ind].name)) != NULL) { if (defp->nargs <= DEF_NOARGS_STANDARD) continue; /* Standard predefined */ dump_a_def( " macro", defp, FALSE, TRUE, fp_err); /* Macro already read over */ } } free_arg: for (i = 0; i < 2; i++) free( arg_t[ i]); } void cfatal( const char * format, const char * arg1, long arg2, const char * arg3 ) /* * A real disaster. */ { do_msg( "fatal error", format, arg1, arg2, arg3); longjmp( error_exit, -1); } void cerror( const char * format, const char * arg1, long arg2, const char * arg3 ) /* * Print a error message. */ { do_msg( "error", format, arg1, arg2, arg3); errors++; } void cwarn( const char * format, const char * arg1, long arg2, const char * arg3 ) /* * Maybe an error. */ { do_msg( "warning", format, arg1, arg2, arg3); } void dump_string( const char * why, const char * text ) /* * Dump text readably. * Bug: macro argument number may be putout as a control character or any * other character, just after MAC_PARM has been read away. */ { const char * cp; const char * chr; int c, c1, c2; if (why != NULL) mcpp_fprintf( DBG, " (%s)", why); mcpp_fputs( " => ", DBG); if (text == NULL) { mcpp_fputs( "NULL", DBG); return; } for (cp = text; (c = *cp++ & UCHARMAX) != EOS; ) { chr = NULL; switch (c) { case MAC_PARM: c = *cp++ & UCHARMAX; /* Macro parameter number */ mcpp_fprintf( DBG, "<%d>", c); break; case MAC_INF: if (! (mcpp_mode == STD && (mcpp_debug & MACRO_CALL))) goto no_magic; /* Macro informations inserted by -K option */ c2 = *cp++ & UCHARMAX; if (option_flags.v || c2 == MAC_CALL_START || c2 == MAC_ARG_START) { c = ((*cp++ & UCHARMAX) - 1) * UCHARMAX; c += (*cp++ & UCHARMAX) - 1; } switch (c2) { case MAC_CALL_START: mcpp_fprintf( DBG, "", c); break; case MAC_CALL_END: if (option_flags.v) mcpp_fprintf( DBG, "", c); else chr = ""; break; case MAC_ARG_START: c1 = *cp++ & UCHARMAX; mcpp_fprintf( DBG, "", c, c1 - 1); break; case MAC_ARG_END: if (option_flags.v) { c1 = *cp++ & UCHARMAX; mcpp_fprintf( DBG, "", c, c1 - 1); } else { chr = ""; } break; } break; case DEF_MAGIC: if (standard) { chr = ""; break; } /* Else fall through */ case CAT: if (standard) { chr = "##"; break; } /* Else fall through */ case ST_QUOTE: if (standard) { chr = "#"; break; } /* Else fall through */ case RT_END: if (standard) { chr = ""; break; } /* Else fall through */ case IN_SRC: if (standard) { if ((mcpp_debug & MACRO_CALL) && ! in_directive) { int num; num = ((*cp++ & UCHARMAX) - 1) * UCHARMAX; num += (*cp++ & UCHARMAX) - 1; mcpp_fprintf( DBG, "", num); } else { chr = ""; } } else { /* Control character */ mcpp_fprintf( DBG, "<^%c>", c + '@'); } break; case TOK_SEP: if (mcpp_mode == STD) { chr = ""; break; } else if (mcpp_mode == OLD_PREP) { /* COM_SEP */ chr = ""; break; } /* Else fall through */ default: no_magic: if (c < ' ') mcpp_fprintf( DBG, "<^%c>", c + '@'); else mcpp_fputc( c, DBG); break; } if (chr) mcpp_fputs( chr, DBG); } mcpp_fputc( '\n', DBG); } void dump_unget( const char * why ) /* * Dump all ungotten junk (pending macros and current input lines). */ { const FILEINFO * file; mcpp_fputs( "dump of pending input text", DBG); if (why != NULL) { mcpp_fputs( "-- ", DBG); mcpp_fputs( why, DBG); } mcpp_fputc( '\n', DBG); for (file = infile; file != NULL; file = file->parent) dump_string( file->real_fname ? file->real_fname : file->filename ? file->filename : "NULL", file->bptr); } static void dump_token( int token_type, const char * cp /* Token */ ) /* * Dump a token. */ { static const char * const t_type[] = { "NAM", "NUM", "STR", "WSTR", "CHR", "WCHR", "OPE", "SPE" , "SEP", }; mcpp_fputs( "token", DBG); dump_string( t_type[ token_type - NAM], cp); } mcpp-2.7.2/src/Makefile.in0000644000175000017500000006057311113211444012241 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @MCPP_LIB_FALSE@bin_PROGRAMS = mcpp$(EXEEXT) @MCPP_LIB_TRUE@bin_PROGRAMS = mcpp$(EXEEXT) @MCPP_LIB_FALSE@mcpp_DEPENDENCIES = @GNUC_TRUE@@MINGW_TRUE@@REPLACE_CPP_TRUE@cc1_PROGRAMS = cc1$(EXEEXT) subdir = src DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(cc1dir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libmcpp_la_LIBADD = am__libmcpp_la_SOURCES_DIST = system.H configed.H internal.H main.c \ directive.c eval.c expand.c mbchar.c support.c system.c @MCPP_LIB_TRUE@am_libmcpp_la_OBJECTS = main.lo directive.lo eval.lo \ @MCPP_LIB_TRUE@ expand.lo mbchar.lo support.lo system.lo libmcpp_la_OBJECTS = $(am_libmcpp_la_OBJECTS) libmcpp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmcpp_la_LDFLAGS) $(LDFLAGS) -o $@ @MCPP_LIB_TRUE@am_libmcpp_la_rpath = -rpath $(libdir) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) cc1PROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(cc1_PROGRAMS) am__cc1_SOURCES_DIST = cc1.c @GNUC_TRUE@@MINGW_TRUE@@REPLACE_CPP_TRUE@am_cc1_OBJECTS = \ @GNUC_TRUE@@MINGW_TRUE@@REPLACE_CPP_TRUE@ cc1.$(OBJEXT) cc1_OBJECTS = $(am_cc1_OBJECTS) cc1_LDADD = $(LDADD) am__mcpp_SOURCES_DIST = system.H configed.H internal.H main.c \ directive.c eval.c expand.c mbchar.c support.c system.c \ mcpp_out.h main_libmcpp.c @MCPP_LIB_FALSE@am_mcpp_OBJECTS = mcpp-main.$(OBJEXT) \ @MCPP_LIB_FALSE@ mcpp-directive.$(OBJEXT) mcpp-eval.$(OBJEXT) \ @MCPP_LIB_FALSE@ mcpp-expand.$(OBJEXT) mcpp-mbchar.$(OBJEXT) \ @MCPP_LIB_FALSE@ mcpp-support.$(OBJEXT) mcpp-system.$(OBJEXT) @MCPP_LIB_TRUE@am_mcpp_OBJECTS = mcpp-main_libmcpp.$(OBJEXT) mcpp_OBJECTS = $(am_mcpp_OBJECTS) mcpp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(mcpp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmcpp_la_SOURCES) $(cc1_SOURCES) $(mcpp_SOURCES) DIST_SOURCES = $(am__libmcpp_la_SOURCES_DIST) $(am__cc1_SOURCES_DIST) \ $(am__mcpp_SOURCES_DIST) am__include_HEADERS_DIST = mcpp_lib.h mcpp_out.h includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ Target_Cpu = @Target_Cpu@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cpp_call = @cpp_call@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gcc_maj_ver = @gcc_maj_ver@ gcc_min_ver = @gcc_min_ver@ gcc_path = @gcc_path@ gcc_testsuite_dir = @gcc_testsuite_dir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_system = @host_system@ host_vendor = @host_vendor@ htmldir = @htmldir@ inc_dir = @inc_dir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cc = @target_cc@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MCPP_LIB_FALSE@mcpp_SOURCES = system.H configed.H internal.H main.c directive.c eval.c \ @MCPP_LIB_FALSE@ expand.c mbchar.c support.c system.c mcpp_out.h @MCPP_LIB_TRUE@mcpp_SOURCES = main_libmcpp.c @MCPP_LIB_TRUE@mcpp_DEPENDENCIES = libmcpp.la @MCPP_LIB_TRUE@mcpp_LDADD = -lmcpp @MCPP_LIB_TRUE@lib_LTLIBRARIES = libmcpp.la @MCPP_LIB_TRUE@libmcpp_la_SOURCES = system.H configed.H internal.H main.c directive.c \ @MCPP_LIB_TRUE@ eval.c expand.c mbchar.c support.c system.c @MCPP_LIB_TRUE@libmcpp_la_LDFLAGS = -no-undefined -version-info 3:0:3 @MCPP_LIB_TRUE@include_HEADERS = mcpp_lib.h mcpp_out.h @MCPP_LIB_FALSE@mcpp_CFLAGS = $(AM_CFLAGS) ## dummy to avoid conflict with MCPP_LIB @GNUC_TRUE@@MINGW_TRUE@@REPLACE_CPP_TRUE@cc1_SOURCES = cc1.c @GNUC_TRUE@@MINGW_TRUE@@REPLACE_CPP_TRUE@cc1dir = $(bindir) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmcpp.la: $(libmcpp_la_OBJECTS) $(libmcpp_la_DEPENDENCIES) $(libmcpp_la_LINK) $(am_libmcpp_la_rpath) $(libmcpp_la_OBJECTS) $(libmcpp_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done install-cc1PROGRAMS: $(cc1_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(cc1dir)" || $(MKDIR_P) "$(DESTDIR)$(cc1dir)" @list='$(cc1_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cc1PROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cc1dir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cc1PROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cc1dir)/$$f" || exit 1; \ else :; fi; \ done uninstall-cc1PROGRAMS: @$(NORMAL_UNINSTALL) @list='$(cc1_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(cc1dir)/$$f'"; \ rm -f "$(DESTDIR)$(cc1dir)/$$f"; \ done clean-cc1PROGRAMS: @list='$(cc1_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) @rm -f cc1$(EXEEXT) $(LINK) $(cc1_OBJECTS) $(cc1_LDADD) $(LIBS) mcpp$(EXEEXT): $(mcpp_OBJECTS) $(mcpp_DEPENDENCIES) @rm -f mcpp$(EXEEXT) $(mcpp_LINK) $(mcpp_OBJECTS) $(mcpp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mcpp-main.o: main.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c mcpp-main.obj: main.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` mcpp-directive.o: directive.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-directive.o `test -f 'directive.c' || echo '$(srcdir)/'`directive.c mcpp-directive.obj: directive.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-directive.obj `if test -f 'directive.c'; then $(CYGPATH_W) 'directive.c'; else $(CYGPATH_W) '$(srcdir)/directive.c'; fi` mcpp-eval.o: eval.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-eval.o `test -f 'eval.c' || echo '$(srcdir)/'`eval.c mcpp-eval.obj: eval.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-eval.obj `if test -f 'eval.c'; then $(CYGPATH_W) 'eval.c'; else $(CYGPATH_W) '$(srcdir)/eval.c'; fi` mcpp-expand.o: expand.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-expand.o `test -f 'expand.c' || echo '$(srcdir)/'`expand.c mcpp-expand.obj: expand.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-expand.obj `if test -f 'expand.c'; then $(CYGPATH_W) 'expand.c'; else $(CYGPATH_W) '$(srcdir)/expand.c'; fi` mcpp-mbchar.o: mbchar.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-mbchar.o `test -f 'mbchar.c' || echo '$(srcdir)/'`mbchar.c mcpp-mbchar.obj: mbchar.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-mbchar.obj `if test -f 'mbchar.c'; then $(CYGPATH_W) 'mbchar.c'; else $(CYGPATH_W) '$(srcdir)/mbchar.c'; fi` mcpp-support.o: support.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-support.o `test -f 'support.c' || echo '$(srcdir)/'`support.c mcpp-support.obj: support.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-support.obj `if test -f 'support.c'; then $(CYGPATH_W) 'support.c'; else $(CYGPATH_W) '$(srcdir)/support.c'; fi` mcpp-system.o: system.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-system.o `test -f 'system.c' || echo '$(srcdir)/'`system.c mcpp-system.obj: system.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-system.obj `if test -f 'system.c'; then $(CYGPATH_W) 'system.c'; else $(CYGPATH_W) '$(srcdir)/system.c'; fi` mcpp-main_libmcpp.o: main_libmcpp.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-main_libmcpp.o `test -f 'main_libmcpp.c' || echo '$(srcdir)/'`main_libmcpp.c mcpp-main_libmcpp.obj: main_libmcpp.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mcpp_CFLAGS) $(CFLAGS) -c -o mcpp-main_libmcpp.obj `if test -f 'main_libmcpp.c'; then $(CYGPATH_W) 'main_libmcpp.c'; else $(CYGPATH_W) '$(srcdir)/main_libmcpp.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) config.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cc1dir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @GNUC_FALSE@install-exec-hook: @REPLACE_CPP_FALSE@install-exec-hook: @GNUC_FALSE@uninstall-hook: @REPLACE_CPP_FALSE@uninstall-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-cc1PROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-cc1PROGRAMS install-includeHEADERS install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-cc1PROGRAMS \ uninstall-includeHEADERS uninstall-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-cc1PROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-cc1PROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-cc1PROGRAMS uninstall-hook uninstall-includeHEADERS \ uninstall-libLTLIBRARIES @MCPP_LIB_TRUE@main.lo directive.lo eval.lo expand.lo mbohar.lo support.lo system.lo \ @MCPP_LIB_TRUE@ : system.H internal.H mcpp_lib.h mcpp_out.h @MCPP_LIB_TRUE@system.H : configed.H @MCPP_LIB_FALSE@main.o directive.o eval.o expand.o mbohar.o support.o system.o : \ @MCPP_LIB_FALSE@ system.H internal.H mcpp_out.h @MCPP_LIB_FALSE@system.H : configed.H @GNUC_TRUE@@REPLACE_CPP_TRUE@install-exec-hook: @GNUC_TRUE@@REPLACE_CPP_TRUE@ @if test x"$(gcc_path)" = x""; then exit 1; fi @GNUC_TRUE@@REPLACE_CPP_TRUE@ @$(srcdir)/set_mcpp.sh '$(gcc_path)' $(gcc_maj_ver) $(gcc_min_ver) \ @GNUC_TRUE@@REPLACE_CPP_TRUE@ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(CPPFLAGS)' 'x$(EXEEXT)' \ @GNUC_TRUE@@REPLACE_CPP_TRUE@ '$(LN_S)' '$(inc_dir)' $(host_system) $(Target_Cpu) \ @GNUC_TRUE@@REPLACE_CPP_TRUE@ $(target_cc) @GNUC_TRUE@@REPLACE_CPP_TRUE@uninstall-hook: @GNUC_TRUE@@REPLACE_CPP_TRUE@ @$(srcdir)/unset_mcpp.sh '$(gcc_path)' $(gcc_maj_ver) $(gcc_min_ver)\ @GNUC_TRUE@@REPLACE_CPP_TRUE@ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(EXEEXT)' '$(LN_S)' \ @GNUC_TRUE@@REPLACE_CPP_TRUE@ '$(inc_dir)' $(host_system) $(target_cc) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mcpp-2.7.2/src/mcpp_lib.def0000644000175000017500000000017410600260236012433 00000000000000LIBRARY mcpp0 EXPORTS mcpp_lib_main mcpp_reset_def_out_func mcpp_set_out_func mcpp_use_mem_buffers mcpp_get_mem_buffer mcpp-2.7.2/src/expand.c0000644000175000017500000035670410767701141011637 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * E X P A N D . C * M a c r o E x p a n s i o n * * The macro expansion routines are placed here. */ #if PREPROCESSED #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif #define ARG_ERROR (-255) #define CERROR 1 #define CWARN 2 typedef struct location { /* Where macro or arg locate */ long start_line; /* Beginning at 1 */ size_t start_col; /* Beginning at 0 */ long end_line; size_t end_col; } LOCATION; typedef struct magic_seq { /* Data of a sequence inserted between tokens */ char * magic_start; /* First MAC_INF sequence */ char * magic_end; /* End of last MAC_INF seq */ int space; /* Space succeeds or not */ } MAGIC_SEQ; static int compat_mode; /* Expand recursive macro more than Standard (for compatibility with GNUC) */ #if COMPILER == GNUC static int ansi; /* __STRICT_ANSI__ flag */ #endif static char * expand_std( DEFBUF * defp, char * out, char * out_end , LINE_COL line_col, int * pragma_op); /* Expand a macro completely (for Standard modes) */ static char * expand_prestd( DEFBUF * defp, char * out, char * out_end , LINE_COL line_col, int * pragma_op); /* Expand a macro completely (for pre-Standard modes) */ static DEFBUF * is_macro_call( DEFBUF * defp, char ** cp, char ** endf , MAGIC_SEQ * mgc_seq); /* Is this really a macro call ? */ static int collect_args( const DEFBUF * defp, char ** arglist, int m_num); /* Collect arguments of a macro call*/ static int get_an_arg( int c, char ** argpp, char * arg_end , char ** seqp, int var_arg, int nargs, LOCATION ** locp, int m_num , MAGIC_SEQ * mgc_prefix); /* Get an argument */ static int squeeze_ws( char ** out, char ** endf, MAGIC_SEQ * mgc_seq); /* Squeeze white spaces to a space */ static void skip_macro( void); /* Skip the rest of macro call */ static void diag_macro( int severity, const char * format , const char * arg1, long arg2, const char * arg3, const DEFBUF * defp1 , const DEFBUF * defp2) ; /* Supplement diagnostic information*/ static void dump_args( const char * why, int nargs, const char ** arglist); /* Dump arguments list */ static int rescan_level; /* Times of macro rescan */ static const char * const macbuf_overflow = "Buffer overflow expanding macro \"%s\" at %.0ld\"%s\""; /* _E_ */ static const char * const empty_arg = "Empty argument in macro call \"%s\""; /* _W2_ */ static const char * const unterm_macro = "Unterminated macro call \"%s\""; /* _E_ */ static const char * const narg_error = "%s than necessary %ld argument(s) in macro call \"%s\""; /* _E_ _W1_ */ static const char * const only_name = "Macro \"%s\" needs arguments"; /* _W8_ */ void expand_init( int compat, /* "Compatible" to GNUC expansion of recursive macro*/ int strict_ansi /* __STRICT_ANSI__ flag for GNUC */ ) /* Set expand_macro() function */ { expand_macro = standard ? expand_std : expand_prestd; compat_mode = compat; #if COMPILER == GNUC ansi = strict_ansi; #endif } DEFBUF * is_macro( char ** cp ) /* * The name is already in 'identifier', the next token is not yet read. * Return the definition info if the name is a macro call, else return NULL. */ { DEFBUF * defp; if ((defp = look_id( identifier)) != NULL) /* Is a macro name */ return is_macro_call( defp, cp, NULL, NULL); else return NULL; } static DEFBUF * is_macro_call( DEFBUF * defp, char ** cp, /* Pointer to output buffer */ char ** endf, /* Pointer to indicate end of infile buffer */ MAGIC_SEQ * mgc_seq /* Infs on MAC_INF sequences and space */ ) /* * Return DEFBUF if the defp->name is a macro call, else return NULL. */ { int c; if (defp->nargs >= 0 /* Function-like macro */ || defp->nargs == DEF_PRAGMA) { /* _Pragma() pseudo-macro */ c = squeeze_ws( cp, endf, mgc_seq); /* See the next char. */ if (c == CHAR_EOF) /* End of file */ unget_string( "\n", NULL); /* Restore skipped '\n' */ else if (! standard || c != RT_END) /* Still in the file and rescan boundary ? */ unget_ch(); /* To see it again */ if (c != '(') { /* Only the name of function-like macro */ if (! standard && warn_level & 8) cwarn( only_name, defp->name, 0L, NULL); return NULL; } } return defp; /* Really a macro call */ } /* * expand_macro() expands a macro call completely, and writes out the result * to the specified output buffer and returns the advanced pointer. */ /* * T h e S T A N D A R D C o n f o r m i n g M o d e * o f M a c r o E x p a n s i o n * * 1998/08 First released. kmatsui */ /* For debug of -K option: should be turned off on release version. */ #define DEBUG_MACRO_ANN FALSE /* Return value of is_able_repl() */ #define NO 0 /* "Blue-painted" */ #define YES 1 /* Not blue-painted */ #define READ_OVER 2 /* Still "blue-painted", yet has read over repl-list */ /* * Macros related to macro notification mode. * The macro notification routines are hacks on the normal processing * routines, and very complicated and cumbersome. Be sure to keep symmetry * of starting and closing magic sequences. Enable the routines enclosed * by #if 0 - #endif for debugging. * Any byte in the sequences beginning with MAC_INF can coincide with any * other character. Hence, the data stream should be read from the top, * not from the tail, in principle. */ /* Length of sequence of MAC_INF, MAC_CALL_START, mac_num-1, mac_num-2 */ #define MAC_S_LEN 4 /* Length of sequence of MAC_INF, MAC_ARG_START, mac_num1, mac_num2, arg-num*/ #define ARG_S_LEN 5 #define MAC_E_LEN 2 /* Length of MAC_INF, MAC_CALL_END sequence */ #define ARG_E_LEN MAC_E_LEN /* Lenght of MAC_INF, MAC_ARG_END sequence */ #define MAC_E_LEN_V 4 /* Length of macro closing sequence in verbose mode */ /* MAC_INF, MAC_CALL_END, mac_num1, mac_num2 */ #define ARG_E_LEN_V 5 /* Length of argument closing sequence in verbose */ /* MAC_INF, MAC_ARG_END, mac_num1, mac_num2, arg_num */ #define IN_SRC_LEN 3 /* Length of sequence of IN_SRC, num-1, num-2 */ #define INIT_MAC_INF 0x100 /* Initial num of elements in mac_inf[] */ #define MAX_MAC_INF 0x1000 /* Maximum num of elements in mac_inf[] */ #define INIT_IN_SRC_NUM 0x100 /* Initial num of elements in in_src[] */ #define MAX_IN_SRC_NUM 0x1000 /* Maximum num of elements in in_src[] */ /* Variables for macro notification mode */ typedef struct macro_inf { /* Informations of a macro */ const DEFBUF * defp; /* Definition of the macro */ char * args; /* Arguments, if any */ int num_args; /* Number of real arguments */ int recur; /* Recurrence of this macro */ LOCATION locs; /* Location of macro call */ LOCATION * loc_args; /* Location of arguments */ } MACRO_INF; static MACRO_INF * mac_inf; static int max_mac_num; /* Current num of elements in mac_inf[] */ static int mac_num; /* Index into mac_inf[] */ static LOCATION * in_src; /* Location of identifiers in macro arguments */ static int max_in_src_num; /* Current num of elements in in_src[] */ static int in_src_num; /* Index into in_src[] */ static int trace_macro; /* Enable to trace macro infs */ static struct { const DEFBUF * def; /* Macro definition */ int read_over; /* Has read over repl-list */ /* 'read_over' is never used in POST_STD mode and in compat_mode*/ } replacing[ RESCAN_LIMIT]; /* Macros currently replacing */ static int has_pragma = FALSE; /* Flag of _Pragma() operator */ static int print_macro_inf( int c, char ** cpp, char ** opp); /* Embed macro infs into comments */ static char * print_macro_arg( char *out, MACRO_INF * m_inf, int argn , int real_arg, int start); /* Embed macro arg inf into comments*/ static char * chk_magic_balance( char * buf, char * buf_end, int move , int diag); /* Check imbalance of magics */ static char * replace( DEFBUF * defp, char * out, char * out_end , const DEFBUF * outer, FILEINFO * rt_file, LINE_COL line_col , int in_src_n); /* Replace a macro recursively */ static char * close_macro_inf( char * out_p, int m_num, int in_src_n); /* Put closing mark for a macro call*/ static DEFBUF * def_special( DEFBUF * defp); /* Re-define __LINE__, __FILE__ */ static int prescan( const DEFBUF * defp, const char ** arglist , char * out, char * out_end); /* Process #, ## operator */ static char * catenate( const DEFBUF * defp, const char ** arglist , char * out, char * out_end, char ** token_p); /* Catenate tokens */ static const char * remove_magics( const char * argp, int from_last); /* Remove pair of magic characters */ #if DEBUG_MACRO_ANN static void chk_symmetry( char * start_id, char * end_id, size_t len); /* Check if a pair of magics are symmetrical */ #endif static char * stringize( const DEFBUF * defp, const char * argp, char * out); /* Stringize an argument */ static char * substitute( const DEFBUF * defp, const char ** arglist , const char * in, char * out, char * out_end); /* Substitute parms with arguments */ static char * rescan( const DEFBUF * outer, const char * in, char * out , char * out_end); /* Rescan once replaced sequences */ static int disable_repl( const DEFBUF * defp); /* Disable the macro once replaced */ static void enable_repl( const DEFBUF * defp, int done); /* Enable the macro for later use */ static int is_able_repl( const DEFBUF * defp); /* Is the macro allowed to replace? */ static char * insert_to_bptr( char * ins, size_t len); /* Insert a sequence into infile->bptr */ static char * expand_std( DEFBUF * defp, /* Macro definition */ char * out, /* Output buffer */ char * out_end, /* End of output buffer */ LINE_COL line_col, /* Location of macro */ int * pragma_op /* _Pragma() is found ? */ ) /* * Expand a macro call completely, write the results to the specified buffer * and return the advanced output pointer. */ { char macrobuf[ NMACWORK + IDMAX]; /* Buffer for replace() */ char * out_p = out; size_t len; int c, c1; char * cp; has_pragma = FALSE; /* Have to re-initialize*/ macro_line = src_line; /* Line number for diag */ macro_name = defp->name; rescan_level = 0; trace_macro = (mcpp_mode == STD) && (mcpp_debug & MACRO_CALL) && ! in_directive; if (trace_macro) { max_mac_num = INIT_MAC_INF; mac_inf = (MACRO_INF *) xmalloc( sizeof (MACRO_INF) * max_mac_num); memset( mac_inf, 0, sizeof (MACRO_INF) * max_mac_num); max_in_src_num = INIT_IN_SRC_NUM; in_src = (LOCATION *) xmalloc( sizeof (LOCATION) * max_in_src_num); memset( in_src, 0, sizeof (LOCATION) * max_in_src_num); mac_num = in_src_num = 0; /* Initialize */ } if (replace( defp, macrobuf, macrobuf + NMACWORK, NULL, infile, line_col , 0) == NULL) { /* Illegal macro call */ skip_macro(); macro_line = MACRO_ERROR; goto exp_end; } len = (size_t) (out_end - out); if (strlen( macrobuf) > len) { cerror( macbuf_overflow, macro_name, 0, macrobuf); memcpy( out, macrobuf, len); out_p = out + len; macro_line = MACRO_ERROR; goto exp_end; } #if DEBUG_MACRO_ANN chk_magic_balance( macrobuf, macrobuf + strlen( macrobuf), FALSE, TRUE); #endif cp = macrobuf; c1 = '\0'; /* The char previous to 'c' */ while ((c = *cp++) != EOS) { if (c == DEF_MAGIC) continue; /* Skip DEF_MAGIC */ if (mcpp_mode == STD) { if (c == IN_SRC) { /* Skip IN_SRC */ if (trace_macro) cp += 2; /* Skip also the number (coded in 2 bytes) */ continue; } else if (c == TOK_SEP) { /* Remove redundant token separator */ if ((char_type[ c1 & UCHARMAX] & HSP) || (char_type[ *cp & UCHARMAX] & HSP) || in_include || option_flags.lang_asm || (*cp == MAC_INF && *(cp + 1) == MAC_CALL_END) || (!option_flags.v && c1 == MAC_CALL_END) || (option_flags.v && *(cp - MAC_E_LEN_V - 1) == MAC_INF && *(cp - MAC_E_LEN_V) == MAC_CALL_END)) continue; /* Skip separator just after ' ', '\t' */ /* and just after MAC_CALL_END. */ /* Also skip this in lang_asm mode, #include */ /* Skip just before another TOK_SEP, ' ', '\t' */ /* Skip just before MAC_INF,MAC_CALL_END seq too*/ else c = ' '; /* Else convert to ' ' */ } else if (trace_macro && (c == MAC_INF)) { /* Embed macro expansion informations into comments */ c = *cp++; c1 = print_macro_inf( c, &cp, &out_p); if (out_end <= out_p) { cerror( macbuf_overflow, macro_name, 0, out); macro_line = MACRO_ERROR; goto exp_end; } continue; } } *out_p++ = c1 = c; } macro_line = 0; exp_end: *out_p = EOS; if (mcpp_debug & EXPAND) dump_string( "expand_std exit", out); macro_name = NULL; clear_exp_mac(); /* Clear the information for diagnostic */ if (trace_macro) { /* Clear macro informations */ int num; for (num = 1; num < mac_num; num++) { /* 'num' start at 1 */ if (mac_inf[ num].num_args >= 0) { /* Macro with args */ free( mac_inf[ num].args); /* Saved arguments */ free( mac_inf[ num].loc_args); /* Location of args */ } } free( mac_inf); free( in_src); } *pragma_op = has_pragma; return out_p; } static int print_macro_inf( int c, char ** cpp, /* Magic character sequence */ char ** opp /* Output for macro information */ ) /* * Embed macro expansion information into comments. * Enabled by '#pragma MCPP debug macro_call' or -K option in STD mode. */ { MACRO_INF * m_inf; int num; int num_args; /* Number of actual args (maybe less than expected) */ int i; if (*((*opp) - 1) == '/' && *((*opp) - 2) != '*') /* Immediately preceding token is '/' (not '*' and '/') */ *((*opp)++) = ' '; /* Insert a space to separate with following '/' and '*' */ if (option_flags.v || c == MAC_CALL_START || c == MAC_ARG_START) { num = ((*(*cpp)++ & UCHARMAX) - 1) * UCHARMAX; num += (*(*cpp)++ & UCHARMAX) - 1; m_inf = & mac_inf[ num]; /* Saved information */ } switch (c) { case MAC_CALL_START : /* Start of a macro expansion */ *opp += sprintf( *opp, "/*<%s", m_inf->defp->name); /* Macro name */ if (m_inf->locs.start_line) { /* Location of the macro call in source file */ *opp += sprintf( *opp, " %ld:%d-%ld:%d" , m_inf->locs.start_line, (int) m_inf->locs.start_col , m_inf->locs.end_line, (int) m_inf->locs.end_col); } *opp = stpcpy( *opp, "*/"); if ((num_args = m_inf->num_args) >= 1) { /* The macro has arguments. Show the locations. */ for (i = 0; i < num_args; i++) /* Arg num begins at 0 */ *opp = print_macro_arg( *opp, m_inf, i, TRUE, TRUE); } break; case MAC_ARG_START : /* Start of an argument */ i = (*(*cpp)++ & UCHARMAX) - 1; /* Argument number */ *opp = print_macro_arg( *opp, m_inf, i, FALSE, TRUE); break; case MAC_CALL_END : /* End of a macro expansion */ if (option_flags.v) { /* Verbose mode */ *opp += sprintf( *opp, "/*%s>*/", m_inf->defp->name); break; } /* Else fall through */ case MAC_ARG_END : /* End of an argument */ if (option_flags.v) { i = (*(*cpp)++ & UCHARMAX) - 1; /* Output verbose infs symmetrical to start of the arg infs */ *opp = print_macro_arg( *opp, m_inf, i, FALSE, FALSE); } else { *opp = stpcpy( *opp, "/*>*/"); } break; } return **cpp & UCHARMAX; } static char * print_macro_arg( char * out, /* Output buffer */ MACRO_INF * m_inf, /* &mac_inf[ m_num] */ int argn, /* Argument number */ int real_arg, /* Real argument or expanded argument ? */ int start /* Start of an argument or end ? */ ) /* * Embed an argument information into a comment. * This routine is only called from above print_macro_inf(). */ { LOCATION * loc = m_inf->loc_args + argn; out += sprintf( out, "/*%s%s:%d-%d", real_arg ? "!" : (start ? "<" : "") , m_inf->defp->name, m_inf->recur, argn); if (real_arg && m_inf->loc_args && loc->start_line) { /* Location of the argument in source file */ out += sprintf( out, " %ld:%d-%ld:%d", loc->start_line , (int) loc->start_col, loc->end_line, (int) loc->end_col); } if (! start) /* End of an argument in verbose mode */ out = stpcpy( out, ">"); out = stpcpy( out, "*/"); return out; } static char * chk_magic_balance( char * buf, /* Sequence to check */ char * buf_end, /* End of the sequence */ int move, /* Move a straying magic ? */ int diag /* Output a diagnostic? */ ) /* * Check imbalance of macro information magics and warn it. * get_an_arg() calls this routine setting 'move' argument on, hence a stray * magic is moved to an edge if found. * This routine does not do token parsing. Yet it will do fine practically. */ { #define MAX_NEST_MAGICS 255 char mac_id[ MAX_NEST_MAGICS][ MAC_E_LEN_V - 2]; char arg_id[ MAX_NEST_MAGICS][ ARG_E_LEN_V - 2]; char * mac_loc[ MAX_NEST_MAGICS]; char * arg_loc[ MAX_NEST_MAGICS]; char * mesg = "%s %ld %s-closing-comment(s) in tracing macro"; int mac, arg; int mac_s_n, mac_e_n, arg_s_n, arg_e_n; char * buf_p = buf; /* Save 'buf' for debugging purpose */ mac = arg = 0; while (buf_p < buf_end) { if (*buf_p++ != MAC_INF) continue; switch (*buf_p++) { case MAC_CALL_START : if (option_flags.v) { mac_loc[ mac] = buf_p - 2; memcpy( mac_id[ mac], buf_p, MAC_S_LEN - 2); } mac++; buf_p += MAC_S_LEN - 2; break; case MAC_ARG_START : if (option_flags.v) { arg_loc[ arg] = buf_p - 2; memcpy( arg_id[ arg], buf_p, ARG_S_LEN - 2); } arg++; buf_p += ARG_S_LEN - 2; break; case MAC_ARG_END : arg--; if (option_flags.v) { if (arg < 0) { /* Perhaps moved magic */ if (diag) cwarn( mesg, "Redundant", (long) -arg, "argument"); } else if (memcmp( arg_id[ arg], buf_p, ARG_E_LEN_V - 2) != 0) { char * to_be_edge = NULL; char * cur_edge; if (arg >= 1 && memcmp( arg_id[ 0], buf_p, ARG_E_LEN_V - 2) == 0) { to_be_edge = arg_loc[ arg]; /* To be moved to top */ cur_edge = arg_loc[ 0]; /* Current top */ } else if (arg == 0) { char arg_end_magic[ 2] = { MAC_INF, MAC_ARG_END}; cur_edge = buf_end - ARG_E_LEN_V; /* Search the last magic */ /* Sequence from get_an_arg() is always */ /* surrounded by starting of an arg magic */ /* and its corresponding closing magic. */ while (buf_p + (ARG_E_LEN_V - 2) <= cur_edge && memcmp( cur_edge, arg_end_magic, 2) != 0) cur_edge--; if (buf_p + (ARG_E_LEN_V - 2) <= cur_edge && memcmp( arg_id[ 0], cur_edge + 2 , ARG_E_LEN_V - 2) == 0) { to_be_edge = buf_p - 2; /* To be moved to end */ } } if (to_be_edge) { /* Appropriate place found */ if (diag) { mac_s_n = ((to_be_edge[ 2] & UCHARMAX) - 1) * UCHARMAX; mac_s_n += (to_be_edge[ 3] & UCHARMAX) - 1; arg_s_n = (to_be_edge[ 4] & UCHARMAX) - 1; mcpp_fprintf( ERR, "Stray arg inf of macro: %d:%d at line:%d\n" , mac_s_n, arg_s_n, src_line); } if (move) { /* Move a stray magic to outside of sequences */ char magic[ ARG_E_LEN_V]; size_t len = ARG_E_LEN_V; memcpy( magic, cur_edge, len); /* Save current edge */ if (to_be_edge == arg_loc[ arg]) /* Shift followings to cur_edge */ memmove( cur_edge, cur_edge + len , to_be_edge - cur_edge); else /* Shift precedents to cur_edge */ memmove( to_be_edge + len, to_be_edge , cur_edge - to_be_edge); memcpy( to_be_edge, magic, len); /* Restore old 'cur_edge' into old 'to_be_edge' */ } } else { /* Serious imbalance, just warn */ char * arg_p = arg_id[ arg]; arg_s_n = ((arg_p[ 0] & UCHARMAX) - 1) * UCHARMAX; arg_s_n += (arg_p[ 1] & UCHARMAX) - 1; arg_e_n = ((buf_p[ 0] & UCHARMAX) - 1) * UCHARMAX; arg_e_n += (buf_p[ 1] & UCHARMAX) - 1; mcpp_fprintf( ERR, "Asymmetry of arg inf found: start %d, end %d at line:%d\n" , arg_s_n, arg_e_n, src_line); } } buf_p += ARG_E_LEN_V - 2; } break; case MAC_CALL_END : mac--; if (option_flags.v) { if (mac < 0) { if (diag) cwarn( mesg, "Redundant", (long) -mac, "macro"); } else if (memcmp( mac_id[ mac], buf_p, MAC_E_LEN_V - 2) != 0) { char * mac_p = mac_id[ mac]; mac_s_n = ((mac_p[ 0] & UCHARMAX) - 1) * UCHARMAX; mac_s_n += (mac_p[ 1] & UCHARMAX) - 1; mac_e_n = ((buf_p[ 0] & UCHARMAX) - 1) * UCHARMAX; mac_e_n += (buf_p[ 1] & UCHARMAX) - 1; mcpp_fprintf( ERR, "Asymmetry of macro inf found: start %d, end %d at line:%d\n" , mac_s_n, mac_e_n, src_line); } buf_p += MAC_E_LEN_V - 2; } break; default : /* Not a MAC_INF sequence */ break; /* Continue */ } } if (diag && (warn_level & 1)) { if (mac > 0) cwarn( mesg, "Lacking", (long) mac, "macro"); if (arg > 0) cwarn( mesg, "Lacking", (long) arg, "argument"); if ((mac || arg) && (mcpp_debug & EXPAND)) mcpp_fputs( "Imbalance of magics occurred (perhaps a moved magic), see and diagnostics.\n" , DBG); } return buf; } static char * replace( DEFBUF * defp, /* Macro to be replaced */ char * out, /* Output Buffer */ char * out_end, /* End of output buffer */ const DEFBUF * outer, /* Outer macro replacing*/ FILEINFO * rt_file, /* Repl-text "file" */ LINE_COL line_col, /* Location of macro */ int in_src_n /* Index into in_src[] */ ) /* * Replace a possibly nested macro recursively. * replace() and rescan() call each other recursively. * Return the advanced output pointer or NULL on error. */ { char ** arglist = NULL; /* Pointers to arguments*/ int nargs; /* Number of arguments expected */ char * catbuf; /* Buffer for prescan() */ char * expbuf; /* Buffer for substitute() */ char * out_p; /* Output pointer */ char * cur_out = out; /* One more output pointer */ int num_args; /* Number of actual arguments (maybe less than expected) */ int enable_trace_macro; /* To exclude _Pragma() pseudo macro */ int m_num = 0; /* 'mac_num' of current macro */ MACRO_INF * m_inf; /* Pointer into mac_inf[] */ if (mcpp_debug & EXPAND) { dump_a_def( "replace entry", defp, FALSE, TRUE, fp_debug); dump_unget( "replace entry"); } if ((mcpp_debug & MACRO_CALL) && in_if) mcpp_fprintf( OUT, "/*%s*/", defp->name); enable_trace_macro = trace_macro && defp->nargs != DEF_PRAGMA; if (enable_trace_macro) { int num; int recurs; if (mac_num >= MAX_MAC_INF - 1) { cerror( "Too many nested macros in tracing %s" /* _E_ */ , defp->name, 0L, NULL); return NULL; } else if (mac_num >= max_mac_num - 1) { size_t len = sizeof (MACRO_INF) * max_mac_num; /* Enlarge the array */ mac_inf = (MACRO_INF *) xrealloc( (char *) mac_inf, len * 2); memset( mac_inf + max_mac_num, 0, len); /* Clear the latter half */ max_mac_num *= 2; } m_num = ++mac_num; /* Remember this number */ /* Note 'mac_num' starts at 1 */ *cur_out++ = MAC_INF; /* Embed a magic char */ *cur_out++ = MAC_CALL_START; /* A macro call */ /* Its index number, can be greater than UCHARMAX */ /* We represent the number by 2 bytes where each byte is not '\0' */ *cur_out++ = (m_num / UCHARMAX) + 1; *cur_out++ = (m_num % UCHARMAX) + 1; *cur_out = EOS; m_inf = & mac_inf[ m_num]; m_inf->defp = defp; /* The macro definition */ m_inf->num_args = 0; /* Default num of args */ if (line_col.line) { get_src_location( & line_col); m_inf->locs.start_line = line_col.line; m_inf->locs.start_col = line_col.col; } else { m_inf->locs.start_col = m_inf->locs.start_line = 0L; } m_inf->args = m_inf->loc_args = NULL; /* Default args */ for (num = 1, recurs = 0; num < m_num; num++) if (mac_inf[ num].defp == defp) recurs++; /* Recursively nested macro */ m_inf->recur = recurs; } nargs = (defp->nargs == DEF_PRAGMA) ? 1 : (defp->nargs & ~AVA_ARGS); if (nargs < DEF_NOARGS_DYNAMIC) { /* __FILE__, __LINE__ */ defp = def_special( defp); /* These are redefined dynamically */ if (mcpp_mode == STD) { /* Wrap repl-text with token separators to prevent token merging */ *cur_out++ = TOK_SEP; cur_out = stpcpy( cur_out, defp->repl); *cur_out++ = TOK_SEP; *cur_out = EOS; } else { cur_out = stpcpy( cur_out, defp->repl); } if (enable_trace_macro) { m_inf->defp = defp; /* Redefined dynamically*/ cur_out = close_macro_inf( cur_out, m_num, in_src_n); } return cur_out; } else if (nargs == DEF_NOARGS_PREDEF_OLD && standard && (warn_level & 1)) { /* Some macros on GCC */ cwarn( "Old style predefined macro \"%s\" is used", /* _W2_ */ defp->name, 0L, NULL); } else if (nargs >= 0) { /* Function-like macro */ squeeze_ws( NULL, NULL, NULL); /* Skip to '(' */ /* Magic sequences are already read over by is_macro_call() */ arglist = (char **) xmalloc( (nargs + 1) * sizeof (char *)); arglist[ 0] = xmalloc( (size_t) (NMACWORK + IDMAX * 2)); /* Note: arglist[ n] may be reallocated */ /* and re-written by collect_args() */ if ((num_args = collect_args( defp, arglist, m_num)) == ARG_ERROR) { free( arglist[ 0]); /* Syntax error */ free( arglist); return NULL; } if (enable_trace_macro) { /* Save the arglist for later informations */ m_inf->args = arglist[ 0]; m_inf->num_args = num_args; /* Number of actual args*/ } if (mcpp_mode == STD && outer && rt_file != infile) { /* Has read over replacement-text */ if (compat_mode) { enable_repl( outer, FALSE); /* Enable re-expansion */ if (mcpp_debug & EXPAND) dump_string( "enabled re-expansion" , outer ? outer->name : ""); } else { replacing[ rescan_level-1].read_over = READ_OVER; } } } catbuf = xmalloc( (size_t) (NMACWORK + IDMAX)); if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, "(%s)", defp->name); dump_string( "prescan entry", defp->repl); } if (prescan( defp, (const char **) arglist, catbuf, catbuf + NMACWORK) == FALSE) { /* Process #, ## operators */ diag_macro( CERROR, macbuf_overflow, defp->name, 0L, catbuf, defp , NULL); if (nargs >= 0) { if (! enable_trace_macro) /* arglist[0] is needed for macro infs */ free( arglist[ 0]); free( arglist); } free( catbuf); return NULL; } catbuf = xrealloc( catbuf, strlen( catbuf) + 1); /* Use memory sparingly */ if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, "(%s)", defp->name); dump_string( "prescan exit", catbuf); } if (nargs > 0) { /* Function-like macro with any argument */ expbuf = xmalloc( (size_t) (NMACWORK + IDMAX)); if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, "(%s)", defp->name); dump_string( "substitute entry", catbuf); } out_p = substitute( defp, (const char **) arglist, catbuf, expbuf , expbuf + NMACWORK); /* Expand each arguments */ if (! enable_trace_macro) free( arglist[ 0]); free( arglist); free( catbuf); expbuf = xrealloc( expbuf, strlen( expbuf) + 1); /* Use memory sparingly */ if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, "(%s)", defp->name); dump_string( "substitute exit", expbuf); } } else { /* Object-like macro or */ if (nargs == 0 && ! enable_trace_macro) /* Function-like macro with no argument */ free( arglist[ 0]); free( arglist); out_p = expbuf = catbuf; } if (out_p) out_p = rescan( defp, expbuf, cur_out, out_end); if (out_p && defp->nargs == DEF_PRAGMA) has_pragma = TRUE; /* Inform mcpp_main() that _Pragma() was found */ free( expbuf); if (enable_trace_macro && out_p) out_p = close_macro_inf( out_p, m_num, in_src_n); if (mcpp_debug & EXPAND) dump_string( "replace exit", out); if (trace_macro && defp->nargs == DEF_PRAGMA) { /* Remove intervening magics if the macro is _Pragma pseudo-macro */ /* These magics have been inserted by macros in _Pragma()'s args */ int c; cur_out = out_p = out; while ((c = *cur_out++) != EOS) { if (c == MAC_INF) { if (! option_flags.v) { switch (*cur_out) { case MAC_ARG_START : cur_out++; /* Fall through */ case MAC_CALL_START : cur_out++; cur_out++; /* Fall through */ default: cur_out++; break; } } else { switch (*cur_out) { case MAC_ARG_START : case MAC_ARG_END : cur_out++; /* Fall through */ default: cur_out += 3; break; } } } else { *out_p++ = c; } } *out_p = EOS; } return out_p; } static char * close_macro_inf( char * out_p, /* Current output pointer */ int m_num, /* 'mac_num' of this macro */ int in_src_n /* Location of macro in arg */ ) /* * Mark up closing of a macro expansion. * Note that 'm_num' argument is necessary rather than 'm_inf' from replace(), * because mac_inf[] may have been reallocated while rescanning. */ { MACRO_INF * m_inf; LINE_COL e_line_col; m_inf = & mac_inf[ m_num]; *out_p++ = MAC_INF; /* Magic for end of macro expansion */ *out_p++ = MAC_CALL_END; if (option_flags.v) { *out_p++ = (m_num / UCHARMAX) + 1; *out_p++ = (m_num % UCHARMAX) + 1; } *out_p = EOS; get_ch(); /* Clear the garbage */ unget_ch(); if (infile->fp || in_src_n) { if (infile->fp) { /* Macro call on source file */ e_line_col.line = src_line; e_line_col.col = infile->bptr - infile->buffer; } else { /* Macro in argument of parent macro and from source */ e_line_col.line = in_src[ in_src_n].end_line; e_line_col.col = in_src[ in_src_n].end_col; } /* Get the location before line splicing by */ /* or by a line-crossing comment */ get_src_location( & e_line_col); m_inf->locs.end_line = e_line_col.line; m_inf->locs.end_col = e_line_col.col; } else { m_inf->locs.end_col = m_inf->locs.end_line = 0L; } return out_p; } static DEFBUF * def_special( DEFBUF * defp /* Macro definition */ ) /* * Re-define __LINE__, __FILE__. * Return the new definition. */ { const FILEINFO * file; DEFBUF ** prevp; int cmp; switch (defp->nargs) { case DEF_NOARGS_DYNAMIC - 1: /* __LINE__ */ if ((src_line > std_limits.line_num || src_line <= 0) && (warn_level & 1)) diag_macro( CWARN , "Line number %.0s\"%ld\" is out of range" /* _W1_ */ , NULL, src_line, NULL, defp, NULL); sprintf( defp->repl, "%ld", src_line); /* Re-define */ break; case DEF_NOARGS_DYNAMIC - 2: /* __FILE__ */ for (file = infile; file != NULL; file = file->parent) { if (file->fp != NULL) { sprintf( work_buf, "\"%s\"", file->filename); if (str_eq( work_buf, defp->repl)) break; /* No change */ defp->nargs = DEF_NOARGS; /* Enable to redefine */ prevp = look_prev( defp->name, &cmp); defp = install_macro( "__FILE__", DEF_NOARGS_DYNAMIC - 2, "" , work_buf, prevp, cmp, 0); /* Re-define */ break; } } break; } return defp; } static int prescan( const DEFBUF * defp, /* Definition of the macro */ const char ** arglist, /* Pointers to actual arguments */ char * out, /* Output buffer */ char * out_end /* End of output buffer */ ) /* * Concatenate the tokens surounding ## by catenate(), and stringize the * argument following # by stringize(). */ { FILEINFO * file; char * prev_token = NULL; /* Preceding token */ char * horiz_space = NULL; /* Horizontal white space */ int c; /* Value of a character */ /* * The replacement lists are -- * stuff1stuff2 * or stuff1stuff2stuff3... * where is CAT, maybe with preceding space and following space, * stuff might be * ordinary-token * MAC_PARM * or MAC_PARM * where is ST_QUO, possibly with following space. * * DEF_MAGIC may has been inserted sometimes. * In other than POST_STD modes, TOK_SEP and IN_SRC may have been * inserted, and TOK_SEPs are inserted also in this routine. * In trace_macro mode, many magic character sequences may have been * inserted here and there. */ if (mcpp_mode == POST_STD) { file = unget_string( defp->repl, defp->name); } else { *out++ = TOK_SEP; /* Wrap replacement */ workp = work_buf; /* text with token */ workp = stpcpy( workp, defp->repl); /* separators to */ *workp++ = TOK_SEP; /* prevent unintended*/ *workp = EOS; /* token merging. */ file = unget_string( work_buf, defp->name); } while (c = get_ch(), file == infile) { /* To the end of repl */ switch (c) { case ST_QUOTE: skip_ws(); /* Skip spaces and the returned MAC_PARM*/ c = get_ch() - 1; /* Parameter number */ prev_token = out; /* Remember the token */ out = stringize( defp, arglist[ c], out); /* Stringize without expansion */ horiz_space = NULL; break; case CAT: if (*prev_token == DEF_MAGIC || *prev_token == IN_SRC) { /* Rare case yet possible after catenate() */ size_t len = 1; /* Remove trailing white space prior to removing DEF_MAGIC */ if (horiz_space == out - 1) { *--out = EOS; horiz_space = NULL; } if (*prev_token == IN_SRC && trace_macro) len = IN_SRC_LEN; memmove( prev_token, prev_token + len , strlen( prev_token + len)); out -= len; *out = EOS; /* Remove DEF_MAGIC, IN_SRC */ } #if COMPILER == GNUC if (*prev_token == ',') break; /* ', ##' sequence (peculiar to GCC) */ #endif if (horiz_space == out - 1) { *--out = EOS; /* Remove trailing white space */ horiz_space = NULL; } out = catenate( defp, arglist, out, out_end, &prev_token); if (char_type[ *(out - 1) & UCHARMAX] & HSP) horiz_space = out - 1; /* TOK_SEP has been appended */ break; case MAC_PARM: prev_token = out; *out++ = MAC_PARM; *out++ = get_ch(); /* Parameter number */ break; case TOK_SEP: case ' ': case '\t' : if (out - 1 == horiz_space) continue; /* Squeeze white spaces */ horiz_space = out; *out++ = c; break; default: prev_token = out; scan_token( c, &out, out_end); /* Ordinary token */ break; } *out = EOS; /* Ensure termination */ if (out_end <= out) /* Buffer overflow */ return FALSE; } *out = EOS; /* Ensure terminatation in case of no token */ unget_ch(); return TRUE; } static char * catenate( const DEFBUF * defp, /* The macro definition */ const char ** arglist, /* Pointers to actual arguments */ char * out, /* Output buffer */ char * out_end, /* End of output buffer */ char ** token_p /* Address of preceding token pointer */ ) /* * Concatenate the previous and the following tokens. * Note: The parameter codes may coincide with white spaces or any * other characters. */ { FILEINFO * file; char * prev_prev_token = NULL; const char * invalid_token = "Not a valid preprocessing token \"%s\""; /* _E_ _W2_ */ const char * argp; /* Pointer to an actual argument*/ char * prev_token = *token_p; /* Preceding token */ int in_arg = FALSE; int c; /* Value of a character */ /* Get the previous token */ if (*prev_token == MAC_PARM) { /* Formal parameter */ c = (*(prev_token + 1) & UCHARMAX) - 1; /* Parm number */ argp = arglist[ c]; /* Actual argument */ out = prev_token; /* To overwrite */ if (trace_macro) argp = remove_magics( argp, TRUE); /* Remove pair of magics */ if ((mcpp_mode == POST_STD && *argp == EOS) || (mcpp_mode == STD && *argp == RT_END)) { *out = EOS; /* An empty argument */ } else { if (mcpp_mode == POST_STD) { file = unget_string( argp, NULL); while (c = get_ch(), file == infile) { prev_token = out; /* Remember the last token */ scan_token( c, &out, out_end); } /* Copy actual argument without expansion */ unget_ch(); } else { unget_string( argp, NULL); if (trace_macro) free( (char *) argp); /* malloc()ed in remove_magics() */ while ((c = get_ch()) != RT_END) { prev_prev_token = prev_token; prev_token = out; /* Remember the last token */ scan_token( c, &out, out_end); } /* Copy actual argument without expansion */ if (*prev_token == TOK_SEP) { out = prev_token; prev_token = prev_prev_token; /* Skip separator */ } } if (*prev_token == DEF_MAGIC || (mcpp_mode == STD && *prev_token == IN_SRC)) { size_t len = 1; if (trace_macro && *prev_token == IN_SRC) len = IN_SRC_LEN; memmove( prev_token, prev_token + len , (size_t) ((out -= len) - prev_token)); /* Remove DEF_MAGIC enabling the name to replace later */ } } } /* Else the previous token is an ordinary token, not an argument */ c = skip_ws(); /* Catenate */ switch (c) { case ST_QUOTE: /* First stringize and then catenate */ skip_ws(); /* Skip MAC_PARM, ST_QUOTE */ c = get_ch() - 1; out = stringize( defp, arglist[ c], out); break; case MAC_PARM: c = get_ch() - 1; /* Parameter number */ argp = arglist[ c]; /* Actual argument */ if (trace_macro) argp = remove_magics( argp, FALSE); /* Remove pair of magics */ if ((mcpp_mode == POST_STD && *argp == EOS) || (mcpp_mode == STD && *argp == RT_END)) { *out = EOS; /* An empty argument */ } else { unget_string( argp, NULL); if (trace_macro) free( (char *) argp); if ((c = get_ch()) == DEF_MAGIC) { /* Remove DEF_MAGIC */ c = get_ch(); /* enabling to replace */ } else if (c == IN_SRC) { /* Remove IN_SRC */ if (trace_macro) { get_ch(); /* Also its number */ get_ch(); } c = get_ch(); } scan_token( c, &out, out_end); /* The first token */ if (*infile->bptr) /* There are more tokens*/ in_arg = TRUE; } break; case IN_SRC: if (trace_macro) { get_ch(); get_ch(); } /* Fall through */ case DEF_MAGIC: c = get_ch(); /* Skip DEF_MAGIC, IN_SRC */ /* Fall through */ default: scan_token( c, &out, out_end); /* Copy the token */ break; } /* The generated sequence is a valid preprocessing-token ? */ if (*prev_token) { /* There is any token */ unget_string( prev_token, NULL); /* Scan once more */ c = get_ch(); /* This line should be before the next line. */ infile->fp = (FILE *)-1; /* To check token length*/ if (mcpp_debug & EXPAND) dump_string( "checking generated token", infile->buffer); scan_token( c, (workp = work_buf, &workp), work_end); infile->fp = NULL; if (*infile->bptr != EOS) { /* More than a token */ if (option_flags.lang_asm) { /* Assembler source */ if (warn_level & 2) diag_macro( CWARN, invalid_token, prev_token, 0L, NULL , defp, NULL); } else { diag_macro( CERROR, invalid_token, prev_token, 0L, NULL, defp , NULL); } infile->bptr += strlen( infile->bptr); } get_ch(); /* To the parent "file" */ unget_ch(); } if (mcpp_mode == STD && ! option_flags.lang_asm) { *out++ = TOK_SEP; /* Prevent token merging*/ *out = EOS; } if (in_arg) { /* There are more tokens after the generated one */ if (mcpp_mode == POST_STD) { file = infile; while (c = get_ch(), file == infile) { prev_token = out; /* Remember the last token */ scan_token( c, &out, out_end); } /* Copy rest of argument without expansion */ unget_ch(); } else { while ((c = get_ch()) != RT_END) { if (c == TOK_SEP) continue; /* Skip separator */ prev_token = out; /* Remember the last token */ scan_token( c, &out, out_end); } /* Copy rest of argument without expansion */ } } *token_p = prev_token; /* Report back the last token */ return out; } static const char * remove_magics( const char * argp, /* The argument list */ int from_last /* token is the last or first? */ ) /* * Remove pair of magic character sequences in an argument in order to catenate * the last or first token to another. * Or remove pair of magic character sequences surrounding an argument in order * to keep symmetry of magics. */ { #define INIT_MAGICS 128 char (* mac_id)[ MAC_S_LEN]; char (* arg_id)[ ARG_S_LEN]; char ** mac_loc; char ** arg_loc; char * mgc_index; size_t max_magics; int mac_n, arg_n, ind, n; char * first = NULL; char * last = NULL; char * token; char * arg_p; char * ap; char * ep; char * tp; char * space = NULL; int with_rtend; int c; FILEINFO * file; mac_id = (char (*)[ MAC_S_LEN]) xmalloc( MAC_S_LEN * INIT_MAGICS); arg_id = (char (*)[ ARG_S_LEN]) xmalloc( ARG_S_LEN * INIT_MAGICS * 2); mac_loc = (char **) xmalloc( sizeof (char *) * INIT_MAGICS); arg_loc = (char **) xmalloc( sizeof (char *) * INIT_MAGICS * 2); mgc_index = xmalloc( INIT_MAGICS * 3); max_magics = INIT_MAGICS; mac_n = arg_n = ind = 0; ap = arg_p = xmalloc( strlen( argp) + 1); strcpy( arg_p, argp); ep = arg_p + strlen( arg_p); if (*(ep - 1) == RT_END) { with_rtend = TRUE; ep--; /* Point to RT_END */ } else { with_rtend = FALSE; } file = unget_string( arg_p, NULL); /* Stack to "file" for token parsing*/ /* Search all the magics in argument, as well as first and last token */ /* Read stacked arg_p and write it to arg_p as a dummy buffer */ while ((*ap++ = c = get_ch()) != RT_END && file == infile) { if (c == MAC_INF) { if (mac_n >= max_magics || arg_n >= max_magics * 2) { max_magics *= 2; mac_id = (char (*)[ MAC_S_LEN]) xrealloc( (void *) mac_id , MAC_S_LEN * max_magics); arg_id = (char (*)[ ARG_S_LEN]) xrealloc( (void *) arg_id , ARG_S_LEN * max_magics * 2); mac_loc = (char **) xrealloc( (void *) mac_loc , sizeof (char *) * max_magics); arg_loc = (char **) xrealloc( (void *) arg_loc , sizeof (char *) * max_magics * 2); mgc_index = xrealloc( mgc_index, max_magics * 3); } *ap++ = c = get_ch(); switch (c) { case MAC_CALL_START : *ap++ = get_ch(); *ap++ = get_ch(); mac_loc[ mac_n] = ap - MAC_S_LEN; /* Location of the seq */ memcpy( mac_id[ mac_n], ap - (MAC_S_LEN - 1), MAC_S_LEN - 1); /* Copy the sequence from its second byte */ mac_id[ mac_n++][ MAC_S_LEN - 1] = FALSE; /* Mark of to-be-removed or not */ break; case MAC_ARG_START : *ap++ = get_ch(); *ap++ = get_ch(); *ap++ = get_ch(); arg_loc[ arg_n] = ap - ARG_S_LEN; memcpy( arg_id[ arg_n], ap - (ARG_S_LEN - 1), ARG_S_LEN - 1); arg_id[ arg_n++][ ARG_S_LEN - 1] = FALSE; break; case MAC_CALL_END : mac_loc[ mac_n] = ap - MAC_E_LEN; mac_id[ mac_n][ 0] = c; mac_id[ mac_n++][ MAC_E_LEN_V - 1] = FALSE; break; case MAC_ARG_END : arg_loc[ arg_n] = ap - ARG_E_LEN; arg_id[ arg_n][ 0] = c; arg_id[ arg_n++][ ARG_E_LEN_V - 1] = FALSE; break; } if (option_flags.v) { switch (c) { case MAC_CALL_END : mac_id[ mac_n - 1][ 1] = *ap++ = get_ch(); mac_id[ mac_n - 1][ 2] = *ap++ = get_ch(); break; case MAC_ARG_END : arg_id[ arg_n - 1][ 1] = *ap++ = get_ch(); arg_id[ arg_n - 1][ 2] = *ap++ = get_ch(); arg_id[ arg_n - 1][ 3] = *ap++ = get_ch(); break; } } mgc_index[ ind++] = c; /* Index to mac_id[] and arg_id[] */ continue; } else if (char_type[ c & UCHARMAX] & HSP) { if (! first) { ap--; /* Skip white space on top of the argument */ ep--; } continue; } last = --ap; if (! first) first = ap; if (char_type[ c & UCHARMAX] & HSP) space = ap; /* Remember the last white space */ scan_token( c, &ap, ep); } if (file == infile) get_ch(); /* Clear the "file" */ unget_ch(); if (space == ep - 1) ep--; /* Remove trailing white space */ if (with_rtend) *ep++ = RT_END; *ep = EOS; if ((from_last && !last) || (!from_last && !first)) return arg_p; if (mac_n == 0 && arg_n == 0) /* No magic sequence */ return arg_p; token = from_last ? last : first; /* Remove pair of magics surrounding the last (or first) token */ if (mac_n) { /* Remove pair of macro magics surrounding the token */ int magic, mac_s, mac_e; int nest_s, nest_e; nest_s = 0; for (mac_s = 0; mac_loc[ mac_s] < token; mac_s++) { magic = mac_id[ mac_s][ 0]; if (magic == MAC_CALL_START) { /* Starting magic */ nest_e = ++nest_s; /* Search the corresponding closing magic */ for (mac_e = mac_s + 1; mac_e < mac_n; mac_e++) { magic = mac_id[ mac_e][ 0]; if (magic == MAC_CALL_START) { nest_e++; } else { /* MAC_CALL_END: Closing magic */ nest_e--; /* Search after the token */ if (token < mac_loc[ mac_e] && nest_e == nest_s - 1) { #if DEBUG_MACRO_ANN if (option_flags.v) chk_symmetry( mac_id[ mac_s], mac_id[ mac_e] , MAC_E_LEN - 2); #endif mac_id[ mac_e][ MAC_S_LEN - 1] = TRUE; /* To be removed */ break; /* Done for this mac_s */ } } } if (mac_e < mac_n) /* Found corresponding magic */ mac_id[ mac_s][ MAC_S_LEN - 1] = TRUE; /* To be removed*/ else /* Not found */ break; } else { nest_s--; /* MAC_CALL_END: Closing magic */ } } } if (arg_n) { /* Remove pair of arg magics surrounding the token */ int magic, arg_s, arg_e; int nest_s, nest_e; nest_s = 0; for (arg_s = 0; arg_loc[ arg_s] < token; arg_s++) { magic = arg_id[ arg_s][ 0]; if (magic == MAC_ARG_START) { nest_e = ++nest_s; for (arg_e = arg_s + 1; arg_e < arg_n; arg_e++) { magic = arg_id[ arg_e][ 0]; if (magic == MAC_ARG_START) { nest_e++; } else { nest_e--; if (token < arg_loc[ arg_e] && nest_e == nest_s - 1) { #if DEBUG_MACRO_ANN if (option_flags.v) chk_symmetry( arg_id[ arg_s], arg_id[ arg_e] , ARG_E_LEN_V - 2); #endif arg_id[ arg_e][ ARG_S_LEN - 1] = TRUE; break; } } } if (arg_e < arg_n) arg_id[ arg_s][ ARG_S_LEN - 1] = TRUE; else break; } else { nest_s--; } } } /* Copy the sequences skipping the to-be-removed magic seqs */ file = unget_string( arg_p, NULL); /* Stack to "file" for token parsing*/ tp = arg_p; ep = arg_p + strlen( arg_p); mac_n = arg_n = n = 0; while ((*tp++ = c = get_ch()) != RT_END && file == infile) { char ** loc_tab; int num, mark, rm, magic; size_t len; if (c != MAC_INF) { scan_token( c, (--tp, &tp), ep); continue; } unget_ch(); /* Pushback MAC_INF */ tp--; switch (magic = mgc_index[ n++]) { case MAC_CALL_START : len = MAC_S_LEN; mark = MAC_S_LEN - 1; break; case MAC_CALL_END : len = option_flags.v ? MAC_E_LEN_V : MAC_E_LEN; mark = MAC_E_LEN_V - 1; break; case MAC_ARG_START : len = ARG_S_LEN; mark = ARG_S_LEN - 1; break; case MAC_ARG_END : len = option_flags.v ? ARG_E_LEN_V : ARG_E_LEN; mark = ARG_E_LEN_V - 1; break; } switch (magic) { case MAC_CALL_START : case MAC_CALL_END : loc_tab = mac_loc; num = mac_n; rm = mac_id[ mac_n++][ mark]; break; case MAC_ARG_START : case MAC_ARG_END : loc_tab = arg_loc; num = arg_n; rm = arg_id[ arg_n++][ mark]; break; } if (rm == FALSE) { /* Not to be removed */ memmove( tp, loc_tab[ num], len); /* Copy it (from arg_p buffer for convenience) */ tp += len; } infile->bptr += len; } if (! with_rtend) tp--; *tp = EOS; if (file == infile) get_ch(); /* Clear the "file" */ unget_ch(); return arg_p; } #if DEBUG_MACRO_ANN static void chk_symmetry( char * start_id, /* Sequence of macro (or arg) starting inf */ char * end_id, /* Sequence of macro (or arg) closing inf */ size_t len /* Length of the sequence */ ) /* * Check whether starting sequence and corresponding closing sequence is the * same. */ { int s_id, e_id, arg_s_n, arg_e_n; if (memcmp( start_id + 1, end_id + 1, len) == 0) return; /* The sequences are the same */ s_id = ((start_id[ 1] & UCHARMAX) - 1) * UCHARMAX; s_id += (start_id[ 2] & UCHARMAX) - 1; e_id = ((end_id[ 1] & UCHARMAX) - 1) * UCHARMAX; e_id += (end_id[ 2] & UCHARMAX) - 1; if (len >= 3) { arg_s_n = (start_id[ 3] & UCHARMAX) - 1; arg_e_n = (end_id[ 3] & UCHARMAX) - 1; mcpp_fprintf( ERR, "Asymmetry of arg inf found removing magics: start %d:%d, end: %d:%d at line:%d\n" , s_id, arg_s_n, e_id, arg_e_n, src_line); } else { mcpp_fprintf( ERR, "Asymmetry of macro inf found removing magics: start %d, end: %d at line:%d\n" , s_id, e_id, src_line); } } #endif static char * stringize( const DEFBUF * defp, /* The macro definition */ const char * argp, /* Pointer to argument */ char * out /* Output buffer */ ) /* * Make a string literal from an argument. */ { char arg_end_inf[ 8][ ARG_E_LEN_V - 1]; /* Verbose information of macro arguments */ FILEINFO * file; int stray_bsl = FALSE; /* '\\' not in literal */ char * out_p = out; int token_type; int num_arg_magic = 0; size_t len; size_t arg_e_len = option_flags.v ? ARG_E_LEN_V : ARG_E_LEN; int c; if (trace_macro) { while ((*argp == MAC_INF && *(argp + 1) == MAC_ARG_START) /* Argument is prefixed with macro tracing magics */ || (char_type[ *argp & UCHARMAX] & HSP)) { if (*argp == MAC_INF) { /* Move magics to outside of string */ memcpy( out_p, argp, ARG_S_LEN); out_p += ARG_S_LEN; argp += ARG_S_LEN; num_arg_magic++; } else { /* Skip white spaces */ argp++; } } } file = unget_string( argp, NULL); len = strlen( infile->buffer); /* Sequence ends with RT_END */ if (trace_macro) { /* Remove suffixed argument closing magics */ /* There are 0 or more argument closing magic sequences and */ /* 0 or more TOK_SEPs and no space at the end of argp. */ /* This is assured by get_an_arg(). */ int nmagic = 0; while (len > arg_e_len && (((*(infile->buffer + len - arg_e_len - 1) == MAC_INF && *(infile->buffer + len - arg_e_len) == MAC_ARG_END) || *(infile->buffer + len - 2) == TOK_SEP))) { if (*(infile->buffer + len - arg_e_len - 1) == MAC_INF && *(infile->buffer + len - arg_e_len) == MAC_ARG_END) { if (option_flags.v) { memcpy( arg_end_inf[ nmagic] , infile->buffer + len - arg_e_len + 1 , arg_e_len - 2); arg_end_inf[ nmagic][ arg_e_len - 2] = EOS; } nmagic++; len -= arg_e_len; *(infile->buffer + len - 1) = RT_END; *(infile->buffer + len) = EOS; } else if (*(infile->buffer + len - 2) == TOK_SEP) { len--; *(infile->buffer + len - 1) = RT_END; *(infile->buffer + len) = EOS; } } if (nmagic != num_arg_magic) { /* There are some imbalances */ /* Some surrounding magics correspond to intervening ones. */ /* So, unmatched surrounding magics should be removed. */ if (num_arg_magic > nmagic) { num_arg_magic = nmagic; /* Ignore the surplus */ out_p = out + ARG_S_LEN * num_arg_magic; } /* Else simply ignore the surplus nmagic */ } } *out_p++ = '"'; /* Starting quote */ while ((c = get_ch()), ((mcpp_mode == POST_STD && file == infile) || (mcpp_mode == STD && c != RT_END))) { if (c == ' ' || c == '\t') { *out_p++ = c; continue; } else if (c == TOK_SEP) { continue; /* Skip inserted separator */ } else if (c == IN_SRC) { /* Skip magics */ if (trace_macro) { get_ch(); get_ch(); } continue; } else if (c == '\\') { stray_bsl = TRUE; /* May cause a trouble */ } else if (c == MAC_INF) { /* Remove intervening magics */ switch (c = get_ch()) { case MAC_ARG_START : get_ch(); /* Fall through */ case MAC_CALL_START : get_ch(); get_ch(); break; } if (option_flags.v) { switch (c) { case MAC_ARG_END : get_ch(); /* Fall through */ case MAC_CALL_END : get_ch(); get_ch(); break; } } continue; } token_type = scan_token( c, (workp = work_buf, &workp), work_end); switch (token_type) { case WSTR: case WCHR: case STR: case CHR: workp = work_buf; while ((c = *workp++ & UCHARMAX) != EOS) { if (char_type[ c] & mbchk) { /* Multi-byte character */ mb_read( c, &workp, (*out_p++ = c, &out_p)); /* Copy as it is */ continue; } else if (c == '"') { *out_p++ = '\\'; /* Insert '\\' */ } else if (c == '\\') { #if OK_UCN if (mcpp_mode == POST_STD || ! stdc3 || (*workp != 'u' && *workp != 'U')) /* Not UCN */ #endif *out_p++ = '\\'; } *out_p++ = c; } *out_p = EOS; break; default: out_p = stpcpy( out_p, work_buf); break; } } if (mcpp_mode == POST_STD) unget_ch(); *out_p++ = '"'; /* Closing quote */ if (trace_macro) { while (num_arg_magic--) { *out_p++ = MAC_INF; /* Restore removed magic*/ *out_p++ = MAC_ARG_END; if (option_flags.v) out_p = stpcpy( out_p, arg_end_inf[ num_arg_magic]); } } *out_p = EOS; if (stray_bsl) { /* '\\' outside of quotation has been found */ int invalid = FALSE; unget_string( out, defp->name); if (mcpp_debug & EXPAND) dump_string( "checking generated token", infile->buffer); scan_quote( get_ch(), work_buf, work_end, TRUE); /* Unterminated or too long string will be diagnosed */ if (*infile->bptr != EOS) /* More than a token */ invalid = TRUE; /* Diagnose after clearing the "file" */ infile->bptr += strlen( infile->bptr); get_ch(); /* Clear the "file" */ unget_ch(); if (invalid) diag_macro( CERROR , "Not a valid string literal %s" /* _E_ */ , out, 0L, NULL, defp, NULL); } #if NWORK-2 > SLEN90MIN else if ((warn_level & 4) && out_p - out > std_limits.str_len) diag_macro( CWARN , "String literal longer than %.0s%ld bytes %s" /* _W4_ */ , NULL , (long) std_limits.str_len, out, defp, NULL); #endif return out_p; } static char * substitute( const DEFBUF * defp, /* The macro getting arguments */ const char ** arglist, /* Pointers to actual arguments */ const char * in, /* Replacement text */ char * out, /* Output buffer */ char * out_end /* End of output buffer */ ) /* * Replace completely each actual arguments of the macro, and substitute for * the formal parameters in the replacement list. */ { char * out_start = out; const char * arg; int c; int gvar_arg; /* gvar_arg'th argument is GCC variable argument */ gvar_arg = (defp->nargs & GVA_ARGS) ? (defp->nargs & ~AVA_ARGS) : 0; *out = EOS; /* Ensure to termanate */ while ((c = *in++) != EOS) { if (c == MAC_PARM) { /* Formal parameter */ c = *in++ & UCHARMAX; /* Parameter number */ if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, " (expanding arg[%d])", c); dump_string( NULL, arglist[ c - 1]); } #if COMPILER == GNUC || COMPILER == MSC arg = arglist[ c - 1]; if (trace_macro) { if (*arg == MAC_INF) { if (*++arg == MAC_ARG_START) arg += ARG_S_LEN - 1; /* Next to magic chars */ } } #if COMPILER == GNUC if (c == gvar_arg && *arg == RT_END && ! ansi) { /* * GCC variadic macro and its variable argument is absent. * Note that in its "strict-ansi" mode GCC does not remove * ',', nevertheless it ignores '##' (inconsistent * behavior). Though GCC2 changes behavior depending the * ',' is preceded by space or not, we only count on the * "strict-ansi" flag. */ #else if ((defp->nargs & VA_ARGS) && c == (defp->nargs & ~VA_ARGS) && *arg == RT_END && mcpp_mode == STD) { /* Visual C 2005 also removes ',' immediately preceding */ /* absent variable arguments. It does not use '##' though. */ #endif char * tmp; tmp = out - 1; while (char_type[ *tmp & UCHARMAX] & HSP) tmp--; if (*tmp == ',') { out = tmp; /* Remove the immediately preceding ',' */ if (warn_level & 1) { *out = EOS; diag_macro( CWARN, "Removed ',' preceding the absent variable argument: %s" /* _W1_ */ , out_start, 0L, NULL, defp, NULL); } } } else #endif if ((out = rescan( NULL, arglist[ c - 1], out, out_end)) == NULL) { /* Replace completely */ return NULL; /* Error */ } } else { *out++ = c; /* Copy the character */ } } *out = EOS; return out; } static char * rescan( const DEFBUF * outer, /* Outer macro just replacing */ const char * in, /* Sequences to be rescanned */ char * out, /* Output buffer */ char * out_end /* End of output buffer */ ) /* * Re-scan the once replaced sequences to replace the remaining macros * completely. * rescan() and replace() call each other recursively. * * Note: POST_STD mode does not use IN_SRC nor TOK_SEP and seldom uses RT_END. * Checking of those are unnecessary overhead for POST_STD mode. To integrate * the code for POST_STD with STD mode, however, we use these checkings * commonly. * Also compat_mode does not use IN_SRC unless in trace_macro mode. * STD mode has macro notification mode (trace_macro mode), too. Its routines * are complicated and not easy to understand. */ { char * cur_cp = NULL; char * tp = NULL; /* Temporary pointer into buffer*/ char * out_p = out; /* Current output pointer */ FILEINFO * file; /* Input sequences stacked on a "file" */ DEFBUF * inner; /* Inner macro to replace */ int c; /* First character of token */ int token_type; char * mac_arg_start = NULL; #if COMPILER == GNUC int within_defined = FALSE; int within_defined_arg_depth = 0; #endif if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, "rescan_level--%d (%s) " , rescan_level + 1, outer ? outer->name : ""); dump_string( "rescan entry", in); } if (! disable_repl( outer)) /* Don't re-replace replacing macro */ return NULL; /* Too deeply nested macro call */ if (mcpp_mode == STD) { get_ch(); /* Clear empty "file"s */ unget_ch(); /* for diagnostic */ cur_cp = infile->bptr; /* Remember current location */ } file = unget_string( in, outer ? outer->name : NULL); /* Stack input on a "file" */ while ((c = get_ch()), file == infile /* Rescanning is limited to the "file" */ && c != RT_END) { /* * This is the trick of STD mode. collect_args() via replace() * may read over to file->parent (provided the "file" is macro) * unless stopped by RT_END. */ size_t len = 0; if (char_type[ c] & HSP) { *out_p++ = c; continue; } else if (c == MAC_INF) { /* Only in STD mode */ *out_p++ = c; *out_p++ = c = get_ch(); switch (c) { case MAC_ARG_START : mac_arg_start = out_p - 2; /* Remember the position */ *out_p++ = get_ch(); /* Fall through */ case MAC_CALL_START : *out_p++ = get_ch(); *out_p++ = get_ch(); break; case MAC_ARG_END : if (! option_flags.v) break; else *out_p++ = get_ch(); /* Fall through */ case MAC_CALL_END : if (option_flags.v) { *out_p++ = get_ch(); *out_p++ = get_ch(); } break; } /* Pass these characters as they are */ continue; } token_type = scan_token( c, (tp = out_p, &out_p), out_end); #if COMPILER == GNUC if (mcpp_mode == STD) { /* Pass stuff within defined() as they are, if in_directive */ if ((within_defined || within_defined_arg_depth)) { if (c == '(') { within_defined_arg_depth++; within_defined = FALSE; } else if (within_defined_arg_depth && c == ')') { within_defined_arg_depth--; } /* Else should be a name (possibly macro) */ continue; } else if (token_type == NAM && in_directive && str_eq(identifier, "defined")) { within_defined = TRUE; /* 'defined' token in directive line */ continue; } } #endif if (mcpp_mode == STD && c == IN_SRC) len = trace_macro ? IN_SRC_LEN : 1; if (token_type == NAM && c != DEF_MAGIC && (inner = look_id( tp + len)) != NULL) { /* A macro name */ int is_able; /* Macro is not "blue-painted" */ char * endf = NULL; /* Output stream at end of infile */ MAGIC_SEQ mgc_seq; /* Magics between macro name and '(' */ if (trace_macro) memset( &mgc_seq, 0, sizeof (MAGIC_SEQ)); if (is_macro_call( inner, &out_p, &endf , trace_macro ? &mgc_seq : NULL) && ((mcpp_mode == POST_STD && is_able_repl( inner)) || (mcpp_mode == STD && (((is_able = is_able_repl( inner)) == YES) || (is_able == READ_OVER && (c == IN_SRC || compat_mode)))))) { /* Really a macro call */ LINE_COL in_src_line_col = { 0L, 0}; int in_src_n = 0; if (trace_macro) { if (c == IN_SRC) { /* Macro in argument from source */ /* Get the location in source */ in_src_n = ((*(tp + 1) & UCHARMAX) - 1) * UCHARMAX; in_src_n += (*(tp + 2) & UCHARMAX) - 1; in_src_line_col.line = in_src[ in_src_n].start_line; in_src_line_col.col = in_src[ in_src_n].start_col; } if (inner->nargs >= 0 && mgc_seq.magic_start) { /* Magic sequence is found between macro */ /* name and '('. This is a nuisance. */ char * mgc_cleared; size_t seq_len; size_t arg_elen = option_flags.v ? ARG_E_LEN_V : ARG_E_LEN; if ((tp - ARG_S_LEN) == mac_arg_start && *mgc_seq.magic_start == MAC_INF && *(mgc_seq.magic_start + 1) == MAC_ARG_END) { /* Name of function-like macro is surrounded by */ /* magics, which were inserted by outer macro. */ /* Remove the starting magic. (The closing magic*/ /* has already been removed by is_macro_call(). */ tp -= ARG_S_LEN; mgc_seq.magic_start += arg_elen; /* Next seq */ } /* Restore once skipped magic sequences, */ /* then remove "pair"s of sequences. */ seq_len = mgc_seq.magic_end - mgc_seq.magic_start; if (seq_len) { insert_to_bptr( mgc_seq.magic_start, seq_len); mgc_cleared = remove_magics( (const char *) infile->bptr, FALSE); /* Remove pair of magics */ strcpy( infile->bptr, mgc_cleared); free( mgc_cleared); } } } if ((out_p = replace( inner, tp, out_end, outer, file , in_src_line_col, in_src_n)) == NULL) break; /* Error of macro call */ } else { if (endf && strlen( endf)) { /* Has read over to parent file: another nuisance. */ /* Restore the read-over sequence into current buffer. */ /* Don't use unget_string() here. */ insert_to_bptr( endf, out_p - endf); out_p = endf; *out_p = EOS; } if ((is_able = is_able_repl( inner)) == NO || (mcpp_mode == STD && is_able == READ_OVER && c != IN_SRC && ! compat_mode)) { if (mcpp_mode == POST_STD || c != IN_SRC) memmove( tp + 1, tp, (size_t) (out_p++ - tp)); *tp = DEF_MAGIC; /* Mark not to replace */ } /* Else not a macro call*/ } } if (out_end <= out_p) { *out_p = EOS; diag_macro( CERROR, macbuf_overflow, outer ? outer->name : in, 0L , out, outer, inner); out_p = NULL; break; } } if (out_p) { *out_p = EOS; if (mcpp_mode == STD) { if (c != RT_END) { unget_ch(); if (outer != NULL) { /* outer isn't a macro in argument */ if (infile && infile->bptr != cur_cp /* Have overrun replacement list*/ && !(tp && *tp == DEF_MAGIC) /* Macro is enabled */ && ((!compat_mode && (warn_level & 1)) || (compat_mode && (warn_level & 8)))) { diag_macro( CWARN, "Replacement text \"%s\" of macro %.0ld\"%s\" involved subsequent text" /* _W1_ */ , in, 0L, outer->name, outer, inner); } } } /* Else remove RT_END */ } else { unget_ch(); } } enable_repl( outer, TRUE); /* Enable macro for later text */ if (mcpp_debug & EXPAND) { mcpp_fprintf( DBG, "rescan_level--%d (%s) " , rescan_level + 1, outer ? outer->name : ""); dump_string( "rescan exit", out); } return out_p; } static int disable_repl( const DEFBUF * defp ) /* * Register the macro name currently replacing. */ { if (defp == NULL) return TRUE; if (rescan_level >= RESCAN_LIMIT) { diag_macro( CERROR, "Rescanning macro \"%s\" more than %ld times at \"%s\"" /* _E_ */ , macro_name, (long) RESCAN_LIMIT, defp->name, defp, NULL); return FALSE; } replacing[ rescan_level].def = defp; replacing[ rescan_level++].read_over = NO; return TRUE; } static void enable_repl( const DEFBUF * defp, int done ) /* * Un-register the macro name just replaced for later text. */ { if (defp == NULL) return; replacing[ rescan_level - 1].def = NULL; if (done && rescan_level) rescan_level--; } static int is_able_repl( const DEFBUF * defp ) /* * The macro is permitted to replace ? */ { int i; if (defp == NULL) return YES; for (i = rescan_level-1; i >= 0; i--) { if (defp == replacing[ i].def) return replacing[ i].read_over; } return YES; } static char * insert_to_bptr( char * ins, /* Sequence to be inserted */ size_t len /* Byte to be inserted */ ) /* * Insert a sequence into infile->bptr. * infile->buffer is reallocated to ensure buffer size. * This routine changes absolute address of infile->bptr, hence rescan() emits * a "Replacement text ... involved subsequent text" warning. Anyway, * a macro which needs this routine deserves that warning. */ { size_t bptr_offset = infile->bptr - infile->buffer; if (infile->fp == NULL) { /* Not source file */ infile->buffer = xrealloc( infile->buffer , strlen( infile->buffer) + len + 1); infile->bptr = infile->buffer + bptr_offset; } memmove( infile->bptr + len, infile->bptr, strlen( infile->bptr) + 1); memcpy( infile->bptr, ins, len); return infile->buffer; } /* * M a c r o E x p a n s i o n i n P R E - S T A N D A R D M o d e */ #include "setjmp.h" static jmp_buf jump; static char * arglist_pre[ NMACPARS]; /* Pointers to args */ static int rescan_pre( int c, char * mp, char * mac_end); /* Replace a macro repeatedly */ static int replace_pre( DEFBUF * defp); /* Replace a macro once */ static void substitute_pre( DEFBUF * defp); /* Substitute parms with args */ static char * expand_prestd( DEFBUF * defp, /* Macro definition */ char * out, /* Output buffer */ char * out_end, /* End of output buffer */ LINE_COL line_col, /* Location of macro (not used in prestd) */ int * pragma_op /* Flag of _Pragma (not used in prestd) */ ) /* * Expand a macro call completely, write the results to the specified buffer * and return the advanced pointer. */ { char macrobuf[ NMACWORK + IDMAX]; /* Buffer for rescan_pre() */ char * mac_end = ¯obuf[ NMACWORK]; /* End of macrobuf[] */ char * out_p; /* Pointer into out[] */ char * mp = macrobuf; /* Pointer into macrobuf*/ int len; /* Length of a token */ int token_type; /* Type of token */ int c; macro_line = src_line; /* Line number for diag.*/ unget_string( identifier, identifier); /* To re-read */ macro_name = defp->name; rescan_level = 0; if (setjmp( jump) == 1) { skip_macro(); mp = macrobuf; *mp = EOS; macro_line = MACRO_ERROR; goto err_end; } while ((c = get_ch()) != CHAR_EOF && infile->fp == NULL) { /* While the input stream is a macro */ while (c == ' ' || c == '\t') { /* Output the spaces */ *mp++ = c; c = get_ch(); if (infile == NULL || infile->fp != NULL) goto exp_end; } token_type = rescan_pre( c, mp, mac_end); /* Scan token */ /* and expand. Result of expansion is written at mp. */ switch (token_type) { case STR: /* String literal */ case CHR: /* Character constant */ case NUM: /* Number token */ case OPE: /* Operator or punct. */ case NAM: /* Identifier */ len = strlen( mp); mp += len; break; case SEP: /* Special character */ switch( *mp) { case COM_SEP: if (mcpp_mode == OLD_PREP) break; /* Zero-length comment is removed now */ /* Else fall through */ default: /* Who knows ? */ mp++; /* Copy the character */ break; } break; case NO_TOKEN: break; /* End of file */ default: /* Unkown token char. */ mp++; /* Copy the character */ break; } if (mac_end <= mp) { *mp = EOS; cerror( macbuf_overflow, macro_name, 0L, macrobuf); longjmp( jump, 1); } if (mcpp_debug & GETC) { *mp = EOS; dump_string( "macrobuf", macrobuf); } } exp_end: unget_ch(); while (macrobuf < mp && (*(mp - 1) == ' ' || *(mp - 1) == '\t')) mp--; /* Remove trailing blank */ macro_line = 0; *mp = EOS; if (mp - macrobuf > out_end - out) { cerror( macbuf_overflow, macro_name, 0L, macrobuf); macro_line = MACRO_ERROR; } err_end: out_p = stpcpy( out, macrobuf); if (mcpp_debug & EXPAND) { dump_string( "expand_prestd exit", out); } macro_name = NULL; clear_exp_mac(); *pragma_op = FALSE; return out_p; } static int rescan_pre( int c, /* First character of token */ char * mp, /* Output buffer */ char * mac_end /* End of output buffer */ ) /* * If the token is a macro name, replace the macro repeatedly until the first * token becomes a non-macro and return the type of token after expansion. */ { int token_type; /* Type of token */ char * cp = mp; /* Value of mp should not be changed */ DEFBUF * defp; FILEINFO * file; while ((token_type = scan_token( c, &cp, mac_end)) == NAM && (defp = look_id( identifier)) != NULL) { /* Macro */ if (replace_pre( defp) == FALSE) break; /* Macro name with no argument */ file = infile; c = get_ch(); if (file != infile) { /* Replaced to 0 token */ unget_ch(); token_type = NO_TOKEN; break; } cp = mp; /* Overwrite on the macro call */ } /* The macro call is replaced */ return token_type; } static int replace_pre( DEFBUF * defp /* Definition of the macro */ ) /* * Replace a macro one level. Called from expand_prestd() (via rescan_pre()) * when an identifier is found in the macro table. It calls collect_args() * to parse actual arguments, checking for the correct number. It then * creates a "file" containing single line containing the replacement text * with the actual arguments inserted appropriately. This is "pushed back" * onto the input stream. (When get_ch() routine runs off the end of the macro * line, it will dismiss the macro itself.) */ { int arg_len; int c; if (mcpp_debug & EXPAND) { dump_a_def( "replace_pre entry", defp, FALSE, TRUE, fp_debug); dump_unget( "replace_pre entry"); } if (++rescan_level >= PRESTD_RESCAN_LIMIT) { diag_macro( CERROR , "Recursive macro definition of \"%s\"" /* _E_ */ , defp->name, 0L, NULL, defp, NULL); longjmp( jump, 1); } /* * Here's a macro to replace. */ switch (defp->nargs) { case DEF_NOARGS: /* No argument just stuffs */ case DEF_NOARGS_PREDEF_OLD: /* Compiler-specific predef without '_' */ case DEF_NOARGS_PREDEF: /* Compiler-specific predef */ break; default: /* defp->nargs >= 0 */ c = squeeze_ws( NULL, NULL, NULL); /* Look for and skip '('*/ if (c != '(') { /* Macro name without following '(' */ unget_ch(); if (warn_level & 8) diag_macro( CWARN, only_name, defp->name, 0L, NULL, defp, NULL); return FALSE; } else { arglist_pre[ 0] = xmalloc( (size_t) (NMACWORK + IDMAX * 2)); arg_len = collect_args( defp, arglist_pre, 0); /* Collect arguments */ if (arg_len == ARG_ERROR) { /* End of input */ free( arglist_pre[ 0]); longjmp( jump, 1); } } break; } if (defp->nargs > 0) substitute_pre( defp); /* Do actual arguments */ else unget_string( defp->repl, defp->name); if (mcpp_debug & EXPAND) dump_unget( "replace_pre exit"); if (defp->nargs >= 0) free( arglist_pre[ 0]); return TRUE; } static void substitute_pre( DEFBUF * defp /* Current macro being replaced */ ) /* * Stuff the macro body, substituting formal parameters with actual arguments. */ { int c; /* Current character */ FILEINFO * file; /* Funny #include */ char * out_end; /* -> output buffer end */ char * in_p; /* -> replacement text */ char * out_p; /* -> macro output buff */ file = get_file( defp->name, NULL, NULL, (size_t) (NMACWORK + 1), FALSE); /* file == infile */ in_p = defp->repl; /* -> macro replacement */ out_p = file->buffer; /* -> output buffer */ out_end = file->buffer + NMACWORK; /* -> buffer end */ while ((c = *in_p++) != EOS) { if (c == MAC_PARM) { c = (*in_p++ & UCHARMAX) - 1; /* Parm number */ /* * Substitute formal parameter with actual argument. */ if (out_end <= (out_p + strlen( arglist_pre[ c]))) goto nospace; out_p = stpcpy( out_p, arglist_pre[ c]); } else { *out_p++ = c; } if (out_end <= out_p) goto nospace; } *out_p = EOS; file->buffer = xrealloc( file->buffer, strlen( file->buffer) + 1); file->bptr = file->buffer; /* Truncate buffer */ if (mcpp_debug & EXPAND) dump_string( "substitute_pre macroline", file->buffer); return; nospace: *out_p = EOS; diag_macro( CERROR, macbuf_overflow, defp->name, 0L, file->buffer, defp , NULL); longjmp( jump, 1); } /* * C O M M O N R O U T I N E S * f o r S T A N D A R D a n d p r e - S T A N D A R D M o d e s */ static int collect_args( const DEFBUF * defp, /* Definition of the macro */ char ** arglist, /* Pointers to actual arguments */ int m_num /* Index into mac_inf[] */ ) /* * Collect the actual arguments for the macro, checking for correct number * of arguments. * Variable arguments (on Standard modes) are read as a merged argument. * Return number of real arguments, or ARG_ERROR on error of unterminated * macro. * collect_args() may read over to the next line unless 'in_directive' is * set to TRUE. * collect_args() may read over into file->parent to complete a macro call * unless stopped by RT_END (provided the "file" is macro). This is a key * trick of STD mode macro expansion. Meanwhile, POST_STD mode limits the * arguments in the "file" (macro or not). * Note: arglist[ n] may be reallocated by collect_args(). */ { const char * name = defp->name; char * argp = arglist[ 0]; /* Pointer to an argument */ char * arg_end; /* End of arguments buffer */ char * valid_argp = NULL; /* End of valid arguments */ char * sequence; /* Token sequence for diagnostics */ char * seq; /* Current pointer into 'sequence' */ char * seq_end; /* Limit of buffer */ int args; /* Number of arguments expected */ int nargs = 0; /* Number of collected args */ int var_arg = defp->nargs & VA_ARGS; /* Variable args */ int more_to_come = FALSE; /* Next argument is expected*/ LOCATION * locs; /* Location of args in source file */ LOCATION * loc; /* Current locs */ MAGIC_SEQ mgc_prefix; /* MAC_INF seqs and spaces preceding an arg */ int c; if (mcpp_debug & EXPAND) dump_unget( "collect_args entry"); args = (defp->nargs == DEF_PRAGMA) ? 1 : (defp->nargs & ~AVA_ARGS); if (args == 0) /* Need no argument */ valid_argp = argp; *argp = EOS; /* Make sure termination */ arg_end = argp + NMACWORK/2; seq = sequence = arg_end + IDMAX; /* Use latter half of argp */ seq_end = seq + NMACWORK/2; seq = stpcpy( seq, name); *seq++ = '('; if (mcpp_mode == STD) { /* * in_getarg is set TRUE while getting macro arguments, for the sake * of diagnostic's convenience. in_getarg is used only in STD mode. */ in_getarg = TRUE; if (trace_macro && m_num) { /* #pragma MCPP debug macro_call, and the macro is on source */ mac_inf[ m_num].loc_args = loc = locs = (LOCATION *) xmalloc( (sizeof (LOCATION)) * UCHARMAX); memset( loc, 0, (sizeof (LOCATION)) * UCHARMAX); /* 0-clear for default values, including empty argument */ } } while (1) { memset( &mgc_prefix, 0, sizeof (MAGIC_SEQ)); c = squeeze_ws( &seq, NULL , (trace_macro && m_num) ? &mgc_prefix : NULL); /* Skip MAC_INF seqs and white spaces, still remember */ /* the sequence in buffer, if necessary. */ if (c == ')' || c == ',') scan_token( c, &seq, seq_end); /* Ensure token parsing */ else *seq = EOS; switch (c) { /* First character of token */ case ')': if (! more_to_come) { /* Zero argument */ if (trace_macro && m_num) loc++; break; } /* Else fall through */ case ',': /* Empty argument */ if (trace_macro && m_num) loc++; /* Advance pointer to infs */ if (warn_level & 2) diag_macro( CWARN, empty_arg, sequence, 0L, NULL, defp, NULL); if (standard && var_arg && nargs == args - 1) { /* Variable arguments begin with an empty argument */ c = get_an_arg( c, &argp, arg_end, &seq, 1, nargs, &loc , m_num, (trace_macro && m_num) ? &mgc_prefix : NULL); } else { if (mcpp_mode == STD) *argp++ = RT_END; *argp++ = EOS; } if (++nargs == args) valid_argp = argp; if (c == ',') { more_to_come = TRUE; continue; } else { /* ')' */ break; } case '\n': /* Unterminated macro call in directive line*/ unget_ch(); /* Fall through */ case RT_END: /* Error of missing ')' */ diag_macro( CERROR, unterm_macro, sequence, 0L, NULL, defp, NULL); /* Fall through */ case CHAR_EOF: /* End of file in macro call*/ nargs = ARG_ERROR; goto arg_ret; /* Diagnosed by at_eof() */ default: /* Nomal argument */ break; } if (c == ')') /* At end of all args */ break; c = get_an_arg( c, &argp, arg_end, &seq , (var_arg && nargs == args - 1) ? 1 : 0, nargs, &loc , m_num, (trace_macro && m_num) ? &mgc_prefix : NULL); if (++nargs == args) valid_argp = argp; /* End of valid arguments */ if (c == ')') break; if (c == 0) { /* End of file */ nargs = ARG_ERROR; goto arg_ret; /* Diagnosed by at_eof() */ } if (c == -1) { /* Untermanated macro call */ diag_macro( CERROR, unterm_macro, sequence, 0L, NULL, defp, NULL); nargs = ARG_ERROR; goto arg_ret; } more_to_come = (c == ','); } /* Collected all arguments */ if (nargs == 0 && args == 1) { /* Only and empty argument */ if (warn_level & 2) diag_macro( CWARN, empty_arg, sequence, 0L, NULL, defp, NULL); } else if (nargs != args) { /* Wrong number of arguments*/ if (mcpp_mode != OLD_PREP || (warn_level & 1)) { if ((standard && var_arg && (nargs == args - 1)) /* Absence of variable arguments */ || (mcpp_mode == OLD_PREP)) { if (warn_level & 1) diag_macro( CWARN, narg_error, nargs < args ? "Less" : "More", (long) args, sequence, defp, NULL); } else { diag_macro( CERROR, narg_error, nargs < args ? "Less" : "More" , (long) args, sequence, defp, NULL); } } } if (args < nargs) { argp = valid_argp; /* Truncate excess arguments*/ } else { for (c = nargs; c < args; c++) { if (mcpp_mode == STD) *argp++ = RT_END; /* For rescan() */ *argp++ = EOS; /* Missing arguments */ } if (c == 0) argp++; /* Ensure positive length */ } arglist[ 0] = argp = xrealloc( arglist[ 0], (size_t) (argp - arglist[ 0])); /* Use memory sparingly */ for (c = 1; c < args; c++) arglist[ c] = argp += strlen( argp) + 1; if (trace_macro && m_num) mac_inf[ m_num].loc_args /* Truncate excess memory */ = (LOCATION *) xrealloc( (char *) locs , (loc - locs) * sizeof (LOCATION)); if (mcpp_debug & EXPAND) { if (nargs > 0) { if (nargs > args) nargs = args; dump_args( "collect_args exit", nargs, (const char **) arglist); } dump_unget( "collect_args exit"); } arg_ret: if (mcpp_mode == STD) in_getarg = FALSE; /* Return number of found arguments for function-like macro at most */ /* defp->nargs, or return defp->nargs for object-like macro. */ return defp->nargs <= DEF_NOARGS ? defp->nargs : nargs; } static int get_an_arg( int c, char ** argpp, /* Address of pointer into argument list */ char * arg_end, /* End of argument list buffer */ char ** seqp, /* Buffer for diagnostics */ int var_arg, /* 1 on __VA_ARGS__, 0 on others*/ int nargs, /* Argument number */ LOCATION ** locp, /* Where to save location infs */ int m_num, /* Macro number to trace */ MAGIC_SEQ * mgc_prefix /* White space and magics leading to argument */ ) /* * Get an argument of macro into '*argpp', return the next punctuator. * Variable arguments are read as a merged argument. * Note: nargs, locp and m_num are used only in macro trace mode of * '#pragma MCPP debug macro_call' or -K option. */ { struct { int n_par; int n_in_src; } n_paren[ 16]; int num_paren = 0; int end_an_arg = FALSE; /* End-of-an-arg flag */ int paren = var_arg; /* For embedded ()'s */ int token_type; char * prevp; char * argp = *argpp; int trace_arg = 0; /* Enable tracing arg */ LINE_COL s_line_col, e_line_col; /* Location of macro in an argument */ MAGIC_SEQ mgc_seq; /* Magic seqs and spaces succeeding an arg */ size_t len; if (trace_macro) { trace_arg = m_num && infile->fp; if (m_num) { if (trace_arg) { /* The macro call is in source */ s_line_col.line = src_line; s_line_col.col = infile->bptr - infile->buffer - 1; /* '-1': bptr is one byte passed beginning of the token */ get_src_location( & s_line_col); (*locp)->start_line = s_line_col.line; (*locp)->start_col = s_line_col.col; e_line_col = s_line_col; /* Save the location, */ /* also for end of arg in case of empty arg*/ memset( n_paren, 0, sizeof (n_paren)); } *argp++ = MAC_INF; *argp++ = MAC_ARG_START; *argp++ = (m_num / UCHARMAX) + 1; *argp++ = (m_num % UCHARMAX) + 1; *argp++ = nargs + 1; /* Argument number internally starts at 1 */ if (mgc_prefix->magic_start) { /* Copy the preceding magics, if any */ len = mgc_prefix->magic_end - mgc_prefix->magic_start; memcpy( argp, mgc_prefix->magic_start, len); argp += len; } } memset( &mgc_seq, 0, sizeof (MAGIC_SEQ)); } while (1) { if (c == '\n' /* In control line */ || c == RT_END) { /* Boundary of rescan (in STD mode) */ if (c == '\n') unget_ch(); break; } if (trace_arg) { /* Save the location */ s_line_col.line = src_line; /* of the token */ s_line_col.col = infile->bptr - infile->buffer - 1; } token_type = scan_token( c, (prevp = argp, &argp), arg_end); /* Scan the next token */ switch (c) { case '(': /* Worry about balance */ paren++; /* To know about commas */ break; case ')': /* Other side too */ if (paren-- == var_arg) /* At the end? */ end_an_arg = TRUE; /* Else more to come */ if (trace_arg) { if (num_paren && paren == n_paren[ num_paren].n_par) { /* Maybe corresponding parentheses for the macro in arg */ int src_n; src_n = n_paren[ num_paren].n_in_src; in_src[ src_n].end_line = s_line_col.line; in_src[ src_n].end_col = s_line_col.col + 1; num_paren--; } } break; case ',': if (paren == 0) /* Comma delimits arg */ end_an_arg = TRUE; break; case MAC_INF : /* Copy magics as they are */ switch (*argp++ = get_ch()) { case MAC_ARG_START : *argp++ = get_ch(); /* Fall through */ case MAC_CALL_START : *argp++ = get_ch(); *argp++ = get_ch(); break; case MAC_ARG_END : if (! option_flags.v) break; else *argp++ = get_ch(); /* Fall through */ case MAC_CALL_END : if (option_flags.v) { *argp++ = get_ch(); *argp++ = get_ch(); } break; } break; case CHAR_EOF : /* Unexpected EOF */ return 0; default : /* Any token */ if (mcpp_mode == STD && token_type == NAM && c != IN_SRC && c != DEF_MAGIC && infile->fp) { len = trace_arg ? IN_SRC_LEN : 1; memmove( prevp + len, prevp, (size_t) (argp - prevp)); argp += len; *prevp = IN_SRC; /* Mark that the name is read from source file */ if (trace_arg) { DEFBUF * defp; defp = look_id( prevp + IN_SRC_LEN); if (in_src_num >= MAX_IN_SRC_NUM - 1) { cerror( "Too many names in arguments tracing %s" /* _E_ */ , defp ? defp->name : null, 0L, NULL); return 0; } else if (++in_src_num > max_in_src_num) { size_t old_len; old_len = sizeof (LOCATION) * max_in_src_num; /* Enlarge the array */ in_src = (LOCATION *) xrealloc( (char *) in_src , old_len * 2); /* Have to initialize the enlarged area */ memset( in_src + max_in_src_num, 0, old_len); max_in_src_num *= 2; } /* Insert the identifier number in 2-bytes-encoding */ *(prevp + 1) = (in_src_num / UCHARMAX) + 1; *(prevp + 2) = (in_src_num % UCHARMAX) + 1; if (defp) { /* Macro name in arg */ in_src[ in_src_num].start_line = s_line_col.line; in_src[ in_src_num].start_col = s_line_col.col; /* For object-like macro, also for function-like */ /* macro in case of parens are not found. */ in_src[ in_src_num].end_line = s_line_col.line; in_src[ in_src_num].end_col = infile->bptr - infile->buffer; if (defp->nargs >= 0) { /* Function-like macro: search parentheses */ n_paren[ ++num_paren].n_par = paren; n_paren[ num_paren].n_in_src = in_src_num; } } /* Else in_src[ in_src_num].* are 0L */ } } break; } /* End of switch */ if (end_an_arg) /* End of an argument */ break; if (trace_arg) { /* Save the location */ e_line_col.line = src_line; /* before spaces */ e_line_col.col = infile->bptr - infile->buffer; } memset( &mgc_seq, 0, sizeof (MAGIC_SEQ)); c = squeeze_ws( &argp, NULL, &mgc_seq); /* To the next token */ } /* Collected an argument*/ *argp = EOS; *seqp = stpcpy( *seqp, *argpp); /* Save the sequence */ if (c == '\n' || c == RT_END) return -1; /* Unterminated macro */ argp--; /* Remove the punctuator*/ if (mgc_seq.space) --argp; /* Remove trailing space */ if (mcpp_mode == STD) { if (trace_macro && m_num) { if (trace_arg) { /* Location of end of an arg */ get_src_location( & e_line_col); (*locp)->end_line = e_line_col.line; (*locp)->end_col = e_line_col.col; } (*locp)++; /* Advance pointer even if !trace_arg */ *argp++ = MAC_INF; *argp++ = MAC_ARG_END; if (option_flags.v) { *argp++ = (m_num / UCHARMAX) + 1; *argp++ = (m_num % UCHARMAX) + 1; *argp++ = nargs + 1; *argp = EOS; *argpp = chk_magic_balance( *argpp, argp, TRUE, FALSE); /* Check a stray magic caused by abnormal macro */ /* and move it to an edge if found. */ } } *argp++ = RT_END; /* For rescan() */ } *argp++ = EOS; /* Terminate an argument*/ *argpp = argp; return c; } static int squeeze_ws( char ** out, /* Pointer to output pointer */ char ** endf, /* Pointer to end of infile data*/ MAGIC_SEQ * mgc_seq /* Sequence of MAC_INFs and space */ /* mgc_seq should be initialized in the calling routine */ ) /* * Squeeze white spaces to one space. * White spaces are ' ' (and possibly '\t', when keep_spaces == TRUE. Note * that '\r', '\v', '\f' have been already converted to ' ' by get_ch()), * and '\n' unless in_directive is set. * COM_SEP is skipped. TOK_SEPs are squeezed to one TOK_SEP. * Copy MAC_INF and its sequences as they are. * If white spaces are found and 'out' is not NULL, write a space to *out and * increment *out. * Record start and end of MAC_INF sequences and whether space is found or * not for a convenience of get_an_arg(). * Return the next character. */ { int c; int space = 0; int tsep = 0; FILEINFO * file = infile; FILE * fp = infile->fp; int end_of_file = (out && endf) ? FALSE : TRUE; while (((char_type[ c = get_ch()] & SPA) && (! standard || (mcpp_mode == POST_STD && file == infile) || (mcpp_mode == STD && ((macro_line != 0 && macro_line != MACRO_ERROR) || file == infile)))) || c == MAC_INF) { if (! end_of_file && file != infile) { /* Infile has been read over*/ *endf = *out; /* Remember the location */ end_of_file = TRUE; } if (c == '\n' && in_directive) /* If scanning control line */ break; /* do not skip newline. */ switch (c) { case '\n': space++; wrong_line = TRUE; break; case TOK_SEP: if (mcpp_mode == STD) tsep++; continue; /* Skip COM_SEP in OLD_PREP mode */ case MAC_INF : /* Copy magics as they are, or skip */ if (mgc_seq && ! mgc_seq->magic_start) mgc_seq->magic_start = *out; /* First occurence of magic seq */ if (out) *(*out)++ = c; c = get_ch(); if (out) *(*out)++ = c; switch (c) { case MAC_ARG_START : c = get_ch(); if (out) *(*out)++ = c; /* Fall through */ case MAC_CALL_START : c = get_ch(); if (out) *(*out)++ = c; c = get_ch(); if (out) *(*out)++ = c; break; case MAC_ARG_END : if (! option_flags.v) { break; } else { c = get_ch(); if (out) *(*out)++ = c; /* Fall through */ } case MAC_CALL_END : if (option_flags.v) { c = get_ch(); if (out) *(*out)++ = c; c = get_ch(); if (out) *(*out)++ = c; } break; } if (mgc_seq) /* Remember end of last magic seq */ mgc_seq->magic_end = *out; break; default: space++; break; } } if (out) { if (space) { /* Write a space to output pointer */ *(*out)++ = ' '; /* and increment the pointer. */ if (mgc_seq) mgc_seq->space = TRUE; } if (tsep && !space) /* Needs to preserve token separator*/ *(*out)++ = TOK_SEP; **out = EOS; } if (mcpp_mode == POST_STD && file != infile) { unget_ch(); /* Arguments cannot cross "file"s */ c = fp ? CHAR_EOF : RT_END; /* EOF is diagnosed by at_eof() */ } else if (mcpp_mode == STD && macro_line == MACRO_ERROR && file != infile) { /* EOF */ unget_ch(); /* diagnosed by at_eof() or only */ c = CHAR_EOF; /* name of a function-like macro. */ } /* at_eof() resets macro_line on error */ return c; /* Return the next character */ } static void skip_macro( void) /* * Clear the stacked (i.e. half-expanded) macro, called on macro error. */ { if (infile == NULL) /* End of input */ return; if (infile->fp) /* Source file */ return; while (infile->fp == NULL) { /* Stacked stuff */ infile->bptr += strlen( infile->bptr); get_ch(); /* To the parent "file" */ } unget_ch(); } static void diag_macro( int severity, /* Error or warning */ const char * format, const char * arg1, long arg2, const char * arg3, const DEFBUF * defp1, /* Macro causing the problem 1 */ const DEFBUF * defp2 /* 2 */ ) /* * Supplement macro information for diagnostic. */ { if (defp1 && defp1->name != macro_name) expanding( defp1->name, FALSE); /* Inform of the problematic macro call */ if (defp2 && defp2->name != macro_name) expanding( defp2->name, FALSE); if (severity == CERROR) cerror( format, arg1, arg2, arg3); else cwarn( format, arg1, arg2, arg3); } static void dump_args( const char * why, int nargs, const char ** arglist ) /* * Dump arguments list. */ { int i; mcpp_fprintf( DBG, "dump of %d actual arguments %s\n", nargs, why); for (i = 0; i < nargs; i++) { mcpp_fprintf( DBG, "arg[%d]", i + 1); dump_string( NULL, arglist[ i]); } } mcpp-2.7.2/src/configed.H0000644000175000017500000003062711111213412012053 00000000000000/* * configed.H * Configurations for MCPP using config.h genarated by configure script. * * WARNING: These settings assume HOST == TARGET. In case of HOST * differs from TARGET, you must edit this file here and there. */ #define TRUE 1 #define FALSE 0 #define DATE "2008/11" /* Date of mcpp */ /* * 'Target' means the O.S. and the compiler to which cpp is implemented. * 'Host' means the O.S. and the compiler with which cpp is compiled. */ #include "config.h" #ifndef COMPILER /* No target compiler specified */ #define COMPILER COMPILER_UNKNOWN #endif #ifndef HOST_COMPILER /* No host compiler specified */ #define HOST_COMPILER COMPILER #endif /* * P A R T 1 Configurations for target-operating-system * and target-compiler. */ /* * Names of the SYSTEM (i.e. target operating system). This is needed so that * cpp can use appropriate filename conventions. */ #define SYS_UNKNOWN 0 #define SYS_UNIX 0x1000 #define SYS_LINUX 0x1800 /* (SYS_LINUX & 0xF000) == SYS_UNIX */ #define SYS_FREEBSD 0x1A00 /* (SYS_FREEBSD & 0xF000) == SYS_UNIX */ #define SYS_CYGWIN 0x1C00 /* (SYS_CYGWIN & 0xF000) == SYS_UNIX */ #define SYS_MAC 0x1E00 /* (SYS_MAC & 0xF000) == SYS_UNIX */ #define SYS_WIN 0x7000 #define SYS_WIN32 0x7400 /* (SYS_WIN32 & 0xF000) == SYS_WIN */ #define SYS_MINGW 0x7C00 /* (SYS_MINGW & 0xF000) == SYS_WIN */ /* COMPILER */ #define COMPILER_UNKNOWN 0 #define MSC 0x7400 /* Microsoft C, Visual C++ */ #define BORLANDC 0x7440 /* Borland C */ #define WIN_SYMANTECC 0x7470 /* Symantec for Windows */ #define LCC 0x74C0 /* LCC-Win32 */ #define GNUC 0x00E0 /* GNU C (GCC) */ #define INDEPENDENT 0xFFFF /* No target, compiler-independent-build*/ #define SYS_FAMILY (SYSTEM & 0xF000) #define COMPILER_FAMILY (COMPILER & 0xF0) #define HOST_SYS_FAMILY (HOST_SYSTEM & 0xF000) /* Default MBCHAR (multi-byte character) encoding. */ #define EUC_JP 0x10 /* Extended UNIX code of JIS X 0208 */ #define GB2312 0x20 /* EUC-like encoding of Chinese GB 2312-80 */ #define KSC5601 0x30 /* EUC-like encoding of Korean KS C 5601 */ #define SJIS 0x80 /* Shift-JIS encoding of JIS X 0208 */ #define BIGFIVE 0x90 /* Encoding of Taiwanese Big Five */ #define ISO2022_JP 0x100 /* ISO-2022-JP (ISO-2022-JP1) encoding */ #define UTF8 0x1000 /* UTF-8 encoding */ /* * MBCHAR means multi-byte character encoding. * MBCHAR means the default encoding, and you can change the encoding by * #pragma MCPP setlocale, -e option or environment variable * LC_ALL, LC_CTYPE, LANG. * MBCHAR == 0 means not to recognize any multi-byte character encoding. */ /* * In order to predefine target-dependent macros, * several macros are defined here: * *_OLD define the macro beginning with an alphabetic letter, * *_STD, *_STD?, *_EXT, *_EXT2 define the macro beginning with an '_'. * *_STD1 define the macro beginning with '__' and ending with an alpha- * numeric letter. * *_STD2 define the macro beginning with '__' and ending with '__'. * These may not be defined, if they are not needed. * They should not be #defined to no token or to "". * * SYSTEM_OLD, SYSTEM_STD1, SYSTEM_STD2, SYSTEM_EXT, SYSTEM_EXT2 * define the target operating system (by name). * SYSTEM_SP_OLD, SYSTEM_SP_STD define the target-OS specific macro name * COMPILER_OLD, COMPILER_STD1, COMPILER_STD2, COMPILER_EXT, COMPILER_EXT2 * , COMPILER_SP_OLD, COMPILER_SP_STD * define the target compiler (by name). * COMPILER_CPLUS defines the target C++ compiler. * COMPILER_SP1, COMPILER_SP2, COMPILER_SP3 * define the compiler-specific macros. * * _VAL specify the value of the . * If not specified, these values default to "1". * To define the value of no-token, specify as "" rather than no-token. * SYSTEM_OLD, SYSTEM_STD?, COMPILER_OLD have the value of "1". */ /* * target-compiler-dependent definitions: * * LINE_PREFIX defines the output line prefix, if not "#line 123". * This should be defined as "# " to represent "# 123" format * ("#line " represents "#line 123" format). * * ENV_C_INCLUDE_DIR may be defined to the name of environment-variable for * C include directory. * ENV_CPLUS_INCLUDE_DIR is name of environment-variable for C++ include * directory which exists other than ENV_C_INCLUDE_DIR. * ENV_SEP is the separator (other than space) of include-paths in an * environment-variable. e.g. the ':' in * "/usr/abc/include:/usr/xyz/include" * * EMFILE should be defined to the macro to represent errno of 'too many * open files' if the macro is different from EMFILE. * * ONE_PASS should be set TRUE, if COMPILER is "one pass compiler". * * FNAME_FOLD means that target-system folds upper and lower cases of * directory and file-name. * * SEARCH_INIT specifies the default value of 'search_rule' (in system.c). * 'search_rule' holds searching rule of #include "header.h" to * search first before searching user specified or system- * specific include directories. * CURRENT means to search the directory relative to "current * directory" which is current at cpp invocation. * SOURCE means to search the directory relative to that of the * source file (i.e. "includer"). * (CURRENT & SOURCE) means to search current directory first * source directory next. * 'search_rule' is initialized to SEARCH_INIT. */ #define CURRENT 1 #define SOURCE 2 #if SYS_FAMILY == SYS_UNIX #define SYSTEM_OLD "unix" #define SYSTEM_STD1 "__unix" #define SYSTEM_STD2 "__unix__" #endif #if SYSTEM == SYS_FREEBSD #define SYSTEM_EXT "__FreeBSD__" #endif #if SYSTEM == SYS_LINUX #define SYSTEM_EXT "__linux__" #endif #if SYSTEM == SYS_MAC #define SYSTEM_EXT "__APPLE__" #endif #if SYSTEM == SYS_CYGWIN #define SYSTEM_EXT "__CYGWIN__" #if defined (__CYGWIN64__) #define SYSTEM_EXT2 "__CYGWIN64__" #else #define SYSTEM_EXT2 "__CYGWIN32__" #endif #ifndef MBCHAR #define MBCHAR SJIS #endif #endif #if SYSTEM == SYS_MINGW #define SYSTEM_EXT "__MINGW__" #if defined (__MINGW64__) #define SYSTEM_EXT2 "__MINGW64__" #else #define SYSTEM_EXT2 "__MINGW32__" #endif #ifndef MBCHAR #define MBCHAR SJIS #endif #endif #if SYS_FAMILY == SYS_UNIX #ifndef MBCHAR #define MBCHAR EUC_JP /* UTF8 if you like */ #endif #endif #if COMPILER == GNUC #define COMPILER_EXT "__GNUC__" #define COMPILER_EXT_VAL GCC_MAJOR_VERSION #define COMPILER_EXT2 "__GNUC_MINOR__" #define COMPILER_EXT2_VAL GCC_MINOR_VERSION #define COMPILER_CPLUS "__GNUG__" #define COMPILER_CPLUS_VAL GCC_MAJOR_VERSION #ifndef ENV_C_INCLUDE_DIR #define ENV_C_INCLUDE_DIR "C_INCLUDE_PATH" #define ENV_CPLUS_INCLUDE_DIR "CPLUS_INCLUDE_PATH" #endif /* * __SIZE_TYPE__, __PTRDIFF_TYPE__ and __WCHAR_TYPE__ are the predefines of * GCC and undocumented in GCC 2. * On GCC V.3.*, V.4.*, these macros are known by mcpp_g*_predef_*.h files. */ #if __GNUC__ == 2 #define COMPILER_SP1 "__SIZE_TYPE__" #define COMPILER_SP2 "__PTRDIFF_TYPE__" #define COMPILER_SP3 "__WCHAR_TYPE__" #endif #define CMP_NAME "GCC" #endif /* COMPILER == GNUC */ #if COMPILER == INDEPENDENT /* specifications of compiler-independent-build */ #define LINE_PREFIX "#line " #define STD_LINE_PREFIX TRUE /* Output #line by C source format */ #define HAVE_DIGRAPHS TRUE /* Output digraphs as it is */ #define SEARCH_INIT SOURCE /* Include directory relative to source */ #define SJIS_IS_ESCAPE_FREE TRUE /* Do not treat SJIS specially */ #define BIGFIVE_IS_ESCAPE_FREE TRUE /* Do not treat specially */ #define ISO2022_JP_IS_ESCAPE_FREE TRUE /* Do not treat specially */ #define TARGET_HAVE_LONG_LONG TRUE /* dummy */ #define STDC_VERSION 199409L /* Initial value of __STDC_VERSION__ */ #endif /* * defaults */ #ifdef SYSTEM_EXT #ifndef SYSTEM_EXT_VAL #define SYSTEM_EXT_VAL "1" #endif #endif #ifdef SYSTEM_EXT2 #ifndef SYSTEM_EXT2_VAL #define SYSTEM_EXT2_VAL "1" #endif #endif #ifdef COMPILER_STD1 #ifndef COMPILER_STD1_VAL #define COMPILER_STD1_VAL "1" #endif #endif #ifdef COMPILER_STD2 #ifndef COMPILER_STD2_VAL #define COMPILER_STD2_VAL "1" #endif #endif #ifdef COMPILER_EXT #ifndef COMPILER_EXT_VAL #define COMPILER_EXT_VAL "1" #endif #endif #ifdef COMPILER_EXT2 #ifndef COMPILER_EXT2_VAL #define COMPILER_EXT2_VAL "1" #endif #endif #ifdef COMPILER_CPLUS #ifndef COMPILER_CPLUS_VAL #define COMPILER_CPLUS_VAL "1" #endif #endif #ifndef ENV_C_INCLUDE_DIR #define ENV_C_INCLUDE_DIR "INCLUDE" #endif #ifndef ENV_CPLUS_INCLUDE_DIR #define ENV_CPLUS_INCLUDE_DIR "CPLUS_INCLUDE" #endif #ifndef ENV_SEP #if SYS_FAMILY == SYS_WIN #define ENV_SEP ';' #else #define ENV_SEP ':' #endif #endif #ifndef ONE_PASS #define ONE_PASS FALSE #endif /* * CHARBIT, UCHARMAX are respectively CHAR_BIT, UCHAR_MAX of target compiler. * CHARBIT should be defined to the number of bits per character. * It is needed only for processing of multi-byte character constants. * UCHARMAX should be defined to the maximum value of type unsigned char * or maximum value of unsigned int which is converted from type (signed) * char. * * LONGMAX should be defined to the LONG_MAX in . * ULONGMAX should be defined to the ULONG_MAX in . */ /* _POSIX_* only to get PATH_MAX */ #define _POSIX_ 1 #define _POSIX_SOURCE 1 #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 1 #define _POSIX_C_SOURCE_defined 1 #endif #include "limits.h" #undef _POSIX_ #undef _POSIX_SOURCE #ifdef _POSIX_C_SOURCE_defined #undef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE_defined #endif #define CHARBIT CHAR_BIT #define UCHARMAX UCHAR_MAX #define USHRTMAX USHRT_MAX #define LONGMAX LONG_MAX #define ULONGMAX ULONG_MAX /* * Define MBCHAR (multi-byte character encoding) to SJIS, EUC_JP or other. */ #ifndef MBCHAR #define MBCHAR 0 #endif /* * SJIS_IS_ESCAPE_FREE means the compiler does not escape '0x5c' ('\\') in * shift-JIS encoded multi-byte character. SJIS_IS_ESCAPE_FREE == FALSE * enables cpp to insert * '\\' before '\\' of the 2nd byte of SJIS code in * literal. This insertion is for the compiler-proper which can't recognize * SJIS literal. * BIGFIVE_IS_ESCAPE_FREE means similar case on BIGFIVE encoding. * ISO2022_JP_IS_ESCAPE_FREE means similar case on ISO2022_JP encoding. */ #ifndef SJIS_IS_ESCAPE_FREE #define SJIS_IS_ESCAPE_FREE FALSE /* or TRUE following your compiler */ #endif #ifndef BIGFIVE_IS_ESCAPE_FREE #define BIGFIVE_IS_ESCAPE_FREE FALSE /* or TRUE following your compiler */ #endif #ifndef ISO2022_JP_IS_ESCAPE_FREE #define ISO2022_JP_IS_ESCAPE_FREE FALSE /* or TRUE following compiler */ #endif /* * P A R T 2 Configurations for host-compiler. * * WARNING: In case of HOST_COMPILER differs from COMPILER, you must * edit here and there of this part. */ #define HOST_HAVE_STPCPY HAVE_STPCPY /* * Declaration of standard library functions and macros. */ /* stdin, stdout, stderr, FILE, NULL, fgets(), fputs() and other functions. */ #include "stdio.h" /* PATHMAX is the maximum length of path-list on the host system. */ #ifdef PATH_MAX #define PATHMAX PATH_MAX /* Posix macro */ #else #define PATHMAX FILENAME_MAX #endif /* islower(), isupper(), toupper(), isdigit(), isxdigit(), iscntrl() */ #include "ctype.h" /* errno */ #include "errno.h" #include "string.h" #include "stdlib.h" #include "time.h" #include "setjmp.h" /* For debugging malloc systems by kmatsui */ #if KMMALLOC && _MEM_DEBUG #include "xalloc.h" #endif mcpp-2.7.2/src/eval.c0000644000175000017500000016442711065171315011302 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * E V A L . C * E x p r e s s i o n E v a l u a t i o n * * The routines to evaluate #if expression are placed here. * Some routines are used also to evaluate the value of numerical tokens. */ #if PREPROCESSED #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif typedef struct optab { char op; /* Operator */ char prec; /* Its precedence */ char skip; /* Short-circuit: non-0 to skip */ } OPTAB; static int eval_lex( void); /* Get type and value of token */ static int chk_ops( void); /* Check identifier-like ops */ static VAL_SIGN * eval_char( char * const token); /* Evaluate character constant */ static expr_t eval_one( char ** seq_pp, int wide, int mbits, int * ucn8); /* Evaluate a character */ static VAL_SIGN * eval_eval( VAL_SIGN * valp, int op); /* Entry to #if arithmetic */ static expr_t eval_signed( VAL_SIGN ** valpp, expr_t v1, expr_t v2, int op); /* Do signed arithmetic of expr.*/ static expr_t eval_unsigned( VAL_SIGN ** valpp, uexpr_t v1u, uexpr_t v2u , int op); /* Do unsigned arithmetic */ static void overflow( const char * op_name, VAL_SIGN ** valpp , int ll_overflow); /* Diagnose overflow of expr. */ static int do_sizeof( void); /* Evaluate sizeof (type) */ static int look_type( int typecode); /* Look for type of the name */ static void dump_val( const char * msg, const VAL_SIGN * valp); /* Print value of an operand */ static void dump_stack( const OPTAB * opstack, const OPTAB * opp , const VAL_SIGN * value, const VAL_SIGN * valp); /* Print stacked operators */ /* For debug and error messages. */ static const char * const opname[ OP_END + 1] = { "end of expression", "val", "(", "unary +", "unary -", "~", "!", "*", "/", "%", "+", "-", "<<", ">>", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "?", ":", ")", "(none)" }; /* * opdope[] has the operator (and operand) precedence: * Bits * 7 Unused (so the value is always positive) * 6-2 Precedence (0000 .. 0174) * 1-0 Binary op. flags: * 10 The next binop flag (binop should/not follow). * 01 The binop flag (should be set/cleared when this op is seen). * Note: next binop * value 1 0 Value doesn't follow value. * Binop, ), END should follow value, value or unop doesn't. * ( 0 0 ( doesn't follow value. Value follows. * unary 0 0 Unop doesn't follow value. Value follows. * binary 0 1 Binary op follows value. Value follows. * ) 1 1 ) follows value. Binop, ), END follows. * END 0 1 END follows value, doesn't follow ops. */ static const char opdope[ OP_END + 1] = { 0001, /* End of expression */ 0002, 0170, /* VAL (constant), LPA */ /* Unary op's */ 0160, 0160, 0160, 0160, /* PLU, NEG, COM, NOT */ /* Binary op's */ 0151, 0151, 0151, /* MUL, DIV, MOD, */ 0141, 0141, 0131, 0131, /* ADD, SUB, SL, SR */ 0121, 0121, 0121, 0121, 0111, 0111, /* LT, LE, GT, GE, EQ, NE */ 0101, 0071, 0061, 0051, 0041, /* AND, XOR, OR, ANA, ORO */ 0031, 0031, /* QUE, COL */ /* Parens */ 0013, 0023 /* RPA, END */ }; /* * OP_QUE, OP_RPA and unary operators have alternate precedences: */ #define OP_RPA_PREC 0013 #define OP_QUE_PREC 0024 /* From right to left grouping */ #define OP_UNOP_PREC 0154 /* ditto */ /* * S_ANDOR and S_QUEST signal "short-circuit" boolean evaluation, so that * #if FOO != 0 && 10 / FOO ... * doesn't generate an error message. They are stored in optab.skip. */ #define S_ANDOR 2 #define S_QUEST 1 static VAL_SIGN ev; /* Current value and signedness */ static int skip = 0; /* 3-way signal of skipping expr*/ static const char * const non_eval = " (in non-evaluated sub-expression)"; /* _W8_ */ #if HAVE_LONG_LONG && COMPILER == INDEPENDENT static int w_level = 1; /* warn_level at overflow of long */ #else static int w_level = 2; #endif /* * In KR and OLD_PREP modes. * Define bits for the basic types and their adjectives. */ #define T_CHAR 1 #define T_INT 2 #define T_FLOAT 4 #define T_DOUBLE 8 #define T_LONGDOUBLE 16 #define T_SHORT 32 #define T_LONG 64 #define T_LONGLONG 128 #define T_SIGNED 256 #define T_UNSIGNED 512 #define T_PTR 1024 /* Pointer to data objects */ #define T_FPTR 2048 /* Pointer to functions */ /* * The SIZES structure is used to store the values for #if sizeof. */ typedef struct sizes { int bits; /* If this bit is set, */ int size; /* this is the datum size value */ int psize; /* this is the pointer size */ } SIZES; /* * S_CHAR, etc. define the sizeof the basic TARGET machine word types. * By default, sizes are set to the values for the HOST computer. If * this is inappropriate, see those tables for details on what to change. * Also, if you have a machine where sizeof (signed int) differs from * sizeof (unsigned int), you will have to edit those tables and code in * eval.c. * Note: sizeof in #if expression is disallowed by Standard. */ #define S_CHAR (sizeof (char)) #define S_SINT (sizeof (short int)) #define S_INT (sizeof (int)) #define S_LINT (sizeof (long int)) #define S_FLOAT (sizeof (float)) #define S_DOUBLE (sizeof (double)) #define S_PCHAR (sizeof (char *)) #define S_PSINT (sizeof (short int *)) #define S_PINT (sizeof (int *)) #define S_PLINT (sizeof (long int *)) #define S_PFLOAT (sizeof (float *)) #define S_PDOUBLE (sizeof (double *)) #define S_PFPTR (sizeof (int (*)())) #if HAVE_LONG_LONG #if (HOST_COMPILER == BORLANDC) \ || (HOST_COMPILER == MSC && defined(_MSC_VER) && (_MSC_VER < 1300)) #define S_LLINT (sizeof (__int64)) #define S_PLLINT (sizeof (__int64 *)) #else #define S_LLINT (sizeof (long long int)) #define S_PLLINT (sizeof (long long int *)) #endif #endif #define S_LDOUBLE (sizeof (long double)) #define S_PLDOUBLE (sizeof (long double *)) typedef struct types { int type; /* This is the bits for types */ char * token_name; /* this is the token word */ int excluded; /* but these aren't legal here. */ } TYPES; #define ANYSIGN (T_SIGNED | T_UNSIGNED) #define ANYFLOAT (T_FLOAT | T_DOUBLE | T_LONGDOUBLE) #if HAVE_LONG_LONG #define ANYINT (T_CHAR | T_SHORT | T_INT | T_LONG | T_LONGLONG) #else #define ANYINT (T_CHAR | T_SHORT | T_INT | T_LONG) #endif static const TYPES basic_types[] = { { T_CHAR, "char", ANYFLOAT | ANYINT }, { T_SHORT, "short", ANYFLOAT | ANYINT }, { T_INT, "int", ANYFLOAT | T_CHAR | T_INT }, { T_LONG, "long", ANYFLOAT | ANYINT }, #if HAVE_LONG_LONG #if HOST_COMPILER == BORLANDC { T_LONGLONG, "__int64", ANYFLOAT | ANYINT }, #else { T_LONGLONG, "long long", ANYFLOAT | ANYINT }, #endif #endif { T_FLOAT, "float", ANYFLOAT | ANYINT | ANYSIGN }, { T_DOUBLE, "double", ANYFLOAT | ANYINT | ANYSIGN }, { T_LONGDOUBLE, "long double", ANYFLOAT | ANYINT | ANYSIGN }, { T_SIGNED, "signed", ANYFLOAT | ANYINT | ANYSIGN }, { T_UNSIGNED, "unsigned", ANYFLOAT | ANYINT | ANYSIGN }, { 0, NULL, 0 } /* Signal end */ }; /* * In this table, T_FPTR (pointer to function) should be placed last. */ static const SIZES size_table[] = { { T_CHAR, S_CHAR, S_PCHAR }, /* char */ { T_SHORT, S_SINT, S_PSINT }, /* short int */ { T_INT, S_INT, S_PINT }, /* int */ { T_LONG, S_LINT, S_PLINT }, /* long */ #if HAVE_LONG_LONG { T_LONGLONG, S_LLINT, S_PLLINT }, /* long long */ #endif { T_FLOAT, S_FLOAT, S_PFLOAT }, /* float */ { T_DOUBLE, S_DOUBLE, S_PDOUBLE }, /* double */ { T_LONGDOUBLE, S_LDOUBLE, S_PLDOUBLE }, /* long double */ { T_FPTR, 0, S_PFPTR }, /* int (*()) */ { 0, 0, 0 } /* End of table */ }; #define is_binary(op) (FIRST_BINOP <= op && op <= LAST_BINOP) #define is_unary(op) (FIRST_UNOP <= op && op <= LAST_UNOP) #if MCPP_LIB void init_eval( void) { skip = 0; } #endif expr_t eval_if( void) /* * Evaluate a #if expression. Straight-forward operator precedence. * This is called from directive() on encountering an #if directive. * It calls the following routines: * eval_lex() Lexical analyser -- returns the type and value of * the next input token. * eval_eval() Evaluates the current operator, given the values on the * value stack. Returns a pointer to the (new) value stack. */ { VAL_SIGN value[ NEXP * 2 + 1]; /* Value stack */ OPTAB opstack[ NEXP * 3 + 1]; /* Operator stack */ int parens = 0; /* Nesting levels of (, ) */ int prec; /* Operator precedence */ int binop = 0; /* Set if binary op. needed */ int op1; /* Operator from stack */ int skip_cur; /* For short-circuit testing */ VAL_SIGN * valp = value; /* -> Value and signedness */ OPTAB * opp = opstack; /* -> Operator stack */ int op; /* Current operator */ opp->op = OP_END; /* Mark bottom of stack */ opp->prec = opdope[ OP_END]; /* And its precedence */ skip = skip_cur = opp->skip = 0; /* Not skipping now */ while (1) { if (mcpp_debug & EXPRESSION) mcpp_fprintf( DBG , "In eval loop skip = %d, binop = %d, line is: %s\n" , opp->skip, binop, infile->bptr); skip = opp->skip; op = eval_lex(); skip = 0; /* Reset to be ready to return */ switch (op) { case OP_SUB : if (binop == 0) op = OP_NEG; /* Unary minus */ break; case OP_ADD : if (binop == 0) op = OP_PLU; /* Unary plus */ break; case OP_FAIL: return 0L; /* Token error */ } if (mcpp_debug & EXPRESSION) mcpp_fprintf( DBG , "op = %s, opdope = %04o, binop = %d, skip = %d\n" , opname[ op], opdope[ op], binop, opp->skip); if (op == VAL) { /* Value? */ if (binop != 0) { /* Binop is needed */ cerror( "Misplaced constant \"%s\"" /* _E_ */ , work_buf, 0L, NULL); return 0L; } else if (& value[ NEXP * 2] <= valp) { cerror( "More than %.0s%ld constants stacked at %s" /* _E_ */ , NULL, (long) (NEXP * 2 - 1), work_buf); return 0L; } else { if (mcpp_debug & EXPRESSION) { dump_val( "pushing ", &ev); mcpp_fprintf( DBG, " onto value stack[%d]\n" , (int)(valp - value)); } valp->val = ev.val; (valp++)->sign = ev.sign; binop = 1; /* Binary operator or so should follow */ } continue; } /* Else operators */ prec = opdope[ op]; if (binop != (prec & 1)) { if (op == OP_EOE) cerror( "Unterminated expression" /* _E_ */ , NULL, 0L, NULL); else cerror( "Operator \"%s\" in incorrect context" /* _E_ */ , opname[ op], 0L, NULL); return 0L; } binop = (prec & 2) >> 1; /* Binop should follow? */ while (1) { if (mcpp_debug & EXPRESSION) mcpp_fprintf( DBG , "op %s, prec %d, stacked op %s, prec %d, skip %d\n" , opname[ op], prec, opname[ opp->op], opp->prec, opp->skip); /* Stack coming sub-expression of higher precedence. */ if (opp->prec < prec) { if (op == OP_LPA) { prec = OP_RPA_PREC; if (standard && (warn_level & 4) && ++parens == std_limits.exp_nest + 1) cwarn( "More than %.0s%ld nesting of parens" /* _W4_ */ , NULL, (long) std_limits.exp_nest, NULL); } else if (op == OP_QUE) { prec = OP_QUE_PREC; } else if (is_unary( op)) { prec = OP_UNOP_PREC; } op1 = opp->skip; /* Save skip for test */ /* * Push operator onto operator stack. */ opp++; if (& opstack[ NEXP * 3] <= opp) { cerror( "More than %.0s%ld operators and parens stacked at %s" /* _E_ */ , NULL, (long) (NEXP * 3 - 1), opname[ op]); return 0L; } opp->op = op; opp->prec = prec; if (&value[0] < valp) skip_cur = (valp[-1].val != 0L); /* Short-circuit tester */ /* * Do the short-circuit stuff here. Short-circuiting * stops automagically when operators are evaluated. */ if ((op == OP_ANA && ! skip_cur) || (op == OP_ORO && skip_cur)) { opp->skip = S_ANDOR; /* And/or skip starts */ if (skip_cur) /* Evaluate non-zero */ valp[-1].val = 1L; /* value to 1 */ } else if (op == OP_QUE) { /* Start of ?: operator */ opp->skip = (op1 & S_ANDOR) | (!skip_cur ? S_QUEST : 0); } else if (op == OP_COL) { /* : inverts S_QUEST */ opp->skip = (op1 & S_ANDOR) | (((op1 & S_QUEST) != 0) ? 0 : S_QUEST); } else { /* Other operators leave*/ opp->skip = op1; /* skipping unchanged. */ } if (mcpp_debug & EXPRESSION) { mcpp_fprintf( DBG, "stacking %s, ", opname[ op]); if (&value[0] < valp) dump_val( "valp[-1].val == ", valp - 1); mcpp_fprintf( DBG, " at %s\n", infile->bptr); dump_stack( opstack, opp, value, valp); } break; } /* * Coming sub-expression is of lower precedence. * Evaluate stacked sub-expression. * Pop operator from operator stack and evaluate it. * End of stack and '(', ')' are specials. */ skip_cur = opp->skip; /* Remember skip value */ switch ((op1 = opp->op)) { /* Look at stacked op */ case OP_END: /* Stack end marker */ if (op == OP_RPA) { /* No corresponding ( */ cerror( "Excessive \")\"", NULL, 0L, NULL); /* _E_ */ return 0L; } if (op == OP_EOE) return valp[-1].val; /* Finished ok. */ break; case OP_LPA: /* ( on stack */ if (op != OP_RPA) { /* Matches ) on input? */ cerror( "Missing \")\"", NULL, 0L, NULL); /* _E_ */ return 0L; } opp--; /* Unstack it */ parens--; /* Count down nest level*/ break; case OP_QUE: /* Evaluate true expr. */ break; case OP_COL: /* : on stack */ opp--; /* Unstack : */ if (opp->op != OP_QUE) { /* Matches ? on stack? */ cerror( "Misplaced \":\", previous operator is \"%s\"" /* _E_ */ , opname[opp->op], 0L, NULL); return 0L; } /* Evaluate op1. Fall through */ default: /* Others: */ opp--; /* Unstack the operator */ if (mcpp_debug & EXPRESSION) { mcpp_fprintf( DBG, "Stack before evaluation of %s\n" , opname[ op1]); dump_stack( opstack, opp, value, valp); } if (op1 == OP_COL) skip = 0; else skip = skip_cur; valp = eval_eval( valp, op1); if (valp->sign == VAL_ERROR) return 0L; /* Out of range or divide by 0 */ valp++; skip = 0; if (mcpp_debug & EXPRESSION) { mcpp_fprintf( DBG, "Stack after evaluation\n"); dump_stack( opstack, opp, value, valp); } } /* op1 switch end */ if (op1 == OP_END || op1 == OP_LPA || op1 == OP_QUE) break; /* Read another op. */ } /* Stack unwind loop */ } return 0L; /* Never reach here */ } static int eval_lex( void) /* * Return next operator or constant to evaluate. Called from eval_if(). It * calls a special-purpose routines for character constants and numeric values: * eval_char() called to evaluate 'x' * eval_num() called to evaluate numbers * C++98 treats 11 identifier-like tokens as operators. * POST_STD forbids character constants in #if expression. */ { int c1; VAL_SIGN * valp; int warn = ! skip || (warn_level & 8); int token_type; int c; ev.sign = SIGNED; /* Default signedness */ ev.val = 0L; /* Default value (on error or 0 value) */ in_if = ! skip; /* Inform to expand_macro() that the macro is */ /* in #if line and not skipped expression. */ c = skip_ws(); if (c == '\n') { unget_ch(); return OP_EOE; /* End of expression */ } token_type = get_unexpandable( c, warn); if (standard && macro_line == MACRO_ERROR) return OP_FAIL; /* Unterminated macro call */ if (token_type == NO_TOKEN) return OP_EOE; /* Only macro(s) expanding to 0-token */ switch (token_type) { case NAM: if (standard && str_eq( identifier, "defined")) { /* defined name */ c1 = c = skip_ws(); if (c == '(') /* Allow defined (name) */ c = skip_ws(); if (scan_token( c, (workp = work_buf, &workp), work_end) == NAM) { DEFBUF * defp = look_id( identifier); if (warn) { ev.val = (defp != NULL); if ((mcpp_debug & MACRO_CALL) && ! skip && defp) /* Annotate if the macro is in non-skipped expr. */ mcpp_fprintf( OUT, "/*%s*/", defp->name); } if (c1 != '(' || skip_ws() == ')') /* Balanced ? */ return VAL; /* Parsed ok */ } cerror( "Bad defined syntax: %s" /* _E_ */ , infile->fp ? "" : infile->buffer, 0L, NULL); break; } else if (cplus_val) { if (str_eq( identifier, "true")) { ev.val = 1L; return VAL; } else if (str_eq( identifier, "false")) { ev.val = 0L; return VAL; } else if (mcpp_mode != POST_STD && (openum = id_operator( identifier)) != 0) { /* Identifier-like operator in C++98 */ strcpy( work_buf, identifier); return chk_ops(); } } else if (! standard && str_eq( identifier, "sizeof")) { /* sizeof hackery */ return do_sizeof(); /* Gets own routine */ } /* * The ANSI C Standard says that an undefined symbol * in an #if has the value zero. We are a bit pickier, * warning except where the programmer was careful to write * #if defined(foo) ? foo : 0 */ if ((! skip && (warn_level & 4)) || (skip && (warn_level & 8))) cwarn( "Undefined symbol \"%s\"%.0ld%s" /* _W4_ _W8_ */ , identifier, 0L, skip ? non_eval : ", evaluated to 0"); return VAL; case CHR: /* Character constant */ case WCHR: /* Wide char constant */ if (mcpp_mode == POST_STD) { cerror( "Can't use a character constant %s" /* _E_ */ , work_buf, 0L, NULL); break; } valp = eval_char( work_buf); /* 'valp' points 'ev' */ if (valp->sign == VAL_ERROR) break; if (mcpp_debug & EXPRESSION) { dump_val( "eval_char returns ", &ev); mcpp_fputc( '\n', DBG); } return VAL; /* Return a value */ case STR: /* String literal */ case WSTR: /* Wide string literal */ cerror( "Can't use a string literal %s", work_buf, 0L, NULL); /* _E_ */ break; case NUM: /* Numbers are harder */ valp = eval_num( work_buf); /* 'valp' points 'ev' */ if (valp->sign == VAL_ERROR) break; if (mcpp_debug & EXPRESSION) { dump_val( "eval_num returns ", &ev); mcpp_fputc( '\n', DBG); } return VAL; case OPE: /* Operator or punctuator */ return chk_ops(); default: /* Total nonsense */ cerror( "Can't use the character %.0s0x%02lx" /* _E_ */ , NULL, (long) c, NULL); break; } return OP_FAIL; /* Any errors */ } static int chk_ops( void) /* * Check the operator. * If it can't be used in #if expression return OP_FAIL * else return openum. */ { switch (openum) { case OP_STR: case OP_CAT: case OP_ELL: case OP_1: case OP_2: case OP_3: cerror( "Can't use the operator \"%s\"" /* _E_ */ , work_buf, 0L, NULL); return OP_FAIL; default: return openum; } } static int do_sizeof( void) /* * Process the sizeof (basic type) operation in an #if string. * Sets ev.val to the size and returns * VAL success * OP_FAIL bad parse or something. * This routine is never called in STD and POST_STD mode. */ { const char * const no_type = "sizeof: No type specified"; /* _E_ */ int warn = ! skip || (warn_level & 8); int type_end = FALSE; int typecode = 0; int token_type = NO_TOKEN; const SIZES * sizp = NULL; if (get_unexpandable( skip_ws(), warn) != OPE || openum != OP_LPA) goto no_good; /* Not '(' */ /* * Scan off the tokens. */ while (! type_end) { token_type = get_unexpandable( skip_ws(), warn); /* Get next token expanding macros */ switch (token_type) { case OPE: if (openum == OP_LPA) { /* thing (*)() func ptr */ if (get_unexpandable( skip_ws(), warn) == OPE && openum == OP_MUL && get_unexpandable( skip_ws(), warn) == OPE && openum == OP_RPA) { /* (*) */ if (get_unexpandable( skip_ws(), warn) != OPE || openum != OP_LPA || get_unexpandable( skip_ws(), warn) != OPE || openum != OP_RPA) /* Not () */ goto no_good; typecode |= T_FPTR; /* Function pointer */ } else { /* Junk is an error */ goto no_good; } } else { /* '*' or ')' */ type_end = TRUE; } break; case NAM: /* Look for type comb. */ if ((typecode = look_type( typecode)) == 0) return OP_FAIL; /* Illegal type or comb.*/ break; default: goto no_good; /* Illegal token */ } } /* End of while */ /* * We are at the end of the type scan. Chew off '*' if necessary. */ if (token_type == OPE) { if (openum == OP_MUL) { /* '*' */ typecode |= T_PTR; if (get_unexpandable( skip_ws(), warn) != OPE) goto no_good; } if (openum == OP_RPA) { /* ')' */ /* * Last syntax check * We assume that all function pointers are the same size: * sizeof (int (*)()) == sizeof (float (*)()) * We assume that signed and unsigned don't change the size: * sizeof (signed int) == sizeof (unsigned int) */ if ((typecode & T_FPTR) != 0) { /* Function pointer */ typecode = T_FPTR | T_PTR; } else { /* Var or var * datum */ typecode &= ~(T_SIGNED | T_UNSIGNED); #if HAVE_LONG_LONG if ((typecode & (T_SHORT | T_LONG | T_LONGLONG)) != 0) #else if ((typecode & (T_SHORT | T_LONG)) != 0) #endif typecode &= ~T_INT; } if ((typecode & ~T_PTR) == 0) { cerror( no_type, NULL, 0L, NULL); return OP_FAIL; } else { /* * Exactly one bit (and possibly T_PTR) may be set. */ for (sizp = size_table; sizp->bits != 0; sizp++) { if ((typecode & ~T_PTR) == sizp->bits) { ev.val = ((typecode & T_PTR) != 0) ? sizp->psize : sizp->size; break; } } } } else { goto no_good; } } else { goto no_good; } if (mcpp_debug & EXPRESSION) { if (sizp) mcpp_fprintf( DBG, "sizp->bits:0x%x sizp->size:0x%x sizp->psize:0x%x ev.val:0x%lx\n" , sizp->bits, sizp->size, sizp->psize , (unsigned long) ev.val); } return VAL; no_good: unget_ch(); cerror( "sizeof: Syntax error", NULL, 0L, NULL); /* _E_ */ return OP_FAIL; } static int look_type( int typecode ) { const char * const unknown_type = "sizeof: Unknown type \"%s\"%.0ld%s"; /* _E_ _W8_ */ const char * const illeg_comb = "sizeof: Illegal type combination with \"%s\"%.0ld%s"; /* _E_ _W8_ */ int token_type; const TYPES * tp; if (str_eq( identifier, "long")) { if ((token_type = get_unexpandable( skip_ws(), !skip || (warn_level & 8))) == NO_TOKEN) return typecode; if (token_type == NAM) { #if HAVE_LONG_LONG if (str_eq( identifier, "long")) { strcpy( work_buf, "long long"); goto basic; } #endif if (str_eq( identifier, "double")) { strcpy( work_buf, "long double"); goto basic; } } unget_string( work_buf, NULL); /* Not long long */ strcpy( work_buf, "long"); /* nor long double */ } /* * Look for this unexpandable token in basic_types. */ basic: for (tp = basic_types; tp->token_name != NULL; tp++) { if (str_eq( work_buf, tp->token_name)) break; } if (tp->token_name == NULL) { if (! skip) { cerror( unknown_type, work_buf, 0L, NULL); return 0; } else if (warn_level & 8) { cwarn( unknown_type, work_buf, 0L, non_eval); } } if ((typecode & tp->excluded) != 0) { if (! skip) { cerror( illeg_comb, work_buf, 0L, NULL); return 0; } else if (warn_level & 8) { cwarn( illeg_comb, work_buf, 0L, non_eval); } } if (mcpp_debug & EXPRESSION) { if (tp->token_name) mcpp_fprintf( DBG, "sizeof -- typecode:0x%x tp->token_name:\"%s\" tp->type:0x%x\n" , typecode, tp->token_name, tp->type); } return typecode |= tp->type; /* Or in the type bit */ } VAL_SIGN * eval_num( const char * nump /* Preprocessing number */ ) /* * Evaluate number for #if lexical analysis. Note: eval_num recognizes * the unsigned suffix, but only returns a signed expr_t value, and stores * the signedness to ev.sign, which is set UNSIGNED (== unsigned) if the * value is not in the range of positive (signed) expr_t. */ { const char * const not_integer = "Not an integer \"%s\""; /* _E_ */ const char * const out_of_range = "Constant \"%s\"%.0ld%s is out of range"; /* _E_ _W1_ _W8_ */ expr_t value; uexpr_t v, v1; /* unsigned long long or unsigned long */ int uflag = FALSE; int lflag = FALSE; int erange = FALSE; int base; int c, c1; const char * cp = nump; #if HAVE_LONG_LONG const char * const out_of_range_long = "Constant \"%s\"%.0ld%s is out of range " /* _E_ _W1_ _W2_ _W8_ */ "of (unsigned) long"; const char * const ll_suffix = "LL suffix is used in other than C99 mode \"%s\"%.0ld%s"; /* _W1_ _W2_ _W8_ */ #if COMPILER == MSC || COMPILER == BORLANDC const char * const i64_suffix = "I64 suffix is used in other than C99 mode \"%s\"%.0ld%s"; /* _W2_ _W8_ */ #endif int llflag = FALSE; int erange_long = FALSE; #endif ev.sign = SIGNED; /* Default signedness */ ev.val = 0L; /* Default value */ if ((char_type[ c = *cp++ & UCHARMAX] & DIG) == 0) /* Dot */ goto num_err; if (c != '0') { /* Decimal */ base = 10; } else if ((c = *cp++ & UCHARMAX) == 'x' || c == 'X') { base = 16; /* Hexadecimal */ c = *cp++ & UCHARMAX; } else if (c == EOS) { /* 0 */ return & ev; } else { /* Octal or illegal */ base = 8; } v = v1 = 0L; for (;;) { c1 = c; if (isupper( c1)) c1 = tolower( c1); if (c1 >= 'a') c1 -= ('a' - 10); else c1 -= '0'; if (c1 < 0 || base <= c1) break; v1 *= base; v1 += c1; if (v1 / base < v) { /* Overflow */ if (! skip) goto range_err; else erange = TRUE; } #if HAVE_LONG_LONG if (! stdc3 && v1 > ULONGMAX) /* Overflow of long or unsigned long */ erange_long = TRUE; #endif v = v1; c = *cp++ & UCHARMAX; } value = v; while (c == 'u' || c == 'U' || c == 'l' || c == 'L') { if (c == 'u' || c == 'U') { if (uflag) goto num_err; uflag = TRUE; } else if (c == 'l' || c == 'L') { #if HAVE_LONG_LONG if (llflag) { goto num_err; } else if (lflag) { llflag = TRUE; if (! stdc3 && ((! skip && (warn_level & w_level)) || (skip && (warn_level & 8)))) cwarn( ll_suffix, nump, 0L, skip ? non_eval : NULL); } else { lflag = TRUE; } #else if (lflag) goto num_err; else lflag = TRUE; #endif } c = *cp++; } #if HAVE_LONG_LONG && (COMPILER == MSC || COMPILER == BORLANDC) if (tolower( c) == 'i') { c1 = atoi( cp); if (c1 == 64) { if (! stdc3 && ((! skip && (warn_level & w_level)) || (skip && (warn_level & 8)))) cwarn( i64_suffix, nump, 0L, skip ? non_eval : NULL); cp += 2; } else if (c1 == 32 || c1 == 16) { cp += 2; } else if (c1 == 8) { cp++; } c = *cp++; } #endif if (c != EOS) goto num_err; if (standard) { if (uflag) /* If 'U' suffixed, uexpr_t is treated as unsigned */ ev.sign = UNSIGNED; else ev.sign = (value >= 0L); #if HAVE_LONG_LONG } else { if (value > LONGMAX) erange_long = TRUE; #endif } ev.val = value; if (erange && (warn_level & 8)) cwarn( out_of_range, nump, 0L, non_eval); #if HAVE_LONG_LONG else if (erange_long && ((skip && (warn_level & 8)) || (! stdc3 && ! skip && (warn_level & w_level)))) cwarn( out_of_range_long, nump, 0L, skip ? non_eval : NULL); #endif return & ev; range_err: cerror( out_of_range, nump, 0L, NULL); ev.sign = VAL_ERROR; return & ev; num_err: cerror( not_integer, nump, 0L, NULL); ev.sign = VAL_ERROR; return & ev; } static VAL_SIGN * eval_char( char * const token ) /* * Evaluate a character constant. * This routine is never called in POST_STD mode. */ { const char * const w_out_of_range = "Wide character constant %s%.0ld%s is out of range"; /* _E_ _W8_ */ const char * const c_out_of_range = "Integer character constant %s%.0ld%s is out of range"; /* _E_ _W8_ */ uexpr_t value; uexpr_t tmp; expr_t cl; int erange = FALSE; int wide = (*token == 'L'); int ucn8; int i; int bits, mbits, u8bits, bits_save; char * cp = token + 1; /* Character content */ #if HAVE_LONG_LONG const char * const w_out_of_range_long = "Wide character constant %s%.0ld%s is " /* _E_ _W1_ _W2_ _W8_ */ "out of range of unsigned long"; const char * const c_out_of_range_long = "Integer character constant %s%.0ld%s is " /* _E_ _W1_ _W2_ _W8_ */ "out of range of unsigned long"; int erange_long = FALSE; #endif bits = CHARBIT; u8bits = CHARBIT * 4; if (mbchar & UTF8) mbits = CHARBIT * 4; else mbits = CHARBIT * 2; if (mcpp_mode == STD && wide) { /* Wide character constant */ cp++; /* Skip 'L' */ bits = mbits; } if (char_type[ *cp & UCHARMAX] & mbchk) { cl = mb_eval( &cp); bits = mbits; } else if ((cl = eval_one( &cp, wide, mbits, (ucn8 = FALSE, &ucn8))) == -1L) { ev.sign = VAL_ERROR; return & ev; } bits_save = bits; value = cl; for (i = 0; *cp != '\'' && *cp != EOS; i++) { if (char_type[ *cp & UCHARMAX] & mbchk) { cl = mb_eval( &cp); if (cl == 0) /* Shift-out sequence of multi-byte or wide character */ continue; bits = mbits; } else { cl = eval_one( &cp, wide, mbits, (ucn8 = FALSE, &ucn8)); if (cl == -1L) { ev.sign = VAL_ERROR; return & ev; } #if OK_UCN if (ucn8 == TRUE) bits = u8bits; else bits = bits_save; #endif } tmp = value; value = (value << bits) | cl; /* Multi-char or multi-byte char */ if ((value >> bits) < tmp) { /* Overflow */ if (! skip) goto range_err; else erange = TRUE; } #if HAVE_LONG_LONG if ((mcpp_mode == STD && (! stdc3 && value > ULONGMAX)) || (! standard && value > LONGMAX)) erange_long = TRUE; #endif } ev.sign = ((expr_t) value >= 0L); ev.val = value; if (erange && skip && (warn_level & 8)) { if (wide) cwarn( w_out_of_range, token, 0L, non_eval); else cwarn( c_out_of_range, token, 0L, non_eval); #if HAVE_LONG_LONG } else if (erange_long && ((skip && (warn_level & 8)) || (! stdc3 && ! skip && (warn_level & w_level)))) { if (wide) cwarn( w_out_of_range_long, token, 0L, skip ? non_eval : NULL); else cwarn( c_out_of_range_long, token, 0L, skip ? non_eval : NULL); #endif } if (i == 0) /* Constant of single (character or wide-character) */ return & ev; if ((! skip && (warn_level & 4)) || (skip && (warn_level & 8))) { if (mcpp_mode == STD && wide) cwarn( "Multi-character wide character constant %s%.0ld%s isn't portable" /* _W4_ _W8_ */ , token, 0L, skip ? non_eval : NULL); else cwarn( "Multi-character or multi-byte character constant %s%.0ld%s isn't portable" /* _W4_ _W8_ */ , token, 0L, skip ? non_eval : NULL); } return & ev; range_err: if (wide) cerror( w_out_of_range, token, 0L, NULL); else cerror( c_out_of_range, token, 0L, NULL); ev.sign = VAL_ERROR; return & ev; } static expr_t eval_one( char ** seq_pp, /* Address of pointer to sequence */ /* eval_one() advances the pointer to sequence */ int wide, /* Flag of wide-character */ int mbits, /* Number of bits of a wide-char */ int * ucn8 /* Flag of UCN-32 bits */ ) /* * Called from eval_char() above to get a single character, single multi- * byte character or wide character (with or without \ escapes). * Returns the value of the character or -1L on error. */ { #if OK_UCN const char * const ucn_malval = "UCN cannot specify the value %.0s\"%08lx\""; /* _E_ _W8_ */ #endif const char * const out_of_range = "%s%ld bits can't represent escape sequence '%s'"; /* _E_ _W8_ */ uexpr_t value; int erange = FALSE; char * seq = *seq_pp; /* Initial seq_pp for diagnostic*/ const char * cp; const char * digits; unsigned uc; unsigned uc1; int count; int bits; size_t wchar_max; uc = *(*seq_pp)++ & UCHARMAX; if (uc != '\\') /* Other than escape sequence */ return (expr_t) uc; /* escape sequence */ uc1 = uc = *(*seq_pp)++ & UCHARMAX; switch (uc) { case 'a': return '\a'; case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; case 'v': return '\v'; #if OK_UCN case 'u': case 'U': if (! stdc2) goto undefined; /* Else Universal character name */ /* Fall through */ #endif case 'x': /* '\xFF' */ if (! standard) goto undefined; digits = "0123456789abcdef"; bits = 4; uc = *(*seq_pp)++ & UCHARMAX; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': digits = "01234567"; bits = 3; break; case '\'': case '"': case '?': case '\\': return (expr_t) uc; default: goto undefined; } wchar_max = (UCHARMAX << CHARBIT) | UCHARMAX; if (mbits == CHARBIT * 4) { if (mcpp_mode == STD) wchar_max = (wchar_max << CHARBIT * 2) | wchar_max; else wchar_max = LONGMAX; } value = 0L; for (count = 0; ; ++count) { if (isupper( uc)) uc = tolower( uc); if ((cp = strchr( digits, uc)) == NULL) break; if (count >= 3 && bits == 3) break; /* Octal escape sequence at most 3 digits */ #if OK_UCN if ((count >= 4 && uc1 == 'u') || (count >= 8 && uc1 == 'U')) break; #endif value = (value << bits) | (cp - digits); #if OK_UCN if (wchar_max < value && uc1 != 'u' && uc1 != 'U') #else if (wchar_max < value) #endif { if (! skip) goto range_err; else erange = TRUE; } uc = *(*seq_pp)++ & UCHARMAX; } (*seq_pp)--; if (erange) { value &= wchar_max; goto range_err; } if (count == 0 && bits == 4) /* '\xnonsense' */ goto undefined; #if OK_UCN if (uc1 == 'u' || uc1 == 'U') { if ((count < 4 && uc1 == 'u') || (count < 8 && uc1 == 'U')) goto undefined; if ((value >= 0L && value <= 0x9FL && value != 0x24L && value != 0x40L && value != 0x60L) || (!stdc3 && value >= 0xD800L && value <= 0xDFFFL)) { if (!skip) cerror( ucn_malval, NULL, (long) value, NULL); else if (warn_level & 8) cwarn( ucn_malval, NULL, (long) value, NULL); } if (count >= 8 && uc1 == 'U') *ucn8 = TRUE; return (expr_t) value; } #endif /* OK_UCN */ if (! wide && (UCHARMAX < value)) { value &= UCHARMAX; goto range_err; } return (expr_t) value; undefined: uc1 = **seq_pp; **seq_pp = EOS; /* For diagnostic */ if ((! skip && (warn_level & 1)) || (skip && (warn_level & 8))) cwarn( "Undefined escape sequence%s %.0ld'%s'" /* _W1_ _W8_ */ , skip ? non_eval : NULL, 0L, seq); **seq_pp = uc1; *seq_pp = seq + 1; return (expr_t) '\\'; /* Returns the escape char */ range_err: uc1 = **seq_pp; **seq_pp = EOS; /* For diagnostic */ if (wide) { if (! skip) cerror( out_of_range, NULL, (long) mbits, seq); else if (warn_level & 8) cwarn( out_of_range, non_eval, (long) mbits, seq); } else { if (! skip) cerror( out_of_range, NULL, (long) CHARBIT, seq); else if (warn_level & 8) cwarn( out_of_range, non_eval, (long) CHARBIT, seq); } **seq_pp = uc1; if (! skip) return -1L; else return (expr_t) value; } static VAL_SIGN * eval_eval( VAL_SIGN * valp, int op ) /* * One or two values are popped from the value stack and do arithmetic. * The result is pushed onto the value stack. * eval_eval() returns the new pointer to the top of the value stack. */ { const char * const zero_div = "%sDivision by zero%.0ld%s"; /* _E_ _W8_ */ #if HAVE_LONG_LONG const char * const neg_format = "Negative value \"%" LL_FORM "d\" is converted to positive \"%" /* _W1_ _W8_*/ LL_FORM "u\"%%s"; #else const char * const neg_format = "Negative value \"%ld\" is converted to positive \"%lu\"%%s"; /* _W1_ _W8_*/ #endif expr_t v1, v2; int sign1, sign2; if (is_binary( op)) { v2 = (--valp)->val; sign2 = valp->sign; } else { v2 = 0L; /* Dummy */ sign2 = SIGNED; /* Dummy */ } v1 = (--valp)->val; sign1 = valp->sign; if (mcpp_debug & EXPRESSION) { mcpp_fprintf( DBG, "%s op %s", (is_binary( op)) ? "binary" : "unary" , opname[ op]); dump_val( ", v1 = ", valp); if (is_binary( op)) dump_val( ", v2 = ", valp + 1); mcpp_fputc( '\n', DBG); } if (standard && (sign1 == UNSIGNED || sign2 == UNSIGNED) && is_binary( op) && op != OP_ANA && op != OP_ORO && op != OP_SR && op != OP_SL) { if (((sign1 == SIGNED && v1 < 0L) || (sign2 == SIGNED && v2 < 0L) ) && ((! skip && (warn_level & 1)) || (skip && (warn_level & 8)))) { char negate[(((sizeof (expr_t) * 8) / 3) + 1) * 2 + 50]; expr_t v3; v3 = (sign1 == SIGNED ? v1 : v2); sprintf( negate, neg_format, v3, v3); cwarn( negate, skip ? non_eval : NULL, 0L, NULL); } valp->sign = sign1 = sign2 = UNSIGNED; } if ((op == OP_SL || op == OP_SR) && ((! skip && (warn_level & 1)) || (skip && (warn_level & 8)))) { if (v2 < 0L || v2 >= sizeof (expr_t) * CHARBIT) cwarn( "Illegal shift count %.0s\"%ld\"%s" /* _W1_ _W8_ */ , NULL, (long) v2, skip ? non_eval : NULL); #if HAVE_LONG_LONG else if (! stdc3 && v2 >= sizeof (long) * CHARBIT && ((! skip && (warn_level & w_level)) || (skip && (warn_level & 8)))) cwarn( "Shift count %.0s\"%ld\" is larger than bit count of long%s" /* _W1_ _W8_*/ , NULL, (long) v2, skip ? non_eval : NULL); #endif } if ((op == OP_DIV || op == OP_MOD) && v2 == 0L) { if (! skip) { cerror( zero_div, NULL, 0L, NULL); valp->sign = VAL_ERROR; return valp; } else { if (warn_level & 8) cwarn( zero_div, NULL, 0L, non_eval); valp->sign = sign1; valp->val = (expr_t) EXPR_MAX; return valp; } } if (! standard || sign1 == SIGNED) v1 = eval_signed( & valp, v1, v2, op); else v1 = eval_unsigned( & valp, (uexpr_t) v1, (uexpr_t) v2, op); if (valp->sign == VAL_ERROR) /* Out of range */ return valp; switch (op) { case OP_NOT: case OP_EQ: case OP_NE: case OP_LT: case OP_LE: case OP_GT: case OP_GE: case OP_ANA: case OP_ORO: valp->sign = SIGNED; break; default: valp->sign = sign1; break; } valp->val = v1; return valp; } static expr_t eval_signed( VAL_SIGN ** valpp, expr_t v1, expr_t v2, int op ) /* * Apply the argument operator to the signed data. * OP_COL is a special case. */ { const char * const illeg_op = "Bug: Illegal operator \"%s\" in eval_signed()"; /* _F_ */ const char * const not_portable = "\"%s\" of negative number isn't portable%.0ld%s"; /* _W1_ _W8_*/ const char * op_name = opname[ op]; VAL_SIGN * valp = *valpp; expr_t val; int chk; /* Flag of overflow in long long */ switch (op) { case OP_EOE: case OP_PLU: break; case OP_NEG: chk = v1 && v1 == -v1; if (chk #if HAVE_LONG_LONG || (! stdc3 && v1 && (long) v1 == (long) -v1) #endif ) overflow( op_name, valpp, chk); v1 = -v1; break; case OP_COM: v1 = ~v1; break; case OP_NOT: v1 = !v1; break; case OP_MUL: val = v1 * v2; chk = v1 && v2 && (val / v1 != v2 || val / v2 != v1); if (chk #if HAVE_LONG_LONG || (! stdc3 && v1 && v2 && ((long)val / (long)v1 != (long)v2 || (long)val / (long)v2 != (long)v1)) #endif ) overflow( op_name, valpp, chk); v1 = val; break; case OP_DIV: case OP_MOD: /* Division by 0 has been already diagnosed by eval_eval(). */ chk = -v1 == v1 && v2 == -1; if (chk /* LONG_MIN / -1 on two's complement */ #if HAVE_LONG_LONG || (! stdc3 && (long)-v1 == (long)v1 && (long)v2 == (long)-1) #endif ) overflow( op_name, valpp, chk); else if (! stdc3 && (v1 < 0L || v2 < 0L) && ((! skip && (warn_level & 1)) || (skip && (warn_level & 8)))) cwarn( not_portable, op_name, 0L, skip ? non_eval : NULL); if (op == OP_DIV) v1 /= v2; else v1 %= v2; break; case OP_ADD: val = v1 + v2; chk = (v2 > 0L && v1 > val) || (v2 < 0L && v1 < val); if (chk #if HAVE_LONG_LONG || (! stdc3 && (((long)v2 > 0L && (long)v1 > (long)val) || ((long)v2 < 0L && (long)v1 < (long)val))) #endif ) overflow( op_name, valpp, chk); v1 = val; break; case OP_SUB: val = v1 - v2; chk = (v2 > 0L && val > v1) || (v2 < 0L && val < v1); if (chk #if HAVE_LONG_LONG || (! stdc3 && (((long)v2 > 0L && (long)val > (long)v1) || ((long)v2 < 0L && (long)val < (long)v1))) #endif ) overflow( op_name, valpp, chk); v1 = val; break; case OP_SL: v1 <<= v2; break; case OP_SR: if (v1 < 0L && ((!skip && (warn_level & 1)) || (skip && (warn_level & 8)))) cwarn( not_portable, op_name, 0L, skip ? non_eval : NULL); v1 >>= v2; break; case OP_LT: v1 = (v1 < v2); break; case OP_LE: v1 = (v1 <= v2); break; case OP_GT: v1 = (v1 > v2); break; case OP_GE: v1 = (v1 >= v2); break; case OP_EQ: v1 = (v1 == v2); break; case OP_NE: v1 = (v1 != v2); break; case OP_AND: v1 &= v2; break; case OP_XOR: v1 ^= v2; break; case OP_OR: v1 |= v2; break; case OP_ANA: v1 = (v1 && v2); break; case OP_ORO: v1 = (v1 || v2); break; case OP_COL: /* * If v1 has the "true" value, v2 has the "false" value. * The top of the value stack has the test. */ v1 = (--*valpp)->val ? v1 : v2; break; default: cfatal( illeg_op, op_name, 0L, NULL); } *valpp = valp; return v1; } static expr_t eval_unsigned( VAL_SIGN ** valpp, uexpr_t v1u, uexpr_t v2u, int op ) /* * Apply the argument operator to the unsigned data. * Called from eval_eval() only in Standard mode. */ { const char * const illeg_op = "Bug: Illegal operator \"%s\" in eval_unsigned()"; /* _F_ */ const char * op_name = opname[ op]; VAL_SIGN * valp = *valpp; uexpr_t v1 = 0; int chk; /* Flag of overflow in unsigned long long */ int minus; /* Big integer converted from signed long */ minus = ! stdc3 && (v1u > ULONGMAX || v2u > ULONGMAX); switch (op) { case OP_EOE: case OP_PLU: v1 = v1u; break; case OP_NEG: v1 = -v1u; if (v1u) overflow( op_name, valpp, TRUE); break; case OP_COM: v1 = ~v1u; break; case OP_NOT: v1 = !v1u; break; case OP_MUL: v1 = v1u * v2u; chk = v1u && v2u && (v1 / v2u != v1u || v1 / v1u != v2u); if (chk #if HAVE_LONG_LONG || (! stdc3 && ! minus && v1 > ULONGMAX) #endif ) overflow( op_name, valpp, chk); break; case OP_DIV: /* Division by 0 has been already diagnosed by eval_eval(). */ v1 = v1u / v2u; break; case OP_MOD: v1 = v1u % v2u; break; case OP_ADD: v1 = v1u + v2u; chk = v1 < v1u; if (chk #if HAVE_LONG_LONG || (! stdc3 && ! minus && v1 > ULONGMAX) #endif ) overflow( op_name, valpp, chk); break; case OP_SUB: v1 = v1u - v2u; chk = v1 > v1u; if (chk #if HAVE_LONG_LONG || (! stdc3 && ! minus && v1 > ULONGMAX) #endif ) overflow( op_name, valpp, chk); break; case OP_SL: v1 = v1u << v2u; break; case OP_SR: v1 = v1u >> v2u; break; case OP_LT: v1 = (v1u < v2u); break; case OP_LE: v1 = (v1u <= v2u); break; case OP_GT: v1 = (v1u > v2u); break; case OP_GE: v1 = (v1u >= v2u); break; case OP_EQ: v1 = (v1u == v2u); break; case OP_NE: v1 = (v1u != v2u); break; case OP_AND: v1 = v1u & v2u; break; case OP_XOR: v1 = v1u ^ v2u; break; case OP_OR: v1 = v1u | v2u; break; case OP_ANA: v1 = (v1u && v2u); break; case OP_ORO: v1 = (v1u || v2u); break; case OP_COL: valp--; if (valp->val) v1 = v1u; else v1 = v2u; break; default: cfatal( illeg_op, op_name, 0L, NULL); } *valpp = valp; return v1; } static void overflow( const char * op_name, VAL_SIGN ** valpp, int ll_overflow /* Flag of overflow in long long */ ) { const char * const out_of_range = "Result of \"%s\" is out of range%.0ld%s"; /* _E_ _W1_ _W8_ */ #if HAVE_LONG_LONG if (standard && ! ll_overflow) { /* Overflow of long not in C99 mode */ if ((! skip && (warn_level & w_level)) || (skip && (warn_level & 8))) cwarn( out_of_range, op_name, 0L, " of (unsigned) long"); } else #endif if (skip) { if (warn_level & 8) cwarn( out_of_range, op_name, 0L, non_eval); /* Else don't warn */ } else if (standard && (*valpp)->sign == UNSIGNED) {/* Never overflow */ if (warn_level & 1) cwarn( out_of_range, op_name, 0L, NULL); } else { cerror( out_of_range, op_name, 0L, NULL); (*valpp)->sign = VAL_ERROR; } } static void dump_val( const char * msg, const VAL_SIGN * valp ) /* * Dump a value by internal representation. */ { #if HAVE_LONG_LONG const char * const format = "%s(%ssigned long long) 0x%016" LL_FORM "x"; #else const char * const format = "%s(%ssigned long) 0x%08lx"; #endif int sign = valp->sign; mcpp_fprintf( DBG, format, msg, sign ? "" : "un", valp->val); } static void dump_stack( const OPTAB * opstack, /* Operator stack */ const OPTAB * opp, /* Pointer into operator stack */ const VAL_SIGN * value, /* Value stack */ const VAL_SIGN * valp /* -> value vector */ ) /* * Dump stacked operators and values. */ { if (opstack < opp) mcpp_fprintf( DBG, "Index op prec skip name -- op stack at %s" , infile->bptr); while (opstack < opp) { mcpp_fprintf( DBG, " [%2d] %2d %04o %d %s\n", (int)(opp - opstack) , opp->op, opp->prec, opp->skip, opname[ opp->op]); opp--; } while (value <= --valp) { mcpp_fprintf( DBG, "value[%d].val = ", (int)(valp - value)); dump_val( "", valp); mcpp_fputc( '\n', DBG); } } mcpp-2.7.2/src/cc1.c0000644000175000017500000000316610713367271011020 00000000000000/* * cc1.c: dummy cc1 and cc1plus to be invoked by MinGW's GCC * MinGW's GCC does not invoke shell-script named cc1. */ #include "stdio.h" #include "string.h" #include "process.h" #define ARG_LIM 64 int exec_program( int argc, char ** argv); int main( int argc, char ** argv) { int status; if (argc - 1 >= ARG_LIM) { fprintf( stderr, "Too many arguments.\n"); return 1; } status = exec_program( argc, argv); /* MinGW does not have fork() nor wait(). */ return status; } int exec_program( int argc, char ** argv) { char * buf[ ARG_LIM]; char temp[ FILENAME_MAX]; char * tp; int plus = 0; int n = 1; int i; int status; size_t len; if (strstr( argv[ 0], "cc1plus")) plus = 1; /* C++ */ tp = strstr( argv[ 0], "cc1"); len = tp - argv[ 0]; memcpy( temp, argv[ 0], len); temp[ len] = '\0'; tp = temp + len; for (i = 1; i < argc; i++) if ((strcmp( argv[ i], "-fpreprocessed") == 0) || (strncmp( argv[ i], "-traditional", 12) == 0)) break; /* Invoke cc1 or cc1plus */ if (i < argc) { strcpy( tp, plus ? "cc1plus_gnuc.exe" : "cc1_gnuc.exe"); } else { /* Invoke mcpp */ strcpy( tp, "mcpp.exe"); if (plus) buf[ n++] = "-+"; /* Insert the option */ } buf[ 0] = temp; for (i = 1; i < argc; i++, n++) buf[ n] = argv[ i]; buf[ n] = NULL; status = spawnv( _P_WAIT, buf[ 0], buf); return status; } mcpp-2.7.2/src/system.c0000644000175000017500000051607111113216257011672 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * Some parts of this code are derived from the public domain software * DECUS cpp (1984,1985) written by Martin Minow. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * S Y S T E M . C * S y s t e m D e p e n d e n t R o u t i n e s * * Routines dependent on O.S., compiler or compiler-driver. * To port MCPP for the systems not yet ported, you must * 1. specify the constants in "configed.H" or "noconfig.H", * 2. append the system-dependent routines in this file. */ #if PREPROCESSED #include "mcpp.H" #else #include "system.H" #include "internal.H" #endif #if HOST_SYS_FAMILY == SYS_UNIX #include "unistd.h" /* For getcwd(), readlink() */ #elif HOST_COMPILER == MSC || HOST_COMPILER == LCC #include "direct.h" #define getcwd( buf, size) _getcwd( buf, size) #elif HOST_COMPILER == BORLANDC #include "dir.h" #endif #include "sys/types.h" #include "sys/stat.h" /* For stat() */ #if ! defined( S_ISREG) #define S_ISREG( mode) (mode & S_IFREG) #define S_ISDIR( mode) (mode & S_IFDIR) #endif #if HOST_COMPILER == MSC #define S_IFREG _S_IFREG #define S_IFDIR _S_IFDIR #define stat( path, stbuf) _stat( path, stbuf) #endif /* Function to compare path-list */ #if FNAME_FOLD #if HOST_COMPILER == GNUC /* CYGWIN, MINGW, MAC */ #include /* POSIX 1, 2001 */ #define str_case_eq( str1, str2) (strcasecmp( str1, str2) == 0) #else /* MSC, BORLANDC, LCC */ #if HOST_COMPILER == MSC #define stricmp( str1, str2) _stricmp( str1, str2) #endif #define str_case_eq( str1, str2) (stricmp( str1, str2) == 0) #endif #else /* ! FNAME_FOLD */ #define str_case_eq( str1, str2) (strcmp( str1, str2) == 0) #endif /* * PATH_DELIM is defined for the O.S. which has single byte path-delimiter. * Note: '\\' or any other character identical to second byte of MBCHAR should * not be used for PATH_DELIM for convenience of path-list parsing. */ #if SYS_FAMILY == SYS_UNIX || SYS_FAMILY == SYS_WIN || SYSTEM == SYS_UNKNOWN #define PATH_DELIM '/' #define SPECIAL_PATH_DELIM FALSE #else /* Any other path-delimiter, define PATH_DELIM by yourself */ #define SPECIAL_PATH_DELIM TRUE /* Any path-delimiter other than '/' */ #endif /* * OBJEXT is the suffix to denote "object" file. */ #ifndef OBJEXT #if SYS_FAMILY == SYS_UNIX || HOST_COMPILER == GNUC #define OBJEXT "o" #elif SYS_FAMILY == SYS_WIN #define OBJEXT "obj" #elif 1 /* Add here appropriate definitions for other systems. */ #endif #endif static void version( void); /* Print version message */ static void usage( int opt); /* Putout usage of MCPP */ static void set_opt_list( char * optlist); /* Set list of legal option chars */ static int parse_warn_level( const char * mcpp_optarg, int opt); /* Parse warning level option */ static void def_a_macro( int opt, char * def); /* Do a -D option */ static void chk_opts( int sflag, int trad); /* Check consistency of options */ #if COMPILER != GNUC static void init_cpu_macro( int gval, int sse); /* Predefine CPU-dependent macros */ #endif static void init_predefines( void); /* Set and unset predefined macros */ static void init_std_defines( void); /* Predefine Standard macros */ static void set_limit( void); /* Set minimum translation limits */ static void set_pragma_op( void); /* Set the _Pragma() operator */ static void put_info( FILEINFO * sharp_file); /* Print compiler-specific-inf */ static char * set_files( int argc, char ** argv, char ** in_pp , char ** out_pp); /* Set input, output, diagnostic */ static void set_sys_dirs( int set_cplus_dir); /* Set system-specific include dirs */ static void set_env_dirs( void); /* Set user-defined include dirs */ static void parse_env( const char * env); /* Parse environment variables */ static void set_a_dir( const char * dirname); /* Append an include directory */ static char * norm_dir( const char * dirname, int framework); /* Normalize include directory path */ static char * norm_path( const char * dir, const char * fname, int inf , int hmap); /* Normalize pathname to compare */ #if SYS_FAMILY == SYS_UNIX static void deref_syml( char * slbuf1, char * slbuf2, char * chk_start); /* Dereference symbolic linked directory and file */ #endif #if COMPILER == GNUC static void init_gcc_macro( void); /* Predefine GCC-specific macros */ static void chk_env( void); /* Check the environment variables */ #elif COMPILER == MSC static void init_msc_macro( void); /* Predefine Visual C-specific macros */ #endif static void def_macros( void); /* Define macros specified by -D */ static void undef_macros( void); /* Undefine macros specified by -U */ static char * md_init( const char * filename, char * output); /* Initialize makefile dependency */ static char * md_quote( char * output); /* 'Quote' special characters */ static int open_include( char * filename, int searchlocal, int next); /* Open the file to include */ static int has_directory( const char * source, char * directory); /* Get directory part of fname */ static int is_full_path( const char * path); /* The path is absolute path list ? */ static int search_dir( char * filename, int searchlocal, int next); /* Search the include directories */ static int open_file( const char ** dirp, const char * src_dir , const char * filename, int local, int include_opt, int sys_frame); /* Open a source file */ static const char * set_fname( const char * filename); /* Remember the source filename */ #if SYSTEM == SYS_MAC #if COMPILER == GNUC static char * search_header_map( const char * hmap_file , const char * filename, char * pathlist); /* Search header map file for a header */ static unsigned hmap_hash( const char * fname); /* Get hash value for the fname */ #endif static void init_framework( void); /* Initialize framework[] */ static int search_framework( char * filename); /* Search "Framework" directories */ static int search_subdir( char * fullname, char * cp, char * frame , char * fname, int sys_frame); /* Search "Headers" and other dirs */ #endif /* SYSTEM == SYS_MAC */ #if 0 /* This function is only for debugging use */ static int chk_dirp( const char ** dirp); /* Check validity of dirp arg for open_file() */ #endif static void cur_file( FILEINFO * file, FILEINFO * sharp_file, int marker); /* Output current source file name */ #if SYS_FAMILY == SYS_WIN static char * bsl2sl( char * filename); /* Convert \ to / in path-list */ #endif static int is_junk( void); /* The directive has trailing junk? */ static void do_once( const char * fullname); /* Process #pragma once */ static int included( const char * fullname); /* The file has been once included? */ static void push_or_pop( int direction); /* Push or pop a macro definition */ static int do_prestd_directive( void); /* Process pre-Standard directives */ static void do_preprocessed( void); /* Process preprocessed file */ static int do_debug( int set); /* #pragma MCPP debug, #debug */ static void dump_path( void); /* Print include search path */ static void do_asm( int asm_start); /* Process #asm, #endasm */ static int mcpp_getopt( int argc, char * const * argv, const char * opts); /* getopt() to prevent linking of glibc getopt */ /* for mcpp_getopt() */ static int mcpp_optind = 1; static int mcpp_opterr = 1; static int mcpp_optopt; static char * mcpp_optarg; static int mb_changed = FALSE; /* Flag of -e option */ static char cur_work_dir[ PATHMAX + 1]; /* Current working directory*/ /* * incdir[] stores the -I directories (and the system-specific #include <...> * directories). This is set by set_a_dir(). A trailing PATH_DELIM is * appended if absent. */ static const char ** incdir; /* Include directories */ static const char ** incend; /* -> active end of incdir */ static int max_inc; /* Number of incdir[] */ typedef struct inc_list { /* List of directories or files */ char * name; /* Filename or directory-name */ size_t len; /* Length of 'name' */ } INC_LIST; /* * fnamelist[] stores the souce file names opened by #include directive for * debugging information. */ static INC_LIST * fnamelist; /* Source file names */ static INC_LIST * fname_end; /* -> active end of fnamelist */ static int max_fnamelist; /* Number of fnamelist[] */ /* once_list[] stores the #pragma once file names. */ static INC_LIST * once_list; /* Once opened file */ static INC_LIST * once_end; /* -> active end of once_list */ static int max_once; /* Number of once_list[] */ #define INIT_NUM_INCLUDE 32 /* Initial number of incdir[] */ #define INIT_NUM_FNAMELIST 256 /* Initial number of fnamelist[] */ #define INIT_NUM_ONCE 64 /* Initial number of once_list[] */ /* * 'search_rule' holds searching rule of #include "header.h" to search first * before searching user specified or system-specific include directories. * 'search_rule' is initialized to SEARCH_INIT. It can be changed by -I1, -I2 * or -I3 option. -I1 specifies CURRENT, -I2 SOURCE and -I3 both. */ static int search_rule = SEARCH_INIT; /* Rule to search include file */ static int nflag = FALSE; /* Flag of -N (-undef) option */ static long std_val = -1L; /* Value of __STDC_VERSION__ or __cplusplus */ #define MAX_DEF 256 #define MAX_UNDEF (MAX_DEF/4) static char * def_list[ MAX_DEF]; /* Macros to be defined */ static char * undef_list[ MAX_UNDEF]; /* Macros to be undefined */ static int def_cnt; /* Count of def_list */ static int undef_cnt; /* Count of undef_list */ /* Values of mkdep. */ #define MD_MKDEP 1 /* Output source file dependency line */ #define MD_SYSHEADER 2 /* Print also system-header names */ #define MD_FILE 4 /* Output to the file named *.d */ #define MD_PHONY 8 /* Print also phony targets for each header */ #define MD_QUOTE 16 /* 'Quote' $ and space in target name */ static FILE * mkdep_fp; /* For -Mx option */ static char * mkdep_target; /* For -MT TARGET option and for GCC's queer environment variables. */ static char * mkdep_mf; /* Argument of -MF option */ static char * mkdep_md; /* Argument of -MD option */ static char * mkdep_mq; /* Argument of -MQ option */ static char * mkdep_mt; /* Argument of -MT option */ /* sharp_filename is filename for #line line, used only in cur_file() */ static char * sharp_filename = NULL; static char * argv0; /* argv[ 0] for usage() and version() */ static int ansi; /* __STRICT_ANSI__ flag for GNUC */ static int compat_mode; /* "Compatible" mode of recursive macro expansion */ #define MAX_ARCH_LEN 16 static char arch[ MAX_ARCH_LEN]; /* -arch or -m64, -m32 options */ #if COMPILER == GNUC #define N_QUOTE_DIR 8 /* quote_dir[]: Include directories for "header" specified by -iquote */ /* quote_dir_end: Active end of quote_dir */ static const char * quote_dir[ N_QUOTE_DIR]; static const char ** quote_dir_end = quote_dir; /* sys_dirp indicates the first directory to search for system headers. */ static const char ** sys_dirp = NULL; /* System header directory */ static const char * sysroot = NULL; /* Logical root directory of header */ static int i_split = FALSE; /* For -I- option */ static int gcc_work_dir = FALSE; /* For -fworking-directory */ static int gcc_maj_ver; /* __GNUC__ */ static int gcc_min_ver; /* __GNUC_MINOR__ */ static int dDflag = FALSE; /* Flag of -dD option */ static int dMflag = FALSE; /* Flag of -dM option */ #endif #if COMPILER == GNUC || COMPILER == MSC /* * preinclude points to the file specified by -include (-Fl for MSC) option, * which is included prior to the main input file. */ #define NPREINCLUDE 8 static char * preinclude[ NPREINCLUDE]; /* File to pre-include */ static char ** preinc_end = preinclude; /* -> active end of preinclude */ #endif #if COMPILER == MSC static int wchar_t_modified = FALSE; /* -Zc:wchar_t flag */ #endif #if COMPILER == LCC static const char * optim_name = "__LCCOPTIMLEVEL"; #endif #if SYSTEM == SYS_CYGWIN static int no_cygwin = FALSE; /* -mno-cygwin */ #elif SYSTEM == SYS_MAC #define MAX_FRAMEWORK 8 static char * framework[ MAX_FRAMEWORK]; /* Framework directories*/ static int num_framework; /* Current number of framework[] */ static int sys_framework; /* System framework dir */ static const char ** to_search_framework; /* Search framework[] next to the directory */ static int in_import; /* #import rather than #include */ #endif #define NO_DIR FALSE #if NO_DIR /* Unofficial feature to strip directory part of include file */ static int no_dir; #endif #if MCPP_LIB void init_system( void) /* Initialize static variables */ { if (sharp_filename) free( sharp_filename); sharp_filename = NULL; incend = incdir = NULL; fnamelist = once_list = NULL; search_rule = SEARCH_INIT; mb_changed = nflag = ansi = compat_mode = FALSE; mkdep_fp = NULL; mkdep_target = mkdep_mf = mkdep_md = mkdep_mq = mkdep_mt = NULL; std_val = -1L; def_cnt = undef_cnt = 0; mcpp_optind = mcpp_opterr = 1; #if COMPILER == GNUC sys_dirp = NULL; sysroot = NULL; gcc_work_dir = i_split = FALSE; quote_dir_end = quote_dir; dDflag = dMflag = FALSE; #endif #if COMPILER == MSC wchar_t_modified = FALSE; #endif #if COMPILER == GNUC || COMPILER == MSC preinc_end = preinclude; #endif #if SYSTEM == SYS_CYGWIN no_cygwin = FALSE; #elif SYSTEM == SYS_MAC num_framework = sys_framework = 0; to_search_framework = NULL; #endif #if NO_DIR no_dir = FALSE; #endif } #endif #define OPTLISTLEN 80 void do_options( int argc, char ** argv, char ** in_pp, /* Input file name */ char ** out_pp /* Output file name */ ) /* * Process command line arguments, called only at MCPP startup. */ { char optlist[ OPTLISTLEN]; /* List of option letter*/ const char * warning = "warning: -%c%s option is ignored\n"; int opt; int unset_sys_dirs; /* Unset system-specific and site-specific include directories ? */ int set_cplus_dir; /* Set C++ include directory ? (for GCC)*/ int show_path; /* Show include directory list */ DEFBUF * defp; VAL_SIGN * valp; int sflag; /* -S option or similar */ int trad; /* -traditional */ int old_mode; /* backup of 'mcpp_mode'*/ int gval, sse; char * cp; int i; #if COMPILER == GNUC #define NSYSDIR 8 /* System include directory specified by -isystem */ char * sysdir[ NSYSDIR] = { NULL, }; char ** sysdir_end = sysdir; int integrated_cpp; /* Flag of cc1 which integrates cpp in it */ #elif COMPILER == LCC const char * debug_name = "__LCCDEBUGLEVEL"; #endif argv0 = argv[ 0]; nflag = unset_sys_dirs = show_path = sflag = trad = FALSE; arch[ 0] = 0; gval = sse = 0; set_cplus_dir = TRUE; /* Get current directory for -I option and #pragma once */ getcwd( cur_work_dir, PATHMAX); #if SYS_FAMILY == SYS_WIN bsl2sl( cur_work_dir); #endif sprintf( cur_work_dir + strlen( cur_work_dir), "%c%c", PATH_DELIM, EOS); /* Append trailing path-delimiter */ #if COMPILER == GNUC defp = look_id( "__GNUC__"); /* Already defined by init_defines() */ gcc_maj_ver = atoi( defp->repl); defp = look_id( "__GNUC_MINOR__"); gcc_min_ver = atoi( defp->repl); integrated_cpp = ((gcc_maj_ver == 3 && gcc_min_ver >= 3) || gcc_maj_ver == 4); #endif #if COMPILER == GNUC || COMPILER == MSC option_flags.dollar_in_name = TRUE; /* GCC and Visual C allows '$' in name by default */ #endif set_opt_list( optlist); opt_search: ; while (mcpp_optind < argc && (opt = mcpp_getopt( argc, argv, optlist)) != EOF) { switch (opt) { /* Command line option character */ #if COMPILER == GNUC case '$': /* Forbid '$' in identifier */ option_flags.dollar_in_name = FALSE; break; #endif case '+': #if COMPILER == GNUC plus: #endif if (cplus_val || sflag) { mcpp_fputs( "warning: -+ option is ignored\n", ERR); break; } cplus_val = CPLUS; break; #if COMPILER == GNUC case '-': if (memcmp( mcpp_optarg, "sysroot", 7) == 0) { if (mcpp_optarg[ 7] == '=') /* --sysroot=DIR */ sysroot = mcpp_optarg + 8; else if (mcpp_optarg[ 7] == EOS) /* --sysroot DIR */ sysroot = argv[ mcpp_optind++]; else usage( opt); break; } else { usage( opt); } #endif case '2': /* Reverse digraphs recognition */ option_flags.dig = ! option_flags.dig; break; case '3': /* Reverse trigraph recogniion */ option_flags.trig = ! option_flags.trig; break; case '@': /* Special preprocessing mode */ old_mode = mcpp_mode; if (str_eq( mcpp_optarg, "post") || str_eq( mcpp_optarg, "poststd")) mcpp_mode = POST_STD; /* 'post-Standard' mode */ else if (str_eq( mcpp_optarg, "old") || str_eq( mcpp_optarg, "oldprep")) mcpp_mode = OLD_PREP; /* 'old-Preprocessor' mode */ else if (str_eq( mcpp_optarg, "kr")) mcpp_mode = KR; /* 'K&R 1st' mode */ else if (str_eq( mcpp_optarg, "std")) mcpp_mode = STD; /* 'Standard' mode (default)*/ else if (str_eq( mcpp_optarg, "compat")) { compat_mode = TRUE; /* 'compatible' mode */ mcpp_mode = STD; } else usage( opt); standard = (mcpp_mode == STD || mcpp_mode == POST_STD); if (old_mode != STD && old_mode != mcpp_mode) mcpp_fprintf( ERR, "Mode is redefined to: %s\n", mcpp_optarg); break; #if COMPILER == GNUC case 'A': /* Ignore -A system(gnu), -A cpu(vax) or so */ break; case 'a': if (str_eq( mcpp_optarg, "nsi")) { /* -ansi */ look_and_install( "__STRICT_ANSI__", DEF_NOARGS_PREDEF, null , "1"); ansi = TRUE; break; } else if (memcmp( mcpp_optarg, "uxbase", 6) == 0) { mcpp_optind++; break; /* Ignore '-auxbase some' or such nonsence */ #if SYSTEM == SYS_MAC } else if (str_eq( mcpp_optarg, "rch")) { /* -arch */ strcpy( arch, argv[ mcpp_optind++]); if (str_eq( arch, "ppc") || str_eq( arch, "ppc7400") || str_eq( arch, "ppc64") || str_eq( arch, "i386") || str_eq( arch, "i686") || str_eq( arch, "x86_64") || str_eq( arch, "amd64")) { if (str_eq( arch, "i686")) strcpy( arch, "i386"); else if (str_eq( arch, "amd64")) strcpy( arch, "x86_64"); else if (str_eq( arch, "ppc7400")) strcpy( arch, "ppc"); break; } /* Else usage() */ #endif } usage( opt); #elif COMPILER == MSC case 'a': if (memcmp( mcpp_optarg, "rch", 3) == 0) { if (str_eq( mcpp_optarg + 3, ":SSE") /* -arch:SSE */ || str_eq( mcpp_optarg + 3, ":sse")) sse = 1; else if (str_eq( mcpp_optarg + 3, ":SSE2") /* -arch:SSE2 */ || str_eq( mcpp_optarg + 3, ":sse2")) sse = 2; /* Else ignore */ } else { usage( opt); } break; case 'A': option_flags.lang_asm = TRUE; /* "assembler" source */ break; #else case 'a': option_flags.lang_asm = TRUE; /* "assembler" source */ break; #endif #if ! STD_LINE_PREFIX case 'b': std_line_prefix = TRUE; /* Putout line and file infor- */ break; /* mation in C source style. */ #endif case 'C': /* Keep comments */ option_flags.c = TRUE; break; #if COMPILER == GNUC case 'c': if (! integrated_cpp) usage( opt); break; /* Else ignore this option */ case 'd': if (str_eq( mcpp_optarg, "M")) { /* -dM */ dMflag = TRUE; no_output++; } else if (str_eq( mcpp_optarg, "D")) { /* -dD */ dDflag = TRUE; } else if (str_eq( mcpp_optarg, "igraphs")) { /* -digraphs */ option_flags.dig = TRUE; } else if (str_eq( mcpp_optarg, "umpbase")) { /* -dumpbase */ ; /* Ignore */ } else { usage( opt); } break; #endif /* COMPILER == GNUC */ case 'D': /* Define symbol */ if (def_cnt >= MAX_DEF) { mcpp_fputs( "Too many -D options.\n", ERR); longjmp( error_exit, -1); } def_list[ def_cnt++] = mcpp_optarg; break; case 'e': /* Change the default MBCHAR encoding */ if (set_encoding( mcpp_optarg, FALSE, 0) == NULL) usage( opt); mb_changed = TRUE; break; #if COMPILER == GNUC case 'E': if (! integrated_cpp) usage( opt); break; /* Ignore this option */ case 'f': if (memcmp( mcpp_optarg, "input-charset=", 14) == 0) { /* Treat -finput-charset= as the same option as -e */ if (set_encoding( mcpp_optarg + 14, FALSE, 0) == NULL) usage( opt); mb_changed = TRUE; } else if (str_eq( mcpp_optarg, "working-directory")) { gcc_work_dir = TRUE; } else if (str_eq( mcpp_optarg, "no-working-directory")) { gcc_work_dir = FALSE; } else if (str_eq( mcpp_optarg, "stack-protector")) { look_and_install( "__SSP__", DEF_NOARGS_PREDEF, null, "1"); } else if (str_eq( mcpp_optarg, "stack-protector-all")) { look_and_install( "__SSP_ALL__", DEF_NOARGS_PREDEF, null, "2"); } else if (str_eq( mcpp_optarg, "exceptions")) { look_and_install( "__EXCEPTIONS", DEF_NOARGS_PREDEF, null , "1"); } else if (str_eq( mcpp_optarg, "no-exceptions")) { undef_list[ undef_cnt++] = "__EXCEPTIONS"; } else if (str_eq( mcpp_optarg, "PIC") || str_eq( mcpp_optarg, "pic") || str_eq( mcpp_optarg, "PIE") || str_eq( mcpp_optarg, "pie")) { look_and_install( "__PIC__", DEF_NOARGS_PREDEF, null, "1"); look_and_install( "__pic__", DEF_NOARGS_PREDEF, null, "1"); } else if (str_eq( mcpp_optarg, "no-dollars-in-identifiers")) { option_flags.dollar_in_name = FALSE; } else if (str_eq( mcpp_optarg, "no-show-column")) { ; /* Ignore this option */ } else if (! integrated_cpp) { usage( opt); } break; case 'g': if (!isdigit( *mcpp_optarg) && str_eq( argv[ mcpp_optind - 2], "-g")) /* Neither '-g 0' nor '-ggdb' -- No argument */ mcpp_optind--; break; /* Ignore the option */ #elif COMPILER == LCC case 'g': /* Define __LCCDEBUGLEVEL as */ if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg)) { defp = look_id( debug_name); strcpy( defp->repl, mcpp_optarg); } else { usage( opt); } break; #elif COMPILER == MSC case 'G': if (*(mcpp_optarg + 1) == EOS) { /* -Gx */ switch (*mcpp_optarg) { case '3': case '4': case '5': case '6': gval = *mcpp_optarg; break; case 'B': /* -GB */ gval = '6'; break; case 'R': look_and_install( "_CPPRTTI", DEF_NOARGS_PREDEF, null , "1"); break; case 'X': look_and_install( "_CPPUNWIND", DEF_NOARGS_PREDEF, null , "1"); break; case 'Z': look_and_install( "__MSVC_RUNTIME_CHECKS" , DEF_NOARGS_PREDEF, null, "1"); break; default : mcpp_fprintf( ERR, warning, opt, mcpp_optarg); } } else { usage( opt); } break; #endif #if SYSTEM == SYS_MAC case 'F': framework[ num_framework++] = mcpp_optarg; break; #endif case 'h': if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg)) /* a digit */ look_and_install( "__STDC_HOSTED__", DEF_NOARGS_PREDEF, null , mcpp_optarg); else usage( opt); break; #if COMPILER == MSC case 'X': unset_sys_dirs = TRUE; break; #endif case 'I': /* Include directory */ if (str_eq( mcpp_optarg, "-")) { /* -I- */ #if COMPILER == GNUC sys_dirp = incend; /* Split include directories */ i_split = TRUE; #else unset_sys_dirs = TRUE; /* Unset pre-specified include directories */ #endif } else if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg) && (i = *mcpp_optarg - '0') != 0 && (i & ~(CURRENT | SOURCE)) == 0) { search_rule = i; /* -I1, -I2 or -I3 */ } else { /* Not '-' nor a digit */ set_a_dir( mcpp_optarg); /* User-defined dir */ } break; #if COMPILER == MSC case 'F': if (str_eq( mcpp_optarg, "l")) { /* -Fl */ if (preinc_end >= &preinclude[ NPREINCLUDE]) { mcpp_fputs( "Too many -Fl options.\n", ERR); longjmp( error_exit, -1); } *preinc_end++ = argv[ mcpp_optind++]; } else { usage( opt); } break; #endif #if COMPILER == GNUC case 'i': if (str_eq( mcpp_optarg, "nclude")) { /* -include */ if (preinc_end >= &preinclude[ NPREINCLUDE]) { mcpp_fputs( "Too many -include options.\n", ERR); longjmp( error_exit, -1); } *preinc_end++ = argv[ mcpp_optind++]; } else if (str_eq( mcpp_optarg, "system")) { /* -isystem */ if (sysdir_end >= &sysdir[ NSYSDIR]) { mcpp_fputs( "Too many -isystem options.\n", ERR); longjmp( error_exit, -1); } *sysdir_end++ = argv[ mcpp_optind++]; /* Add the directory before system include directory*/ } else if (str_eq( mcpp_optarg, "quote")) { /* -iquote */ if (quote_dir_end >= "e_dir[ N_QUOTE_DIR]) { mcpp_fputs( "Too many -iquote options.\n", ERR); longjmp( error_exit, -1); } *quote_dir_end++ = argv[ mcpp_optind++]; /* Add the directory for #include "header" */ } else if (memcmp( mcpp_optarg, "sysroot", 7) == 0) { if (mcpp_optarg[ 7] == '=') /* -isysroot=DIR */ sysroot = mcpp_optarg + 8; else if (mcpp_optarg[ 7] == EOS) /* -isysroot DIR */ sysroot = argv[ mcpp_optind++]; else usage( opt); } else if (str_eq( mcpp_optarg, "prefix") /* -iprefix */ || str_eq( mcpp_optarg, "withprefix") /* -iwithprefix */ || str_eq( mcpp_optarg, "withprefixbefore") /* -iwithprefixbefore */ || str_eq( mcpp_optarg, "dirafter") /* -idirafter */ || str_eq( mcpp_optarg, "multilib")) { /* -imultilib */ mcpp_optind++; /* Skip the argument */ /* Ignore these options */ } else { usage( opt); } break; #endif case 'j': option_flags.no_source_line = TRUE; break; /* Do not output the source line in diagnostics */ #if COMPILER == MSC case 'J': look_and_install( "_CHAR_UNSIGNED", DEF_NOARGS_PREDEF, null, "1"); break; #endif case 'K': mcpp_debug |= MACRO_CALL; /* * Putout macro expansion informations embedded in comments. * Same with '#pragma MCPP debug macro_call'. */ /* Enable white spaces preservation, too */ /* Fall through */ case 'k': option_flags.k = TRUE; /* Keep white spaces of input lines as they are */ break; #if COMPILER == GNUC case 'l': if (memcmp( mcpp_optarg, "ang-", 4) != 0) { usage( opt); } else if (str_eq( mcpp_optarg + 4, "c")) { /* -lang-c */ ; /* Ignore this option */ } else if (str_eq( mcpp_optarg + 4, "c99") /* -lang-c99*/ || str_eq( mcpp_optarg + 4, "c9x")) { /* -lang-c9x*/ if (! sflag) { stdc_val = 1; /* Define __STDC__ to 1 */ std_val = 199901L; sflag = TRUE; } } else if (str_eq( mcpp_optarg + 4, "c89")) { /* -lang-c89*/ if (! sflag) { stdc_val = 1; /* Define __STDC__ to 1 */ sflag = TRUE; } } else if (str_eq( mcpp_optarg + 4, "c++")) { /* -lang-c++*/ goto plus; } else if (str_eq( mcpp_optarg + 4, "asm")) { /* -lang-asm*/ option_flags.lang_asm = TRUE; } else { usage( opt); } break; #endif /* COMPILER == GNUC */ case 'M': /* Output source file dependency line */ if (str_eq( mcpp_optarg, "M")) { /* -MM */ ; } else if (str_eq( mcpp_optarg, "D")) { /* -MD */ mkdep |= (MD_SYSHEADER | MD_FILE); } else if (str_eq( mcpp_optarg, "MD")) { /* -MMD */ mkdep |= MD_FILE; } else if (str_eq( mcpp_optarg, "P")) { /* -MP */ mkdep |= MD_PHONY; } else if (str_eq( mcpp_optarg, "Q")) { /* -MQ target */ mkdep |= MD_QUOTE; mkdep_mq = argv[ mcpp_optind++]; } else if (str_eq( mcpp_optarg, "T")) { /* -MT target */ mkdep_mt = argv[ mcpp_optind++]; } else if (str_eq( mcpp_optarg, "F")) { /* -MF file */ mkdep_mf = argv[ mcpp_optind++]; } else if (argv[ mcpp_optind - 1] == mcpp_optarg) { /* -M */ mkdep |= MD_SYSHEADER; mcpp_optind--; } else { usage( opt); } if (str_eq( mcpp_optarg, "D") || str_eq( mcpp_optarg, "MD")) { cp = argv[ mcpp_optind]; if (cp && *cp != '-') /* -MD (-MMD) file */ mkdep_md = argv[ mcpp_optind++]; } mkdep |= MD_MKDEP; break; #if SYS_FAMILY == SYS_UNIX case 'm': if (str_eq( mcpp_optarg, "64")) { /* -m64 */ if (str_eq( CPU, "i386")) strcpy( arch, "x86_64"); else if (str_eq( CPU, "ppc")) strcpy( arch, "ppc64"); /* Else ignore */ break; } else if (str_eq( mcpp_optarg, "32")) { /* -m32 */ if (str_eq( CPU, "x86_64")) strcpy( arch, "i386"); else if (str_eq( CPU, "ppc64")) strcpy( arch, "ppc"); /* Else ignore */ break; } else if (str_eq( mcpp_optarg, "mmx")) { /* -mmmx */ look_and_install( "__MMX__", DEF_NOARGS_PREDEF, null, "1"); break; } else if (str_eq( mcpp_optarg, "no-mmx")) { /* -mno-mmx */ undef_list[ undef_cnt++] = "__MMX__"; break; } #endif /* SYS_FAMILY == UNIX */ #if COMPILER == GNUC #if SYSTEM == SYS_CYGWIN if (str_eq( mcpp_optarg, "no-cygwin")) { /* -mno-cygwin */ no_cygwin = TRUE; break; } #endif if (! integrated_cpp) usage( opt); break; case 'u': if (! str_eq( mcpp_optarg, "ndef")) /* -undef */ usage( opt); /* Else fall through */ #endif /* COMPILER == GNUC */ #if COMPILER == MSC case 'u': #endif case 'N': /* No predefines: remove "unix", "__unix__" and friends. */ nflag = TRUE; break; #if COMPILER == GNUC || NO_DIR case 'n': #if NO_DIR if (str_eq( mcpp_optarg, "odir")) { /* -nodir */ no_dir = TRUE; } #endif #if COMPILER == GNUC if (str_eq( mcpp_optarg, "ostdinc")) { /* -nostdinc */ unset_sys_dirs = TRUE; /* Unset pre-specified directories */ } else if (str_eq( mcpp_optarg, "ostdinc++")) { /* -nostdinc++ */ set_cplus_dir = FALSE; /* Unset C++-specific directories */ } else if (str_eq( mcpp_optarg, "oprecomp")) { /* -noprecomp */ mcpp_fprintf( ERR, warning, opt, mcpp_optarg); break; } #endif else { usage( opt); } break; #endif #if COMPILER == GNUC case 'O': if (integrated_cpp) { if (*mcpp_optarg == '-') /* No argument */ mcpp_optind--; else if ((isdigit( *mcpp_optarg) && *mcpp_optarg != '0') || *mcpp_optarg == 's' || *mcpp_optarg == 'z') /* -O1, -O2 -Os, -Oz */ look_and_install( "__OPTIMIZE__", DEF_NOARGS_PREDEF, null , "1"); else if (! isdigit( *mcpp_optarg)) usage( opt); /* Else -O0: ignore */ } else { usage( opt); } break; /* Else ignore -Ox option */ #elif COMPILER == LCC case 'O': /* Define __LCCOPTIMLEVEL as 1 */ defp = look_id( optim_name); strcpy( defp->repl, "1"); break; #endif case 'o': *out_pp = mcpp_optarg; /* Output file name */ break; case 'P': /* No #line output */ option_flags.p = TRUE; break; #if COMPILER == GNUC case 'p': if (str_eq( mcpp_optarg, "edantic") /* -pedantic */ || str_eq( mcpp_optarg, "edantic-errors")) { /* -pedantic-errors */ /* This option does not imply -ansi */ if (warn_level == -1) warn_level = 0; warn_level |= (1 | 2 | 4); if (! sflag && ! cplus_val) { stdc_val = 1; sflag = TRUE; } } else { usage( opt); } break; case 'q': if (str_eq( mcpp_optarg, "uiet")) /* -quiet: GCC's undocumented, yet frequently specified opt */ break; /* Ignore the option */ else usage( opt); break; #endif /* COMPILER == GNUC */ case 'Q': option_flags.q = TRUE; break; #if COMPILER == MSC case 'R': /* -RTC1, -RTCc, -RTCs, -RTCu, etc. */ if (memcmp( mcpp_optarg, "TC", 2) == 0 && *(mcpp_optarg + 2) != EOS) look_and_install( "__MSVC_RUNTIME_CHECKS", DEF_NOARGS_PREDEF , null, "1"); else usage( opt); break; #endif case 'S': if (cplus_val || sflag) { /* C++ or the second time */ mcpp_fprintf( ERR, warning, opt, mcpp_optarg); break; } i = *mcpp_optarg; if (! isdigit( i) || *(mcpp_optarg + 1) != EOS) usage( opt); stdc_val = i - '0'; sflag = TRUE; break; #if COMPILER == GNUC case 'r': if (str_eq( mcpp_optarg, "emap")) mcpp_fprintf( ERR, warning, opt, mcpp_optarg); /* Ignore -remap option */ else usage( opt); break; case 's': if (memcmp( mcpp_optarg, "td=", 3) == 0 && strlen( mcpp_optarg) > 3) { /* -std=STANDARD*/ cp = mcpp_optarg + 3; if (str_eq( cp, "c89") /* std=c89 */ || str_eq( cp, "c90") /* std=c90 */ || str_eq( cp, "gnu89") /* std=gnu89 */ || str_eq( cp, "iso9899:1990")) { std_val = 0L; /* C90 + extensions */ } else if (str_eq( cp, "c99") /* std=c99 */ || str_eq( cp, "c9x") /* std=c9x */ || str_eq( cp, "gnu99") /* std=gnu99 */ || str_eq( cp, "gnu9x") /* std=gnu9x */ || str_eq( cp, "iso9899:1999") || str_eq( cp, "iso9899:199x")) { std_val = 199901L; } else if (str_eq( cp, "c++98")) { /* std=c++98 */ cplus_val = std_val = 199711L; } else if (memcmp( cp, "iso9899:", 8) == 0 && strlen( cp) >= 14) { /* std=iso9899:199409, etc. */ mcpp_optarg = cp + 8; look_and_install( "__STRICT_ANSI__", DEF_NOARGS_PREDEF , null, "1"); ansi = TRUE; goto Version; } else if (memcmp( cp, "iso14882", 8) == 0) { cp += 8; ansi = TRUE; if (cp && *cp == ':' && strlen( cp) >= 7) { /* std=iso14882:199711, etc. */ cplus_val = CPLUS; mcpp_optarg = cp + 1; goto Version; } else { goto plus; } } else { usage( opt); } if (! cplus_val && memcmp( cp, "gnu", 3) != 0) { /* 'std=gnu*' does not imply -ansi */ look_and_install( "__STRICT_ANSI__", DEF_NOARGS_PREDEF , null, "1"); ansi = TRUE; } stdc_val = 1; sflag = TRUE; } else { usage( opt); } break; case 't': if (str_eq( mcpp_optarg, "raditional") || str_eq( mcpp_optarg, "raditional-cpp")) { /* -traditional, -traditional-cpp */ trad = TRUE; mcpp_mode = OLD_PREP; } else if (str_eq( mcpp_optarg, "rigraphs")) { option_flags.trig = TRUE; /* -trigraphs */ } else { usage( opt); } break; #endif /* COMPILER == GNUC */ #if COMPILER == MSC case 'T': if (strlen( mcpp_optarg) > 1) usage( opt); i = tolower( *mcpp_optarg); /* Fold case */ if (i == 'c') { ; /* Ignore this option */ } else if (i == 'p') { cplus_val = CPLUS; } else { usage( opt); } break; #endif case 'U': /* Undefine macro */ if (undef_cnt >= MAX_UNDEF) { mcpp_fputs( "Too many -U options.\n", ERR); longjmp( error_exit, -1); } undef_list[ undef_cnt++] = mcpp_optarg; break; case 'V': #if COMPILER == GNUC Version: #endif valp = eval_num( mcpp_optarg); if (valp->sign == VAL_ERROR) usage( opt); std_val = (long) valp->val; break; case 'v': option_flags.v = TRUE; show_path = TRUE; break; case 'W': /* warning level */ if (warn_level == -1) /* Have to initialize */ warn_level = 0; #if COMPILER == GNUC if (argv[ mcpp_optind - 1] == mcpp_optarg) { /* No argument */ /* * Note: -W without argument is not officially supported. * It may cause an error. */ warn_level |= (1 | 2 | 4 | 16); mcpp_optind--; } else if (str_eq( mcpp_optarg, "comment") || str_eq( mcpp_optarg, "comments") || str_eq( mcpp_optarg, "sign-compare")) { warn_level |= 1; } else if (str_eq( mcpp_optarg, "undef")) { warn_level |= 4; } else if (str_eq( mcpp_optarg, "all")) { warn_level |= (1 | 16); /* Convert -Wall to -W17*/ } else if (str_eq( mcpp_optarg, "trigraphs")) { warn_level |= 16; } #endif /* COMPILER == GNUC */ #if COMPILER == MSC if (str_eq( mcpp_optarg, "all")) { warn_level |= (1 | 16); /* Convert -Wall to -W17*/ } else if (str_eq( mcpp_optarg, "L")) { option_flags.no_source_line = TRUE; /* Single-line diagnostic */ } #endif if (isdigit( *mcpp_optarg)) { warn_level |= parse_warn_level( mcpp_optarg, opt); if (warn_level > 31 || warn_level < 0) usage( opt); } if (warn_level == 0) warn_level = 0xFF; /* Remember this option */ /* Else ignore the option */ break; #if COMPILER == GNUC || COMPILER == MSC case 'w': /* Same as -W0 */ warn_level = 0xFF; /* Remenber this option */ break; #endif #if COMPILER == GNUC case 'x': if (str_eq( mcpp_optarg, "c")) { break; /* -x c -- ignore this */ } else if (str_eq( mcpp_optarg, "c++")) { goto plus; } else if (str_eq( mcpp_optarg, "assembler-with-cpp")) { option_flags.lang_asm = TRUE; break; } else { usage( opt); } break; #endif #if COMPILER == MSC case 'Z': if (str_eq( mcpp_optarg, "c:wchar_t")) { /* -Zc:wchar_t */ look_and_install( "_NATIVE_WCHAR_T_DEFINED", DEF_NOARGS_PREDEF , null, "1"); look_and_install( "_WCHAR_T_DEFINED", DEF_NOARGS_PREDEF, null , "1"); wchar_t_modified = TRUE; } else if (str_eq( mcpp_optarg, "c:wchar_t-")) {/* -Zc:wchar_t- */ wchar_t_modified = TRUE; /* Do not define the macros */ } else if (str_eq( mcpp_optarg, "l")) { look_and_install( "_VC_NODEFAULTLIB", DEF_NOARGS_PREDEF, null , "1"); } else if (str_eq( mcpp_optarg, "a")) { /* -Za */ undefine( "_MSC_EXTENSIONS"); option_flags.dollar_in_name = FALSE; } else if (str_eq( mcpp_optarg, "e")) { /* Ignore -Ze silently */ break; } else if (*(mcpp_optarg + 1) == EOS) { /* -Z followed by one char */ mcpp_fprintf( ERR, warning, opt, mcpp_optarg); /* Ignore the option with warning */ } else { usage( opt); } break; #endif case 'z': option_flags.z = TRUE; /* No output of included file */ break; default: /* What is this one? */ usage( opt); break; } /* Switch on all options */ } /* For all arguments */ if (mcpp_optind < argc && set_files( argc, argv, in_pp, out_pp) != NULL) goto opt_search; /* More options after the filename */ /* Check consistency of specified options, set some variables */ chk_opts( sflag, trad); if (warn_level == -1) /* No -W option */ warn_level = 1; /* Default warning level */ else if (warn_level == 0xFF) warn_level = 0; /* -W0 has high precedence */ #if SYSTEM == SYS_MAC set_a_dir( NULL); /* Initialize incdir[] */ to_search_framework = incend; /* Search framework[] next to the directory */ #endif #if COMPILER == GNUC && SYSTEM == SYS_MAC if (arch[ 0]) { /* -arch option has been specified */ if (((str_eq( CPU, "i386") || str_eq( CPU, "x86_64")) && (! str_eq( arch, "i386") && ! str_eq( arch, "x86_64"))) || ((str_eq( CPU, "ppc") || str_eq( CPU, "ppc64")) && (! str_eq( arch, "ppc") && ! str_eq( arch, "ppc64")))) { mcpp_fprintf( ERR, "Wrong argument of -arch option: %s\n", arch); longjmp( error_exit, -1); } } #endif if (! arch[ 0]) { /* None of -arch, -m32 or -m64 options has been specified. */ /* The CPU-specific-macros will be defined in init_cpu_macro(). */ strcpy( arch, CPU); } #if COMPILER != GNUC init_cpu_macro( gval, sse); #endif #if COMPILER == GNUC if (sysdir < sysdir_end) { char ** dp = sysdir; if (! sys_dirp || sys_dirp == incdir) sys_dirp = dp; while (dp < sysdir_end) set_a_dir( *dp++); } if (*in_pp && str_eq( (*in_pp) + strlen( *in_pp) - 2, ".S")) option_flags.lang_asm = TRUE; /* Input file name is *.S */ if (option_flags.lang_asm) { look_and_install( "__ASSEMBLER__", DEF_NOARGS_PREDEF, null, "1"); option_flags.dollar_in_name = FALSE; /* Disable '$' in name */ } if (! sys_dirp || sys_dirp == incdir) sys_dirp = incend; #endif #if SYSTEM == SYS_MAC init_framework(); /* After setting sys_dirp */ #endif set_env_dirs(); if (! unset_sys_dirs) set_sys_dirs( set_cplus_dir); if (mkdep_mf) { /* -MF overrides -MD */ mkdep_fp = fopen( mkdep_mf, "w"); } else if (mkdep_md) { mkdep_fp = fopen( mkdep_md, "w"); } if (mkdep_mq) /* -MQ overrides -MT */ mkdep_target = mkdep_mq; else if (mkdep_mt) mkdep_target = mkdep_mt; /* Normalize the path-list */ if (*in_pp && ! str_eq( *in_pp, "-")) { char * tmp = norm_path( null, *in_pp, FALSE, FALSE); if (tmp) /* The file exists */ *in_pp = tmp; /* Else mcpp_main() will diagnose *in_pp and exit */ } if (! (mcpp_debug & MACRO_CALL)) { /* -K option alters behavior of -v option */ if (option_flags.v) version(); if (show_path) { fp_debug = stderr; dump_path(); fp_debug = stdout; } } } static void version( void) /* * Print version message. */ { const char * mes[] = { #if MCPP_LIB /* Write messages here, for example, "MySomeTool with ". */ #endif #ifdef VERSION_MSG "MCPP V.2.7.2 (2008/11) " #else "MCPP V.", VERSION, " (", DATE, ") " #endif #if COMPILER == INDEPENDENT , "compiler-independent-build " #else #ifdef CMP_NAME , "for ", CMP_NAME, " " #endif #endif , "compiled by " #ifdef VERSION_MSG , VERSION_MSG #else #ifdef HOST_CMP_NAME , HOST_CMP_NAME #if HOST_COMPILER == GNUC , " V.", GCC_MAJOR_VERSION, ".", GCC_MINOR_VERSION #endif #endif #endif , "\n", NULL }; const char ** mpp = mes; while (*mpp) mcpp_fputs( *mpp++, ERR); } static void usage( int opt ) /* * Print usage. */ { const char * mes[] = { "Usage: ", "mcpp", " [- [-]] [ [-] [] [-]]\n", " defaults to stdin and defaults to stdout.\n", "\nCommonly used options:\n", "-@MODE Specify preprocessing mode. MODE should be one of these 4:\n", " -@std Standard conforming mode. (default)\n", " -@poststd, -@post special 'post-Standard' mode.\n", " -@kr K&R 1st mode.\n", " -@oldprep, -@old 'old_preprocessor' mode (i.e. 'Reiser model' cpp).\n", #if COMPILER == MSC "-arch:SSE, -arch:SSE2 Define the macro _M_IX86_FP as 1, 2 respectively.\n", #endif #if SYSTEM == SYS_MAC && COMPILER == GNUC "-arch Change the target to (i386, x86_64, ppc, ppc64).\n", #endif #if ! STD_LINE_PREFIX "-b Output #line lines in C source style.\n", #endif "-C Output also comments.\n", "-D [=] Define as (default:1).\n", "-D [=] Define as .\n", "-e Change the default multi-byte character encoding to one of:\n", " euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.\n", #if SYSTEM == SYS_MAC "-F Add to top of framework directory list.\n", #endif #if COMPILER == GNUC "-finput-charset= Same as -e .\n", " (Don't insert spaces around '=').\n", #endif #if COMPILER == MSC "-Fl Include the prior to the main input file.\n", "-G Define the macro _M_IX86 according to .\n", #endif #if COMPILER == LCC "-g Define the macro __LCCDEBUGLEVEL as .\n", #endif "-I Add to the #include search list.\n", #if COMPILER == GNUC "-isysroot Change root of system header directory to .\n", "-include Include the prior to the main input file.\n", #else "-I- Unset system or site specific include directories.\n", #endif #if COMPILER == MSC "-J Define the macro _CHAR_UNSIGNED as 1.\n", #endif "-j Don't output the source line in diagnostics.\n", "-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file\n", " Output source file dependency line for makefile.\n", #if SYS_FAMILY == SYS_UNIX "-m32 Change target CPU from x86_64, ppc64 to i386, ppc, respectively.\n", "-m64 Change target CPU from i386, ppc to x86_64, ppc64, respectively.\n", #endif "-N Don't predefine any non-standard macros.\n", #if COMPILER == GNUC "-nostdinc Unset system or site specific include directories.\n", #endif #if COMPILER == LCC "-O Define the macro __LCCOPTIMLEVEL as 1.\n", #endif "-o Output to .\n", "-P Don't output #line lines.\n", "-Q Output diagnostics to \"mcpp.err\" (default:stderr).\n", #if COMPILER == MSC "-RTC* Define the macro __MSVC_RUNTIME_CHECKS as 1.\n", #endif #if COMPILER == GNUC "-traditional, -traditional-cpp Same as -@oldprep.\n", #endif "-U Undefine .\n", #if COMPILER == GNUC "-undef Same as -N.\n", #endif #if COMPILER == MSC "-u Same as -N.\n", #endif "-v Show version and include directories of mcpp.\n", "-W Set warning level to (OR of {0,1,2,4,8,16}, default:1).\n", #if COMPILER == MSC "-WL Same as -j.\n", #endif #if COMPILER == MSC || COMPILER == GNUC "-w Same as -W0.\n", #endif #if COMPILER == MSC "-X Same as -I-.\n", "-Zc:wchar_t Define _NATIVE_WCHAR_T_DEFINED and _WCHAR_T_DEFINED as 1.\n", "-Zl Define the macro _VC_NODEFAULTLIB as 1.\n", #endif "-z Don't output the included file, only defining macros.\n", "\nOptions available with -@std (default) or -@poststd options:\n", "-+ Process C++ source.\n", #if DIGRAPHS_INIT "-2 Disable digraphs.\n", #else "-2 Enable digraphs.\n", #endif #if COMPILER == GNUC "-digraphs Enable digraphs.\n", #endif "-h Re-define the pre-defined macro __STDC_HOSTED__ as .\n", #if COMPILER == GNUC "-lang-c89 Same as -S1.\n", "-lang-c++ Same as -+.\n", "-pedantic, -pedantic-errors Same as -W7.\n", "-S Redefine __STDC__ to .\n", #else "-S Redefine __STDC__ to , undefine old style macros.\n", #endif #if COMPILER == GNUC "-std= Specify the standard to which the code should conform.\n", " may be one of: c90, c99, iso9899:1990, iso14882, etc.\n", " iso9899:, iso14882: : Same as -V (long in decimals).\n", #endif #if COMPILER == MSC "-Tp Same as -+.\n", #endif "-V Redefine __STDC_VERSION__ or __cplusplus to .\n", " C with -V199901L specifies C99 specs.\n", " C++ with -V199901L specifies C99 compatible specs.\n", #if COMPILER == GNUC "-x c++ Same as -+.\n", #endif "\nOptions available with only -@std (default) option:\n", "-@compat Expand recursive macro more than Standard.\n", #if TRIGRAPHS_INIT "-3 Disable trigraphs.\n", #else "-3 Enable trigraphs.\n", #endif "-K Output macro annotations embedding in comments.\n", #if COMPILER == GNUC "-trigraphs Enable trigraphs.\n", #endif "\nOptions available with -@std (default), -@kr or -@oldprep options:\n", #if COMPILER == GNUC "-lang-asm Same as -x assembler-with-cpp.\n", "-x assembler-with-cpp Process \"assembler\" source.\n", #elif COMPILER == MSC "-A Process \"assembler\" source.\n", #else "-a Process \"assembler\" source.\n", #endif "-k Keep white spaces of input lines as they are.\n", "\nFor further details see mcpp-manual.html.\n", NULL, }; const char * illegopt = "Incorrect option -%c%s\n"; const char * const * mpp = mes; if (opt != '?') mcpp_fprintf( ERR, illegopt, opt, mcpp_optarg ? mcpp_optarg : null); version(); #if MCPP_LIB mes[ 1] = argv0; #endif while (*mpp) mcpp_fputs( *mpp++, ERR); longjmp( error_exit, -1); } static void set_opt_list( char * optlist ) /* * Set list of legal option characters. */ { const char * list[] = { #if ! STD_LINE_PREFIX "b", #endif #if SYS_FAMILY == SYS_UNIX "m:", #endif #if COMPILER == GNUC "$A:a:cd:Ef:g:i:l:r:s:t:u:O:p:q:wx:", #elif COMPILER == MSC "Aa:F:G:JR:T:XZ:uw", #elif COMPILER == LCC "g:O", #endif #if COMPILER != GNUC && COMPILER != MSC "a", #endif #if SYSTEM == SYS_MAC "F:-:", #endif NULL }; const char * const * lp = & list[ 0]; strcpy( optlist, "23+@:e:h:jkn:o:vzCD:I:KM:NPQS:U:V:W:"); /* Default options */ while (*lp) strcat( optlist, *lp++); if (strlen( optlist) >= OPTLISTLEN) cfatal( "Bug: Too long option list", NULL, 0L, NULL); /* _F_ */ } static int parse_warn_level( const char * mcpp_optarg, int opt ) /* * Parse warn level option. * Warning level option is specified as '19' or '1|2|16' or even '3|16'. * Even spaces are allowed as ' 1 | 2|16 '. */ { const char * cp = mcpp_optarg; int w, i; w = i = 0; while( *cp != EOS) { while( *cp == ' ') cp++; /* Skip spaces */ if (! isdigit( *cp)) break; /* Error */ while (isdigit( *cp)) { i *= 10; i += (*cp++ - '0'); } while (*cp == ' ') cp++; if (*cp == '|') { /* Only digits or '|' are allowed */ w |= i; /* Take OR of the args */ i = 0; cp++; } } if (*cp != EOS) { /* Not ending with digit */ mcpp_fprintf( ERR, "Illegal warning level option \"%s\"\n" , mcpp_optarg); usage( opt); } w |= i; /* Take the last arg */ return w; } static void def_a_macro( int opt, /* 'D' */ char * def /* Argument of -D option */ ) /* * Define a macro specified by -D option. * The macro maybe either object-like or function-like (with parameter). */ { DEFBUF * defp; char * definition; /* Argument of -D option */ char * cp; int i; /* Convert trigraphs for the environment which need trigraphs */ if (mcpp_mode == STD && option_flags.trig) cnv_trigraph( def); if (mcpp_mode == POST_STD && option_flags.dig) cnv_digraph( def); /* Convert prior to installing macro */ definition = xmalloc( strlen( def) + 4); strcpy( definition, def); if ((cp = strchr( definition, '=')) != NULL) { *cp = ' '; /* Remove the '=' */ cp = "\n"; /* Append */ } else { cp = " 1\n"; /* With definition "1" */ } strcat( definition, cp); cp = definition; while ((char_type[ *cp & UCHARMAX] & SPA) == 0) cp++; i = *cp; *cp = EOS; if ((defp = look_id( definition)) != NULL) /* Pre-defined */ undefine( definition); *cp = i; /* Now, save the definition. */ unget_string( definition, NULL); if (do_define( FALSE, 0) == NULL) /* Define a macro */ usage( opt); *cp = EOS; if (str_eq( definition, "__STDC__")) { defp = look_id( definition); defp->nargs = DEF_NOARGS_STANDARD; /* Restore Standard-predefinedness */ } free( definition); skip_nl(); /* Clear the appended */ } static void chk_opts( int sflag, /* Flag of Standard or post-Standard mode */ int trad /* -traditional (GCC only) */ ) /* * Check consistency between the specified options. * Set default value of some variables for each 'mcpp_mode'. */ { int incompat = FALSE; switch (mcpp_mode) { case STD : case POST_STD : if (trad) incompat = TRUE; if (! stdc_val) stdc_val = STDC; break; case KR : case OLD_PREP : #if COMPILER == GNUC if (sflag || cplus_val || ansi || std_val != -1L) #else if (sflag || cplus_val || std_val != -1L) #endif incompat = TRUE; if (option_flags.dig) { if (option_flags.dig != DIGRAPHS_INIT) incompat = TRUE; else option_flags.dig = 0; } break; } if (mcpp_mode == POST_STD && (option_flags.lang_asm || compat_mode || option_flags.k)) incompat = TRUE; if (mcpp_mode != STD && option_flags.trig) { if (option_flags.trig != TRIGRAPHS_INIT) incompat = TRUE; else option_flags.trig = FALSE; } if (mcpp_mode != STD && (mcpp_debug & MACRO_CALL)) incompat = TRUE; if ((mcpp_debug & MACRO_CALL) && (option_flags.lang_asm || option_flags.c)) { mcpp_fputs( "Disabled -K option.\n", ERR); mcpp_debug &= ~MACRO_CALL; /* -a and -C options do not co-exist with -K */ } if (incompat) { mcpp_fputs( "Incompatible options are specified.\n", ERR); usage( '?'); } standard = (mcpp_mode == STD || mcpp_mode == POST_STD); /* Modify magic characters in character type table. */ if (! standard) char_type[ DEF_MAGIC] = 0; if (mcpp_mode != STD) char_type[ IN_SRC] = 0; if (mcpp_mode == POST_STD || mcpp_mode == KR) char_type[ TOK_SEP] = 0; /* TOK_SEP equals to COM_SEP */ if (mcpp_mode != STD) char_type[ MAC_INF] = 0; expand_init( compat_mode, ansi); /* Set function pointer to macro expansion routine */ } #if COMPILER != GNUC static void init_cpu_macro ( int gval, /* Argument of -G option for MSC */ int sse /* Argument of -sse: option for MSC */ ) /* * Set predefined macros for CPU. * This routine is called from do_options() only once. * GCC-specific-build defines these macro by init_gcc_macro(). */ { const char * cpu_macro[][ 7] = { #if SYS_FAMILY == SYS_UNIX { "__i386__" #if SYSTEM == SYS_CYGWIN , "_X86_" #endif , NULL,}, { "__x86_64__", "__amd64__", NULL,}, { "__ppc__", "__powerpc__", NULL,}, { "__ppc64__", "__powerpc64__", NULL,} #elif SYS_FAMILY == SYS_WIN { "_WIN32", "__WIN32__", "_X86_" #if SYSTEM == SYS_MINGW , "__i386__" #endif , NULL,}, { "_WIN32", "_WIN64", "__WIN64__", "_M_AMD64", "_AMD64_", "_X64_" , NULL,}, /* "_WIN32" is defined even on Windows 64 */ { NULL,}, /* Not supported */ { NULL,} /* Not supported */ #endif }; const char ** macro; int index; if (str_eq( arch, "i386")) index = 0; else if (str_eq( arch, "x86_64")) index = 1; else if (str_eq( arch, "ppc")) index = 2; else if (str_eq( arch, "ppc64")) index = 3; else index = 9; if (index == 9) { /* Unknown CPU */ look_and_install( "__" CPU "__", DEF_NOARGS_PREDEF, null, "1"); return; } macro = cpu_macro[ index]; while (*macro) look_and_install( *macro++, DEF_NOARGS_PREDEF, null, "1"); #if SYS_FAMILY == SYS_WIN if (index == 0) { char val[] = "600"; if (gval) val[ 0] = gval; look_and_install( "_M_IX86", DEF_NOARGS_PREDEF, null, val); val[ 0] = '0' + sse; val[ 1] = '\0'; look_and_install( "_M_IX86_FP", DEF_NOARGS_PREDEF, null, val); } #endif } #endif /* COMPILER != GNUC */ static void init_predefines( void) /* * Set or unset predefined macros. */ { char tmp[ 16]; if (std_val != -1L) { /* Version is specified */ if (cplus_val) cplus_val = std_val; /* Value of __cplusplus */ else stdc_ver = std_val; /* Value of __STDC_VERSION__ */ } else { if (! cplus_val) stdc_ver = stdc_val ? STDC_VERSION : 0L; } if (nflag) { un_predefine( TRUE); } else if (stdc_val || cplus_val) { #if COMPILER != GNUC un_predefine( FALSE); /* Undefine "unix" or so */ #endif } sprintf( tmp, "%ldL", cplus_val ? cplus_val : stdc_ver); if (cplus_val) { look_and_install( "__cplusplus", DEF_NOARGS_STANDARD, null, tmp); } else { if (stdc_ver) look_and_install( "__STDC_VERSION__", DEF_NOARGS_STANDARD, null , tmp); #ifdef COMPILER_CPLUS if (! nflag) /* Undefine pre-defined macro for C++ */ undefine( COMPILER_CPLUS); #endif } set_limit(); stdc2 = cplus_val || stdc_ver >= 199901L; stdc3 = (cplus_val >= 199901L) || (stdc_ver >= 199901L); /* (cplus_val >= 199901L) makes C++ C99-compatible specs */ if (standard) init_std_defines(); if (stdc3) set_pragma_op(); } static void init_std_defines( void) /* * For STD and POST_STD modes. * The magic pre-defines are initialized with magic argument counts. * expand_macro() notices this and calls the appropriate routine. * DEF_NOARGS is one greater than the first "magic" definition. * 'DEF_NOARGS - n' are reserved for pre-defined macros. * __STDC_VERSION__ and __cplusplus are defined by chk_opts() and set_cplus(). */ { char tmp[ 16]; char timestr[ 14]; time_t tvec; char * tstring; look_and_install( "__LINE__", DEF_NOARGS_DYNAMIC - 1, null, "-1234567890"); /* Room for 11 chars (10 for long and 1 for '-' in case of wrap round. */ look_and_install( "__FILE__", DEF_NOARGS_DYNAMIC - 2, null, null); /* Should be stuffed */ /* Define __DATE__, __TIME__ as present date and time. */ time( &tvec); tstring = ctime( &tvec); sprintf( timestr, "\"%.3s %c%c %.4s\"", tstring + 4, *(tstring + 8) == '0' ? ' ' : *(tstring + 8), *(tstring + 9), tstring + 20); look_and_install( "__DATE__", DEF_NOARGS_DYNAMIC, null, timestr); sprintf( timestr, "\"%.8s\"", tstring + 11); look_and_install( "__TIME__", DEF_NOARGS_DYNAMIC, null, timestr); if (! look_id( "__STDC_HOSTED__")) { /* * Some compilers, e.g. GCC older than 3.3, define this macro by * -D option. */ sprintf( tmp, "%d", STDC_HOSTED); look_and_install( "__STDC_HOSTED__", DEF_NOARGS_PREDEF, null, tmp); } #if COMPILER != GNUC /* GCC do not undefine __STDC__ on C++ */ if (cplus_val) return; #endif /* Define __STDC__ as 1 or such for Standard conforming compiler. */ if (! look_id( "__STDC__")) { sprintf( tmp, "%d", stdc_val); look_and_install( "__STDC__", DEF_NOARGS_STANDARD, null, tmp); } } #define LINE90LIMIT 32767 #define LINE_CPLUS_LIMIT 32767 static void set_limit( void) /* * Set the minimum translation limits specified by the Standards. */ { if (cplus_val) { /* Specified by C++ 1998 Standard */ std_limits.str_len = SLEN_CPLUS_MIN; std_limits.id_len = IDLEN_CPLUS_MIN; std_limits.n_mac_pars = NMACPARS_CPLUS_MIN; std_limits.exp_nest = EXP_NEST_CPLUS_MIN; std_limits.blk_nest = BLK_NEST_CPLUS_MIN; std_limits.inc_nest = INCLUDE_NEST_CPLUS_MIN; std_limits.n_macro = NMACRO_CPLUS_MIN; std_limits.line_num = LINE_CPLUS_LIMIT; } else if (stdc_ver >= 199901L) { /* Specified by C 1999 Standard */ std_limits.str_len = SLEN99MIN; std_limits.id_len = IDLEN99MIN; std_limits.n_mac_pars = NMACPARS99MIN; std_limits.exp_nest = EXP_NEST99MIN; std_limits.blk_nest = BLK_NEST99MIN; std_limits.inc_nest = INCLUDE_NEST99MIN; std_limits.n_macro = NMACRO99MIN; std_limits.line_num = LINE99LIMIT; } else if (standard) { /* Specified by C 1990 Standard */ std_limits.str_len = SLEN90MIN; std_limits.id_len = IDLEN90MIN; std_limits.n_mac_pars = NMACPARS90MIN; std_limits.exp_nest = EXP_NEST90MIN; std_limits.blk_nest = BLK_NEST90MIN; std_limits.inc_nest = INCLUDE_NEST90MIN; std_limits.n_macro = NMACRO90MIN; std_limits.line_num = LINE90LIMIT; } /* Else pre-Standard mode */ } static void set_pragma_op( void) /* * #define _Pragma(a) _Pragma ( a ) * Define _Pragma() operator as a special macro so as to be searched * easily. The unusual 'DEF_PRAGMA' is a marker of this psuedo * macro. */ { char * name = "_Pragma"; char tmp[ 16]; sprintf( tmp, "%c%s ( %c%c )", DEF_MAGIC, name, MAC_PARM, 1); /* Replacement text */ look_and_install( name, DEF_PRAGMA, "a", tmp); } void init_sys_macro( void) /* * Define system-specific macros and some Standard required macros * and undefine macros specified by -U options. */ { /* This order is important. */ def_macros(); /* Define macros specified by -D */ #if COMPILER == GNUC chk_env(); #endif init_predefines(); /* Define predefined macros */ #if COMPILER == GNUC init_gcc_macro(); #elif COMPILER == MSC init_msc_macro(); #endif undef_macros(); /* Undefine macros specified by -U */ if (mcpp_debug & MACRO_CALL) dump_def( FALSE, TRUE); /* Finally putout current macro names */ } void at_start( void) /* * Do the commands prior to processing main source file after do_options(). */ { char * env; FILEINFO * file_saved = infile; /* * Set multi-byte character encoding according to environment variables * LC_ALL, LC_CTYPE and LANG -- with preference in this order. */ if (! mb_changed) { /* -m option precedes */ if ((env = getenv( "LC_ALL")) != NULL) set_encoding( env, "LC_ALL", 0); else if ((env = getenv( "LC_CTYPE")) != NULL) set_encoding( env, "LC_CTYPE", 0); else if ((env = getenv( "LANG")) != NULL) set_encoding( env, "LANG", 0); } #if COMPILER == GNUC || COMPILER == MSC if (option_flags.dollar_in_name) char_type[ 0x24] |= LET; /* Enable '$' in identifiers */ /* * Do the -include (-Fl for MSC) options in the specified order. * Note: This functionality is implemented as nested #includes * which results the same effect as sequential #includes. */ { char ** preinc; /* * Note: Here, 'infile' is the main input file, which is pseudo- * parent file of the files to pre-include. So, we must * temporarily set the infile's directory to the current directory * in order to preinclude the files relative to it. */ preinc = preinc_end; while (preinclude <= --preinc && *preinc != NULL) open_file( &null, NULL, *preinc, TRUE, TRUE, FALSE); } #endif put_info( file_saved); } static void put_info( FILEINFO * sharp_file ) /* * Putout compiler-specific information. */ { if (no_output || option_flags.p) return; sharp_file->line++; sharp( sharp_file, 0); sharp_file->line--; #if COMPILER == GNUC if (gcc_work_dir) mcpp_fprintf( OUT, "%s%ld \"%s%c\"\n" , std_line_prefix ? "#line " : LINE_PREFIX , 1, cur_work_dir, '/'); /* Putout the current directory as a #line line as: */ /* '# 1 "/abs-path/cur_dir//"'. */ mcpp_fprintf( OUT, "%s%ld \"\"\n" , std_line_prefix ? "#line " : LINE_PREFIX , 1); mcpp_fprintf( OUT, "%s%ld \"\"\n" , std_line_prefix ? "#line " : LINE_PREFIX , 1); mcpp_fprintf( OUT, "%s%ld \"%s\"%s\n" , std_line_prefix ? "#line " : LINE_PREFIX, 1, cur_fullname , ! str_eq( cur_fullname, sharp_file->full_fname) ? " 1" : null); /* Suffix " 1" for the file specified by -include */ #endif } static char * set_files( int argc, char ** argv, char ** in_pp, char ** out_pp ) /* * Set input and/or output files. */ { char * cp; if (*in_pp == NULL) { /* Input file */ cp = argv[ mcpp_optind++]; #if SYS_FAMILY == SYS_WIN cp = bsl2sl( cp); #endif *in_pp = cp; } if (mcpp_optind < argc && argv[ mcpp_optind][ 0] != '-' && *out_pp == NULL) { cp = argv[ mcpp_optind++]; #if SYS_FAMILY == SYS_WIN cp = bsl2sl( cp); #endif *out_pp = cp; /* Output file */ } if (mcpp_optind >= argc) return NULL; /* Exhausted command line arguments */ if (argv[ mcpp_optind][ 0] == '-') return argv[ mcpp_optind]; /* More options */ cfatal( "Excessive file argument \"%s\"", argv[ mcpp_optind], 0L , NULL); return NULL; } static void set_env_dirs( void) /* * Add to include path those specified by environment variables. */ { const char * env; if (cplus_val) { if ((env = getenv( ENV_CPLUS_INCLUDE_DIR)) != NULL) parse_env( env); } if ((env = getenv( ENV_C_INCLUDE_DIR)) != NULL) parse_env( env); } static void parse_env( const char * env ) /* * Parse environmental variable and append the path to include-dir-list. */ { char * save; char * save_start; char * p; int sep; save = save_start = save_string( env); while (*save) { p = save; while (*p && *p != ENV_SEP) p++; if (p != save) { /* Variable separator */ sep = *p; *p = EOS; set_a_dir( save); if (sep == EOS) break; save = ++p; } while (*save == ENV_SEP) ++save; } free( save_start); } static void set_sys_dirs( int set_cplus_dir /* Set C++ include-directory too */ ) /* * Set site-specific and system-specific directories to the include directory * list. */ { if (cplus_val && set_cplus_dir) { #ifdef CPLUS_INCLUDE_DIR1 set_a_dir( CPLUS_INCLUDE_DIR1); #endif #ifdef CPLUS_INCLUDE_DIR2 set_a_dir( CPLUS_INCLUDE_DIR2); #endif #ifdef CPLUS_INCLUDE_DIR3 set_a_dir( CPLUS_INCLUDE_DIR3); #endif #ifdef CPLUS_INCLUDE_DIR4 set_a_dir( CPLUS_INCLUDE_DIR4); #endif } #if SYS_FAMILY == SYS_UNIX set_a_dir( "/usr/local/include"); #endif #ifdef C_INCLUDE_DIR1 set_a_dir( C_INCLUDE_DIR1); #endif #ifdef C_INCLUDE_DIR2 set_a_dir( C_INCLUDE_DIR2); #endif #if SYS_FAMILY == SYS_UNIX #if SYSTEM == SYS_CYGWIN if (no_cygwin) /* -mno-cygwin */ set_a_dir( "/usr/include/mingw"); else set_a_dir( "/usr/include"); #else set_a_dir( "/usr/include"); /* Should be placed after C_INCLUDE_DIR? */ #endif #endif } static void set_a_dir( const char * dirname /* The path-name */ ) /* * Append an include directory. * This routine is called from the following routines (in this order). * 1. do_options() by -I option. * 2. do_options() by -isystem option (for GNUC). * 3. set_env_dirs() by environment variables. * 4. set_sys_dirs() by CPLUS_INCLUDE_DIR?, C_INCLUDE_DIR? and system- * specifics (unless -I- or -nostdinc option is specified). * Ignore non-existent directory. * Note that this routine should be called only in initializing steps, * because increase of include dirs causes reallocation of incdir[]. * Note: a trailing PATH-DELIM is appended by norm_path(). */ { char * norm_name; const char ** ip; if (incdir == NULL) { /* Should be initialized */ max_inc = INIT_NUM_INCLUDE; incdir = (const char **) xmalloc( sizeof (char *) * max_inc); incend = &incdir[ 0]; } else if (incend - incdir >= max_inc) { /* Buffer full */ #if SYSTEM == SYS_MAC size_t framework_pos = to_search_framework - incdir; #endif #if COMPILER == GNUC size_t sys_pos = 0; if (sys_dirp) sys_pos = sys_dirp - incdir; #endif incdir = (const char **) xrealloc( (void *) incdir , sizeof (char *) * max_inc * 2); incend = &incdir[ max_inc]; #if COMPILER == GNUC if (sys_pos) sys_dirp = &incdir[ sys_pos]; #endif #if SYSTEM == SYS_MAC to_search_framework = &incdir[ framework_pos]; #endif max_inc *= 2; } if (dirname == NULL) return; /* Only to initialize incdir[] */ norm_name = norm_dir( dirname, FALSE); if (! norm_name) /* Non-existent */ return; for (ip = incdir; ip < incend; ip++) { if (str_case_eq( *ip, norm_name)) { if (option_flags.v && ! (mcpp_debug & MACRO_CALL)) mcpp_fprintf( ERR, "Duplicate directory \"%s\" is ignored\n" , norm_name); free( norm_name); /* Already registered */ return; } } /* Register new directory */ *incend++ = norm_name; } #if SYSTEM == SYS_MAC && COMPILER == GNUC /* Definitions for "header map" file of Xcode / Apple-GCC. */ /* These definitions were taken from cpplib.h of Apple-GCC-4.0.1 */ #define HMAP_SAME_ENDIANNESS_MAGIC \ (((((('h' << 8) | 'm') << 8) | 'a') << 8) | 'p') typedef unsigned short uint16; typedef unsigned int uint32; struct hmap_bucket { uint32 key; /* Offset (into strings) of key */ struct { uint32 prefix; /* Offset (into strings) of value prefix */ uint32 suffix; /* Offset (into strings) of value suffix */ } value; /* Value (prefix- and suffix-strings) */ }; struct hmap_header_map { uint32 magic; /* Magic word, also indicates byte order */ uint16 version; /* Version number -- currently 1 */ uint16 _reserved; /* Reserved for future use -- zero for now */ uint32 strings_offset; /* Offset to start of string pool */ uint32 count; /* Number of entries in the string table */ uint32 capacity; /* Number of buckets (always a power of 2) */ uint32 max_value_length; /* Length of longest result path (excl. '\0') */ struct hmap_bucket buckets[1]; /* Inline array of 'capacity' maptable buckets */ /* Strings follow the buckets, at strings_offset. */ }; #endif static char * norm_dir( const char * dirname, /* Directory path to normalize */ int framework /* Setting a framework directory*/ ) /* * Normalize include directory path. * Handle -isysroot option for GCC, including framework directory for SYS_MAC. */ { char * norm_name; #if COMPILER == GNUC if (sysroot && sys_dirp) { /* Logical system root specified and dirname is system header dir */ char delim[ 2] = { EOS, EOS}; char * dir; #if SYSTEM == SYS_MAC if (! framework && memcmp( dirname, "/usr/", 5) != 0) return NULL; /* /Developer/usr/lib/gcc/ */ #endif if (dirname[ 0] != PATH_DELIM) delim[ 0] = PATH_DELIM; dir = xmalloc( strlen( sysroot) + strlen( dirname) + 2); sprintf( dir, "%s%s%s", sysroot, delim, dirname); dirname = dir; } #endif #if SYSTEM == SYS_MAC && COMPILER == GNUC if (strlen( dirname) > 5 && str_case_eq( dirname + strlen( dirname) - 5, ".hmap")) { /* "header map" file (not an include directory) */ norm_name = norm_path( null, dirname, FALSE, TRUE); if (! norm_name && option_flags.v) mcpp_fprintf( ERR, "Invalid header map file \"%s\" is ignored\n" , dirname); } else #endif { norm_name = norm_path( dirname, NULL, FALSE, FALSE); /* Normalize the pathname to compare */ if (! norm_name && option_flags.v && ! (mcpp_debug & MACRO_CALL)) mcpp_fprintf( ERR, "Non-existent directory \"%s\" is ignored\n" , dirname); } #if COMPILER == GNUC if (sysroot && sys_dirp) free( dirname); #endif return norm_name; } static char * norm_path( const char * dir, /* Include directory (maybe "", never NULL) */ const char * fname, /* Filename (possibly has directory part, or maybe NULL) */ int inf, /* If TRUE, output some infs when (mcpp_debug & PATH) */ int hmap /* "header map" file of Apple-GCC */ ) /* * Normalize the pathname removing redundant components such as * "foo/../", "./" and trailing "/.". * Append trailing "/" if 'fname' is NULL. * Change relative path to absolute path. * Dereference a symbolic linked file (or directory) to a real directory/file. * Return a malloc'ed buffer, if the directory/file exists. * Return NULL, if the specified directory/file does not exist or 'dir' is * not a directory or 'fname' is not a regular file. * This routine is called from set_a_dir(), init_gcc_macro(), do_once() and * open_file(). */ { char * norm_name; /* The path-list converted */ char * start; char * cp1; char * cp2; char * abs_path; int len; /* Should not be size_t */ size_t start_pos = 0; char slbuf1[ PATHMAX+1]; /* Working buffer */ #if SYS_FAMILY == SYS_UNIX char slbuf2[ PATHMAX+1]; /* Working buffer for dereferencing */ #endif #if SYSTEM == SYS_CYGWIN || SYSTEM == SYS_MINGW static char * root_dir; /* System's root directory in Windows file system */ static size_t root_dir_len; #if SYSTEM == SYS_CYGWIN static char * cygdrive = "/cygdrive/"; /* Prefix for drive letter */ #else static char * mingw_dir; /* "/mingw" dir in Windows */ static size_t mingw_dir_len; #endif #endif #if HOST_COMPILER == MSC struct _stat st_buf; #else struct stat st_buf; #endif if (! dir || (*dir && is_full_path( fname))) cfatal( "Bug: Wrong argument to norm_path()" /* _F_ */ , NULL, 0L, NULL); inf = inf && (mcpp_debug & PATH); /* Output information */ strcpy( slbuf1, dir); /* Include directory */ len = strlen( slbuf1); if (fname && len && slbuf1[ len - 1] != PATH_DELIM) { slbuf1[ len] = PATH_DELIM; /* Append PATH_DELIM */ slbuf1[ ++len] = EOS; } else if (! fname && len && slbuf1[ len - 1] == PATH_DELIM) { /* stat() of some systems do not like trailing '/' */ slbuf1[ --len] = EOS; } if (fname) strcat( slbuf1, fname); if (stat( slbuf1, & st_buf) != 0 /* Non-existent */ || (! fname && ! S_ISDIR( st_buf.st_mode)) /* Not a directory though 'fname' is not specified */ || (fname && ! S_ISREG( st_buf.st_mode))) /* Not a regular file though 'fname' is specified */ return NULL; #if SYSTEM == SYS_MAC && COMPILER == GNUC if (hmap) { /* Dirty "header map" file */ struct hmap_header_map hmap; size_t cnt; FILE * fp; fp = fopen( fname, "r"); cnt = fread( & hmap, sizeof (struct hmap_header_map), 1, fp); fclose( fp); if (cnt == 0 || hmap.magic != HMAP_SAME_ENDIANNESS_MAGIC) return NULL; } #endif if (! fname) { slbuf1[ len] = PATH_DELIM; /* Append PATH_DELIM */ slbuf1[ ++len] = EOS; } #if SYS_FAMILY == SYS_UNIX /* Dereference symbolic linked directory or file, if any */ slbuf1[ len] = EOS; /* Truncate PATH_DELIM and 'fname' part, if any */ slbuf2[ 0] = EOS; if (*dir && ! fname) { /* Registering include directory */ /* Symbolic link check of directories are required */ deref_syml( slbuf1, slbuf2, slbuf1); } else if (fname) { /* Regular file */ len = strlen( slbuf1); strcat( slbuf1, fname); deref_syml( slbuf1, slbuf2, slbuf1 + len); /* Symbolic link check of directory */ if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) { /* Dereference symbolic linked file (not directory) */ *(slbuf2 + len) = EOS; cp1 = slbuf1; if (slbuf2[ 0] != PATH_DELIM) { /* Relative path */ cp2 = strrchr( slbuf1, PATH_DELIM); if (cp2) /* Append to the source directory */ cp1 = cp2 + 1; } strcpy( cp1, slbuf2); } } if (inf) { if (slbuf2[ 0]) mcpp_fprintf( DBG, "Dereferenced \"%s%s\" to \"%s\"\n" , dir, fname ? fname : null, slbuf1); } #endif len = strlen( slbuf1); start = norm_name = xmalloc( len + 1); /* Need a new buffer */ strcpy( norm_name, slbuf1); #if SYS_FAMILY == SYS_WIN bsl2sl( norm_name); #endif #if SPECIAL_PATH_DELIM /* ':' ? */ for (cp1 = norm_name; *cp1 != EOS; cp1++) { if (*cp1 == PATH_DELIM) *cp1 = '/'; } #endif cp1 = norm_name; #if SYSTEM == SYS_CYGWIN /* Convert to "/cygdirve/x/dir" style of absolute path-list */ if (len >= 8 && (memcmp( cp1, "/usr/bin", 8) == 0 || memcmp( cp1, "/usr/lib", 8) == 0)) { memmove( cp1, cp1 + 4, len - 4 + 1); /* Remove "/usr" */ len -= 4; } if (*cp1 == '/' && (len < 10 || memcmp( cp1, cygdrive, 10) != 0)) { /* /dir, not /cygdrive/ */ if (! root_dir_len) { /* Should be initialized */ /* Convert "X:\DIR-list" to "/cygdrive/x/dir-list" */ root_dir = xmalloc( strlen( CYGWIN_ROOT_DIRECTORY) + 1); strcpy( root_dir, CYGWIN_ROOT_DIRECTORY); *(root_dir + 1) = *root_dir; /* "x:/" to " x/" */ cp1 = xmalloc( strlen( cygdrive) + strlen( root_dir)); strcpy( cp1, cygdrive); strcat( cp1, root_dir + 1); free( root_dir); root_dir = cp1; root_dir_len = strlen( root_dir); } cp1 = xmalloc( root_dir_len + len + 1); strcpy( cp1, root_dir); strcat( cp1, norm_name); /* Convert to absolute path */ free( norm_name); norm_name = start = cp1; len += root_dir_len; } #endif #if SYSTEM == SYS_MINGW /* Handle the mess of MinGW's path-list */ /* Convert to "x:/dir" style of absolute path-list */ if (*cp1 == PATH_DELIM && isalpha( *(cp1 + 1)) && *(cp1 + 2) == PATH_DELIM) { /* /c/, /d/, etc*/ *cp1 = *(cp1 + 1); *(cp1 + 1) = ':'; /* Convert to c:/, d:/, etc */ } else if (memcmp( cp1, "/mingw", 6) == 0) { if (! mingw_dir_len) { /* Should be initialized */ mingw_dir_len = strlen( MINGW_DIRECTORY); mingw_dir = xmalloc( mingw_dir_len + 1); strcpy( mingw_dir, MINGW_DIRECTORY); } cp1 = xmalloc( mingw_dir_len + len + 1); strcpy( cp1, mingw_dir); strcat( cp1, norm_name + 6); /* Convert to absolute path */ free( norm_name); norm_name = start = cp1; len += mingw_dir_len; } else if (memcmp( cp1, "/usr", 4) == 0) { memmove( cp1, cp1 + 4, len - 4 + 1); /* Remove "/usr" */ len -= 4; } if (*cp1 == '/') { /* /dir or / */ if (! root_dir_len) { /* Should be initialized */ root_dir_len = strlen( MSYS_ROOT_DIRECTORY); root_dir = xmalloc( root_dir_len + 1); strcpy( root_dir, MSYS_ROOT_DIRECTORY); } cp1 = xmalloc( root_dir_len + len + 1); strcpy( cp1, root_dir); strcat( cp1, norm_name); /* Convert to absolute path */ free( norm_name); norm_name = start = cp1; len += root_dir_len; } #endif #if SYS_FAMILY == SYS_WIN if (*(cp1 + 1) == ':') start = cp1 += 2; /* Next to the drive letter */ start_pos = 2; #endif if (len == 1 && *norm_name == '/') /* Only "/" */ return norm_name; if (strncmp( cp1, "./", 2) == 0) /* Remove beginning "./" */ memmove( cp1, cp1 + 2, strlen( cp1 + 2) + 1); /* +1 for EOS */ if (*start != '/') { /* Relative path to current directory */ /* Make absolute path */ abs_path = xmalloc( len + strlen( cur_work_dir) + 1); cp1 = stpcpy( abs_path, cur_work_dir); strcpy( cp1, start); free( norm_name); norm_name = abs_path; start = cp1 = norm_name + start_pos; } while ((cp1 = strstr( cp1, "/./")) != NULL) memmove( cp1, cp1 + 2, strlen( cp1 + 2) + 1); /* Remove "/." of "/./" */ cp1 = start; /* Remove redundant "foo/../" */ while ((cp1 = strstr( cp1, "/../")) != NULL) { *cp1 = EOS; if ((cp2 = strrchr( start, '/')) != NULL) { if (*(cp1 - 1) != '.') { memmove( cp2 + 1, cp1 + 4, strlen( cp1 + 4) + 1); /* Remove "foo/../" */ cp1 = cp2; } else { /* Impossible */ break; } } else { /* Impossible */ break; } } #if SPECIAL_PATH_DELIM for (cp1 = start; *cp1 != EOS; cp1++) { if (*cp1 == '/') *cp1 = PATH_DELIM; } #endif if (inf) { char debug_buf[ PATHMAX+1]; strcpy( debug_buf, dir); strcat( debug_buf, fname ? fname : null); #if SYS_FAMILY == SYS_WIN bsl2sl( debug_buf); #endif if (! str_eq( debug_buf, norm_name)) mcpp_fprintf( DBG, "Normalized the path \"%s\" to \"%s\"\n" , debug_buf, norm_name); } return norm_name; } #if SYS_FAMILY == SYS_UNIX static void deref_syml( char * slbuf1, /* Original path-list */ char * slbuf2, /* Working buffer */ char * chk_start /* Pointer into slbuf1 */ ) /* Dereference symbolic linked directory */ { char * cp2; int len; /* Should be int, not size_t */ while ((chk_start = strchr( chk_start, PATH_DELIM)) != NULL) { *chk_start = EOS; if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) { /* Dereference symbolic linked directory */ cp2 = strrchr( slbuf1, PATH_DELIM); /* Previous delimiter */ *chk_start = PATH_DELIM; strcpy( slbuf2 + len, chk_start); if (slbuf2[ 0] == PATH_DELIM) { /* Absolute path */ strcpy( slbuf1, slbuf2); chk_start = slbuf1 + len + 1; } else { if (cp2) chk_start = cp2 + 1; else chk_start = slbuf1; strcpy( chk_start, slbuf2); /* Rewrite the path */ chk_start += len; } } else { *chk_start++ = PATH_DELIM; } } } #endif #if COMPILER == GNUC static void init_gcc_macro( void) /* * Predefine GCC macros. * This routine should be called after opening output file in order to putout * macro informations by -K option into the file. * Also this routine should be called before undef_macros() in order to * permit undefining a macro by -U option. */ { char fname[ BUFSIZ]; char lbuf[ BUFSIZ]; char * include_dir; /* The version-specific include directory */ char * tmp; FILE * fp; DEFBUF * defp; const char * cp; char * tp; int i; if (nflag) /* -undef option */ goto undef_special; tmp = xmalloc( strlen( INC_DIR) + strlen( "/mingw/mcpp-gcc-") + strlen( arch) + 1); #if SYSTEM == SYS_CYGWIN if (no_cygwin) { sprintf( tmp, "%s/mingw/mcpp-gcc-%s", INC_DIR, arch); } else { sprintf( tmp, "%s/mcpp-gcc-%s", INC_DIR, arch); } #else sprintf( tmp, "%s/mcpp-gcc-%s", INC_DIR, arch); #endif include_dir = norm_path( tmp, NULL, TRUE, FALSE); free( tmp); for (i = 0; i <= 1; i++) { int nargs; if ((mcpp_mode == POST_STD || ansi) && i == 0) continue; /* POST_STD or __STRICT_ANSI__ does not */ /* predefine non-conforming macros */ /* The predefined macro file */ cp = i ? "std" : "old"; sprintf( fname, "%sg%s%d%d_predef_%s.h" , include_dir, cplus_val ? "xx" : "cc" , gcc_maj_ver, gcc_min_ver, cp); /* Note that norm_path() append a PATH_DELIM. */ if ((fp = fopen( fname, "r")) == NULL) { mcpp_fprintf( ERR, "The mode for %s has not been installed.\n" , arch); longjmp( error_exit, -1); } nargs = i ? 0 : DEF_NOARGS_PREDEF_OLD; /* g*_predef_std.h has DEF_NOARGS_PREDEF or non-negative args */ /* while g*_predef_old.h has only DEF_NOARGS_PREDEF_OLD args */ while (fgets( lbuf, BUFSIZ, fp) != NULL) { unget_string( lbuf, "gcc_predefine"); if (skip_ws() == '#' && scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == NAM && str_eq( work_buf, "define")) { defp = do_define( TRUE, nargs); /* Ignore re-definition */ } skip_nl(); } } free( include_dir); undef_special: if (look_id( "__OPTIMIZE__")) /* -O option is specified */ undefine( "__NO_INLINE__"); } static void chk_env( void) /* * Check the environment variables to specify output of dependency lines. */ { char * env; char * cp; /* Output of dependency lines */ if ((env = getenv( "DEPENDENCIES_OUTPUT")) == NULL) { if ((env = getenv( "SUNPRO_DEPENDENCIES")) == NULL) return; else mkdep |= MD_SYSHEADER; } mkdep |= MD_MKDEP; if ((cp = strchr( env, ' ')) != NULL) { *cp++ = EOS; while (*cp == ' ') cp++; } if (! mkdep_fp) /* Command line option precedes */ mkdep_fp = fopen( env, "a"); if (! mkdep_target) mkdep_target = cp; } #elif COMPILER == MSC static void init_msc_macro( void) /* * Define a few MSC-specific predefined macros. */ { DEFBUF * defp; int i; defp = look_id( "_MSC_VER"); i = atoi( defp->repl); if (i >= 1400) { /* _MSC_VER >= 1400 */ look_and_install( "_MT", DEF_NOARGS_PREDEF, null, "1"); if (cplus_val && ! wchar_t_modified) { /* -Zc:wchar_t- was not specified */ look_and_install( "_NATIVE_WCHAR_T_DEFINED", DEF_NOARGS_PREDEF , null, "1"); look_and_install( "_WCHAR_T_DEFINED", DEF_NOARGS_PREDEF, null , "1"); } } } #endif static void def_macros( void) /* * Define macros specified by -D option. * This routine should be called before undef_macros(). */ { int i; for (i = 0; i < def_cnt; i++) def_a_macro( 'D', def_list[ i]); } static void undef_macros( void) /* * Undefine macros specified by -U option. * This routine should be called after init_predefine(). */ { char * name; int i; for (i = 0; i < undef_cnt; i++) { name = undef_list[ i]; if (look_id( name) != NULL) undefine( name); else if (warn_level & 8) mcpp_fprintf( ERR, "\"%s\" wasn't defined\n", name); } } void put_depend( const char * filename ) /* * Append a header name to the source file dependency line. */ { #define MAX_OUT_LEN 76 /* Maximum length of output line */ #define MKDEP_INITLEN (MKDEP_INIT * 0x100) #define MKDEP_MAX (MKDEP_INIT * 0x10) #define MKDEP_MAXLEN (MKDEP_INITLEN * 0x10) static char * output = NULL; /* File names */ static size_t * pos = NULL; /* Offset to filenames */ static int pos_num; /* Index of pos[] */ static char * out_p; /* Pointer to output[] */ static size_t mkdep_len; /* Size of output[] */ static size_t pos_max; /* Size of pos[] */ static FILE * fp; /* Path to output dependency line */ static size_t llen; /* Length of current physical output line */ size_t * pos_p; /* Index into pos[] */ size_t fnamlen; /* Length of filename */ if (fp == NULL) { /* Main source file. Have to initialize. */ #if MCPP_LIB if (output != NULL) { free( output); free( pos); } #endif output = xmalloc( mkdep_len = MKDEP_INITLEN); pos = (size_t *) xmalloc( (pos_max = MKDEP_INIT) * sizeof (size_t)); out_p = md_init( filename, output); fp = mkdep_fp; llen = strlen( output); pos_num = 0; /* Initialize for MCPP_LIB build */ } else if (filename == NULL) { /* End of input */ out_p = stpcpy( out_p, "\n\n"); if (mkdep & MD_PHONY) { /* Output the phony target line for each recorded header files. */ char * cp; int c; if (strlen( output) * 2 + (pos_num * 2) >= MKDEP_MAXLEN) { cerror( "Too long dependency line" /* _E_ */ , NULL, 0L, NULL); if (fp == fp_out) mcpp_fputs( output, OUT); else fputs( output, fp); return; } else if (strlen( output) * 2 + (pos_num * 2) >= mkdep_len) { /* Enlarge the buffer */ size_t len = out_p - output; output = xrealloc( output, mkdep_len *= 2); out_p = output + len; } pos_num--; for (pos_p = &pos[ 0]; pos_p <= &pos[ pos_num]; pos_p++) { if (pos_p == &pos[ pos_num]) { /* End of output */ for (cp = output + *pos_p; *cp != '\n'; cp++) ; c = '\n'; /* Append newline */ } else { cp = output + *(pos_p + 1) - 1; while( *cp == ' ' || *cp == '\\' || *cp == '\n') cp--; /* Remove trailing spaces */ c = *(++cp); } *cp = EOS; out_p = stpcpy( out_p, output + *pos_p); out_p = stpcpy( out_p, ":\n\n"); *cp = c; } } if (fp == fp_out) { /* To the same path with normal preprocessing */ mcpp_fputs( output, OUT); } else { /* To the file specified by -MF, -MD, -MMD options */ fputs( output, fp); fclose( fp); } fp = NULL; /* Clear for the next call in MCPP_LIB build */ return; } fnamlen = strlen( filename); /* Check the recorded filename */ for (pos_p = pos; pos_p < &pos[ pos_num]; pos_p++) { if (memcmp( output + *pos_p, filename, fnamlen) == 0) return; /* Already recorded filename */ } /* Any new header. Append its name to output. */ if (llen + fnamlen > MAX_OUT_LEN) { /* Line is long */ out_p = stpcpy( out_p, " \\\n "); /* Fold it */ llen = 1; } llen += fnamlen + 1; if (pos_num >= MKDEP_MAX || out_p + fnamlen + 1 >= output + MKDEP_MAXLEN) cfatal( "Too long dependency line: %s", output, 0L, NULL); /* Need to enlarge the buffer */ if (pos_num >= pos_max) { pos = (size_t *) xrealloc( (char *) pos , (pos_max *= 2) * sizeof (size_t *)); } if (output + mkdep_len <= out_p + fnamlen + 1) { size_t len = out_p - output; output = xrealloc( output, mkdep_len *= 2); out_p = output + len; } *out_p++ = ' '; pos[ pos_num++] = out_p - output; /* Remember the offset */ /* Don't use pointer, since 'output' may be reallocated later. */ out_p = stpcpy( out_p, filename); } static char * md_init( const char * filename, /* The source file name */ char * output /* Output to dependency file */ ) /* * Initialize output file and target. */ { char prefix[ PATHMAX]; char * cp = NULL; size_t len; char * out_p; const char * target = filename; const char * cp0; if (! mkdep_target || ! mkdep_fp) { /* Make target name */ #ifdef PATH_DELIM if ((cp0 = strrchr( target, PATH_DELIM)) != NULL) target = cp0 + 1; #endif if ((cp0 = strrchr( target, '.')) == NULL) len = strlen( target); else len = (size_t) (cp0 - target); memcpy( prefix, target, len); cp = prefix + len; *cp++ = '.'; } if (! mkdep_fp) { /* Unless already opened by -MF, -MD, -MMD options */ if (mkdep & MD_FILE) { strcpy( cp, "d"); mkdep_fp = fopen( prefix, "w"); } else { mkdep_fp = fp_out; /* Output dependency line to normal output */ no_output++; /* Without normal output */ } } if (mkdep_target) { /* -MT or -MQ option is specified */ if (mkdep & MD_QUOTE) { /* 'Quote' $, \t and space */ out_p = md_quote( output); } else { out_p = stpcpy( output, mkdep_target); } } else { strcpy( cp, OBJEXT); out_p = stpcpy( output, prefix); } *out_p++ = ':'; *out_p = EOS; return out_p; } static char * md_quote( char * output ) /* * 'Quote' $, tab and space. * This function was written referring to GCC V.3.2 source. */ { char * p; char * q; for (p = mkdep_target; *p; p++, output++) { switch (*p) { case ' ': case '\t': /* GNU-make treats backslash-space sequence peculiarly */ for (q = p - 1; mkdep_target <= q && *q == '\\'; q--) *output++ = '\\'; *output++ = '\\'; break; case '$': *output++ = '$'; break; default: break; } *output = *p; } *output = EOS; return output; } static const char * toolong_fname = "Too long header name \"%s%.0ld%s\""; /* _F_ */ static const char * excess_token = "Excessive token sequence \"%s\""; /* _E_, _W1_ */ int do_include( int next /* TRUE if the directive is #include_next */ ) /* * Process the #include line. * There are three variations: * #include "file" search somewhere relative to the * current (or source) directory, if not * found, treat as #include . * #include Search in an implementation-dependent * list of places. * #include macro-call Expand the macro call, it must be one of * "file" or , process as such. * On success : return TRUE; * On failure of syntax : return FALSE; * On failure of file opening : return FALSE. * do_include() always absorbs the line (including the ). */ { const char * const no_name = "No header name"; /* _E_ */ char header[ PATHMAX + 16]; int token_type; char * fname; char * filename; int delim; /* " or <, > */ if ((delim = skip_ws()) == '\n') { /* No argument */ cerror( no_name, NULL, 0L, NULL); return FALSE; } fname = infile->bptr - 1; /* Current token for diagnosis */ if (standard && (char_type[ delim] & LET)) { /* Maybe macro */ int c; char *hp; hp = header; *hp = EOS; c = delim; while (get_unexpandable( c, FALSE) != NO_TOKEN) { /* Expand any macros in the line */ if (header + PATHMAX < hp + (int) (workp - work_buf)) cfatal( toolong_fname, header, 0L, work_buf); hp = stpcpy( hp, work_buf); while (char_type[ c = get_ch()] & HSP) *hp++ = c; } *hp = EOS; /* Ensure to terminate */ if (macro_line == MACRO_ERROR) /* Unterminated macro */ return FALSE; /* already diagnosed. */ unget_string( header, NULL); /* To re-read */ delim = skip_ws(); if (delim == '\n') { cerror( no_name, NULL, 0L, NULL); /* Expanded to */ return FALSE; /* 0 token. */ } } token_type = scan_token( delim, (workp = work_buf, &workp) , work_buf + PATHMAX); if (token_type == STR) /* String literal form */ goto found_name; else if (token_type == OPE && openum == OP_LT) /* '<' */ workp = scan_quote( delim, work_buf, work_buf + PATHMAX, TRUE); /* Re-construct or diagnose */ else /* Any other token in- */ goto not_header; /* cluding <=, <<, <% */ if (workp == NULL) /* Missing closing '>' */ goto syntax_error; found_name: *--workp = EOS; /* Remove the closing and */ fname = save_string( &work_buf[ 1]); /* the starting delimiter. */ if (skip_ws() != '\n') { if (standard) { cerror( excess_token, infile->bptr-1, 0L, NULL); skip_nl(); goto error; } else if (mcpp_mode == OLD_PREP) { skip_nl(); } else { if (warn_level & 1) cwarn( excess_token, infile->bptr-1, 0L, NULL); skip_nl(); } } #if SYS_FAMILY == SYS_WIN bsl2sl( fname); #endif filename = fname; #if NO_DIR /* Unofficial feature */ if (no_dir) { /* Strip directory components */ char src_dir[ PATHMAX] = { EOS, }; if (has_directory( fname, src_dir)) filename = fname + strlen( src_dir); delim = '"'; /* Even a system header is handled as a local one */ } #endif if (open_include( filename, (delim == '"'), next)) { /* 'fname' should not be free()ed, it is used as file-> */ /* real_fname and has been registered into fnamelist[] */ return TRUE; } cerror( "Can't open include file \"%s\"", filename, 0L, NULL); /* _E_ */ error: free( fname); return FALSE; not_header: cerror( "Not a header name \"%s\"", fname, 0L, NULL); /* _E_ */ syntax_error: skip_nl(); return FALSE; } static int open_include( char * filename, /* File name to include */ int searchlocal, /* TRUE if #include "file" */ int next /* TRUE if #include_next */ ) /* * Open an include file. This routine is only called from do_include() above. * It searches the list of directories via search_dir() and opens the file * via open_file(), linking it into the list of active files. * Returns TRUE if the file was opened, FALSE if it fails. */ { char src_dir[ PATHMAX] = { EOS, }; /* Directory part of includer */ int full_path; /* Filename is full-path-list */ int has_dir = FALSE; /* Includer has directory part */ int has_dir_src = FALSE; int has_dir_fname = FALSE; full_path = is_full_path( filename); if (!full_path && searchlocal && (search_rule & SOURCE)) { has_dir_src = has_directory( infile->src_dir, src_dir); has_dir_fname = has_directory( infile->real_fname , src_dir + strlen( src_dir)); /* Get directory part of the parent file of the file to include.*/ /* Note that infile->dirp of main input file is set to "" and */ /* remains the same even if -include options are processed. */ has_dir = has_dir_src || has_dir_fname || (**(infile->dirp) != EOS); } if (mcpp_debug & PATH) mcpp_fprintf( DBG, "filename: %s\n", filename); #if COMPILER == GNUC if (! full_path) { if (i_split /* -I- option is specified */ || next) /* or #include_next */ goto search_dirs; } #endif if ((searchlocal && ((search_rule & CURRENT) || !has_dir)) || full_path) { /* * Look in local directory first. * Try to open filename relative to the "current directory". */ if (open_file( &null, NULL, filename, searchlocal && !full_path , FALSE, FALSE)) return TRUE; if (full_path) return FALSE; } if (searchlocal && (search_rule & SOURCE) && has_dir) { /* * Look in local directory of source file. * Try to open filename relative to the "source directory". */ if (open_file( infile->dirp, src_dir, filename, TRUE, FALSE, FALSE)) return TRUE; } #if COMPILER == MSC if (searchlocal) { /* Visual C searches ancestor source's directory, too. */ FILEINFO * file = infile; while ((file = file->parent) != NULL) { /* Search each parent includer's directory */ if (open_file( file->dirp, src_dir, filename, TRUE, FALSE, FALSE)) return TRUE; } } #endif #if COMPILER == GNUC search_dirs: if (searchlocal) { /* Search the directories specified by -iquote option, if any. */ const char ** qdir; for (qdir = quote_dir; qdir < quote_dir_end; qdir++) { if (open_file( qdir, NULL, filename, FALSE, FALSE, FALSE)) return TRUE; } } #endif /* Search the include directories */ if (search_dir( filename, searchlocal, next)) return TRUE; return FALSE; } static int has_directory( const char * source, /* Filename to examine */ char * directory /* Put directory stuff here */ ) /* * If a directory is found in the 'source' filename string (i.e. "includer"), * the directory part of the string is copied to 'directory' and * has_directory() returns TRUE. * Else, nothing is copied and it returns FALSE. */ { const char * sp; size_t len; if (! source) return FALSE; if ((sp = strrchr( source, PATH_DELIM)) == NULL) { return FALSE; } else { len = (size_t)(sp - source) + 1; /* With path-delimiter */ memcpy( directory, source, len); directory[ len] = EOS; return TRUE; } } static int is_full_path( const char * path ) /* * Check whether the path is a full (absolute) path list or not. */ { if (! path) return FALSE; #if SYS_FAMILY == SYS_UNIX if (path[0] == PATH_DELIM) #elif SYS_FAMILY == SYS_WIN if ((path[1] == ':' && path[2] == PATH_DELIM) /* "C:/path" */ || path[0] == PATH_DELIM) /* Root dir of current drive */ #elif 1 /* For other systems you should write code here. */ if (path[0] == PATH_DELIM) #endif return TRUE; else return FALSE; } static int search_dir( char * filename, /* File name to include */ int searchlocal, /* #include "header.h" */ int next /* TRUE if #include_next */ ) /* * Look in any directories specified by -I command line arguments, * specified by environment variable, then in the builtin search list. */ { const char ** incptr; /* -> inlcude directory */ incptr = incdir; #if COMPILER == GNUC if (next && **inc_dirp != EOS) incptr = inc_dirp + 1; /* In case of include_next search after the includer's directory */ #endif for ( ; incptr < incend; incptr++) { if (strlen( *incptr) + strlen( filename) >= PATHMAX) cfatal( toolong_fname, *incptr, 0L, filename); /* _F_ */ #if SYSTEM == SYS_MAC if (incptr == to_search_framework && ! searchlocal) { /* Now search the framework dirs */ if (search_framework( filename)) { /* Found */ if (in_import) /* "#import"ed file is once only */ do_once( infile->full_fname); return TRUE; } /* Else continue to search incptr */ } #endif if (open_file( incptr, NULL, filename, FALSE, FALSE, FALSE)) /* Now infile has been renewed */ return TRUE; } return FALSE; } static int open_file( const char ** dirp, /* Pointer to include directory */ const char * src_dir, /* Source directory of includer */ const char * filename, /* Filename (possibly has directory) */ int local, /* #include "file" */ int include_opt, /* Specified by -include option */ int sys_frame /* System framework header (for SYS_MAC)*/ ) /* * Open a file, add it to the linked list of open files, close the includer * if nessesary and truncate the includer's buffer. * This is called from open_include() and at_start(). */ { char dir_fname[ PATHMAX] = { EOS, }; #if HOST_COMPILER == BORLANDC /* Borland's fopen() does not set errno. */ static int max_open = FOPEN_MAX - 5; #else static int max_open; #endif int len; FILEINFO * file = infile; FILE * fp; char * fullname; const char * fname; errno = 0; /* Clear errno possibly set by path searching */ #if SYSTEM == SYS_MAC && COMPILER == GNUC if (strlen( *dirp) > 5 && str_case_eq( *dirp + strlen( *dirp) - 5, ".hmap")) { /* Search header map file for a header */ if (! search_header_map( *dirp, filename, dir_fname)) return NULL; fname = dir_fname; /* Found a path-list */ dirp = &null; goto search; } else #endif { if (mcpp_debug & PATH) mcpp_fprintf( DBG, "Searching %s%s%s\n", *dirp , src_dir ? src_dir : null, filename); } /* src_dir is usually NULL. This is specified to */ /* search the source directory of the includer. */ if (src_dir && *src_dir != EOS) { strcpy( dir_fname, src_dir); strcat( dir_fname, filename); fname = dir_fname; } else { fname = filename; } search: fullname = norm_path( *dirp, fname, TRUE, FALSE); /* Convert to absolute path */ if (! fullname) /* Non-existent or directory */ return FALSE; if (standard && included( fullname)) /* Once included */ goto true; if ((max_open != 0 && max_open <= include_nest) /* Exceed the known limit of open files */ || ((fp = fopen( fullname, "r")) == NULL && errno == EMFILE)) { /* Reached the limit for the first time */ if (mcpp_debug & PATH) { #if HOST_COMPILER == BORLANDC if (include_nest == FOPEN_MAX - 5) #else if (max_open == 0) #endif mcpp_fprintf( DBG, "#include nest reached at the maximum of system: %d, returned errno: %d\n" , include_nest, errno); } /* * Table of open files is full. * Remember the file position and close the includer. * The state will be restored by get_line() on end of the included. */ file->pos = ftell( file->fp); fclose( file->fp); /* In case of failure, re-open the includer */ if ((fp = fopen( fullname, "r")) == NULL) { file->fp = fopen( cur_fullname, "r"); fseek( file->fp, file->pos, SEEK_SET); goto false; } if (max_open == 0) /* Remember the limit of the system */ max_open = include_nest; } else if (fp == NULL) /* No read permission */ goto false; /* Truncate buffer of the includer to save memory */ len = (int) (file->bptr - file->buffer); if (len) { file->buffer = xrealloc( file->buffer, len + 1); file->bptr = file->buffer + len; } if (! include_opt) sharp( NULL, 0); /* Print includer's line num and fname */ add_file( fp, src_dir, filename, fullname, include_opt); /* Add file-info to the linked list. 'infile' has been just renewed */ /* * Remember the directory for #include_next. * Note: inc_dirp is restored to the parent includer's directory * by get_ch() when the current includer is finished. */ infile->dirp = inc_dirp = dirp; #if 0 /* This part is only for debugging */ chk_dirp( dirp); #endif #if COMPILER == GNUC if ((**dirp != EOS && sys_dirp <= dirp && dirp <= incend) #if SYSTEM == SYS_MAC || sys_frame #endif ) infile->sys_header = TRUE; /* Found in a system header dir */ else infile->sys_header = FALSE; #endif cur_fullname = fullname; if (option_flags.z) { no_output++; /* Don't output the included file */ if (include_nest == 2) mcpp_fprintf( OUT, "#include \"%s\"\n", fullname); /* Output #include line instead, if it is in main source file */ } else if (! include_opt) { /* Do not sharp() on -include */ src_line = 1; /* Working on line 1 now */ sharp( NULL, 1); /* Print out the included file name */ } src_line = 0; /* To read the first line */ if (mkdep && ((mkdep & MD_SYSHEADER) || ! infile->sys_header)) put_depend( fullname); /* Output dependency line */ true: return TRUE; false: free( fullname); return FALSE; } void add_file( FILE * fp, /* Open file pointer */ const char * src_dir, /* Directory of source */ const char * filename, /* Name of the file */ const char * fullname, /* Full path list */ int include_opt /* File specified by -include option */ ) /* * Initialize tables for this open file. This is called from open_file() * (for #include files), and from the entry to MCPP to open the main input * file. It calls a common routine get_file() to build the FILEINFO * structure which is used to read characters. */ { FILEINFO * file; const char * too_many_include_nest = "More than %.0s%ld nesting of #include"; /* _F_ _W4_ */ filename = set_fname( filename); /* Search or append to fnamelist[] */ fullname = set_fname( fullname); /* Search or append to fnamelist[] */ file = get_file( filename, src_dir, fullname, (size_t) NBUFF, include_opt); /* file == infile */ file->fp = fp; /* Better remember FILE * */ cur_fname = filename; if (include_nest >= INCLUDE_NEST) /* Probably recursive #include */ cfatal( too_many_include_nest, NULL, (long) INCLUDE_NEST, NULL); if (standard && (warn_level & 4) && include_nest == std_limits.inc_nest + 1) cwarn( too_many_include_nest, NULL, (long) std_limits.inc_nest, NULL); include_nest++; } static const char * set_fname( const char * filename ) /* * Register the source filename to fnamelist[]. * Search fnamelist[] for filename or append filename to fnamelist[]. * Returns the pointer. * file->real_fname and file->full_fname points into fnamelist[]. */ { INC_LIST * fnamep; size_t fnamelen; if (fnamelist == NULL) { /* Should be initialized */ max_fnamelist = INIT_NUM_FNAMELIST; fnamelist = (INC_LIST *) xmalloc( sizeof (INC_LIST) * max_fnamelist); fname_end = &fnamelist[ 0]; } else if (fname_end - fnamelist >= max_fnamelist) { /* Buffer full: double the elements */ fnamelist = (INC_LIST *) xrealloc( (void *) fnamelist , sizeof (INC_LIST) * max_fnamelist * 2); fname_end = &fnamelist[ max_fnamelist]; max_fnamelist *= 2; } /* Register the filename in fnamelist[] */ fnamelen = strlen( filename); for (fnamep = fnamelist; fnamep < fname_end; fnamep++) { if (fnamep->len == fnamelen && str_case_eq( fnamep->name, filename)) return filename; /* Already registered */ } fname_end->name = xmalloc( fnamelen + 1); filename = strcpy( fname_end->name, filename); /* Global pointer for get_file() */ fname_end->len = fnamelen; fname_end++; return filename; } #if SYSTEM == SYS_MAC #if COMPILER == GNUC /* Routines to search "header map" file of Xcode / Apple-GCC. */ /* search_header_map() and hmap_hash() were written referring to */ /* c-incpath.c of Apple-GCC-4.0.1. */ static char * search_header_map( const char * hmap_file, /* Header map file */ const char * filename, /* Filename to search */ char * pathlist /* Buffer for a found pathlist */ ) /* * Search a table in "header map" file for a header. */ { struct stat stat_buf; FILE * fp; size_t fsize; const char * contents; struct hmap_header_map * hmap; struct hmap_bucket * buckets; const char * strings; uint32 mask; uint32 key_offs; uint32 i; stat( hmap_file, &stat_buf); /* Get size of the file */ fsize = stat_buf.st_size; contents = xmalloc( fsize + 1); fp = fopen( hmap_file, "r"); fread( contents, fsize, 1, fp); /* Read whole of the file at once */ hmap = (struct hmap_header_map *) contents; strings = ((const char *) hmap) + hmap->strings_offset; buckets = hmap->buckets; mask = hmap->capacity - 1; i = hmap_hash( filename) & mask; while ((key_offs = buckets[ i].key) != 0) { if (str_case_eq( filename, strings + key_offs)) { /* The names match. Make path-list. */ char * cp = stpcpy( pathlist, strings + buckets[ i].value.prefix); strcpy( cp, strings + buckets[ i].value.suffix); break; } i = ++i & mask; } free( contents); return key_offs ? pathlist : NULL; } static unsigned hmap_hash( const char * fname /* header name */ ) /* * Get hash value for the fname. */ { const char * sp; unsigned hash_code = 0; for (sp = fname; *sp; sp++) hash_code += tolower( *sp & 0xFF) * 13; return hash_code; } #endif /* COMPILER == GNUC */ static void init_framework( void) /* * Initialize framework[]. */ { char * framework_dir; /* Some frameworks may have been already specified by -F option. */ sys_framework = num_framework; /* These are system frameworks */ #ifdef FRAMEWORK1 framework_dir = norm_dir( FRAMEWORK1, TRUE); if (framework_dir) framework[ num_framework++] = framework_dir; #endif #ifdef FRAMEWORK2 framework_dir = norm_dir( FRAMEWORK2, TRUE); if (framework_dir) framework[ num_framework++] = framework_dir; #endif #ifdef FRAMEWORK3 framework_dir = norm_dir( FRAMEWORK3, TRUE); if (framework_dir) framework[ num_framework++] = framework_dir; #endif if (num_framework >= MAX_FRAMEWORK) { mcpp_fputs( "Too many Framework directories.", ERR); longjmp( error_exit, -1); } } static const char * dot_frame = ".framework"; static int search_framework( char * filename ) /* * Search "Framework" directories. * 'frame/header.h' is converted to * '/System/Library/Frameworks/frame.framework/Headers/header.h', * '/System/Library/Frameworks/frame.framework/PrivateHeaders/header.h', * and so on. */ { char fullname[ PATHMAX + 1]; FILEINFO * file; char * frame, * fname, * cp1, * cp2; int sys_frame = FALSE; int i; cp1 = cp2 = strchr( filename, PATH_DELIM); /* * 'filename' should be format or sometimes * . * e.g.: , * or . */ if (! cp1) return FALSE; *cp1 = EOS; frame = filename; fname = cp1 + 1; /* Search framework[] directories */ for (i = 0; i < num_framework; i++) { cp1 = stpcpy( fullname, framework[ i]); /* 'fullname' e.g.: /System/Library/Frameworks/ */ if (search_subdir( fullname, cp1, frame, fname, sys_framework <= i)) return TRUE; } /* * Search subframework dirs searching its possible parent framework * starting from current file's directory to its ancestors. * Header file in subframework directories should be included only * by its parent or sibling framework headers. */ for (i = sys_framework; i < num_framework; i++) { size_t frame_len, fname_len; frame_len = strlen( framework[ i]); fname_len = strlen( infile->real_fname); if (fname_len <= frame_len) continue; if (memcmp( framework[ i], infile->real_fname, frame_len) == 0) { sys_frame = TRUE; break; } } for (file = infile; file; file = file->parent) { const char * dot; size_t len; if (! file->fp) continue; dot = strstr( file->real_fname, dot_frame); if (! dot) continue; len = dot - file->real_fname + strlen( dot_frame) + 1; memcpy( fullname, file->real_fname, len); cp1 = fullname + len; cp1 = stpcpy( cp1, "Frameworks/"); /* 'fullname' e.g.: */ /* /System/Library/Frameworks/Foundation.framework/Frameworks/ */ if (search_subdir( fullname, cp1, frame, fname, sys_frame)) return TRUE; } *cp2 = PATH_DELIM; /* Restore original include file format */ return FALSE; } static int search_subdir( char * fullname, /* Buffer for path-list to open */ char * cp, /* Latter half of 'fullname' */ char * frame, /* 'frame' of */ char * fname, /* 'header' of */ /* or sometimes 'dir/header' of */ int sys_frame /* System framework header ? */ ) /* * Make path-list and try to open. */ { static const char * subdir[] = { "Headers", "PrivateHeaders", NULL}; int j, n; cp += sprintf( cp, "%s%s%c", frame, dot_frame, PATH_DELIM); for (j = 0; subdir[ j] != NULL; j++) { n = sprintf( cp, "%s%c%s", subdir[ j], PATH_DELIM, fname); /* * 'fullname' is for example: * /System/Library/Frameworks/Foundation.framework/Headers/ * Foundation.h, * /System/Library/Frameworks/Foundation.framework/Frameworks/ * CarbonCore.framework/Headers/OSUtils.h, * or /System/Library/Frameworks/IOKit.framework/Headers/ * pwr_mgt/IOPMLib.h. * Pass this as one filename argument to open_file() rather than * deviding to directory part and file part. The first argument to * open_file() which is a pointer to the directory part is remembered * by FILEINFO struct. But, 'fullname' is over-written each time, * and the former path-list is lost soon. Therefore, it cannot be * passed as the first argument. In addition, though the first * argument to open_file() is needed for #include_next, this directive * has no meaning in framework. */ if ((cp - fullname) + n > PATHMAX) cfatal( "Too long framework path", NULL, 0L, NULL); /* _F_ */ if (open_file( &null, NULL, fullname, FALSE, FALSE, sys_frame)) return TRUE; } return FALSE; } #endif /* SYSTEM == SYS_MAC */ #if 0 /* This part is only for debugging */ static int chk_dirp( const char ** dirp ) /* * Check the validity of include directory specified for open_file(). * Called only from open_file(). */ { const char ** ip; if (dirp == &null) return TRUE; for (ip = incdir; ip < incend; ip++) if (dirp == ip) break; if (ip == incend) { #if COMPILER == MSC FILEINFO * pfile = infile->parent; if (pfile) { while ((pfile = pfile->parent) != NULL) { /* Search each parent includer's directory */ if (dirp == pfile->dirp) break; } } if (! pfile) #endif #if COMPILER == GNUC const char ** qdir; for (qdir = quote_dir; qdir < quote_dir_end; qdir++) { if (dirp == qdir) break; } if (qdir == quote_dir_end) #endif { cfatal( "Bug: *dirp:%s is invalid", *dirp, 0L, NULL); return FALSE; } } return TRUE; } #endif void sharp( FILEINFO * sharp_file, int flag /* Flag to append to the line for GCC */ ) /* * Output a line number line. * 'file' is 'sharp_file' if specified, * else (i.e. 'sharp_file' is NULL) 'infile'. */ { static FILEINFO * sh_file; static int sh_line; FILEINFO * file; int line; file = sharp_file ? sharp_file : infile; if (! file) return; while (! file->fp) file = file->parent; line = sharp_file ? sharp_file->line : src_line; if (no_output || option_flags.p || file == NULL || (file == sh_file && line == sh_line)) goto sharp_exit; sh_file = file; sh_line = line; if (keep_comments) mcpp_fputc( '\n', OUT); /* Ensure to be on line top */ if (std_line_prefix) mcpp_fprintf( OUT, "#line %ld", line); else mcpp_fprintf( OUT, "%s%ld", LINE_PREFIX, line); cur_file( file, sharp_file, flag); mcpp_fputc( '\n', OUT); sharp_exit: wrong_line = FALSE; } static void cur_file( FILEINFO * file, /* infile or sharp_file */ FILEINFO * sharp_file, /* The 'file' or NULL */ int flag /* Flag to append for GCC */ ) /* * Output current source file name and line number. * Called only from sharp() above. */ { const char * name; if (mcpp_debug & MACRO_CALL) { /* In macro notification mode */ if (sharp_file) /* Main input file */ name = file->filename; else /* Output full-path-list, normalized */ name = cur_fullname; } else { /* Usually, the path not "normalized" */ if (sharp_file) { /* Main input file */ name = file->filename; } else if (str_eq( file->filename, file->real_fname)) { sprintf( work_buf, "%s%s", *(file->dirp), cur_fname); name = work_buf; } else { /* Changed by '#line fname' directive */ name = file->filename; } } if (sharp_filename == NULL || ! str_eq( name, sharp_filename)) { if (sharp_filename != NULL) free( sharp_filename); sharp_filename = save_string( name); } mcpp_fprintf( OUT, " \"%s\"", name); #if COMPILER == GNUC if (! std_line_prefix) { if (flag) { mcpp_fputc( ' ', OUT); mcpp_fputc( '0' + flag, OUT); } if (file->sys_header) mcpp_fputs( " 3", OUT); } #endif } #if SYS_FAMILY == SYS_WIN static char * bsl2sl( char * filename ) /* * Convert '\\' in the path-list to '/'. */ { static int diagnosed = FALSE; char * cp; cp = filename; while (*cp) { if (bsl_in_mbchar) { int c; c = *cp & UCHARMAX; if (char_type[ c] & mbchk) { /* First byte of MBCHAR */ char tmp[ PATHMAX]; char * tp = tmp; *tp++ = *cp++; mb_read( c, &cp, &tp); /* Read over the multi-byte characters */ continue; } } if (*cp == '\\') { *cp++ = PATH_DELIM; if (!diagnosed && (warn_level & 2) && (warn_level != -1)) { /* Backslash in source program */ cwarn( "Converted \\ to %s", "/", 0L, NULL); /* _W2_ */ diagnosed = TRUE; /* Diagnose only once */ } } else { cp++; } } return filename; } #endif /* SYS_FAMILY == SYS_WIN */ static const char * const unknown_arg = "Unknown argument \"%s\""; /*_W1_*/ static const char * const not_ident = "Not an identifier \"%s\""; /*_W1_*/ static int is_junk( void) /* * Check the trailing junk in a directive line. * This routine is never called in OLD_PREP mode. */ { int c; c = skip_ws(); unget_ch(); if (c != '\n') { /* Trailing junk */ if (warn_level & 1) cwarn( unknown_arg, infile->bptr, 0L, NULL); return TRUE; } else { return FALSE; } } #define PUSH 1 #define POP -1 #define __SETLOCALE 1 /* #pragma __setlocale( "encoding") */ #define SETLOCALE 2 /* #pragma setlocale( "encoding") */ void do_pragma( void) /* * Process the #pragma lines. * 1. Process the sub-directive for MCPP. * 2. Pass the line to the compiler-proper. * #pragma MCPP put_defines, #pragma MCPP preprocess, * #pragma MCPP preprocessed and #pragma once are, however, not put * out so as not to duplicate output when re-preprocessed. * When EXPAND_PRAGMA == TRUE and (__STDC_VERSION__ >= 199901L or * __cplusplus >= 199901L), the line is subject to macro expansion unless * the next to 'pragma' token is one of 'STDC', 'GCC' or 'MCPP'. */ { int c; int warn = FALSE; /* Necessity of warning */ int token_type; char * bp; /* Pointer to argument */ char * tp; FILEINFO * file; wrong_line = TRUE; /* In case of error */ c = skip_ws(); bp = infile->bptr - 1; /* Remember token to pass to compiler */ if (c == '\n') { if (warn_level & 1) cwarn( "No sub-directive", NULL, 0L, NULL); /* _W1_ */ unget_ch(); return; } token_type = scan_token( c, (tp = work_buf, &tp), work_end); #if EXPAND_PRAGMA #if COMPILER == MSC if (token_type == NAM && !str_eq( identifier, "STDC") && !str_eq( identifier, "MCPP")) { #else if (stdc3 && token_type == NAM && !str_eq( identifier, "STDC") && !str_eq( identifier, "MCPP")) { #endif DEFBUF * defp; char * mp; char * mp_end; LINE_COL line_col = { 0L, 0}; bp = mp = xmalloc( (size_t)(NMACWORK + IDMAX)); /* Buffer for macro expansion */ mp_end = mp + NMACWORK; tp = stpcpy( mp, identifier); do { /* Expand all the macros in the line */ int has_pragma; if (token_type == NAM && (defp = is_macro( &tp)) != NULL) { tp = expand_macro( defp, bp, mp_end, line_col, & has_pragma); if (has_pragma) cerror( "_Pragma operator found in #pragma line" /* _E_ */ , NULL, 0L, NULL); if (! stdc3 && (warn_level & 2)) cwarn( "\"%s\" is macro expanded in other than C99 mode" /* _W2_ */ , identifier, 0L, NULL); } token_type = scan_token( c = get_ch(), (bp = tp, &tp), mp_end); } while (c != '\n'); unget_string( mp, NULL); /* To re-read */ free( mp); c = skip_ws(); bp = infile->bptr - 1; token_type = scan_token( c, (tp = work_buf, &tp), work_end); } #endif if (token_type != NAM) { if (warn_level & 1) cwarn( not_ident, work_buf, 0L, NULL); goto skip_nl; } else if (str_eq( identifier, "once")) { /* #pragma once */ if (! is_junk()) { file = infile; while (file->fp == NULL) file = file->parent; do_once( file->full_fname); goto skip_nl; } } else if (str_eq( identifier, "MCPP")) { if (scan_token( skip_ws(), (tp = work_buf, &tp), work_end) != NAM) { if (warn_level & 1) cwarn( not_ident, work_buf, 0L, NULL); } if (str_eq( identifier, "put_defines")) { if (! is_junk()) dump_def( TRUE, FALSE); /* #pragma MCPP put_defines */ } else if (str_eq( identifier, "preprocess")) { if (! is_junk()) /* #pragma MCPP preprocess */ mcpp_fputs( "#pragma MCPP preprocessed\n", OUT); /* Just putout the directive */ } else if (str_eq( identifier, "preprocessed")) { if (! is_junk()) { /* #pragma MCPP preprocessed*/ skip_nl(); do_preprocessed(); return; } } else if (str_eq( identifier, "warning")) { /* #pragma MCPP warning */ cwarn( infile->buffer, NULL, 0L, NULL); } else if (str_eq( identifier, "push_macro")) { push_or_pop( PUSH); /* #pragma MCPP push_macro */ } else if (str_eq( identifier, "pop_macro")) { push_or_pop( POP); /* #pragma MCPP pop_macro */ } else if (str_eq( identifier, "debug")) { do_debug( TRUE); /* #pragma MCPP debug */ } else if (str_eq( identifier, "end_debug")) { do_debug( FALSE); /* #pragma MCPP end_debug */ } else { warn = TRUE; } if (warn && (warn_level & 1)) cwarn( unknown_arg, identifier, 0L, NULL); goto skip_nl; /* Do not putout the line */ #if COMPILER == GNUC /* The #pragma lines for GCC is skipped not to confuse cc1. */ } else if (str_eq( identifier, "GCC")) { /* #pragma GCC * */ if (scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == NAM) { if (str_eq( identifier, "poison") || str_eq( identifier, "dependency")) { if (warn_level & 2) cwarn( "Skipped the #pragma line" /*_W2_ */ , NULL, 0L, NULL); goto skip_nl; } else if (str_eq( identifier, "system_header")) { infile->sys_header = TRUE; /* Mark as a system header */ goto skip_nl; } } #endif #if COMPILER == MSC } else if (str_eq( identifier, "setlocale")) { if (skip_ws() == '(' && scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == STR && skip_ws() == ')') { if (! is_junk()) { work_buf[ 0] = *(tp - 1) = '\0'; set_encoding( work_buf + 1, NULL, SETLOCALE); work_buf[ 0] = *(tp - 1) = '"'; } /* else warned by is_junk() */ } else { warn = TRUE; } #else /* COMPILER != MSC */ } else if (str_eq( identifier, "__setlocale")) { if (skip_ws() == '(' && scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == STR && skip_ws() == ')') { if (! is_junk()) { /* #pragma __setlocale */ work_buf[ 0] = *(tp - 1) = '\0'; set_encoding( work_buf + 1, NULL, __SETLOCALE); work_buf[ 0] = *(tp - 1) = '"'; } /* else warned by is_junk() */ } else { warn = TRUE; } #endif #if COMPILER == MSC } else if (str_eq( identifier, "push_macro")) { push_or_pop( PUSH); goto skip_nl; } else if (str_eq( identifier, "pop_macro")) { push_or_pop( POP); goto skip_nl; #endif #if COMPILER == LCC } else if (str_eq( identifier, "optimize") && (skip_ws() == '(') && (char_type[ (c = skip_ws()) & UCHARMAX] == DIG) && (skip_ws() == ')')) { char tmp[ 2]; tmp[ 0] = c; tmp[ 1] = EOS; look_and_install( optim_name, DEF_NOARGS_PREDEF, null, tmp); #endif #if COMPILER == COMPILER_UNKNOWN /* * Write here any compiler-specific #pragma sub-directive which should * be processed by preprocessor. */ #endif } if (warn) { if (warn_level & 1) cwarn( unknown_arg, identifier, 0L, NULL); goto skip_nl; /* Do not putout the line */ } sharp( NULL, 0); /* Synchronize line number before output */ if (! no_output) { mcpp_fputs( "#pragma ", OUT); mcpp_fputs( bp, OUT); /* Line is put out */ } skip_nl: /* Don't use skip_nl() which skips to the newline in source file */ while (get_ch() != '\n') ; } static void do_once( const char * fullname /* Full-path-list of the header */ ) /* * Process #pragma once so as not to re-include the file later. * This directive has been imported from GCC V.1.* / cpp as an extension. */ { if (once_list == NULL) { /* Should initialize */ max_once = INIT_NUM_ONCE; once_list = (INC_LIST *) xmalloc( sizeof (INC_LIST) * max_once); once_end = &once_list[ 0]; } else if (once_end - once_list >= max_once) { /* Double the elements */ once_list = (INC_LIST *) xrealloc( (void *) once_list , sizeof (INC_LIST) * max_once * 2); once_end = &once_list[ max_once]; max_once *= 2; } once_end->name = fullname; once_end->len = strlen( fullname); once_end++; } static int included( const char * fullname ) /* * Has the file been once included ? * This routine is only called from open_file(). */ { INC_LIST * inc; size_t fnamelen; if (once_list == NULL) /* No once file registered */ return FALSE; fnamelen = strlen( fullname); for (inc = once_list; inc < once_end; inc++) { if (inc->len == fnamelen && str_case_eq( inc->name, fullname)) { /* Already included */ if (mcpp_debug & PATH) mcpp_fprintf( DBG, "Once included \"%s\"\n", fullname); return TRUE; } } return FALSE; /* Not yet included */ } static void push_or_pop( int direction ) /* Process #pragma MCPP push_macro( "MACRO"), * #pragma MCPP pop_macro( "MACRO") for other compilers than Visual C, * and #pragma push_macro( "MACRO"), #pragma pop_macro( "MACRO") for Visual C. * Note:1. "push" count is set in defp->push. * 2. pushed definitions are inserted immediatly after the current * definition of the same name. * 3. the definitions of a same name macro can be pushed multiple times. */ { char * tp; DEFBUF ** prevp; DEFBUF * defp; DEFBUF * dp; int cmp; size_t s_name, s_def; if (skip_ws() == '(' && scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == STR && skip_ws() == ')') { /* Correct syntax */ if (is_junk()) return; s_name = strlen( work_buf) - 2; *(work_buf + s_name + 1) = '\0'; memcpy( identifier, work_buf + 1, s_name + 1); /* Remove enclosing '"' */ prevp = look_prev( identifier, &cmp); if (cmp == 0) { /* Current definition or pushed definition exists */ defp = *prevp; if (direction == PUSH) {/* #pragma push_macro( "MACRO") */ if (defp->push) { /* No current definition*/ if (warn_level & 1) cwarn( "\"%s\" is already pushed" /* _W1_ */ , identifier, 0L, NULL); return; } /* Else the current definition exists. Push it */ s_def = sizeof (DEFBUF) + 3 + s_name + strlen( defp->repl) + strlen( defp->fname); if (mcpp_mode == STD) s_def += strlen( defp->parmnames); dp = (DEFBUF *) xmalloc( s_def); memcpy( dp, defp, s_def); /* Copy the definition */ dp->link = *prevp; /* Insert to linked-list*/ *prevp = dp; /* the pushed def */ prevp = &dp->link; /* Next link to search */ } else { /* #pragma pop_macro( "MACRO") */ if (defp->push == 0) { /* Current definition */ if (defp->link == NULL || ! str_eq( identifier, defp->link->name)) { if (warn_level & 1) cwarn( "\"%s\" has not been pushed" /* _W1_ */ , identifier, 0L, NULL); return; } else { *prevp = defp->link; /* Link the previous and the next */ free( defp); /* Delete the definition to enable popped def */ } } /* Else no current definition exists */ } while ((defp = *prevp) != NULL) { /* Increment or decrement "push" count of all pushed defs */ if ((cmp = memcmp( defp->name, identifier, s_name)) > 0) break; defp->push += direction; /* Increment or decrement */ prevp = &defp->link; } } else { /* No current definition nor pushed definition */ if (warn_level & 1) cwarn( "\"%s\" has not been defined" /* _W1_ */ , identifier, 0L, NULL); } } else { /* Wrong syntax */ if (warn_level & 1) cwarn( "Bad %s syntax", direction == PUSH /* _W1_ */ ? "push_macro" : "pop_macro", 0L, NULL); } } static void do_asm( int asm_start /* #asm ? */ ) /* * #asm, #endasm * Originally written for OS-9/09 Microware C. */ { if (! compiling) return; if (asm_start == (in_asm != 0L)) { if (in_asm) cerror( "In #asm block started at line %.0s%ld" /* _E_ */ , NULL, in_asm, NULL); else cerror( "Without #asm", NULL, 0L, NULL); /* _E_ */ skip_nl(); unget_ch(); return; } in_asm = asm_start ? src_line : 0L; } void do_old( void) /* * Process the out-of-standard directives. * GCC permits #include_next and #warning even in STANDARD mode. */ { static const char * const unknown = "Unknown #directive \"%s\"%.0ld%s"; /* _E_ _W8_ */ static const char * const ext = "%s is not allowed by Standard%.0ld%s"; /* _W2_ _W8_*/ #if COMPILER == GNUC if (str_eq( identifier, "include_next")) { if ((compiling && (warn_level & 2)) || (! compiling && (warn_level & 8))) cwarn( ext, "#include_next", 0L , compiling ? NULL : " (in skipped block)"); if (! compiling) return; in_include = TRUE; do_include( TRUE); in_include = FALSE; return; } else if (str_eq( identifier, "warning")) { if ((compiling && (warn_level & 2)) || (! compiling && (warn_level & 8))) cwarn( ext, "#warning", 0L , compiling ? NULL : " (in skipped block)"); if (! compiling) return; cwarn( infile->buffer, NULL, 0L, NULL); /* Always output the warning */ skip_nl(); unget_ch(); return; } else if (str_eq( identifier, "ident") || str_eq( identifier, "sccs")) { if ((compiling && (warn_level & 1)) || (! compiling && (warn_level & 8))) { if (str_eq( identifier, "ident")) cwarn( compiling ? "Ignored #ident" : "#ident (in skipped block)" /* _W1_ _W8_*/ , NULL, 0L, NULL); else cwarn( compiling ? "Ignored #sccs" : "#sccs (in skipped block)" /* _W1_ _W8_*/ , NULL, 0L, NULL); } if (! compiling) return; skip_nl(); unget_ch(); return; } #endif /* COMPILER == GNUC */ #if COMPILER == MSC if (str_eq( identifier, "using") || str_eq( identifier, "import")) { /* #using or #import */ if (! compiling) return; mcpp_fputs( infile->buffer, OUT); /* Putout the line as is*/ skip_nl(); unget_ch(); return; } #endif #if SYSTEM == SYS_MAC if (str_eq( identifier, "import")) { if ((compiling && (warn_level & 2)) || (! compiling && (warn_level & 8))) cwarn( ext, "#import", 0L , compiling ? NULL : " (in skipped block)"); if (! compiling) return; in_import = in_include = TRUE; do_include( FALSE); in_import = in_include = FALSE; return; } #endif if (! standard && do_prestd_directive()) return; if (compiling) { if (option_flags.lang_asm) { /* "Assembler" source */ if (warn_level & 1) cwarn( unknown, identifier, 0L, NULL); mcpp_fputs( infile->buffer, OUT); /* Putout the line */ } else { cerror( unknown, identifier, 0L, NULL); } } else if (warn_level & 8) { cwarn( unknown, identifier, 0L, " (in skipped block)"); } skip_nl(); unget_ch(); return; } static int do_prestd_directive( void) /* * Process directives for pre-Standard mode. */ { #if COMPILER != GNUC if (str_eq( identifier, "assert")) { /* #assert */ if (! compiling) /* Only validity check */ return TRUE; if (eval_if() == 0L) { /* Assert expression */ cerror( "Preprocessing assertion failed" /* _E_ */ , NULL, 0L, NULL); skip_nl(); unget_ch(); } return TRUE; } else #endif if (str_eq( identifier, "put_defines")) { if (! compiling) /* Only validity check */ return TRUE; if (mcpp_mode != OLD_PREP && ! is_junk()) dump_def( TRUE, FALSE); /* #put_defines */ skip_nl(); unget_ch(); return TRUE; } else if (str_eq( identifier, "preprocess")) { if (! compiling) /* Only validity check */ return TRUE; if (mcpp_mode != OLD_PREP && ! is_junk()) /* Just putout the directive for the succeding preprocessor */ mcpp_fputs( "#preprocessed\n", OUT); skip_nl(); unget_ch(); return TRUE; } else if (str_eq( identifier, "preprocessed")) { if (! compiling) /* Only validity check */ return TRUE; if (mcpp_mode != OLD_PREP && ! is_junk()) { skip_nl(); do_preprocessed(); /* #preprocessed */ return TRUE; } skip_nl(); unget_ch(); return TRUE; } if (str_eq( identifier, "debug")) { /* #debug */ if (! compiling) /* Only validity check */ return TRUE; do_debug( TRUE); return TRUE; } else if (str_eq( identifier, "end_debug")) { if (! compiling) return TRUE; do_debug( FALSE); /* #end_debug */ return TRUE; } if (str_eq( identifier, "asm")) { /* #asm */ do_asm( TRUE); return TRUE; } if (str_eq( identifier, "endasm")) { /* #endasm */ do_asm( FALSE); skip_nl(); /* Skip comments, etc. */ unget_ch(); return TRUE; } return FALSE; /* Unknown directive */ } static void do_preprocessed( void) /* * The source file has been already preprocessed. * Copy the lines to output. * Install macros according the #define directives. */ { const char * corrupted = "This preprocessed file is corrupted"; /* _F_ */ FILEINFO * file; char * lbuf; char * cp; const char ** incptr; char * comment = NULL; char * colon = NULL; const char * dir; #if STD_LINE_PREFIX == FALSE char conv[ NBUFF]; char * arg; /* * Compiler cannot accept C source style #line. * Convert it to the compiler-specific format. */ strcpy( conv, LINE_PREFIX); arg = conv + strlen( conv); #endif file = infile; lbuf = file->bptr = file->buffer; /* Reset file->bptr */ /* Copy the input to output until a comment line appears. */ while (fgets( lbuf, NBUFF, file->fp) != NULL && memcmp( lbuf, "/*", 2) != 0) { #if STD_LINE_PREFIX == FALSE if (memcmp( lbuf, "#line ", 6) == 0) { strcpy( arg, lbuf + 6); mcpp_fputs( conv, OUT); } else #endif { mcpp_fputs( lbuf, OUT); } } if (! str_eq( lbuf, "/* Currently defined macros. */\n")) cfatal( "This is not a preprocessed source" /* _F_ */ , NULL, 0L, NULL); /* Define macros according to the #define lines. */ while (fgets( lbuf, NWORK, file->fp) != NULL) { if (memcmp( lbuf, "/*", 2) == 0) { /* Standard predefined macro */ continue; } if (memcmp( lbuf, "#define ", 8) != 0) { if (memcmp( lbuf, "#line", 5) == 0) continue; else cfatal( corrupted, NULL, 0L, NULL); } /* Filename and line-number information in comment as: */ /* dir/fname:1234\t*/ cp = lbuf + strlen( lbuf); if ((memcmp( cp - 4, "\t*/\n", 4) != 0) || (*(cp - 4) = EOS , (comment = strrchr( lbuf, '*')) == NULL) || (memcmp( --comment, "/* ", 3) != 0) || ((colon = strrchr( comment, ':')) == NULL)) cfatal( corrupted, NULL, 0L, NULL); src_line = atol( colon + 1); /* Pseudo line number */ *colon = EOS; dir = comment + 3; inc_dirp = &null; /* Search the include directory list */ for (incptr = incdir ; incptr < incend; incptr++) { if (memcmp( *incptr, dir, strlen( *incptr)) == 0) { inc_dirp = incptr; break; } } /* Register the filename to fnamelist[] */ /* inc_dirp may be NULL, and cur_fname may be "(predefined)" */ cur_fname = set_fname( dir + strlen( *inc_dirp)); strcpy( comment - 2, "\n"); /* Remove the comment */ unget_string( lbuf + 8, NULL); do_define( FALSE, 0); get_ch(); /* '\n' */ get_ch(); /* Clear the "file" */ unget_ch(); /* infile == file */ } file->bptr = file->buffer + strlen( file->buffer); } static int do_debug( int set /* TRUE to set debugging */ ) /* * #pragma MCPP debug, #pragma MCPP end_debug, #debug, #end_debug * Return TRUE when diagnostic is issued else return FALSE. */ { struct Debug_arg { const char * arg_name; /* Name of option */ int arg_num; /* Value of 'debug' */ }; static struct Debug_arg debug_args[] = { { "path", PATH }, { "token", TOKEN }, { "expand", EXPAND }, { "macro_call", MACRO_CALL }, /* Implemented only in STD mode */ { "if", IF }, { "expression", EXPRESSION }, { "getc", GETC }, { "memory", MEMORY }, { NULL, 0 }, }; struct Debug_arg *argp; int num; int c; c = skip_ws(); if (c == '\n') { unget_ch(); if (set) { if (warn_level & 1) cwarn( "No argument", NULL, 0L, NULL); /* _W1_ */ return TRUE; } else { mcpp_debug = 0; /* Clear all the flags */ return FALSE; } } while (scan_token( c, (workp = work_buf, &workp), work_end) == NAM) { argp = debug_args; while (argp->arg_name) { if (str_eq( argp->arg_name, work_buf)) break; argp++; } if (argp->arg_name == NULL) { if (warn_level & 1) cwarn( unknown_arg, work_buf, 0L, NULL); goto diagnosed; } else { num = argp->arg_num; if (set) { mcpp_debug |= num; if (num == PATH) dump_path(); else if (num == MEMORY) print_heap(); else if (num == MACRO_CALL) option_flags.k = TRUE; /* This pragma needs this mode */ } else { mcpp_debug &= ~num; } } c = skip_ws(); } if ((mcpp_mode != STD && (mcpp_debug & MACRO_CALL)) || c != '\n') { if (warn_level & 1) { if (c != '\n') { cwarn( not_ident, work_buf, 0L, NULL); } else { cwarn( unknown_arg, work_buf, 0L, NULL); mcpp_debug &= ~num; /* Disable */ } } skip_nl(); unget_ch(); goto diagnosed; } unget_ch(); return FALSE; diagnosed: return TRUE; } void put_asm( void) /* * Put out source line as it is. */ { #if 0 mcpp_fputs( "#2\n", OUT); mcpp_fputs( infile->buffer, OUT); skip_nl(); #endif } static void dump_path( void) /* * Show the include directories. */ { const char ** incptr; const char * inc_dir; const char * dir = "./"; int i; mcpp_fputs( "Include paths are as follows --\n", DBG); for (incptr = incdir; incptr < incend; incptr++) { inc_dir = *incptr; if (*inc_dir == '\0') inc_dir = dir; mcpp_fprintf( DBG, " %s\n", inc_dir); } mcpp_fputs( "End of include path list.\n", DBG); #if SYSTEM == SYS_MAC mcpp_fputs( "Framework paths are as follows --\n", DBG); for (i = 0; i < num_framework; i++ ) mcpp_fprintf( DBG, " %s\n", framework[ i]); mcpp_fputs( "End of framework path list.\n", DBG); #endif } /* * Note: The getopt() of glibc should not be used since the specification * differs from the standard one. * Use this mcpp_getopt() for mcpp. */ /* Based on the public-domain-software released by AT&T in 1985. */ #define OPTERR( s, c) if (mcpp_opterr) { \ mcpp_fputs( argv[0], ERR); \ mcpp_fputs( s, ERR); \ mcpp_fputc( c, ERR); \ mcpp_fputc( '\n', ERR); \ } static int mcpp_getopt( int argc, char * const * argv, const char * opts ) /* * Get the next option (and it's argument) from the command line. */ { const char * const error1 = ": option requires an argument --"; const char * const error2 = ": illegal option --"; static int sp = 1; int c; const char * cp; if (sp == 1) { if (argc <= mcpp_optind || argv[ mcpp_optind][ 0] != '-' || argv[ mcpp_optind][ 1] == '\0') { return EOF; } else if (strcmp( argv[ mcpp_optind], "--") == 0) { mcpp_optind++; return EOF; } } /* mcpp_optopt = c = (unsigned char) argv[ mcpp_optind][ sp]; */ mcpp_optopt = c = argv[ mcpp_optind][ sp] & UCHARMAX; if (c == ':' || (cp = strchr( opts, c)) == NULL) { OPTERR( error2, c) if (argv[ mcpp_optind][ ++sp] == '\0') { mcpp_optind++; sp = 1; } return '?'; } if (*++cp == ':') { if (argv[ mcpp_optind][ sp+1] != '\0') { mcpp_optarg = &argv[ mcpp_optind++][ sp+1]; } else if (argc <= ++mcpp_optind) { OPTERR( error1, c) sp = 1; return '?'; } else { mcpp_optarg = argv[ mcpp_optind++]; } sp = 1; } else { if (argv[ mcpp_optind][ ++sp] == '\0') { sp = 1; mcpp_optind++; } mcpp_optarg = NULL; } return c; } #if ! HOST_HAVE_STPCPY char * stpcpy( char * dest, const char * src ) /* * Copy the string and return the advanced pointer. */ { const char * s; char * d; for (s = src, d = dest; (*d++ = *s++) != '\0'; ) ; return d - 1; } #endif /* * list_heap() is a function to print out information of heap-memory. * See "kmmalloc-2.5.3.zip" by kmatsui. */ #if KMMALLOC int list_heap( int); #elif BSD_MALLOC int list_heap( char *); #elif DB_MALLOC || DMALLOC int list_heap( FILE *); #endif void print_heap( void) { #if KMMALLOC list_heap( 1); #elif BSD_MALLOC list_heap( ":cpp"); #elif DB_MALLOC || DMALLOC || PHK_MALLOC || DLMALLOC list_heap( fp_debug); #endif } void at_end( void) /* * Handle the commands to be executed at the end of processing. */ { #if COMPILER == GNUC if (dMflag || dDflag) dump_def( FALSE, FALSE); #endif } #if MCPP_LIB void clear_filelist( void) /* * Free malloced memory for filename-list and directory-list. */ { const char ** incp; INC_LIST * namep; for (incp = incdir; incp < incend; incp++) free( (void *) *incp); free( (void *) incdir); for (namep = fnamelist; namep < fname_end; namep++) free( (void *) namep->name); free( (void *) fnamelist); if (standard) free( (void *) once_list); } #endif mcpp-2.7.2/src/mcpp_out.h0000644000175000017500000000055410777326423012207 00000000000000/* mcpp_out.h: declarations of OUTDEST data types for MCPP */ #ifndef _MCPP_OUT_H #define _MCPP_OUT_H /* Choices for output destination */ typedef enum { OUT, /* ~= fp_out */ ERR, /* ~= fp_err */ DBG, /* ~= fp_debug */ NUM_OUTDEST } OUTDEST; #endif /* _MCPP_OUT_H */ mcpp-2.7.2/noconfig/0000777000175000017500000000000011112521500011254 500000000000000mcpp-2.7.2/noconfig/mac_gcc401_i686.dif0000644000175000017500000000741511067064516014262 00000000000000*** noconfig.H 2008-09-25 15:34:56.000000000 +0900 --- noconfig.H.mac_gcc401_i686 2008-09-26 13:46:17.000000000 +0900 *************** *** 15,21 **** */ /* Define target operating-system. */ ! #define SYSTEM SYS_FREEBSD /* Define target compiler. */ #ifndef COMPILER --- 15,21 ---- */ /* Define target operating-system. */ ! #define SYSTEM SYS_MAC /* Define target compiler. */ #ifndef COMPILER *************** *** 30,36 **** /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "GCC 3.4" #if 0 "LCC-Win32 2006-03" "Visual C 2005" --- 30,36 ---- /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "GCC 4.0" #if 0 "LCC-Win32 2006-03" "Visual C 2005" *************** *** 280,291 **** #if COMPILER_FAMILY == GNUC #define CMP_NAME "GCC" #define COMPILER_EXT "__GNUC__" ! #define COMPILER_EXT_VAL "3" /* "3" for V.3.* "4" for V.4.* */ #define COMPILER_EXT2 "__GNUC_MINOR__" ! #define COMPILER_EXT2_VAL "4" /* "4" for V.3.4, "1" for V.4.1 */ #define COMPILER_CPLUS "__GNUG__" ! #define COMPILER_CPLUS_VAL "3" /* "3" for V.3.*, "4" for V.4.* */ ! #define GCC_MAJOR_VERSION 3 /* Value of __GNUC__ as a digit */ #define LINE_PREFIX "# " #ifndef HAVE_DIGRAPHS #define HAVE_DIGRAPHS TRUE --- 280,291 ---- #if COMPILER_FAMILY == GNUC #define CMP_NAME "GCC" #define COMPILER_EXT "__GNUC__" ! #define COMPILER_EXT_VAL "4" /* "3" for V.3.* "4" for V.4.* */ #define COMPILER_EXT2 "__GNUC_MINOR__" ! #define COMPILER_EXT2_VAL "0" /* "4" for V.3.4, "1" for V.4.1 */ #define COMPILER_CPLUS "__GNUG__" ! #define COMPILER_CPLUS_VAL "4" /* "3" for V.3.*, "4" for V.4.* */ ! #define GCC_MAJOR_VERSION 4 /* Value of __GNUC__ as a digit */ #define LINE_PREFIX "# " #ifndef HAVE_DIGRAPHS #define HAVE_DIGRAPHS TRUE *************** *** 294,303 **** #define TARGET_HAVE_LONG_LONG TRUE #endif #define STDC_VERSION 0L /* 199409L for V.2.9, 0L for V.3.*,V.4.* */ ! #define CPLUS_INCLUDE_DIR1 "/usr/include/c++/3.4" /* "/usr/include/c++/3.3.6" */ /* "/usr/include/c++/4.1.2" */ ! #define CPLUS_INCLUDE_DIR2 "/usr/include/c++/3.4/backward" /* "/usr/include/c++/3.3.6/i386-vine-linux" */ /* "/usr/include/c++/4.1.2/i486-linux-gnu" */ ! /* #define CPLUS_INCLUDE_DIR3 */ /* "/usr/include/c++/3.3.6/backward" */ /* "/usr/include/c++/4.1.2/backward" */ ! /* #define C_INCLUDE_DIR1 */ /* "/usr/lib/gcc-lib/i386-vine-linux/3.3.6/include" */ /* "/usr/lib/gcc/i486-linux-gnu/4.1.2/include" */ /* #define C_INCLUDE_DIR2 */ #ifndef INC_DIR #ifdef C_INCLUDE_DIR1 --- 294,303 ---- #define TARGET_HAVE_LONG_LONG TRUE #endif #define STDC_VERSION 0L /* 199409L for V.2.9, 0L for V.3.*,V.4.* */ ! #define CPLUS_INCLUDE_DIR1 /* "/usr/include/c++/3.4" */ /* "/usr/include/c++/3.3.6" */ /* "/usr/include/c++/4.1.2" */ "/usr/include/c++/4.0.0" ! #define CPLUS_INCLUDE_DIR2 /* "/usr/include/c++/3.4/backward" */ /* "/usr/include/c++/3.3.6/i386-vine-linux" */ /* "/usr/include/c++/4.1.2/i486-linux-gnu" */ "/usr/include/c++/4.0.0/i686-apple-darwin9" ! #define CPLUS_INCLUDE_DIR3 /* "/usr/include/c++/3.3.6/backward" */ /* "/usr/include/c++/4.1.2/backward" */ "/usr/include/c++/4.0.0/backward" ! #define C_INCLUDE_DIR1 /* "/usr/lib/gcc-lib/i386-vine-linux/3.3.6/include" */ /* "/usr/lib/gcc/i486-linux-gnu/4.1.2/include" */ "/usr/lib/gcc/i686-apple-darwin9/4.0.1/include" /* #define C_INCLUDE_DIR2 */ #ifndef INC_DIR #ifdef C_INCLUDE_DIR1 mcpp-2.7.2/noconfig/linux.mak0000644000175000017500000001403411067077461013050 00000000000000# makefile to compile MCPP version 2.7.2 for Linux / GCC / GNU make # 2008/09 kmatsui # # First, you must edit GCCDIR, BINDIR, INCDIR, gcc_maj_ver and gcc_min_ver. # To make compiler-independent-build of MCPP: # make # sudo make install # To make GCC-specific-build of MCPP: # make COMPILER=GNUC # sudo make COMPILER=GNUC install # To re-compile MCPP using GCC-specific-build of MCPP do: # make COMPILER=GNUC PREPROCESSED=1 # sudo make COMPILER=GNUC PREPROCESSED=1 install # To link malloc() package of kmatsui do: # make [COMPILER=GNUC] [PREPROCESSED=1] MALLOC=KMMALLOC # sudo make [COMPILER=GNUC] [PREPROCESSED=1] MALLOC=KMMALLOC install # To make libmcpp (subroutine build of mcpp) and mcpp binary linking it: # make MCPP_LIB=1 mcpplib # sudo make MCPP_LIB=1 mcpplib_install # To make testmain using libmcpp: # make [OUT2MEM=1] testmain # sudo make [OUT2MEM=1] testmain_install # COMPILER: # Specify whether make a compiler-independent-build or GCC-specific-build # compiler-independent-build: empty # compiler-specific-build: GNUC # NAME: name of mcpp executable NAME = mcpp # CC: name of gcc executable # e.g. cc, gcc, gcc-2.95.3, i686-pc-linux-gnu-gcc-4.1.1 CC = gcc CXX = g++ CFLAGS = -c -O2 -Wall # -ggdb -v # for gcc 4.1 or later (Don't use this option to compile libmcpp) #CFLAGS += -fstack-protector CPPFLAGS = LINKFLAGS = -o $(NAME) # for gcc 4.1 or later (Don't use this option to compile libmcpp) #LINKFLAGS += -fstack-protector ifeq ($(COMPILER), ) # compiler-independent-build CPPOPTS = # BINDIR: directory to install mcpp: /usr/bin or /usr/local/bin BINDIR = /usr/local/bin # INCDIR: directory to install mcpp_lib.h, mcpp_out.h for mcpplib INCDIR = /usr/local/include else # compiler-specific-build: Adjust for your system ifeq ($(COMPILER), GNUC) # The directory where 'gcc' (cc) command is located GCCDIR = /usr/bin #GCCDIR = /usr/local/bin # set GCC version gcc_maj_ver = 3 gcc_min_ver = 3 # INCDIR: GCC's version specific include directory #INCDIR = /usr/lib/gcc-lib/i386-vine-linux/2.95.3/include #INCDIR = /usr/local/gcc-3.2/lib/gcc-lib/i686-pc-linux-gnu/3.2/include # Vine 4.2 INCDIR = /usr/lib/gcc-lib/i386-vine-linux/3.3.6/include #INCDIR = /usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/include # Debian 4.0 #INCDIR = /usr/lib/gcc/i486-linux-gnu/4.1.2/include CPPOPTS = -DCOMPILER=$(COMPILER) #BINDIR = /usr/lib/gcc-lib/i386-vine-linux/2.95.3 #BINDIR = /usr/local/gcc-3.2/lib/gcc-lib/i686-pc-linux-gnu/3.2 # Vine 4.2 BINDIR = /usr/lib/gcc-lib/i386-vine-linux/3.3.6 #BINDIR = /usr/local/libexec/gcc/i686-pc-linux-gnu/4.1.1 # Debian 4.0 #BINDIR = /usr/lib/gcc/i486-linux-gnu/4.1.2 cpu = i386 #cpu = ppc #cpu = x86_64 #cpu = ppc64 ifeq ($(gcc_maj_ver), 2) cpp_call = $(BINDIR)/cpp0 else cpp_call = $(BINDIR)/cc1 endif endif endif ifneq ($(MALLOC), ) ifeq ($(MALLOC), KMMALLOC) LINKFLAGS += -lkmmalloc_debug MEM_MACRO = -D_MEM_DEBUG -DXMALLOC endif MEM_MACRO += -D$(MALLOC) else MEM_MACRO = endif OBJS = main.o directive.o eval.o expand.o support.o system.o mbchar.o all : $(NAME) $(NAME): $(OBJS) $(CC) $(OBJS) $(LINKFLAGS) PREPROCESSED = 0 ifeq ($(PREPROCESSED), 1) CMACRO = -DPREPROCESSED #CPPFLAGS = -Wp,-v,-Q,-W3 # for MCPP to output a bit verbose diagnosis to "mcpp.err" # Make a "pre-preprocessed" header file to recompile MCPP with MCPP. mcpp.H : system.H noconfig.H internal.H ifeq ($(COMPILER), GNUC) $(CC) -E -Wp,-b $(CPPFLAGS) $(CPPOPTS) $(MEM_MACRO) -o mcpp.H preproc.c else @echo "Do 'sudo make COMPILER=GNUC install' prior to recompile." @echo "Then, do 'make COMPILER=GNUC PREPROCESSED=1'." @exit endif $(OBJS) : mcpp.H else CMACRO = $(MEM_MACRO) $(CPPOPTS) $(OBJS) : noconfig.H main.o directive.o eval.o expand.o support.o system.o mbchar.o: \ system.H internal.H endif .c.o : $(CC) $(CFLAGS) $(CMACRO) $(CPPFLAGS) $< install : install -s $(NAME) $(BINDIR)/$(NAME) ifeq ($(COMPILER), GNUC) @./set_mcpp.sh '$(GCCDIR)' '$(gcc_maj_ver)' '$(gcc_min_ver)' \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(CPPFLAGS)' 'x' 'ln -s' \ '$(INCDIR)' SYS_LINUX $(cpu) endif clean : -rm *.o *.so $(NAME) mcpp.H mcpp.err libmcpp.* uninstall: rm -f $(BINDIR)/$(NAME) ifeq ($(COMPILER), GNUC) @./unset_mcpp.sh '$(GCCDIR)' '$(gcc_maj_ver)' '$(gcc_min_ver)' \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x' 'ln -s' '$(INCDIR)' SYS_LINUX endif ifeq ($(COMPILER), ) # the directory to install libmcpp into LIBDIR = /usr/local/lib ifeq ($(MCPP_LIB), 1) # compiler-independent-build and MCPP_LIB=1 CFLAGS += -DMCPP_LIB mcpplib : mcpplib_a mcpplib_so mcpplib_a: $(OBJS) ar -rv libmcpp.a $(OBJS) # shared library # mcpp 2.6.*: 0, mcpp 2.7: 1, mcpp 2.7.1: 2, mcpp 2.7.2: 3 CUR = 3 # mcpp 2.6.3: 0, mcpp 2.6.4: 1, mcpp 2.7, 2.7.1, 2.7.2: 0 REV = 0 # mcpp 2.6.*: 0, mcpp 2.7: 1, mcpp 2.7.1: 2, mcpp 2.7.2: 3 AGE = 3 SHLIB_VER = 0.$(CUR).$(REV) SOBJS = main.so directive.so eval.so expand.so support.so system.so mbchar.so .SUFFIXES: .so .c.so : $(CC) $(CFLAGS) $(MEM_MACRO) -c -fpic -o $*.so $*.c mcpplib_so: $(SOBJS) $(CC) -shared -o libmcpp.so.$(SHLIB_VER) $(SOBJS) chmod a+x libmcpp.so.$(SHLIB_VER) mcpplib_install: cp libmcpp.a libmcpp.so.$(SHLIB_VER) $(LIBDIR) ranlib $(LIBDIR)/libmcpp.a ln -sf libmcpp.so.$(SHLIB_VER) $(LIBDIR)/libmcpp.so ln -sf libmcpp.so.$(SHLIB_VER) $(LIBDIR)/libmcpp.so.$(CUR) # You should do 'ldconfig' as a root after install. cp mcpp_lib.h mcpp_out.h $(INCDIR) $(CC) -o $(NAME) main_libmcpp.c -l $(NAME) install -s $(NAME) $(BINDIR) mcpplib_uninstall: rm -f $(LIBDIR)/libmcpp.a $(LIBDIR)/libmcpp.so.$(SHLIB_VER) $(LIBDIR)/libmcpp.so.$(CUR) $(LIBDIR)/libmcpp.so rm -f $(BINDIR)/$(NAME) rm -f $(INCDIR)/mcpp* endif # use mcpp as a subroutine from testmain.c ifeq ($(OUT2MEM), 1) # output to memory buffer CFLAGS += -DOUT2MEM endif TMAIN_LINKFLAGS = testmain.o -o testmain -L$(LIBDIR) -l$(NAME) ifeq ($(MALLOC), KMMALLOC) TMAIN_LINKFLAGS += -lkmmalloc_debug endif testmain : testmain.o $(CC) $(TMAIN_LINKFLAGS) testmain_install : install -s testmain $(BINDIR)/testmain testmain_uninstall : rm -f $(BINDIR)/testmain endif mcpp-2.7.2/noconfig/mac_osx.mak0000644000175000017500000001474111064623024013334 00000000000000# makefile to compile MCPP version 2.7.2 for Mac OS X / GCC / GNU make # 2008/09 kmatsui # # First, you must edit NAME, GCCDIR, BINDIR, INCDIR, # gcc_maj_ver, gcc_min_ver, arch, target_cc. # To make compiler-independent-build of MCPP: # make # sudo make install # To make GCC-specific-build of MCPP: # make COMPILER=GNUC # sudo make COMPILER=GNUC install # To re-compile MCPP using GCC-specific-build of MCPP do: # make COMPILER=GNUC PREPROCESSED=1 # sudo make COMPILER=GNUC PREPROCESSED=1 install # To link malloc() package of kmatsui do: # make [COMPILER=GNUC] [PREPROCESSED=1] MALLOC=KMMALLOC # sudo make [COMPILER=GNUC] [PREPROCESSED=1] MALLOC=KMMALLOC install # To make libmcpp (subroutine build of mcpp): # make MCPP_LIB=1 mcpplib # sudo make MCPP_LIB=1 mcpplib_install # To make testmain using libmcpp: # make [OUT2MEM=1] testmain # sudo make [OUT2MEM=1] testmain_install # COMPILER: # Specify whether make a compiler-independent-build or GCC-specific-build # compiler-independent-build: empty # compiler-specific-build: GNUC # NAME: name of mcpp executable NAME = mcpp #NAME = powerpc-apple-darwin9-mcpp #NAME = i686-apple-darwin9-mcpp # CC, CXX: name of gcc, g++ executable # CC: default, GCC-specific-build # $(arch)-apple-darwin?-gcc-VERSION: # cross-compile of compiler-independent-build CC = gcc #CC = powerpc-apple-darwin9-gcc-4.0.1 #CC = i686-apple-darwin9-gcc-4.0.1 CXX = g++ #CXX = powerpc-apple-darwin9-g++-4.0.1 #CXX = i686-apple-darwin9-g++-4.0.1 CFLAGS = -c -Wall -O2 # -ggdb -O0 -v # for gcc 4.1 or later (Don't use this option to compile libmcpp) #CFLAGS += -fstack-protector CPPFLAGS = LINKFLAGS = -o $(NAME) # for gcc 4.1 or later (Don't use this option to compile libmcpp) #LINKFLAGS += -fstack-protector # for gcc 4.1 or later # for universal binary of MacOS 10.4 and 10.5, x86 and ppc #UFLAGS = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc ifeq ($(COMPILER), ) # compiler-independent-build CPPOPTS = # BINDIR: directory to install mcpp: /usr/bin or /usr/local/bin BINDIR = /usr/local/bin # INCDIR: directory to install mcpp_lib.h, mcpp_out.h for mcpplib INCDIR = /usr/local/include else # compiler-specific-build: Adjust for your system ifeq ($(COMPILER), GNUC) # The directory where 'gcc' (cc) command is located GCCDIR = /usr/bin #GCCDIR = /usr/local/bin # set GCC version gcc_maj_ver = 4 gcc_min_ver = 0 # INCDIR: GCC's version specific include directory # Mac OS X Leopard INCDIR = /usr/lib/gcc/i686-apple-darwin9/4.0.1/include #INCDIR = /usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include CPPOPTS = -DCOMPILER=$(COMPILER) # BINDIR: Where mcpp should be installed # Mac OS X Leopard BINDIR = /usr/libexec/gcc/i686-apple-darwin9/4.0.1 #BINDIR = /usr/libexec/gcc/powerpc-apple-darwin9/4.0.1 # target_cc: the compiler into which mcpp is installed # gcc: default # $(arch)-apple-darwin?-gcc-VERSION: target is the cross-compiler target_cc = gcc #target_cc = powerpc-apple-darwin9-gcc-4.0.1 #target_cc = i686-apple-darwin9-gcc-4.0.1 arch = i386 #arch = ppc ifeq ($(gcc_maj_ver), 2) cpp_call = $(BINDIR)/cpp0 else cpp_call = $(BINDIR)/cc1 endif endif endif ifneq ($(MALLOC), ) ifeq ($(MALLOC), KMMALLOC) LINKFLAGS += -lkmmalloc_debug MEM_MACRO = -D_MEM_DEBUG -DXMALLOC endif MEM_MACRO += -D$(MALLOC) else MEM_MACRO = endif OBJS = main.o directive.o eval.o expand.o support.o system.o mbchar.o all : $(NAME) $(NAME): $(OBJS) $(CC) $(UFLAGS) $(OBJS) $(LINKFLAGS) PREPROCESSED = 0 ifeq ($(PREPROCESSED), 1) CMACRO = -DPREPROCESSED #CPPFLAGS = -Wp,-v,-Q,-W3 # for MCPP to output a bit verbose diagnosis to "mcpp.err" # Make a "pre-preprocessed" header file to recompile MCPP with MCPP. mcpp.H : system.H noconfig.H internal.H ifeq ($(COMPILER), GNUC) $(CC) -E -Wp,-b $(CPPFLAGS) $(CPPOPTS) $(MEM_MACRO) -o mcpp.H preproc.c else @echo "Do 'sudo make COMPILER=GNUC install' prior to recompile." @echo "Then, do 'make COMPILER=GNUC PREPROCESSED=1'." @exit endif $(OBJS) : mcpp.H else CMACRO = $(MEM_MACRO) $(CPPOPTS) $(OBJS) : noconfig.H main.o directive.o eval.o expand.o support.o system.o mbchar.o: \ system.H internal.H endif .c.o : $(CC) $(CFLAGS) $(UFLAGS) $(CMACRO) $(CPPFLAGS) $< install : install -s $(NAME) $(BINDIR)/$(NAME) ifeq ($(COMPILER), GNUC) @./set_mcpp.sh '$(GCCDIR)' '$(gcc_maj_ver)' '$(gcc_min_ver)' \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(CPPFLAGS)' 'x' 'ln -s' \ '$(INCDIR)' SYS_MAC $(arch) $(target_cc) endif clean : -rm *.o *.so $(NAME) mcpp.H mcpp.err libmcpp.* uninstall: rm -f $(BINDIR)/$(NAME) ifeq ($(COMPILER), GNUC) @./unset_mcpp.sh '$(GCCDIR)' '$(gcc_maj_ver)' '$(gcc_min_ver)' \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x' 'ln -s' '$(INCDIR)' SYS_MAC \ $(target_cc) endif ifeq ($(COMPILER), ) ifeq ($(MCPP_LIB), 1) # compiler-independent-build and MCPP_LIB=1 CFLAGS += -DMCPP_LIB LIBDIR = /usr/local/lib mcpplib : mcpplib_a mcpplib_so mcpplib_a: $(OBJS) ar -rv libmcpp.a $(OBJS) # shared library # mcpp 2.6.*: 0, mcpp 2.7: 1, mcpp 2.7.1: 2, mcpp 2.7.2: 3 CUR = 3 # mcpp 2.6.3: 0, mcpp 2.6.4: 1, mcpp 2.7, 2.7.1, 2.7.2: 0 REV = 0 # mcpp 2.6.*: 0, mcpp 2.7: 1, mcpp 2.7.1: 2, mcpp 2.7.2: 3 AGE = 3 SHLIB_VER = 0.$(CUR).$(REV) SOBJS = main.so directive.so eval.so expand.so support.so system.so mbchar.so .SUFFIXES: .so .c.so : $(CC) $(CFLAGS) $(UFLAGS) $(MEM_MACRO) -c -fno-common -o $*.so $*.c mcpplib_so: $(SOBJS) $(CC) $(UFLAGS) -dynamiclib -o libmcpp.$(SHLIB_VER).dylib $(SOBJS) chmod a+x libmcpp.$(SHLIB_VER).dylib mcpplib_install: cp libmcpp.a libmcpp.$(SHLIB_VER).dylib $(LIBDIR) ranlib $(LIBDIR)/libmcpp.a ln -sf libmcpp.$(SHLIB_VER).dylib $(LIBDIR)/libmcpp.dylib ln -sf libmcpp.$(SHLIB_VER).dylib $(LIBDIR)/libmcpp.0.dylib cp mcpp_lib.h mcpp_out.h $(INCDIR) # You should do 'ldconfig' as a root after install. $(CC) -o $(NAME) main_libmcpp.c -l $(NAME) install -s $(NAME) $(BINDIR) mcpplib_uninstall: rm -f $(LIBDIR)/libmcpp.a $(LIBDIR)/libmcpp.$(SHLIB_VER).dylib $(LIBDIR)/libmcpp.0.dylib $(LIBDIR)/libmcpp.dylib rm -f $(BINDIR)/$(NAME) rm -f $(INCDIR)/mcpp* endif # use mcpp as a subroutine from testmain.c ifeq ($(OUT2MEM), 1) # output to memory buffer CFLAGS += -DOUT2MEM endif TMAIN_LINKFLAGS = testmain.o -o testmain -l $(NAME) ifeq ($(MALLOC), KMMALLOC) TMAIN_LINKFLAGS += -l kmmalloc_debug endif testmain : testmain.o $(CC) $(UFLAGS) $(TMAIN_LINKFLAGS) testmain_install : install -s testmain $(BINDIR)/testmain testmain_uninstall : rm -f $(BINDIR)/testmain endif mcpp-2.7.2/noconfig/mingw.mak0000644000175000017500000001212511066622360013022 00000000000000# makefile to compile MCPP version 2.7.2 and later for MinGW / GCC / GNU make # 2008/09 kmatsui # # First, you must edit GCCDIR, BINDIR, INCDIR, gcc_maj_ver and gcc_min_ver. # To make compiler-independent-build of MCPP do: # make # make install # To make GCC-specific-build of MCPP: # make COMPILER=GNUC # make COMPILER=GNUC install # To re-compile MCPP using GCC-specific-build of MCPP do: # make COMPILER=GNUC PREPROCESSED=1 # make COMPILER=GNUC PREPROCESSED=1 install # To link malloc() package of kmatsui do: # make [COMPILER=GNUC] [PREPROCESSED=1] MALLOC=KMMALLOC # make [COMPILER=GNUC] [PREPROCESSED=1] MALLOC=KMMALLOC install # To make libmcpp (subroutine build of mcpp): # make MCPP_LIB=1 mcpplib # make MCPP_LIB=1 mcpplib_install # To make testmain using libmcpp (add 'DLL_IMPORT=1' to link against DLL): # make [OUT2MEM=1] testmain # make [OUT2MEM=1] testmain_install # COMPILER: # Specify whether make a compiler-independent-build or GCC-specific-build # compiler-independent-build: empty # compiler-specific-build: GNUC # NAME: name of mcpp executable NAME = mcpp # CC: name of gcc executable # e.g. gcc, mingw32-gcc CC = gcc CXX = g++ CFLAGS = -c -O2 -Wall #-v CPPFLAGS = LINKFLAGS = -o $(NAME) ifeq ($(COMPILER), ) # compiler-independent-build CPPOPTS = # BINDIR: directory to install mcpp: /usr/bin or /usr/local/bin BINDIR = /usr/local/bin # INCDIR: directory to install mcpp_lib.h, mcpp_out.h for libmcpp INCDIR = /usr/local/include else # compiler-specific-build: Adjust for your system ifeq ($(COMPILER), GNUC) # The directory where 'gcc' (cc) command is located GCCDIR = /mingw/bin # set GCC version gcc_maj_ver = 3 gcc_min_ver = 4 # INCDIR: version specific include directory INCDIR = /mingw/lib/gcc/mingw32/3.4.5/include CPPOPTS = -DCOMPILER=$(COMPILER) # BINDIR: the directory where cc1 resides BINDIR = /mingw/libexec/gcc/mingw32/3.4.5 cpp_call = $(BINDIR)/cc1.exe cpu = i386 #cpu = x86_64 endif endif LIBDIR = /usr/local/lib ifneq ($(MALLOC), ) ifeq ($(MALLOC), KMMALLOC) LINKFLAGS += -lkmmalloc_debug MEM_MACRO = -D_MEM_DEBUG -DXMALLOC endif MEM_MACRO += -D$(MALLOC) else MEM_MACRO = endif OBJS = main.o directive.o eval.o expand.o support.o system.o mbchar.o $(NAME): $(OBJS) $(CC) $(OBJS) $(LINKFLAGS) ifeq ($(COMPILER), GNUC) $(CC) cc1.c -o cc1.exe endif PREPROCESSED = 0 ifeq ($(PREPROCESSED), 1) CMACRO = -DPREPROCESSED # Make a "pre-preprocessed" header file to recompile MCPP with MCPP. mcpp.H : system.H noconfig.H internal.H ifeq ($(COMPILER), GNUC) $(CC) -v -E -Wp,-b $(CPPFLAGS) $(CPPOPTS) $(MEM_MACRO) -o mcpp.H preproc.c else @echo "Do 'sudo make COMPILER=GNUC install' prior to recompile." @echo "Then, do 'make COMPILER=GNUC PREPROCESSED=1'." @exit endif $(OBJS) : mcpp.H else CMACRO = $(CPPOPTS) $(MEM_MACRO) $(OBJS) : noconfig.H main.o directive.o eval.o expand.o support.o system.o mbchar.o: \ system.H internal.H endif .c.o : $(CC) $(CFLAGS) $(CMACRO) $(CPPFLAGS) $< install : install -s -b $(NAME).exe $(BINDIR)/$(NAME).exe ifeq ($(COMPILER), GNUC) @./set_mcpp.sh '$(GCCDIR)' '$(gcc_maj_ver)' '$(gcc_min_ver)' \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x$(CPPFLAGS)' 'x.exe' 'ln -s' \ '$(INCDIR)' SYS_MINGW $(cpu) endif clean : -rm *.o *.so *.exe cc1.exe mcpp.H mcpp.err libmcpp.* uninstall: rm -f $(BINDIR)/$(NAME).exe ifeq ($(COMPILER), GNUC) @./unset_mcpp.sh '$(GCCDIR)' '$(gcc_maj_ver)' '$(gcc_min_ver)' \ '$(cpp_call)' '$(CC)' '$(CXX)' 'x.exe' 'ln -s' '$(INCDIR)' SYS_MINGW endif ifeq ($(COMPILER), ) ifeq ($(MCPP_LIB), 1) # compiler-independent-build and MCPP_LIB is specified: CFLAGS += -DMCPP_LIB mcpplib : mcpplib_a mcpplib_dll mcpplib_a: $(OBJS) ar -rv libmcpp.a $(OBJS) # DLL DLL_VER = 0 SOBJS = main.so directive.so eval.so expand.so support.so system.so mbchar.so .SUFFIXES: .so .c.so : $(CC) $(CFLAGS) $(MEM_MACRO) -DDLL_EXPORT -c -o $*.so $*.c # -fPIC is not necessary for MinGW mcpplib_dll: $(SOBJS) $(CC) -shared $(SOBJS) -o libmcpp-$(DLL_VER).dll -Wl,--enable-auto-image-base,--out-implib,libmcpp.dll.a mcpplib_install: cp libmcpp.a libmcpp.dll.a $(LIBDIR) cp libmcpp-$(DLL_VER).dll $(BINDIR) ranlib $(LIBDIR)/libmcpp.a cp mcpp_lib.h mcpp_out.h $(INCDIR) $(CC) -o $(NAME) main_libmcpp.c $(LIBDIR)/libmcpp.dll.a install -s -b $(NAME).exe $(BINDIR)/$(NAME).exe mcpplib_uninstall: rm -f $(LIBDIR)/libmcpp.a $(LIBDIR)/libmcpp.dll.a $(BINDIR)/libmcpp-$(DLL_VER).dll rm -f $(BINDIR)/$(NAME).exe rm -f $(INCDIR)/mcpp* endif # use mcpp as a subroutine from testmain.c ifeq ($(OUT2MEM), 1) # output to memory buffer CFLAGS += -DOUT2MEM endif TMAIN_LINKFLAGS = testmain.o -o testmain.exe ifeq ($(DLL_IMPORT), 1) TMAIN_LINKFLAGS += $(LIBDIR)/libmcpp.dll.a CFLAGS += -DDLL_IMPORT else TMAIN_LINKFLAGS += $(LIBDIR)/libmcpp.a endif ifeq ($(MALLOC), KMMALLOC) TMAIN_LINKFLAGS += -lkmmalloc_debug endif testmain : testmain.o $(CC) $(TMAIN_LINKFLAGS) testmain_install : install -s testmain.exe $(BINDIR)/testmain.exe testmain_uninstall : rm -f $(BINDIR)/testmain.exe endif mcpp-2.7.2/noconfig/mac_gcc401_powerpc.dif0000644000175000017500000000742611067065205015243 00000000000000*** noconfig.H 2008-09-25 15:34:56.000000000 +0900 --- noconfig.H.mac_gcc401_powerpc 2008-09-26 13:47:25.000000000 +0900 *************** *** 15,21 **** */ /* Define target operating-system. */ ! #define SYSTEM SYS_FREEBSD /* Define target compiler. */ #ifndef COMPILER --- 15,21 ---- */ /* Define target operating-system. */ ! #define SYSTEM SYS_MAC /* Define target compiler. */ #ifndef COMPILER *************** *** 30,36 **** /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "GCC 3.4" #if 0 "LCC-Win32 2006-03" "Visual C 2005" --- 30,36 ---- /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "GCC 4.0" #if 0 "LCC-Win32 2006-03" "Visual C 2005" *************** *** 280,291 **** #if COMPILER_FAMILY == GNUC #define CMP_NAME "GCC" #define COMPILER_EXT "__GNUC__" ! #define COMPILER_EXT_VAL "3" /* "3" for V.3.* "4" for V.4.* */ #define COMPILER_EXT2 "__GNUC_MINOR__" ! #define COMPILER_EXT2_VAL "4" /* "4" for V.3.4, "1" for V.4.1 */ #define COMPILER_CPLUS "__GNUG__" ! #define COMPILER_CPLUS_VAL "3" /* "3" for V.3.*, "4" for V.4.* */ ! #define GCC_MAJOR_VERSION 3 /* Value of __GNUC__ as a digit */ #define LINE_PREFIX "# " #ifndef HAVE_DIGRAPHS #define HAVE_DIGRAPHS TRUE --- 280,291 ---- #if COMPILER_FAMILY == GNUC #define CMP_NAME "GCC" #define COMPILER_EXT "__GNUC__" ! #define COMPILER_EXT_VAL "4" /* "3" for V.3.* "4" for V.4.* */ #define COMPILER_EXT2 "__GNUC_MINOR__" ! #define COMPILER_EXT2_VAL "0" /* "4" for V.3.4, "1" for V.4.1 */ #define COMPILER_CPLUS "__GNUG__" ! #define COMPILER_CPLUS_VAL "4" /* "3" for V.3.*, "4" for V.4.* */ ! #define GCC_MAJOR_VERSION 4 /* Value of __GNUC__ as a digit */ #define LINE_PREFIX "# " #ifndef HAVE_DIGRAPHS #define HAVE_DIGRAPHS TRUE *************** *** 294,303 **** #define TARGET_HAVE_LONG_LONG TRUE #endif #define STDC_VERSION 0L /* 199409L for V.2.9, 0L for V.3.*,V.4.* */ ! #define CPLUS_INCLUDE_DIR1 "/usr/include/c++/3.4" /* "/usr/include/c++/3.3.6" */ /* "/usr/include/c++/4.1.2" */ ! #define CPLUS_INCLUDE_DIR2 "/usr/include/c++/3.4/backward" /* "/usr/include/c++/3.3.6/i386-vine-linux" */ /* "/usr/include/c++/4.1.2/i486-linux-gnu" */ ! /* #define CPLUS_INCLUDE_DIR3 */ /* "/usr/include/c++/3.3.6/backward" */ /* "/usr/include/c++/4.1.2/backward" */ ! /* #define C_INCLUDE_DIR1 */ /* "/usr/lib/gcc-lib/i386-vine-linux/3.3.6/include" */ /* "/usr/lib/gcc/i486-linux-gnu/4.1.2/include" */ /* #define C_INCLUDE_DIR2 */ #ifndef INC_DIR #ifdef C_INCLUDE_DIR1 --- 294,303 ---- #define TARGET_HAVE_LONG_LONG TRUE #endif #define STDC_VERSION 0L /* 199409L for V.2.9, 0L for V.3.*,V.4.* */ ! #define CPLUS_INCLUDE_DIR1 /* "/usr/include/c++/3.4" */ /* "/usr/include/c++/3.3.6" */ /* "/usr/include/c++/4.1.2" */ "/usr/include/c++/4.0.0" ! #define CPLUS_INCLUDE_DIR2 /* "/usr/include/c++/3.4/backward" */ /* "/usr/include/c++/3.3.6/i386-vine-linux" */ /* "/usr/include/c++/4.1.2/i486-linux-gnu" */ "/usr/include/c++/4.0.0/powerpc-apple-darwin9" ! #define CPLUS_INCLUDE_DIR3 /* "/usr/include/c++/3.3.6/backward" */ /* "/usr/include/c++/4.1.2/backward" */ "/usr/include/c++/4.0.0/backward" ! #define C_INCLUDE_DIR1 /* "/usr/lib/gcc-lib/i386-vine-linux/3.3.6/include" */ /* "/usr/lib/gcc/i486-linux-gnu/4.1.2/include" */ "/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include" /* #define C_INCLUDE_DIR2 */ #ifndef INC_DIR #ifdef C_INCLUDE_DIR1 mcpp-2.7.2/noconfig/bc55.dif0000644000175000017500000000221310664307102012423 00000000000000*** noconfig.H 2007-08-26 23:06:23.000000000 +0900 --- noconfig.H.bc55 2007-08-26 23:29:07.000000000 +0900 *************** *** 15,21 **** */ /* Define target operating-system. */ ! #define SYSTEM SYS_FREEBSD /* Define target compiler. */ #ifndef COMPILER --- 15,21 ---- */ /* Define target operating-system. */ ! #define SYSTEM SYS_WIN32 /* Define target compiler. */ #ifndef COMPILER *************** *** 26,36 **** #define HOST_SYSTEM SYSTEM /* Define host compiler. */ ! #define HOST_COMPILER GNUC /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "GCC 3.4" #if 0 "LCC-Win32 2006-03" "Visual C 2005" --- 26,36 ---- #define HOST_SYSTEM SYSTEM /* Define host compiler. */ ! #define HOST_COMPILER BORLANDC /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "BCC V.5.5" #if 0 "LCC-Win32 2006-03" "Visual C 2005" mcpp-2.7.2/noconfig/lcc0308.dif0000644000175000017500000000222110664306617012752 00000000000000*** noconfig.H 2007-08-26 23:06:23.000000000 +0900 --- noconfig.H.lcc0308 2007-08-26 23:26:01.000000000 +0900 *************** *** 15,21 **** */ /* Define target operating-system. */ ! #define SYSTEM SYS_FREEBSD /* Define target compiler. */ #ifndef COMPILER --- 15,21 ---- */ /* Define target operating-system. */ ! #define SYSTEM SYS_WIN32 /* Define target compiler. */ #ifndef COMPILER *************** *** 26,36 **** #define HOST_SYSTEM SYSTEM /* Define host compiler. */ ! #define HOST_COMPILER GNUC /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "GCC 3.4" #if 0 "LCC-Win32 2006-03" "Visual C 2005" --- 26,36 ---- #define HOST_SYSTEM SYSTEM /* Define host compiler. */ ! #define HOST_COMPILER LCC /* Version message. */ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ! #define VERSION_MSG "LCC-Win32 2003-08" #if 0 "LCC-Win32 2006-03" "Visual C 2005" mcpp-2.7.2/noconfig/visualc.mak0000644000175000017500000001075411112517523013351 00000000000000# makefile to compile MCPP version 2.7.1 and later for Visual C / nmake # 2008/11 kmatsui # You must first edit BINDIR, LIBDIR and INCDIR according to your system. # To make compiler-independent-build of MCPP do: # nmake # To make Visual-C-specific-build of MCPP do: # nmake COMPILER=MSC # To re-compile MCPP using Visual-C-specific-build of MCPP do: # nmake COMPILER=MSC PREPROCESSED=1 # To link kmmalloc V.2.5.3 (malloc() package of kmatsui) or later do: # (Note: Visual C 2005 and 2008 cannot coexist with kmmalloc) # nmake [PREPROCESSED=1] KMMALLOC=1 # To make mcpp.lib (subroutine-build of mcpp) do: # nmake MCPP_LIB=1 mcpplib # nmake MCPP_LIB=1 mcpplib_install # To make testmain.c (sample to use mcpp.lib) against mcpp.lib do # (add 'DLL_IMPORT=1' to link against the DLL): # nmake [OUT2MEM=1] testmain # nmake [OUT2MEM=1] testmain_install # To use this Makefile in IDE of Visual C, include $(targ)_install target # in $(targ) target, since the IDE can't handle install target. NAME = mcpp CC = cl CFLAGS = $(CFLAGS) -Za -c # -Zi # Add -Zi for debugging on Visual C / IDE LINKFLAGS = -Fe$(NAME) # -Zi CPPFLAGS = $(CPPFLAGS) -D_CRT_SECURE_NO_DEPRECATE # -Za # -D_CRT_SECURE_NO_DEPRECATE for Visual C 2005, 2008 # -Za should not be specified for compiler-independent-built MCPP !if "$(COMPILER)"=="MSC" CPPFLAGS = $(CPPFLAGS) -DCOMPILER=MSC # BINDIR : Adjust to your system. # for Visual C 2003 #BINDIR = "$(MSVCDIR)"\bin # for Visual C 2005, 2008 BINDIR = "$(VCINSTALLDIR)"\bin !else # compiler-independent-build: use compiler-independent directory BINDIR = \PUB\bin !endif !ifdef KMMALLOC MEM_MACRO = -DKMMALLOC -D_MEM_DEBUG -DXMALLOC MEMLIB = kmmalloc_debug.lib !else MEM_MACRO = MEMLIB = !endif OBJS = main.obj directive.obj eval.obj expand.obj support.obj system.obj \ mbchar.obj $(NAME).exe : $(OBJS) $(CC) $(LINKFLAGS) $(OBJS) $(MEMLIB) #install : # Visual C++ / IDE "makefile project" does not have "make install" command copy /b $(NAME).exe $(BINDIR)\$(NAME).exe !ifdef PREPROCESSED # make a "pre-preprocessed" header file to recompile MCPP with MCPP. mcpp.H : system.H internal.H $(BINDIR)\$(NAME) $(CPPFLAGS) $(LANG) $(MEM_MACRO) preproc.c mcpp.H $(OBJS) : mcpp.H system.H: noconfig.H !else $(OBJS) : noconfig.H main.obj directive.obj eval.obj expand.obj support.obj system.obj mbchar.obj: \ system.H internal.H !endif !ifdef PREPROCESSED .c.obj : $(BINDIR)\$(NAME) -DPREPROCESSED $(CPPFLAGS) $< $( * Specify the number of preprocessors by . * 1998/08 kmatsui * 2002/08 Updated for "cpp-test.txt" V.1.3 kmatsui * 2004/11 Updated for "cpp-test.txt" V.1.5 kmatsui * 2006/07 Changed non-prototype declarations to prototype ones. * kmatsui */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "ctype.h" #define MAX_COLS (MAX_CASES + MAXC) #define MAX_CASES 30 #define MAXC 1 #define OFFS 7 #define LEN 4 #define COLS (MAXC + cases) #define LLEN ((COLS * LEN) + OFFS + 2 + 2) #define MAX_LLEN ((MAX_COLS * LEN) + OFFS + 2 + 2) #define C90 2 #define C99 3 #define CPL 4 int cases; int subtotal[ MAX_COLS]; int mttl90[ MAX_COLS]; /* mid-total of C90 conformance */ int mttl99[ MAX_COLS]; /* mid-total of C99 new features conformance */ int mttlcpl[ MAX_COLS]; /* mid-total of C++ only features conformance */ int grandtotal[ MAX_COLS]; char buf[ MAX_LLEN]; void usage( void); void add_points( int norm); void put_subtotal( void); void put_mttl( int norm); void put_grandtotal( void); #if !__TURBOC__ char *stpcpy( char *p, const char *app); #endif int main( int argc, char **argv) { int i, len, sitem, mitem90, mitem99, mitemcpl, gitem, cplus; if (argc < 2 || argc > 4) usage(); len = strlen( argv[ 1]); for (i = 0; i < len; i++) { if (! isdigit( argv[ 1][ i])) usage(); } if ((cases = atoi( argv[ 1])) > MAX_CASES) usage(); if (argc > 2) if (freopen( argv[ 2], "r", stdin) == NULL) usage(); if (argc == 4) if (freopen( argv[ 3], "w", stdout) == NULL) usage(); sitem = mitem90 = mitem99 = mitemcpl = gitem = cplus = 0; while (fgets( buf, MAX_LLEN, stdin) != NULL) { if (isalpha( buf[ 0]) && buf[ 1] == '.' && isdigit( buf[ 2])) { add_points( C90); sitem++; } else if (isalpha( buf[ 0]) && buf[ 1] == '.' && isalpha( buf[ 2])) { if (cplus) { add_points( CPL); mitemcpl++; } else { add_points( C99); mitem99++; } } else if (memcmp( buf, "stotal", 6) == 0) { put_subtotal(); fprintf( stderr, "sitem:%d\n", sitem); mitem90 += sitem; sitem = 0; } else if (memcmp( buf, "mttl90", 6) == 0) { put_mttl( C90); fprintf( stderr, " mitem90:%d\n", mitem90); gitem += mitem90; mitem90 = 0; } else if (memcmp( buf, "mttl99", 6) == 0) { put_mttl( C99); fprintf( stderr, " mitem99:%d\n", mitem99); gitem += mitem99; mitem99 = 0; } else if (memcmp( buf, "mttl++", 6) == 0) { put_mttl( CPL); fprintf( stderr, " mitem++:%d\n", mitemcpl); gitem += mitemcpl; mitemcpl = cplus = 0; } else if (memcmp( buf, "gtotal", 6) == 0) { put_grandtotal(); fprintf( stderr, " gitem:%d\n", gitem); } else if (memcmp( buf, "[C++:", 5) == 0) { cplus = 1; } /* Else as it is. */ fputs( buf, stdout); } return 0; } void usage( void) { char **mesp; static char *mes[] = { "Total: Put totals of \"cpp_test.tbl\".\n", "Usage: total cpp_test.old cpp_test.new\n", "Specify the number of preprocessors by .\n", NULL }; mesp = mes; while (*mesp) fputs( *mesp++, stderr); exit( 0); } void add_points( int norm) { int i; int len; int max, point; int *arr; char *p; switch (norm) { case C90: arr = subtotal; break; case C99: arr = mttl99; break; case CPL: arr = mttlcpl; break; } len = strlen( buf); for (i = 0, p = buf + OFFS + 1; i < COLS && p - buf < len; i++, p += LEN, i == MAXC ? (p += 2) : 0) { if (*(p + 2) == ' ') /* No point written */ continue; point = atoi( p); switch (i) { case 0: max = point; break; default: if (point < 0 || max < point) { fprintf( stderr, "Out of range: (No.%d) %d\n" , i - 1, point); fputs( buf, stderr); } break; } arr[ i] += point; } } void put_subtotal( void) { int i; char *p; buf[ OFFS - 1] = ' '; for (i = 0, p = buf + OFFS; i < COLS; i++, p += LEN) { if (i == MAXC) p = stpcpy( p, " "); sprintf( p, "%4d", subtotal[ i]); mttl90[ i] += subtotal[ i]; subtotal[ i] = 0; } strcpy( p, "\n"); } void put_mttl( int norm) { int i; char *p; int *mttl; switch (norm) { case C90: mttl = mttl90; break; case C99: mttl = mttl99; break; case CPL: mttl = mttlcpl; break; } buf[ OFFS - 1] = ' '; for (i = 0, p = buf + OFFS; i < COLS; i++, p += LEN) { if (i == MAXC) p = stpcpy( p, " "); sprintf( p, "%4d", mttl[ i]); grandtotal[ i] += mttl[ i]; mttl[ i] = 0; } strcpy( p, "\n"); } void put_grandtotal( void) { int i; char *p; buf[ OFFS - 1] = ' '; for (i = 0, p = buf + OFFS; i < COLS; i++, p += LEN) { if (i == MAXC) p = stpcpy( p, " "); sprintf( p, "%4d", grandtotal[ i]); } strcpy( p, "\n"); } #if !__TURBOC__ char *stpcpy( char *p, const char *app) { strcpy( p, app); return p + strlen( p); } #endif mcpp-2.7.2/tool/app_once.bat0000644000175000017500000000015110216765467012646 00000000000000REM append once.txt to header files in the current directory REM FOR %%f IN ( *.H ) DO copy %%f+once.txt mcpp-2.7.2/tool/cpp_test.c0000644000175000017500000001204110451754735012355 00000000000000/* * cpp_test.c: to compile and run n_*.c, i_*.c; * make a summary of the results. * 1998/08 by kmatsui * Made after runtest.c and summtest.c of * "Plum-Hall Validation Sampler". * 2005/03 by kmatsui * Changed 'PGNUM'. * 2006/07 by kmatsui * Changed 'PGNUM'. * Changed non-prototype declarations to prototype ones. * Removed DOS-extender option. */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "ctype.h" #include "errno.h" #define NAMEMAX 8 #define PGMNUM 35 #if __MSDOS__ || __WIN32__ || _WIN32 #define PATH_DELIM '\\' #else #define PATH_DELIM '/' #endif #if 0 extern int sleep( unsigned int seconds); #endif void test_cpp( int argc, char **argv); void sum_test( void); void usage( void); char comp_fmt[ BUFSIZ/2] = "cc -o%s %s.c"; char cmp_name[ NAMEMAX+1]; char out_file[ NAMEMAX+5]; char err_file[ NAMEMAX+5]; char sum_file[ NAMEMAX+5]; char err_name[ PGMNUM][ NAMEMAX+5]; char buf[ BUFSIZ]; int main( int argc, char **argv) { char *cp; int i; if (argc < 2) usage(); if (! isalpha( argv[ 1][ 0]) || strchr( argv[ 1], '.') != NULL || strlen( argv[ 1]) > NAMEMAX) { usage(); } strcpy( cmp_name, argv[ 1]); sprintf( sum_file, "%s.sum", cmp_name); sprintf( out_file, "%s.out", cmp_name); sprintf( err_file, "%s.err", cmp_name); for (cp = cmp_name; (i = *cp) != 0; cp++) { if (i == '-' || i == '_' || i == '~') *cp = '|'; /* Convert horizontal line to vertical line */ } if (argc > 2) strcpy( comp_fmt, argv[ 2]); if (freopen( out_file, "w", stdout) == NULL) usage(); if (freopen( err_file, "w", stderr) == NULL) usage(); setbuf( stdout, NULL); setbuf( stderr, NULL); test_cpp( argc, argv); sum_test(); return 0; } void test_cpp( int argc, char ** argv) { int i, len; int pgm_num; for (pgm_num = 0; pgm_num < PGMNUM && ! feof( stdin); pgm_num++) { /* for each input program */ char pgm_name[ NAMEMAX+2]; fgets( pgm_name, NAMEMAX+1, stdin); if ((len = strlen( pgm_name)) < 2 || *(pgm_name + len - 1) != '\n') continue; /* skip erroneous line */ else *(pgm_name + len - 1) = '\0'; /* remove '\n' */ sprintf( buf, comp_fmt, pgm_name, pgm_name); system( buf); printf( "COMPILE: %s\n", buf); #if 0 sleep( 1); /* Wait a moment */ #endif sprintf( err_name[ pgm_num], "%s.err", pgm_name); freopen( err_name[ pgm_num], "w", stderr); sprintf( buf, ".%c%s", PATH_DELIM, pgm_name); system( buf); printf( "EXECUTE: %s\n", buf); #if 0 sleep( 1); /* Wait a moment */ #endif freopen( err_file, "a", stderr); for (i = 3; i < argc; ++i) { sprintf( buf, argv[i], pgm_name, pgm_name); system( buf); printf( "CLEANUP: %s\n", buf); } } /* end loop over each program */ } void sum_test( void) { FILE *sumfp, *errfp; char *cp; int i, len; int nerror = 0; int pgm_num; /* Make a column of summary */ if ((sumfp = fopen( sum_file, "w")) == NULL) { fprintf( stderr, "Can't open %s\n", sum_file); exit( errno); } len = strlen( cmp_name); for (i = 0; i < len; i++) fprintf( sumfp, " %c\n", cmp_name[i]); for (i = len; i <= NAMEMAX; i++) fputs( " \n", sumfp); for (pgm_num = 0; pgm_num < PGMNUM; pgm_num++) { if ((errfp = fopen( err_name[ pgm_num], "r")) == NULL) { fputs( " -\n", sumfp); nerror++; } else { cp = fgets( buf, BUFSIZ, errfp); if (cp == NULL || strcmp( buf, "started\n") != 0) { fputs( " -\n", sumfp); nerror++; } else { fgets( buf, BUFSIZ, errfp); if (strcmp( "success\n", buf) != 0) { fputs( " o\n", sumfp); nerror++; } else { fputs( " *\n", sumfp); } } fclose( errfp); } } fprintf( sumfp, "\n%3d\n", nerror); } void usage( void) { fputs( "Usage:\n" " cpp_test compiler-name \"compile command\" \"cleaning command\"s\n" " Compiler-name must be 8 bytes or less and must be without dot.\n" " Number of \"cleaning command\"s can be any.\n" " Do this command in mcpp's test-c directory.\n" "Examples:\n" " cpp_test GCC332 \"gcc -std=iso9899:199409 -o%s %s.c\"" " \"rm %s\" < n_i_.lst\n" " cpp_test VC2005 \"cl -Za -D_CRT_SECURE_NO_DEPRECATE -Fe%s.exe %s.c\"" " \"del %s.exe\" < n_i_.lst\n" " cpp_test MCPP26 \"gcc -Wp,-23 -std=iso9899:199409 -o%s %s.c\"" " \"rm %s\" < n_i_.lst\n" , stderr); exit( 0); } mcpp-2.7.2/tool/clock_of.c0000644000175000017500000000200410216765467012314 00000000000000/* clock_of.c: to measure the execution time of a program. */ /* 2002/08 kmatsui */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "time.h" void usage( void); int main( int argc, char ** argv) { char command[ BUFSIZ]; char **arg, *buf; long start_time, passed_time; int ret; if (argc < 2) usage(); ret = -1; arg = argv; buf = command; while (*++arg) { sprintf( buf, "%s ", *arg); buf += strlen( buf); } fprintf( stderr, "%s\n", command); start_time = clock(); ret = system( command); if (ret == 0) { passed_time = clock() - start_time; fprintf( stderr, "%ld ticks passed (%f seconds).\n" , passed_time, (double) passed_time / CLOCKS_PER_SEC); } else { fprintf( stderr, "Command execution error! (status: %d)\n", ret); } return 0; } void usage( void) { fputs( "usage: clock_of []\n", stderr); exit( 1); } mcpp-2.7.2/configure.ac0000644000175000017500000006300411113211015011655 00000000000000dnl configure.ac for MCPP 2003/11, 2008/11 kmatsui dnl Process this file with autoconf to produce a configure script. dnl WARNING: This script does not assume cross-compiling. dnl To cross-compile you must edit here and there of this file. AC_INIT( mcpp, 2.7.2, kmatsui@t3.rim.or.jp) AC_CONFIG_SRCDIR( src/main.c) AM_CONFIG_HEADER( src/config.h) AC_CONFIG_AUX_DIR( config) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE( no-dependencies) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_EGREP AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL dnl WARNING: Configure must check the characteristics of target compiler. dnl MCPP may modify the behavior of the target compiler-system. dnl You must uninstall MCPP before re-configuring. AC_MSG_CHECKING( [whether the cpp is target preprocessor]) mcpp=`$CPP $CFLAGS -xc -v /dev/null 2>&1 | grep 'MCPP'` if test "x$mcpp" != x; then AC_MSG_ERROR( Do 'make uninstall' before configuring again.) fi AC_MSG_RESULT( yes) dnl Define host system and target system case $host_os in linux*) AC_DEFINE( [HOST_SYSTEM], [SYS_LINUX], [Define the host system.]) ac_c_define_HOST_SYSTEM=[SYS_LINUX] ;; freebsd*) AC_DEFINE( [HOST_SYSTEM], [SYS_FREEBSD]) ac_c_define_HOST_SYSTEM=[SYS_FREEBSD] ;; darwin*) AC_DEFINE( [HOST_SYSTEM], [SYS_MAC]) ac_c_define_HOST_SYSTEM=[SYS_MAC] ;; cygwin*) AC_DEFINE( [HOST_SYSTEM], [SYS_CYGWIN]) ac_c_define_HOST_SYSTEM=[SYS_CYGWIN] ;; mingw*) AC_DEFINE( [HOST_SYSTEM], [SYS_MINGW]) ac_c_define_HOST_SYSTEM=[SYS_MINGW] ;; *) AC_MSG_WARN( [Unsupported host OS, assuming to be an UNIX variant]) AC_DEFINE( [HOST_SYSTEM], [SYS_UNIX]) ac_c_define_HOST_SYSTEM=[SYS_UNIX] ;; esac host_system=$ac_c_define_HOST_SYSTEM case $target_os in linux*) AC_DEFINE( [SYSTEM], [SYS_LINUX], [Define the target system.]) ;; freebsd*) AC_DEFINE( [SYSTEM], [SYS_FREEBSD]) ;; darwin*) AC_DEFINE( [SYSTEM], [SYS_MAC]) ;; cygwin*) AC_DEFINE( [SYSTEM], [SYS_CYGWIN]) ;; mingw*) AC_DEFINE( [SYSTEM], [SYS_MINGW]) ;; *) AC_MSG_WARN( Unsupported target OS, assuming to be an UNIX variant) AC_DEFINE( [SYSTEM], [SYS_UNIX]) ;; esac ## --enable-replace-cpp option AC_ARG_ENABLE( replace-cpp, AC_HELP_STRING( [--enable-replace-cpp], [Replace the resident preprocessor with mcpp]), , ## the compiler name will be defined later AC_DEFINE( [COMPILER], [INDEPENDENT], [Define the target compiler.]) ## else define COMPILER as INDEPENDENT ) ## Generally this configure does not support cross-compiling. ## Nevertheless, it can configure cross-compiler of Apple-GCC (i686 vs ppc). if test x$enable_replace_cpp = xyes \ && test $ac_c_define_HOST_SYSTEM = SYS_MAC \ && test $host_cpu != $target_cpu; then ## Enable to build mcpp into cross-compiler of Apple-GCC ## --with-target-cc option AC_ARG_WITH( target_cc, AC_HELP_STRING( [--with-target-cc], [Specify the target compiler to build mcpp into on Mac OS X]), if test x${withval+set} = xset; then target_cc=$withval target_name=`echo $target_cc | sed 's/-gcc.*$//'` if test $target_name != $target_alias; then AC_MSG_ERROR( [The argument of --with-target-cc option conflicts with --target option.]) fi AC_SUBST( [target_cc]) fi ) fi dnl Define a target specific macro. AC_MSG_CHECKING( for target cpu) ## These are not predefined macros of MCPP. MCPP will define predefined macros ## on compile time based on the CPU macro, and possibly redefine them at an ## execution time. case $target_cpu in x86_64|amd64) Target_Cpu=x86_64 ;; i?86*) Target_Cpu=i386 ;; powerpc64|ppc64) Target_Cpu=ppc64 ;; powerpc|ppc|ppc7400) Target_Cpu=ppc ;; *) Target_Cpu=$target_cpu ;; esac AC_MSG_RESULT( $Target_Cpu) AC_DEFINE_UNQUOTED( [CPU], "$Target_Cpu", [Define the cpu-specific-macro.]) ## Build into cross-compiler on Mac OS if test x$enable_replace_cpp = xyes \ && test $ac_c_define_HOST_SYSTEM = SYS_MAC \ && test x${target_cc+set} = xset; then arch_opt="-arch $Target_Cpu" fi dnl Checks for header files. AC_CHECK_HEADERS( [unistd.h, stdint.h, inttypes.h]) dnl Checks for typedefs, and compiler characteristics. AC_CHECK_TYPES( [intmax_t, long long]) dnl Check for library functions. AC_CHECK_FUNCS( [stpcpy]) dnl Checks for some system characteristics. AC_CACHE_CHECK( if the cases of filename are folded, ac_cv_fname_fold, [touch hJkL [ac_cv_fname_fold=no] AC_RUN_IFELSE( [[ #include #include void exit(); int main( void) { if (fopen( "HjKl", "r") == NULL) exit( errno); else exit( 0); } ]], [ac_cv_fname_fold=yes], [], AC_MSG_WARN( cannot run on cross-compiling so assumes that the cases of filename are not folded.) ) rm hJkL], ) if test x$ac_cv_fname_fold = xyes; then AC_DEFINE( [FNAME_FOLD], 1, [Define if the cases of file name are folded.]) fi dnl Checks for some host compiler characteristics. AC_DEFINE_UNQUOTED( [OBJEXT], ["$ac_cv_objext"], [Define the suffix of object file.]) dnl Check printf length modifier of the longest integer. # AC_CHECK_MOD_LL( modifier, additional include header) # Try the printf length modifier for the longest integer. # The redundant sscanf() is for some compilers which cannot handle # long long integer token. AC_DEFUN([AC_CHECK_MOD_LL], [ AC_CACHE_CHECK( [printf length modifier for the longest integer], [ac_cv_c_printf_modifier], AC_RUN_IFELSE( [[ #include #include int strcmp(); void exit(); $3 int main( void) { char buf@<:@ 20@:>@; $1 num; sscanf( "1234567890123456789", "%$2d", &num); sprintf( buf, "%$2d", num); assert( strcmp( buf, "1234567890123456789") == 0); exit( 0); } ]], [ac_cv_c_printf_modifier=$2], , AC_MSG_WARN( cannot run on cross-compiling so assumes the length modifier of long long is "%ll") AC_DEFINE( [LL_FORM], "ll", [Define printf length modifier for the longest integer.]) [ac_cv_c_printf_modifier=ll] ) ) ] ) if test x$ac_cv_type_intmax_t = xyes; then AC_CHECK_MOD_LL( [intmax_t], [j], [#include ]) if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \ || test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then sleep 1 # wait for cleanup fi fi if test x$ac_cv_type_long_long = xyes; then for modifier in ll I64 q L do AC_CHECK_MOD_LL( [long long], ${modifier}) if test x${ac_cv_c_printf_modifier+set} = xset; then break fi if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \ || test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then sleep 1 # wait for cleanup fi done fi if test x${ac_cv_c_printf_modifier+set} = xset; then AC_DEFINE_UNQUOTED( [LL_FORM], "$ac_cv_c_printf_modifier", [Define printf length modifier for the longest integer.]) fi if test $ac_c_define_HOST_SYSTEM = SYS_FREEBSD && \ test x$mcpp_ac_c_define_SYSTEM_SP_STD != x__FreeBSD__; then fbsd_ver=`echo '__FreeBSD__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'` AC_DEFINE_UNQUOTED( [SYSTEM_EXT_VAL], "$fbsd_ver", [Define the version of FreeBSD.]) fi if test x$ac_cv_c_compiler_gnu = xyes; then AC_DEFINE( [HOST_COMPILER], [GNUC], [Define the host compiler.]) AC_DEFINE( [HOST_CMP_NAME], "GCC", [Define the host compiler name.]) AC_MSG_CHECKING( for value of __GNUC__) gcc_maj_ver=`echo '__GNUC__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'` AC_MSG_RESULT( $gcc_maj_ver) AC_DEFINE_UNQUOTED( [GCC_MAJOR_VERSION], "$gcc_maj_ver", [Define gcc major version.]) AC_MSG_CHECKING( for value of __GNUC_MINOR__) gcc_min_ver=`echo __GNUC_MINOR__ | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'` AC_MSG_RESULT( $gcc_min_ver) AC_DEFINE_UNQUOTED( [GCC_MINOR_VERSION], "$gcc_min_ver", [Define gcc minor version.]) cw=`pwd` if test x$srcdir = "x." || test x$srcdir = x; then src_dir=$cw else src_dir=$srcdir fi if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN; then AC_CACHE_CHECK( the root directory, ac_cv_cygwin_root, [ac_cv_cygwin_root=`$src_dir/config/cygwin_root`] ) AC_DEFINE_UNQUOTED( [CYGWIN_ROOT_DIRECTORY], "$ac_cv_cygwin_root", [Define root directory of CYGWIN.]) fi if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then AC_CACHE_CHECK( the root directory, ac_cv_msys_root, cd /tmp cat > getcwd.c <<\_EOF #include #include #include int main( int argc, char ** argv) { char buf@<:@ PATH_MAX@:>@; getcwd( buf, PATH_MAX); puts( buf); return 0; } _EOF $CC getcwd.c cd / [ac_cv_msys_root=`$src_dir/config/mingw_root`] ) AC_CACHE_CHECK( the /mingw directory, ac_cv_mingw_dir, cd /mingw [ac_cv_mingw_dir=`$src_dir/config/mingw_root`] ) cd $cw rm -f /tmp/getcwd.c /tmp/a.exe AC_DEFINE_UNQUOTED( [MSYS_ROOT_DIRECTORY], "$ac_cv_msys_root", [Define root directory of MSYS.]) AC_DEFINE_UNQUOTED( [MINGW_DIRECTORY], "$ac_cv_mingw_dir", [Define /mingw directory.]) fi else # not gcc # mcpp_AC_C_DEFINE( SYSTEM | CPU | COMPILER, STD | OLD, $enableval) # Specify the target-specific predefined macro. AC_DEFUN([mcpp_AC_C_DEFINE], [ name=`echo $3 | sed 's/=.*//'` mcpp_macro=$1_SP_$2 stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then AC_MSG_ERROR( The macro name '$name' should begin with '_'.) fi else stripped_name=`echo $name | sed 's/^@<:@A-Za-z@:>@//'` if test x$stripped_name = x$name; then AC_MSG_ERROR( The macro name '$name' should begin with an alphabetic letter.) fi fi if test x$name = x$3; then [replace=1] else [replace=`echo $3 | sed 's/^.*=//'`] fi AC_DEFINE_UNQUOTED( [$mcpp_macro], "$name") AC_DEFINE_UNQUOTED( [${mcpp_macro}_VAL], "$replace") mcpp_ac_c_define_$1_$2=$name ]) # mcpp_AC_C_PREDEF( SYSTEM | CPU | COMPILER, STD | OLD, additional description) # Specify the target-specific predefined macro via mcpp_AC_C_DEFINE. AC_DEFUN([mcpp_AC_C_PREDEF], [ AC_ARG_ENABLE( $1-$2-macro, AC_HELP_STRING( --enable-$1-$2-macro=name@<:@=replace@:>@, [specify the $1-specific $2-style predefined macro. $3]), if test x$enableval = xyes || test x$enableval = xno; then AC_MSG_ERROR( This option requires an argument as 'name@<:@=replace@:>@'.) fi mcpp_AC_C_DEFINE( $1, $2, $enableval) AH_TEMPLATE( [$1_SP_$2], [Define the name of $1-specific $2-style predefined macro.]) AH_TEMPLATE( [$1_SP_$2_VAL], [Define the value of $1-specific $2-style predefined macro.]) ) ]) mcpp_AC_C_PREDEF( [SYSTEM], [STD], [In all this and the following 5 options, 'STD'-style name begins with an '_', 'OLD'-style name begins with an alphabetic and if '=replace' is missing the macro is defined as 1.] ) mcpp_AC_C_PREDEF( [SYSTEM], [OLD]) mcpp_AC_C_PREDEF( [CPU], [STD]) mcpp_AC_C_PREDEF( [CPU], [OLD]) mcpp_AC_C_PREDEF( [COMPILER], [STD]) mcpp_AC_C_PREDEF( [COMPILER], [OLD]) fi ## MacOS has "framework" directories. if test $ac_c_define_HOST_SYSTEM = SYS_MAC; then AC_MSG_CHECKING( for the MacOS-specific framework directory) frameworks=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | sed 's/^ *//' | sed 's/ .*$//' | $EGREP '/Frameworks$'` n=1 for dir in $frameworks do case $n in 1) framework1=$dir;; 2) framework2=$dir;; 3) framework3=$dir;; esac let n=n+1 done if test x${framework1+set} = xset; then AC_DEFINE_UNQUOTED( [FRAMEWORK1], "$framework1", [Define MacOS-specific framework directory 1.]) AC_MSG_RESULT( $framework1) else AC_MSG_RESULT( none) fi if test x${framework2+set} = xset; then AC_DEFINE_UNQUOTED( [FRAMEWORK2], "$framework2", [Define MacOS-specific framework directory 2.]) AC_MSG_RESULT( $framework2) fi if test x${framework3+set} = xset; then AC_DEFINE_UNQUOTED( [FRAMEWORK3], "$framework3", [Define MacOS-specific framework directory 3.]) AC_MSG_RESULT( $framework3) fi fi ## SYS_MAC ## --enable-mcpplib option AC_ARG_ENABLE( mcpplib, AC_HELP_STRING( [--enable-mcpplib], [Build libmcpp rather than stand-alone mcpp]) ) if test x$enable_mcpplib = xyes; then ## mcpplib mode AC_DEFINE( [MCPP_LIB], 1, [Define if build libmcpp]) if test x$enable_replace_cpp = xyes; then AC_MSG_WARN( Ignores enable-replace-cpp option) [enable_replace_cpp=no] fi else if test x$enable_replace_cpp = xyes; then ## replace-cpp mode dnl Check the characteristics of target compiler. dnl Note: The following 3 hundred and more lines are for replace-cpp-mode. dnl Target-compiler-specific configuration need these lines. dnl These lines are not used in compiler-independent configuration. dnl Check which header file CPP includes, dnl relative to CURRENT or SOURCE directory. # AC_C_INCLUDE_PREF( CURRENT | SOURCE | NEXT) # Check the include preference ('NEXT' means CURRENT & SOURCE) AC_DEFUN([AC_C_INCLUDE_PREF], [ AC_EGREP_CPP( $1, [ #include "../next/header.h" ], [ac_cv_c_include_pref=$1], ) ]) AC_CACHE_CHECK( include preference - relative to current or source directory, ac_cv_c_include_pref, mkdir mcpp-tmp cd mcpp-tmp mkdir dir ../next ../next/dir echo '#include "dir/what.h"' > ../next/header.h echo '#include "next.h"' >> ../next/header.h echo 'CURRENT' > dir/what.h echo 'SOURCE' > ../next/dir/what.h echo 'NEXT' > ../next/next.h AC_C_INCLUDE_PREF( [SOURCE]) if test x$ac_cv_c_include_pref != xSOURCE; then AC_C_INCLUDE_PREF( [CURRENT]) if test x$ac_cv_c_include_pref = xCURRENT; then AC_C_INCLUDE_PREF( [NEXT]) if test x$ac_cv_c_include_pref = xNEXT; then [ac_cv_c_include_pref="(CURRENT & SOURCE)"] fi else AC_MSG_ERROR( Failed to include header file.) fi fi cd .. rm -rf mcpp-tmp next if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \ || test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then sleep 1 # wait for cleanup fi ) AC_DEFINE_UNQUOTED( [SEARCH_INIT], $ac_cv_c_include_pref, [Define include preference.]) AC_CACHE_CHECK( if the argument of pragma is macro expanded, ac_cv_c_pragma_is_expanded, AC_COMPILE_IFELSE( [[ #define once #pragma once]], [ac_cv_c_pragma_is_expanded=no], [ac_cv_c_pragma_is_expanded=yes] ) ) if test x$ac_cv_c_pragma_is_expanded = xyes; then AC_DEFINE( [EXPAND_PRAGMA], 1, [Define if the argument of pragma is macro expanded.]) fi AC_CACHE_CHECK( if digraphs can be used, ac_cv_c_digraph, [AC_PREPROC_IFELSE( [ %:if 1 %:endif], [ac_cv_c_digraph=yes], [ac_cv_c_digraph=no] )] ) if test x$ac_cv_c_digraph = xyes; then AC_DEFINE( [HAVE_DIGRAPHS], 1, [Define if digraphs are available.]) fi AC_CACHE_CHECK( preprocessor output format of line directive, ac_cv_c_line_format, [ac_cv_c_line_format=\"`echo '#line 4321' | $CPP - | grep 432 | sed 's/432.*$//'`\"] ## Note: the output line number may be 4320 on GCC 2.* or other preprocessors. ) AC_DEFINE_UNQUOTED( [LINE_PREFIX], $ac_cv_c_line_format, [Define output format of line directive.]) if test "x$ac_cv_c_line_format" = "x\"#line \""; then ac_cv_c_std_line_prefix=1 else ac_cv_c_std_line_prefix=0 fi AC_DEFINE_UNQUOTED( [STD_LINE_PREFIX], $ac_cv_c_std_line_prefix, [Define whether output format of line directive is C source style.]) AC_CACHE_CHECK( default value of __STDC__, ac_cv_c_stdc, [stdc=`echo '__STDC__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'`] if test x"$stdc" = x"__STDC__"; then [ac_cv_c_stdc=0] else [ac_cv_c_stdc=$stdc] fi ) AC_DEFINE_UNQUOTED( [STDC], $ac_cv_c_stdc, [Define the default value of __STDC__.]) AC_CACHE_CHECK( default value of __STDC_VERSION__, ac_cv_c_stdc_ver, [stdc_ver=`echo '__STDC_VERSION__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'`] if test x"$stdc_ver" = x"__STDC_VERSION__"; then [ac_cv_c_stdc_ver=0] else [ac_cv_c_stdc_ver=$stdc_ver] fi ) AC_DEFINE_UNQUOTED( [STDC_VERSION], $ac_cv_c_stdc_ver, [Define the default value of __STDC_VERSION__.]) if test x${ac_cv_c_compiler_gnu} != xyes; then # Specify the compiler's name AC_ARG_WITH( compiler-name, AC_HELP_STRING( [--with-compiler-name=NAME], [specify the compiler name which is used as the definition of COMPILER macro]), AC_DEFINE_UNQUOTED( [COMPILER], $compiler_name, [specify the compiler name]), AC_MSG_ERROR( --with-compiler-name=NAME option should be specified to define [COMPILER] macro.) ) # Specify the C++ header file directory AC_ARG_WITH( cxx-include-dir, AC_HELP_STRING( [--with-cxx-include-dir=directory], [specify the C++ include directory by absolute path [[none]]]), [case "${withval}" in [\\/]* | [A-Za-z]:[\\/]*) cxx_include_dir=`echo $withval | sed 's,/$,,'; 's,\\$,,'` AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR1], $cxx_include_dir, [Define the C++ include directory.]) ;; *) AC_MSG_ERROR( $withval should be an absolute path.) ;; esac] ) fi # not gcc dnl Define compiler specific elements. AC_MSG_NOTICE( checking for some compiler specific elements) # Define GCC specific elements. if test x$ac_cv_c_compiler_gnu = xyes; then AC_DEFINE( [COMPILER], [GNUC], [Define the target compiler.]) cpp_call=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | $EGREP '/cpp|/cc1' | sed 's/^ *//; s/ .*//'` AC_MSG_CHECKING( for the directory to install mcpp) cpp_name=`expr $cpp_call : '.*/\(.*\)'` bindir=`expr $cpp_call : "\(.*\)/$cpp_name"` AC_MSG_RESULT( $bindir) AC_PATH_PROG( [gcc_path], [$CC], , [$PATH]) cc_path=`echo $CC | $EGREP "/"` if test x$cc_path != x; then AC_MSG_ERROR( [Environment variables CC and CXX for GCC-specific-build should not contain a directory part.]); fi ## force to set $prefix to GCC's prefix ## (i.e. "/usr/local" of "/usr/local/bin/gcc") gcc_prefix=`echo $gcc_path | $EGREP "/bin/$CC\$" | sed "s,/bin/$CC\$,,"` if test "x$gcc_prefix" != xNONE; then if test "x$prefix" != xNONE && "x$gcc_prefix" != "x$prefix"; then AC_MSG_WARN( [Ignored --prefix option, since it conflicts with GCC path]) fi prefix=$gcc_prefix else if test "x$prefix" = xNONE; then prefix=$ac_default_prefix fi fi lang_save=$LANG export LANG=C AC_MSG_CHECKING( for the compiler-specific C include directory) exclude="^/usr(/local|)/include\$|^${prefix}(/local|)/include\$|/Frameworks|End of search list" c_include_dirs=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | sed '1,/<...> search starts here/d' | sed '/End of search list/q' | sed 's/^ *//' | $EGREP -v "$exclude"` n=1 for dir in $c_include_dirs do case $n in 1) c_include_dir1=$dir;; 2) c_include_dir2=$dir;; 3) c_include_dir3=$dir;; esac let n=n+1 done if test x${c_include_dir1+set} = xset; then AC_DEFINE_UNQUOTED( [C_INCLUDE_DIR1], "$c_include_dir1", [Define compiler-specific C include directory 1.]) AC_MSG_RESULT( $c_include_dir1) else AC_MSG_RESULT( none) fi if test x${c_include_dir2+set} = xset; then AC_DEFINE_UNQUOTED( [C_INCLUDE_DIR2], "$c_include_dir2", [Define compiler-specific C include directory 2.]) AC_MSG_RESULT( $c_include_dir2) fi if test x${c_include_dir3+set} = xset; then AC_DEFINE_UNQUOTED( [C_INCLUDE_DIR3], "$c_include_dir3", [Define compiler-specific C include directory 3.]) AC_MSG_RESULT( $c_include_dir3) fi AC_PROG_CXX AC_PROG_CXXCPP AC_LANG_PUSH( C++) AC_MSG_CHECKING( for the compiler-specific C++ include directory) exclude="^/usr(/local|)/include\$|^${prefix}(/local|)/include\$|/Frameworks|^${c_include_dir1}\$|^${c_include_dir2}\$|^${c_include_dir3}\$" cxx_include_dirs=`${CXXCPP} ${CXXFLAGS} $arch_opt -xc++ -v /dev/null 2>&1 | sed '1,/<...> search starts here/d' | sed '/End of search list/q' | sed '/End of search list/d' | sed 's/^ *//' | $EGREP -v "$exclude"` n=1 for dir in ${cxx_include_dirs} do case $n in 1) cxx_include_dir1=$dir;; 2) cxx_include_dir2=$dir;; 3) cxx_include_dir3=$dir;; 4) cxx_include_dir4=$dir;; esac let n=n+1 done if test x${cxx_include_dir1+set} = xset; then AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR1], "$cxx_include_dir1", [Define compiler-specific C++ include directory 1.]) AC_MSG_RESULT( $cxx_include_dir1) fi if test x${cxx_include_dir2+set} = xset; then AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR2], "$cxx_include_dir2", [Define compiler-specific C++ include directory 2.]) AC_MSG_RESULT( $cxx_include_dir2) fi if test x${cxx_include_dir3+set} = xset; then AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR3], "$cxx_include_dir3", [Define compiler-specific C++ include directory 3.]) AC_MSG_RESULT( $cxx_include_dir3) fi if test x${cxx_include_dir4+set} = xset; then AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR4], "$cxx_include_dir4", [Define compiler-specific C++ include directory 4.]) AC_MSG_RESULT( $cxx_include_dir4) fi AC_LANG_POP( C++) export LANG=$lang_save ## the directory into which mcpp_g*.h header files are generated ## '/mcpp-gcc' will be appended to 'inc_dir' if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then inc_dir=$c_include_dir2 else if test x${c_include_dir1+set} = xset; then inc_dir=$c_include_dir1 else inc_dir="$prefix"/include fi fi AC_DEFINE_UNQUOTED( [INC_DIR], "$inc_dir", [Define include directory to install mcpp_g*.h header files.]) AC_SUBST( [CPPFLAGS]) AC_SUBST( [host_system]) AC_SUBST( [Target_Cpu]) AC_SUBST( [inc_dir]) AC_SUBST( [gcc_maj_ver]) AC_SUBST( [gcc_min_ver]) AC_SUBST( [cpp_call]) AC_PROG_LN_S if test x$gcc_maj_ver = x2; then AC_CACHE_CHECK( for value of predefined macro '__SIZE_TYPE__', size_type, [size_type=`echo '__SIZE_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'`] ) AC_DEFINE_UNQUOTED( [COMPILER_SP1_VAL], "$size_type", [Define the type of size_t.]) AC_CACHE_CHECK( for value of predefined macro '__PTRDIFF_TYPE__', ptrdiff_type, [ptrdiff_type=`echo '__PTRDIFF_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *$//'`] ) AC_DEFINE_UNQUOTED( [COMPILER_SP2_VAL], "$ptrdiff_type", [Define the type of ptrdiff_t.]) AC_CACHE_CHECK( for value of predefined macro '__WCHAR_TYPE__', wchar_type, [wchar_type=`echo '__WCHAR_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *$//'`] ) AC_DEFINE_UNQUOTED( [COMPILER_SP3_VAL], "$wchar_type", [Define the type of wchar_t.]) fi fi ## Handling of multi-byte characters containing '0x5c' codes: ## These tests cannot be executed without appropriate options for the ## compiler. So, here we define all of these macros as FALSE. ## User should edit config.h by hand after executing this script. ## These should be 0 for GCC at least upto V.4.1. AC_DEFINE( [SJIS_IS_ESCAPE_FREE], 0, [Define if '0x5c' in SJIS multi-byte character is safe.]) AC_DEFINE( [ISO2022_JP_IS_ESCAPE_FREE], 0, [Define if '0x5c' in ISO2022-JP multi-byte character is safe.]) AC_DEFINE( [BIGFIVE_IS_ESCAPE_FREE], 0, [Define if '0x5c' in BIG5 multi-byte character is safe.]) fi ## replace-cpp mode fi ## build-cpp mode or replace-cpp mode AC_ARG_WITH( [gcc-testsuite-dir], AC_HELP_STRING( [--with-gcc-testsuite-dir=directory], [specify the gcc testsuite directory to do make check. e.g. /usr/src/rpm/SOURCES/gcc-2.95.4/gcc/testsuite, /usr/local/src/gcc-3.2/gcc/testsuite, etc. The testsuite of mcpp uses gcc testsuite, hence needs gcc source or at least gcc testsuite. This option needs --enable-replace-cpp option.]), if test x${withval+set} = xset; then if test x$enable_replace_cpp = xyes; then [gcc_testsuite_dir=`echo $withval | sed 's,/$,,'`] else AC_MSG_ERROR( [--with-gcc-testsuite-dir option requires --enable-replace-cpp option.]) fi else AC_MSG_ERROR( [--with-gcc-testsuite-dir option requires an argument.]) fi ) AC_SUBST( [gcc_testsuite_dir]) AM_CONDITIONAL( [GNUC], test x$ac_cv_c_compiler_gnu = xyes) AM_CONDITIONAL( [MCPP_LIB], test x$enable_mcpplib = xyes) AM_CONDITIONAL( [REPLACE_CPP], test x$enable_replace_cpp = xyes) AM_CONDITIONAL( [MINGW], test $ac_c_define_HOST_SYSTEM = SYS_MINGW) dnl Final output. AC_OUTPUT( Makefile src/Makefile tests/Makefile) mcpp-2.7.2/aclocal.m40000644000175000017500000075226111113211442011245 00000000000000# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_if(m4_PACKAGE_VERSION, [2.61],, [m4_fatal([this file was generated for autoconf 2.61. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR mcpp-2.7.2/test-c/0000777000175000017500000000000010763014724010671 500000000000000mcpp-2.7.2/test-c/m_36_jis.c0000644000175000017500000000202210452237430012352 00000000000000/* m_36_jis.c: Handling of '\\' in ISO-2022-JP multi--byte character. */ #include "defs.h" #define str( a) # a main( void) { fputs( "started\n", stdout); /* 36.1: 0x5c in multi-byte character is not an escape character */ #pragma __setlocale( "jis") /* For MCPP */ #pragma setlocale( "jis") /* For MCPP on VC */ #if '$B;z(B' == '\x3b\x7a' && '$B0\(B' != '\x30\x5c' fputs( "Bad handling of '\\' in multi-byte character", stdout); exit( 1); #endif /* 36.2: # operater should not insert '\\' before 0x5c, 0x22 or 0x27 in multi-byte character */ assert( strcmp( str( "$B0\F0(B"), "\"$B0\F0(B\"") == 0); assert( strcmp( str( "$B1"M[(B"), "\"$B1"M[(B\"") == 0); assert( strcmp( str( "$B1'Ch(B"), "\"$B1'Ch(B\"") == 0); fputs( "$B0\F0(B" "\"$B0\F0(B\"\n", stdout); fputs( "$B1"M[(B" "\"$B1"M[(B\"\n", stdout); fputs( "$B1'Ch(B" "\"$B1'Ch(B\"\n", stdout); fputs( "success\n", stdout); return 0; } mcpp-2.7.2/test-c/u_1_19.c0000644000175000017500000000211010216765467011752 00000000000000/* u_1_19.c: Undefined behaviors on undefined #define and #undef syntax. */ #include main( void) { /* u.1.19: A macro expanded to "defined" in #if expression. */ #define DEFINED defined #if DEFINED DEFINED #endif #undef __linux__ #undef __arm__ #define __linux__ 1 #define HAVE_MREMAP defined(__linux__) && !defined(__arm__) /* Wrong macro definition. * This macro should be defined as follows. * #if defined(__linux__) && !defined(__arm__) * #define HAVE_MREMAP 1 * #endif */ #if HAVE_MREMAP mremap(); #endif /* u.1.20: Undefining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or "defined" in #undef directive. */ #undef __LINE__ /* 31 or other undefined result. */ printf( "%d\n", __LINE__); /* u.1.21: Defining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or "defined" in #define directive. */ #define __LINE__ 1234 /* 37 or other undefined result. */ printf( "%d\n", __LINE__); #define defined defined #if defined defined # error I am not a good preprocessor. #endif return 0; } mcpp-2.7.2/test-c/nest3.h0000644000175000017500000000006510216765467012025 00000000000000/* nest3.h */ nest = 3; #include "nest4.h" mcpp-2.7.2/test-c/nest6.h0000644000175000017500000000006510216765467012030 00000000000000/* nest6.h */ nest = 6; #include "nest7.h" mcpp-2.7.2/test-c/n_27.c0000644000175000017500000000331210437053651011515 00000000000000/* n_27.c: Rescanning of a macro replace any macro call in the replacement text after substitution of parameters by pre-expanded-arguments. This re-examination may involve the succeding sequences from the source file (what a queer thing!). */ #include "defs.h" main( void) { int a = 1, b = 2, c, m = 1, n = 2; fputs( "started\n", stderr); /* 27.1: Cascaded use of object-like macros. */ /* 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8; */ #define NEST8 NEST7 + 8 #define NEST7 NEST6 + 7 #define NEST6 NEST5 + 6 #define NEST5 NEST4 + 5 #define NEST4 NEST3 + 4 #define NEST3 NEST2 + 3 #define NEST2 NEST1 + 2 #define NEST1 1 assert( NEST8 == 36); /* 27.2: Cascaded use of function-like macros. */ /* (1) + (1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4; */ #define FUNC4( a, b) FUNC3( a, b) + NEST4 #define FUNC3( a, b) FUNC2( a, b) + NEST3 #define FUNC2( a, b) FUNC1( a, b) + NEST2 #define FUNC1( a, b) (a) + (b) assert( FUNC4( NEST1, NEST2) == 23); /* 27.3: An identifier generated by ## operator is subject to expansion. */ #define glue( a, b) a ## b #define MACRO_1 1 assert( glue( MACRO_, 1) == 1); #define sub( x, y) (x - y) #define head sub( #define math( op, a, b) op( (a), (b)) /* 27.4: 'sub' as an argument of math() is not pre-expanded, since '(' is missing. */ assert( math( sub, a, b) == -1); /* 27.5: Queer thing. */ c = head a,b ); assert( c == -1); /* 27.6: Recursive macro (the 2nd 'm' is expanded to 'n' since it is in source file). */ #define m n #define n( a) a c = m( m); assert( c == 2); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_13_13.c0000644000175000017500000000163210216765467012030 00000000000000/* n_13_13.c: #if expression with macros. */ #include "defs.h" #define ZERO_TOKEN #define MACRO_0 0 #define MACRO_1 1 #define and && #define or || #define not_eq != #define bitor | main( void) { fputs( "started\n", stderr); /* 13.13: With macros expanding to operators. */ #if (1 bitor 2) == 3 and 4 not_eq 5 or 0 /* #if (1 | 2) == 3 && 4 != 5 || 0 */ #else fputs( "Bad evaluation of macros expanding to operators in #if expression.\n" , stderr); exit( 1); #endif /* 13.14: With macros expanding to 0 token, nonsence but legal. */ #if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN /* #if 1 > 0 */ #else fputs( "Bad evaluation of macros expanding to 0 token in #if expression.\n" , stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/i_35_3.c0000644000175000017500000000061410216765467011745 00000000000000/* i_35_3.c: Multi-character wide character constant. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* In ASCII character set. */ /* 35.3: */ #if (L'ab' != L'\x61\x62') || (L'ab' == 'ab') fputs( "Bad handling of multi-character wide character constant.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_37.c0000644000175000017500000000700310216765467011531 00000000000000/* n_37.c: Translation limits. */ #include "defs.h" /* 37.1: Number of parameters in macro: at least 31. */ #define glue31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E main( void) { int ABCDEFGHIJKLMNOPQRSTUVWXYZabcde = 31; int ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ = 30; int nest = 0; fputs( "started\n", stderr); /* 37.2: Number of arguments in macro call: at least 31. */ assert( glue31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R , S, T, U, V, W, X, Y, Z, a, b, c, d, e) == 31); /* 37.3: Significant initial characters in an internal identifier or a macro name: at least 31. */ assert( ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ == 30); /* 37.4: Nested conditional inclusion: at least 8 levels. */ nest = 0; #ifdef A #else # ifdef B # else # ifdef C # else # ifdef D # else # ifdef E # else # ifdef F # else # ifdef G # else # ifdef H # else nest = 8; # endif # endif # endif # endif # endif # endif # endif #endif assert( nest == 8); /* 37.5: Nested source file inclusion: at least 8 levels. */ nest = 0; #include "nest1.h" assert( nest == 8); /* 37.6: Parenthesized expression: at least 32 levels. */ #if 0 + (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 + 0)))))))))) \ )))))))))))))))))))))) == 0 nest = 32; #endif assert( nest == 32); /* 37.7: Characters in a string (after concatenation): at least 509. */ { char * extremely_long_string1 = "123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 012345678901234567" ; assert( strlen( extremely_long_string1) == 507); } /* 37.8: Characters in a logical source line: at least 509. */ { int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int A123456789012345678901234567890 = 123456; \ int B123456789012345678901234567890 = 123457; \ int C123456789012345678901234567890 = 123458; \ int D1234567890123456789012 = 123459; assert( a123456789012345678901234567890 == 123450 && D1234567890123456789012 == 123459); } /* 37.9: Macro definitions: at least 1024. */ #include "m1024.h" assert( ZX); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_34_gb.c0000644000175000017500000000105610216765467012177 00000000000000/* m_34_gb.c: Multi-byte character constant encoded in GB-2312. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "gb2312") /* For MCPP */ #pragma setlocale( "chinese-simplified") /* For Visual C */ #if '' == '\xd7\xd6' ptr = "Multi-byte character is encoded in GB-2312."; #else ptr = "I cannot understand GB-2312."; #endif assert( strcmp( ptr, "I cannot understand GB-2312.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/u_1_7_eucjp.c0000644000175000017500000000045710216765467013071 00000000000000/* u_1_7_eucjp.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma __setlocale( "eucjp") /* For MCPP */ main( void) { char * cp = str( ""); /* 0xb1a0 */ return 0; } mcpp-2.7.2/test-c/u_1_7_utf8.c0000644000175000017500000000077010760727216012641 00000000000000/* u_1_7_utf8.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma __setlocale( "utf8") /* For MCPP */ main( void) { char * cp = str( "字"); /* 0xe5ad97 : legal */ char * ecp1 = str( ""); /* 0xc0af : overlong */ char * ecp2 = str( ""); /* 0xe09fbf : overlong */ char * ecp3 = str( ""); /* 0xeda080 : UTF-16 surrogate */ return 0; } mcpp-2.7.2/test-c/u_2.c0000644000175000017500000000040210216765467011444 00000000000000/* u_2.c: Undefined behaviors on undefined constant expression. */ /* u.2.1: Undefined escape sequence. */ #if '\x' #endif /* u.2.2: Illegal bit shift count. */ #if 1 << -1 #endif #if 1 << 64 #endif main( void) { return 0; } mcpp-2.7.2/test-c/m_34_jis.c0000644000175000017500000000121710216765467012373 00000000000000/* m_34_jis.c: Multi-byte character constant encoded in ISO-2022-JP. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "jis") /* For MCPP */ #pragma setlocale( "jis") /* For MCPP on VC */ #if '$B;z(B' == '\x3b\x7a' /* This line doesn't work unless "shift states" are processed. */ ptr = "Multi-byte character is encoded in ISO-2022-JP."; #else ptr = "I cannot understand ISO-2022-JP."; #endif assert( strcmp( ptr, "I cannot understand ISO-2022-JP.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/nest9.h0000644000175000017500000000004210216765467012026 00000000000000/* nest9.h */ #include "nest10.h" mcpp-2.7.2/test-c/n_10.c0000644000175000017500000000142510216765467011522 00000000000000/* n_10.c: #if, #elif, #else and #endif pp-directive. */ #include "defs.h" #define MACRO_0 0 #define MACRO_1 1 main( void) { fputs( "started\n", stderr); /* 10.1: */ /* Note: an undefined identifier in #if expression is replaced to 0. */ #if a assert( a); #elif MACRO_0 assert( MACRO_0); #elif MACRO_1 /* Valid block */ assert( MACRO_1); #else assert( 0); #endif /* 10.2: Comments must be processed even if in skipped #if block. */ /* At least tokenization of string literal and character constant is necessary to process comments, e.g. /* is not a comment mark in string literal. */ #ifdef UNDEFINED /* Comment */ "in literal /* is not a comment" #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/unbal5.h0000644000175000017500000000006710216765467012161 00000000000000/* unbal5.h */ int unbal5; /* unterminated comment mcpp-2.7.2/test-c/nest8.h0000644000175000017500000000011610216765467012027 00000000000000/* nest8.h */ #ifndef X0F nest = 8; #else #include "nest9.h" #endif mcpp-2.7.2/test-c/u_1_8.c0000644000175000017500000000103410216765467011674 00000000000000/* u_1_8.c: Undefined behaviors on unterminated quotations. */ /* u.1.8: Unterminated character constant. */ /* The following "comment" may not interpreted as a comment but swallowed by the unterminated character constant. */ #error I can't understand. /* Token error prior to execution of #error. */ main( void) { /* u.1.9: Unterminated string literal. */ char * string = "String literal across the lines. " ; return 0; } /* u.1.10: Unterminated header-name. */ #include main( void) { fputs( "started\n", stderr); /* 12.1: */ #if LONG_MAX <= LONG_MIN fputs( "Bad evaluation of long.\n", stderr); exit( 1); #endif #if LONG_MAX <= 1073741823 /* 0x3FFFFFFF */ fputs( "Bad evaluation of long.\n", stderr); exit( 1); #endif /* 12.2: */ #if ULONG_MAX / 2 < LONG_MAX fputs( "Bad evaluation of unsigned long.\n", stderr); exit( 1); #endif /* 12.3: Octal number. */ #if 0177777 != 65535 fputs( "Bad evaluation of octal number.\n", stderr); exit( 1); #endif /* 12.4: Hexadecimal number. */ #if 0Xffff != 65535 || 0xFfFf != 65535 fputs( "Bad evaluation of hexadecimal number.\n", stderr); exit( 1); #endif /* 12.5: Suffix 'L' or 'l'. */ #if 0L != 0 || 0l != 0 fputs( "Bad evaluation of 'L' suffix.\n", stderr); exit( 1); #endif /* 12.6: Suffix 'U' or 'u'. */ #if 1U != 1 || 1u != 1 fputs( "Bad evaluation of 'U' suffix.\n", stderr); exit( 1); #endif /* 12.7: Negative integer. */ #if 0 <= -1 fputs( "Bad evaluation of negative number.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_30.c0000644000175000017500000000131210216765467011517 00000000000000/* n_30.c: Macro calls. */ /* Note: Comma separate the arguments of function-like macro call, but comma between matching inner parenthesis doesn't. This feature is tested on so many places in this suite especially on *.c samples which use assert() macro, that no separete item to test this feature is provided. */ #include "defs.h" #define FUNC( a, b, c) a + b + c main( void) { int a = 1, b = 2, c = 3; fputs( "started\n", stderr); /* 30.1: A macro call crossing lines. */ assert ( FUNC ( a, b, c ) == 6 ); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/nest14.h0000644000175000017500000000004310216765467012103 00000000000000/* nest14.h */ #include "nest15.h" mcpp-2.7.2/test-c/n_15.c0000644000175000017500000000074410216765467011532 00000000000000/* n_15.c: #ifdef, #ifndef directives. */ #include "defs.h" #define MACRO_0 0 #define MACRO_1 1 main( void) { fputs( "started\n", stderr); /* 15.1: #ifdef directive. */ #ifdef MACRO_1 /* Valid block */ assert( MACRO_1); #else assert( MACRO_0); #endif /* 15.2: #ifndef directive. */ #ifndef MACRO_1 assert( MACRO_0); #else /* Valid block */ assert( MACRO_1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_std.c0000644000175000017500000005771210216765467012106 00000000000000/* * n_std.c * * 1998/08 made public kmatsui * 2002/08 revised not to conflict with C99 Standard kmatsui * 2004/10 added a few testcases for macro expansion kmatsui * * Samples to test Standard C preprocessing. * This is a strictly-comforming program. * Any Standard-comforming translator must translate successfully this * program. The generated execution program must be executed with the message * on stdout and no other messages on stderr. * A translator must process also #error directive properly, which is not * included here because the directive might cause translator to terminate. */ #include "defs.h" #define ZERO_TOKEN #define TWO_ARGS a,b #define MACRO_0 0 #define MACRO_1 1 #define sub( x, y) (x - y) #define str( a) # a #define xstr( a) str( a) #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) void n_1( void); void n_2( void); void n_3( void); void n_4( void); void n_5( void); void n_6( void); void n_7( void); void n_9( void); void n_10( void); void n_11( void); void n_12( void); void n_13( void); void n_13_5( void); void n_13_7( void); void n_13_8( void); void n_13_13( void); void n_15( void); void n_18( void); void n_19( void); void n_20( void); void n_21( void); void n_22( void); void n_23( void); void n_24( void); void n_25( void); void n_26( void); void n_27( void); void n_28( void); void n_29( void); void n_30( void); void n_32( void); void n_37( void); int main( void) { n_1(); n_2(); n_3(); n_4(); n_5(); n_6(); n_7(); n_9(); n_10(); n_11(); n_12(); n_13(); n_13_5(); n_13_7(); n_13_8(); n_13_13(); n_15(); n_18(); n_19(); n_20(); n_21(); n_22(); n_23(); n_24(); n_25(); n_26(); n_27(); n_28(); n_29(); n_30(); n_32(); n_37(); puts( ""); return 0; } char quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ' , '?', '?', '%', ' ', '?', '?', '^', ' ', '?', '#', '\0' }; void n_1( void) /* Conversion of trigraph sequences. */ { int ab = 1, cd = 2; /* 1.1: The following 9 sequences are valid trigraph sequences. */ assert( strcmp( "??( ??) ??/??/ ??' ??< ??> ??! ??- ??=" ,"[ ] \\ ^ { } | ~ #") == 0); /* 1.2: In directive line. */ ??= define OR( a, b) a ??! b assert( OR( ab, cd) == 3); /* 1.3: Any sequence other than above 9 is not a trigraph sequence. */ assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0); } void n_2( void) /* Line splicing by sequence. */ { int ab = 1, cd = 2, ef = 3, abcde = 5; /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ #define FUNC( a, b, c) \ a + b + c assert( FUNC( ab, cd, ef) == 6); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c assert (FUNC( ab, cd, ef) == 6); /* 2.3: In a string literal. */ assert (strcmp( "abc\ de", "abcde") == 0); /* 2.4: in midst of an identifier. */ assert( abc\ de == 5); /* 2.5: by trigraph. */ assert( abc??/ de == 5); } void n_3( void) /* Handling of comment. */ { int abcd = 4; /* 3.1: A comment is converted to one space. */ assert( strcmp( str( abc/* comment */de), "abc de") == 0); /* 3.2: // is not a comment of C. */ /* assert( strcmp( str( //), "//") == 0); */ /* 3.3: Comment is parsed prior to the parsing of preprocessing directive. */ #if 0 "nonsence"; /* #else still in comment */ #else #define MACRO_abcd /* in comment */ abcd #endif assert( MACRO_abcd == 4); } void n_4( void) /* Special tokens. */ { /* 4.1: Digraph spellings in directive line. */ %: define stringize( a) %: a assert( strcmp( stringize( abc), "abc") == 0); /* 4.2: Digraph spellings are retained in stringization. */ assert( strcmp( stringize( <:), "<" ":") == 0); } void n_5( void) /* Spaces or tabs are allowed at any place in pp-directive line, including between the top of a pp-directive line and '#', and between the '#' and the directive. */ { int abcde = 5; /* |**|[TAB]# |**|[TAB]define |**| MACRO_abcde[TAB]|**| abcde |**| */ /**/ # /**/ define /**/ MACRO_abcde /**/ abcde /**/ assert( MACRO_abcde == 5); } /* 6.1: Header-name quoted by " and " as well as by < and > can include standard headers. */ /* Note: Standard headers can be included any times. */ #include "ctype.h" #include void n_6( void) /* #include directive. */ { int abc = 3; assert( isalpha( 'a')); /* 6.2: Macro is allowed in #include line. */ #define HEADER "header.h" #include HEADER assert( MACRO_abc == 3); /* 6.3: With macro nonsence but legal. */ #undef MACRO_abc #include ZERO_TOKEN HEADER ZERO_TOKEN assert( MACRO_abc == 3); } void n_7( void) /* #line directive. */ { /* 7.1: Line number and filename. */ #line 1234 "cpp" assert( __LINE__ == 1234); assert( strcmp( __FILE__, "cpp") == 0); /* 7.2: Filename argument is optional. */ #line 2345 assert( __LINE__ == 2345); assert( strcmp( __FILE__, "cpp") == 0); /* 7.3: Argument with macro. */ #define LINE_AND_FILENAME 1234 "n_7.c" #line LINE_AND_FILENAME assert( __LINE__ == 1234); assert( strcmp( __FILE__, "n_7.c") == 0); } /* Restore to correct line number and filename. */ #line 248 "n_std.c" void n_9( void) /* #pragma directive. */ { /* 9.1: Any #pragma directive should be processed or ignored, should not be diagnosed as an error. */ #pragma once #pragma who knows ? } void n_10( void) /* #if, #elif, #else and #endif pp-directive. */ { /* 10.1: */ /* Note: an undefined identifier in #if expression is replaced to 0. */ #if a assert( a); #elif MACRO_0 assert( MACRO_0); #elif MACRO_1 /* Valid block */ assert( MACRO_1); #else assert( 0); #endif /* 10.2: Comments must be processed even if in skipped #if block. */ /* At least tokenization of string literal and character constant is necessary to process comments, e.g. /* is not a comment mark in string literal. */ #ifdef UNDEFINED /* Comment */ "in literal /* is not a comment" #endif } void n_11( void) /* Operator "defined" in #if or #elif directive. */ { int abc = 1, a = 0; /* 11.1: */ #undef MACRO_abc #define MACRO_abc abc #if defined a assert( a); #else assert( MACRO_abc); #endif #if defined (MACRO_abc) assert( MACRO_abc); #else assert( a); #endif /* 11.2: "defined" is an unary operator whose result is 1 or 0. */ #if defined MACRO_0 * 3 != 3 fputs( "Bad handling of defined operator.\n", stderr); #endif #if (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1) fputs( "Bad grouping of defined, -, ! in #if expression.\n", stderr); #endif } #include void n_12( void) /* Integer preprocessing number token and type of #if expression. */ { /* 12.1: */ #if LONG_MAX <= LONG_MIN fputs( "Bad evaluation of long.\n", stderr); #endif #if LONG_MAX <= 1073741823 /* 0x3FFFFFFF */ fputs( "Bad evaluation of long.\n", stderr); #endif /* 12.2: */ #if ULONG_MAX / 2 < LONG_MAX fputs( "Bad evaluation of unsigned long.\n", stderr); #endif /* 12.3: Octal number. */ #if 0177777 != 65535 fputs( "Bad evaluation of octal number.\n", stderr); #endif /* 12.4: Hexadecimal number. */ #if 0Xffff != 65535 || 0XFfFf != 65535 fputs( "Bad evaluation of hexadecimal number.\n", stderr); #endif /* 12.5: Suffix 'L' or 'l'. */ #if 0L != 0 || 0l != 0 fputs( "Bad evaluation of 'L' suffix.\n", stderr); #endif /* 12.6: Suffix 'U' or 'u'. */ #if 1U != 1 || 1u != 1 fputs( "Bad evaluation of 'U' suffix.\n", stderr); #endif /* 12.7: Negative integer. */ #if 0 <= -1 fputs( "Bad evaluation of negative number.\n", stderr); #endif } void n_13( void) /* evaluation of #if expressions. */ /* Valid operators are (precedence in this order) : defined, (unary)+, (unary)-, ~, !, *, /, %, +, -, <<, >>, <, >, <=, >=, ==, !=, &, ^, |, &&, ||, ? : */ { /* 13.1: Bit shift. */ #if 1 << 2 != 4 || 8 >> 1 != 4 fputs( "Bad arithmetic of <<, >> operators.\n", stderr); #endif /* 13.2: Bitwise operators. */ #if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 fputs( "Bad arithmetic of ^, |, & operators.\n", stderr); #endif /* 13.3: Result of ||, && operators is either of 1 or 0. */ #if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 fputs( "Bad arithmetic of ||, && operators.\n", stderr); #endif /* 13.4: ?, : operator. */ #if (0 ? 1 : 2) != 2 fputs( "Bad arithmetic of ?: operator.\n", stderr); #endif } void n_13_5( void) /* Arithmetic conversion in #if expressions. */ { /* 13.5: The usual arithmetic conversion is not performed on bit shift. */ #if -1 << 3U > 0 fputs( "Bad conversion of bit shift operands.\n", stderr); #endif /* 13.6: Usual arithmetic conversions. */ #if -1 <= 0U /* -1 is converted to unsigned long. */ fputs( "Bad arithmetic conversion.\n", stderr); #endif #if -1 * 1U <= 0 fputs( "Bad arithmetic conversion.\n", stderr); #endif /* Second and third operands of conditional operator are converted to the same type, thus -1 is converted to unsigned long. */ #if (1 ? -1 : 0U) <= 0 fputs( "Bad arithmetic conversion.\n", stderr); #endif } void n_13_7( void) /* Short-circuit evaluation of #if expression. */ { /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error cannot occur. */ #if 0 && 10 / 0 #endif #if not_defined && 10 / not_defined #endif #if MACRO_0 && 10 / MACRO_0 > 1 #endif #if MACRO_0 ? 10 / MACRO_0 : 0 #endif #if MACRO_0 == 0 || 10 / MACRO_0 > 1 /* Valid block */ #else #endif } void n_13_8( void) /* Grouping of sub-expressions in #if expression. */ { /* 13.8: Unary operators are grouped from right to left. */ #if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) fputs( "Bad grouping of -, +, !, ~ in #if expression.\n", stderr); #endif /* 13.9: ?: operators are grouped from right to left. */ #if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 fputs( "Bad grouping of ? : in #if expression.\n", stderr); #endif /* 13.10: Other operators are grouped from left to right. */ #if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) fputs( "Bad grouping of >>, << in #if expression.\n", stderr); #endif /* 13.11: Test of precedence. */ #if 3*10/2 >> !0*2 >> !+!-9 != 1 fputs( "Bad grouping of -, +, !, *, /, >> in #if expression.\n", stderr); #endif /* 13.12: Overall test. Grouped as: ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) ? 7 : 0) != 7 evaluated to FALSE. */ #if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 fputs( "Bad arithmetic of #if expression.\n", stderr); #endif } void n_13_13( void) /* #if expression with macros. */ { #define and && #define or || #define not_eq != #define bitor | /* 13.13: With macros expanding to operators. */ #if (1 bitor 2) == 3 and 4 not_eq 5 or 0 /* #if (1 | 2) == 3 && 4 != 5 || 0 */ #else fputs( "Bad evaluation of macros expanding to operators in #if expression.\n" , stderr); #endif /* 13.14: With macros expanding to 0 token, nonsence but legal. */ #if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN /* #if 1 > 0 */ #else fputs( "Bad evaluation of macros expanding to 0 token in #if expression.\n" , stderr); #endif } void n_15( void) /* #ifdef, #ifndef directives. */ { /* 15.1: #ifdef directive. */ #ifdef MACRO_1 /* Valid block */ assert( MACRO_1); #else assert( MACRO_0); #endif /* 15.2: #ifndef directive. */ #ifndef MACRO_1 assert( MACRO_0); #else /* Valid block */ assert( MACRO_1); #endif } void n_18( void) /* #define directive. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) { int c = 3; /* 18.1: Definition of an object-like macro. */ assert( OBJ_LIKE == 0); #ifndef ZERO_TOKEN fputs( "Can't define macro to 0-token.\n", stderr); #endif /* 18.2: Definition of a function-like macro. */ assert( FTN_LIKE( c) == 3); /* 18.3: Spelling in string identical to parameter is not a parameter. */ #define STR( n1, n2) "n1:n2" assert( strcmp( STR( 1, 2), "n1:n2") == 0); } void n_19( void) /* Valid re-definitions of macros. */ { int c = 1; /* 19.1: */ #define OBJ_LIKE /* white space */ (1-1) /* other */ /* 19.2: */ #define FTN_LIKE( a )( /* note the white space */ \ a /* other stuff on this line */ ) assert( FTN_LIKE( c) == 1); } void n_20( void) /* Macro lexically identical to keyword. */ { /* 20.1: */ #define float double float fl; assert( sizeof fl == sizeof (double)); } void n_21( void) /* Tokenization (No preprocessing tokens are merged implicitly). */ { int a = 1, x = 2, y = -3; /* 21.1: */ #define MINUS - assert( -MINUS-a == -1); /* 21.2: */ #undef sub #define sub( a, b) a-b /* '(a)-(b)' is better */ #define Y -y /* '(-y)' is better */ /* x- -y */ assert( sub( x, Y) == -1); } void n_22( void) /* Tokenization of preprocessing number. */ { #define EXP 1 /* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */ assert( strcmp( xstr( 12E+EXP), "12E+EXP") == 0); /* 22.2: .2e-EXP is also a preprocessing number. */ assert( strcmp( xstr( .2e-EXP), ".2e-EXP") == 0); /* 22.3: + or - is allowed only following E or e, 12+EXP is not a preprocessing number. */ assert( strcmp( xstr( 12+EXP), "12+1") == 0); } void n_23( void) /* ## operator in macro definition. */ { int xy = 1; /* 23.1: */ assert( glue( x, y) == 1); /* 23.2: Generate a preprocessing number. */ #undef EXP #define EXP 2 assert( xglue( .12e+, EXP) == 12.0); } void n_24( void) /* # operator in macro definition. */ { /* 24.1: */ assert( strcmp( str( a+b), "a+b") == 0); /* 24.2: White spaces between tokens of operand are converted to one space. */ assert( strcmp( str( ab /* comment */ + cd ), "ab + cd") == 0); /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ assert( strcmp( str( '"' + "' \""), "'\"' + \"' \\\"\"") == 0); /* 24.4: Line splicing by is done prior to token parsing. */ assert( strcmp( str( "ab\ c"), "\"abc\"") == 0); /* 24.5: Token separator inserted by macro expansion should be removed. (Meanwhile, tokens should not be merged. See 21.2.) */ #define f(a) a assert( strcmp( xstr( x-f(y)), "x-y") == 0); } void n_25( void) /* Macro arguments are pre-expanded (unless the argument is an operand of # or ## operator) separately, that is, are macro-replaced completely prior to rescanning. */ { int a = 1, b = 2, abc = 3, MACRO_0MACRO_1 = 2; #undef sub #define sub( x, y) (x - y) /* 25.1: "TWO_ARGS" is read as one argument to "sub", then expanded to "a,b", then "x" is substituted by "a,b". */ assert( sub( TWO_ARGS, 1) == 1); /* 25.2: An argument pre-expanded to 0-token. */ assert( sub( ZERO_TOKEN, a) == -1); /* 25.3: "glue( a, b)" is pre-expanded. */ assert( xglue( glue( a, b), c) == 3); /* 25.4: Operands of ## operator are not pre-expanded. */ assert( glue( MACRO_0, MACRO_1) == 2); /* 25.5: Operand of # operator is not pre-expanded. */ assert( strcmp( str( ZERO_TOKEN), "ZERO_TOKEN") == 0); } #undef f #ifdef void int f( a) int a; { return a; } int g( a) int a; { return a * 2; } #else int f( int a) { return a; } int g( int a) { return a * 2; } #endif void n_26( void) /* The name once replaced is not furthur replaced. */ { int x = 1; int AB = 1; int Z[1]; Z[0] = 1; /* 26.1: Directly recursive macro definition. */ /* Z[0]; */ #define Z Z[0] assert( Z == 1); /* 26.2: Intermediately recursive macro definition. */ /* AB; */ #define AB BA #define BA AB assert( AB == 1); /* 26.3: Directly recursive function-like macro definition. */ /* x + f(x); */ #define f(a) a + f(a) assert( f( x) == 2); /* 26.4: Intermediately recursive function-like macro definition. */ /* x + x + g( x); */ #define g(a) a + h( a) #define h(a) a + g( a) assert( g( x) == 4); /* 26.5: Rescanning encounters the non-replaced macro name. */ /* Z[0] + f( Z[0]); */ assert( f( Z) == 2); } void n_27( void) /* Rescanning of a macro raplace any macro call in the replacement text after substitution of parameters by pre-expanded-arguments. This re-examination may involve the succeding sequences from the source file (what a queer thing!). */ { int a = 1, b = 2, c, m = 1, n = 2; /* 27.1: Cascaded use of object-like macros. */ #define NEST8 NEST7 + 8 #define NEST7 NEST6 + 7 #define NEST6 NEST5 + 6 #define NEST5 NEST4 + 5 #define NEST4 NEST3 + 4 #define NEST3 NEST2 + 3 #define NEST2 NEST1 + 2 #define NEST1 1 assert( NEST8 == 36); /* 27.2: Cascaded use of function-like macros. */ #define FUNC4( a, b) FUNC3( a, b) + NEST4 #define FUNC3( a, b) FUNC2( a, b) + NEST3 #define FUNC2( a, b) FUNC1( a, b) + NEST2 #define FUNC1( a, b) (a) + (b) assert( FUNC4( NEST1, NEST2) == 23); /* 27.3: An identifier generated by ## operator is subject to expansion. */ assert( glue( MACRO_, 1) == 1); #define head sub( #define math( op, a, b) op( (a), (b)) /* 27.4: 'sub' as an argument of math() is not pre-expanded, since '(' is missing. */ assert( math( sub, a, b) == -1); /* 27.5: Queer thing. */ c = head a,b ); assert( c == -1); /* 27.6: Recursive macro (the 2nd 'm' is expanded to 'n' since it is in source file). */ #define m n #define n( a) a assert( m( m) == 2); } void n_28( void) /* __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and __STDC_VERSION are predefined. */ { char * date = __DATE__; /* 28.1: */ assert( strcmp( __FILE__, "n_std.c") == 0); /* 28.2: */ assert( __LINE__ == 779); /* 28.3: */ assert( strlen( __DATE__) == 11); assert( date[ 4] != '0'); /* 28.4: */ assert( strlen( __TIME__) == 8); /* 28.5: */ assert( __STDC__); /* 28.6: */ assert( __STDC_VERSION__ >= 199409L); /* 28.7: */ #include "line.h" } void n_29( void) /* #undef directive. */ { int DEFINED = 1; /* 29.1: Undefined macro is not a macro. */ #define DEFINED #undef DEFINED assert( DEFINED == 1); /* 29.2: Undefining undefined name is not an error. */ #undef UNDEFINED } void n_30( void) /* Macro calls. */ /* Note: Comma separate the arguments of function-like macro call, but comma between matching inner parenthesis doesn't. This feature is tested on so many places in this suite especially on *.c samples which use assert() macro, that no separete item to test this feature is provided. */ { #undef FUNC #define FUNC( a, b, c) a + b + c int a = 1, b = 2, c = 3; /* 30.1: A macro may cross lines. */ assert ( FUNC ( a, b, c ) == 6 ); } void n_32( void) /* Escape sequence in character constant in #if expression. */ { /* 32.1: Character octal escape sequence. */ #if '\123' != 83 fputs( "Bad evaluation of octal escape sequence.\n", stderr); #endif /* 32.2: Character hexadecimal escape sequence. */ #if '\x1b' != '\033' fputs( "Bad evaluation of hexadecimal escape sequence.\n", stderr); #endif } void n_37( void) /* Translation limits. */ { #define MACRO_8 8 /* 37.1: Number of parameters in macro: at least 31. */ #define glue31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E int ABCDEFGHIJKLMNOPQRSTUVWXYZabcde = 31; int ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ = 30; int nest = 0; /* 37.2: Number of arguments in macro call: at least 31. */ assert( glue31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R , S, T, U, V, W, X, Y, Z, a, b, c, d, e) == 31); /* 37.3: Significant initial characters in an internal identifier or a macro name: at least 31. */ assert( ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ == 30); /* 37.4: Nested conditional inclusion: at least 8 levels. */ nest = 0; #ifdef A #else # ifdef B # else # ifdef C # else # ifdef D # else # ifdef E # else # ifdef F # else # ifdef G # else # ifdef H # else nest = 8; # endif # endif # endif # endif # endif # endif # endif #endif assert( nest == 8); /* 37.5: Nested source file inclusion: at least 8 levels. */ nest = 0; #include "nest1.h" assert( nest == 8); /* 37.6: Parenthesized expression: at least 32 levels. */ #if 0 + (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 + 0)))))))))) \ )))))))))))))))))))))) == 0 nest = 32; #endif assert( nest == 32); /* 37.7: Characters in a string (after concatenation): at least 509. */ { char * extremely_long_string = "123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 012345678901234567" ; assert( strlen( extremely_long_string) == 507); } /* 37.8: Characters in a logical source line: at least 509. */ { int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int A123456789012345678901234567890 = 123456; \ int B123456789012345678901234567890 = 123457; \ int C123456789012345678901234567890 = 123458; \ int D1234567890123456789012 = 123459; assert( a123456789012345678901234567890 == 123450 && D1234567890123456789012 == 123459); } /* 37.9: Macro definitions: at least 1024. */ #undef AB #undef BA #undef OR #include "m1024.h" assert( ZX); } mcpp-2.7.2/test-c/defs.h0000644000175000017500000000122310505265067011677 00000000000000/* defs.h */ #include /* assert(): Enable one of these three. */ /* Note: This source doesn't use #elif directive to test preprocessor which can't recognize the directive. */ #if 1 /* For the translator which can process properly. */ #include #else #if 0 /* Not to abort on error. */ #define assert( exp) (exp) ? (void)0 : (void) fprintf( stderr, \ "Assertion failed: %s, from line %d of file %s\n", \ # exp, __LINE__, __FILE__) #endif #endif extern int strcmp( const char *, const char *); extern size_t strlen( const char *); extern void exit( int); mcpp-2.7.2/test-c/e_25_6.c0000644000175000017500000000076410216765467011751 00000000000000/* e_25_6.c: Macro arguments are pre-expanded separately. */ /* 25.6: */ #define sub( x, y) (x - y) #define head sub( #define body(x,y) x,y #define tail ) #define head_body_tail( a, b, c) a b c /* "head" is once expanded to "sub(", then rescanning of "sub(" causes an uncompleted macro call. Expansion of an argument should complete within the argument. */ head_body_tail( head, body(a,b), tail); main( void) { return 0; } mcpp-2.7.2/test-c/u_1_22.c0000644000175000017500000000136310516603227011741 00000000000000/* u_1_22.c: Undefined behaviors on generating invalid pp-token by ## operator. */ #include #define str( a) # a main( void) { /* u.1.22: Result of ## operator is not a valid pp-token. */ #define NUM( dig, exp) dig ## E+ ## exp /* * "E+" is a sequence of two pp-tokens "E" and "+", not a single pp-token. * The first ## concatenates the last pp-token of first argument with "E", * and the second ## concatenates "+" with the first pp-token of the second * argument. * While "12E" (one of the sequence generated by the token concatenation) * is a valid pp-token, "+34" (the another sequence) is not a valid pp-token * and causes an undefined behavior. */ printf( "%e\n", NUM( 12, 34)); return 0; } mcpp-2.7.2/test-c/n_9.c0000644000175000017500000000045710216765467011456 00000000000000/* n_9.c: #pragma directive. */ #include "stdio.h" /* 9.1: Any #pragma directive should be processed or ignored, should not be diagnosed as an error. */ #pragma once #pragma who knows ? main( void) { fputs( "started\n", stderr); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/u_1_27.c0000644000175000017500000000032410216765467011756 00000000000000/* u_1_27.c: Pseudo-directive-line. */ /* u.1.27: Unknown preprocessing directive (other than #pragma). */ #ifdefined MACRO #endif /* The second error. */ main( void) { return 0; } mcpp-2.7.2/test-c/unbal3.h0000644000175000017500000000003210216765467012147 00000000000000/* unbal3.h */ int unbal3;mcpp-2.7.2/test-c/e_17.c0000644000175000017500000000120010216765467011507 00000000000000/* e_17.c: Ill-formed group in a source file. */ #define MACRO_1 1 /* 17.1: Error of #endif without #if. */ #endif /* 17.2: Error of #else without #if. */ #else /* 17.3: Error of #else after #else. */ #if MACRO_1 #else #else #endif /* 17.4: Error of #elif after #else. */ #if MACRO_1 == 1 #else #elif MACRO_1 == 0 #endif /* 17.5: Error of #endif without #if in an included file. */ #if 1 #include "unbal1.h" /* 17.6: Error of unterminated #if section in an included file. */ #include "unbal2.h" #endif /* 17.7: Error of unterminated #if section. */ #if MACRO_1 == 0 #else mcpp-2.7.2/test-c/nest1.h0000644000175000017500000000006510216765467012023 00000000000000/* nest1.h */ nest = 1; #include "nest2.h" mcpp-2.7.2/test-c/n_i_.lst0000644000175000017500000000026410371567315012243 00000000000000n_1 n_2 n_3 n_4 n_5 n_6 n_7 n_9 n_10 n_11 n_12 n_13 n_13_5 n_13_7 n_13_8 n_13_13 n_15 n_18 n_19 n_20 n_21 n_22 n_23 n_24 n_25 n_26 n_27 n_28 n_29 n_30 n_32 n_37 i_32_3 i_35 i_35_3 mcpp-2.7.2/test-c/unbal1.h0000644000175000017500000000002610216765467012150 00000000000000/* unbal1.h */ #endif mcpp-2.7.2/test-c/u_1_7_jis.c0000644000175000017500000000046110216765467012543 00000000000000/* u_1_7_jis.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma __setlocale( "jis") /* For MCPP */ main( void) { char * cp = str( "$B1 (B"); /* 0x3120 */ return 0; } mcpp-2.7.2/test-c/n_20.c0000644000175000017500000000042310216765467011520 00000000000000/* n_20.c: Macro lexically identical to keyword. */ #include "defs.h" main( void) { /* 20.1: */ #define float double float fl; fputs( "started\n", stderr); assert( sizeof fl == sizeof (double)); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_14_7.c0000644000175000017500000000057510216765467011750 00000000000000/* e_14_7.c: There is no keyword in #if expression. */ /* 14.7: sizeof operator is disallowed. */ /* Evaluated as: 0 (0) Constant expression syntax error. */ #if sizeof (int) #endif /* 14.8: type cast is disallowed. */ /* Evaluated as: (0)0x8000 Also a constant expression error. */ #if (int)0x8000 < 0 #endif main( void) { return 0; } mcpp-2.7.2/test-c/u_1_1.c0000644000175000017500000000074710216765467011677 00000000000000/* u_1_1.c: Undefined behaviors on unterminated line, comment or macro. */ main( void) { /* u.1.1: End of a source file without . */ #include "unbal3.h" int e_1; /* u.1.2: End of a source file with . */ #include "unbal4.h" ; /* u.1.3: End of a source file with an unterminated comment. */ #include "unbal5.h" */ /* u.1.4: End of a source file with an uncompleted macro call. */ #include "unbal6.h" y); return 0; } mcpp-2.7.2/test-c/m_36_sjis.c0000644000175000017500000000135610452237407012552 00000000000000/* m_36_sjis.c: Handling of '\\' in shift-JIS multi-byte character. */ #include "defs.h" #define str( a) # a main( void) { fputs( "started\n", stdout); /* 36.1: 0x5c in multi-byte character is not an escape character */ #pragma __setlocale( "sjis") /* For MCPP */ #pragma setlocale( "japanese") /* For Visual C */ #if '' == '\x8e\x9a' && '\' != '\x95\x5c' fputs( "Bad handling of '\\' in multi-byte character", stdout); exit( 1); #endif /* 36.2: # operater should not insert '\\' before 0x5c in multi-byte character */ assert( strcmp( str( "\"), "\"\\"") == 0); fputs( "\" "\"\\"\n", stdout); fputs( "success\n", stdout); return 0; } mcpp-2.7.2/test-c/e_15_3.c0000644000175000017500000000043210216765467011735 00000000000000/* e_15_3.c: #ifdef, #ifndef syntax errors. */ /* 15.3: Not an identifier. */ #ifdef "string" #endif #ifdef 123 #endif /* 15.4: Excessive token sequence. */ #ifdef MACRO Junk #endif /* 15.5: No argument. */ #ifndef #endif main( void) { return 0; } mcpp-2.7.2/test-c/m1024.h0000644000175000017500000002602210216765467011535 00000000000000/* m1024.h */ #define AA #define AB #define AC #define AD #define AE #define AF #define AG #define AH #define AI #define AJ #define AK #define AL #define AM #define AN #define AO #define AP #define AQ #define AR #define AS #define AT #define AU #define AV #define AW #define AX #define AY #define AZ #define Aa #define Ab #define Ac #define Ad #define Ae #define Af #define Ag #define Ah #define Ai #define Aj #define Ak #define Al #define Am #define An #define BA #define BB #define BC #define BD #define BE #define BF #define BG #define BH #define BI #define BJ #define BK #define BL #define BM #define BN #define BO #define BP #define BQ #define BR #define BS #define BT #define BU #define BV #define BW #define BX #define BY #define BZ #define Ba #define Bb #define Bc #define Bd #define Be #define Bf #define Bg #define Bh #define Bi #define Bj #define Bk #define Bl #define Bm #define Bn #define CA #define CB #define CC #define CD #define CE #define CF #define CG #define CH #define CI #define CJ #define CK #define CL #define CM #define CN #define CO #define CP #define CQ #define CR #define CS #define CT #define CU #define CV #define CW #define CX #define CY #define CZ #define Ca #define Cb #define Cc #define Cd #define Ce #define Cf #define Cg #define Ch #define Ci #define Cj #define Ck #define Cl #define Cm #define Cn #define DA #define DB #define DC #define DD #define DE #define DF #define DG #define DH #define DI #define DJ #define DK #define DL #define DM #define DN #define DO #define DP #define DQ #define DR #define DS #define DT #define DU #define DV #define DW #define DX #define DY #define DZ #define Da #define Db #define Dc #define Dd #define De #define Df #define Dg #define Dh #define Di #define Dj #define Dk #define Dl #define Dm #define Dn #define EA #define EB #define EC #define ED #define EE #define EF #define EG #define EH #define EI #define EJ #define EK #define EL #define EM #define EN #define EO #define EP #define EQ #define ER #define ES #define ET #define EU #define EV #define EW #define EX #define EY #define EZ #define Ea #define Eb #define Ec #define Ed #define Ee #define Ef #define Eg #define Eh #define Ei #define Ej #define Ek #define El #define Em #define En #define FA #define FB #define FC #define FD #define FE #define FF #define FG #define FH #define FI #define FJ #define FK #define FL #define FM #define FN #define FO #define FP #define FQ #define FR #define FS #define FT #define FU #define FV #define FW #define FX #define FY #define FZ #define Fa #define Fb #define Fc #define Fd #define Fe #define Ff #define Fg #define Fh #define Fi #define Fj #define Fk #define Fl #define Fm #define Fn #define GA #define GB #define GC #define GD #define GE #define GF #define GG #define GH #define GI #define GJ #define GK #define GL #define GM #define GN #define GO #define GP #define GQ #define GR #define GS #define GT #define GU #define GV #define GW #define GX #define GY #define GZ #define Ga #define Gb #define Gc #define Gd #define Ge #define Gf #define Gg #define Gh #define Gi #define Gj #define Gk #define Gl #define Gm #define Gn #define HA #define HB #define HC #define HD #define HE #define HF #define HG #define HH #define HI #define HJ #define HK #define HL #define HM #define HN #define HO #define HP #define HQ #define HR #define HS #define HT #define HU #define HV #define HW #define HX #define HY #define HZ #define Ha #define Hb #define Hc #define Hd #define He #define Hf #define Hg #define Hh #define Hi #define Hj #define Hk #define Hl #define Hm #define Hn #define IA #define IB #define IC #define ID #define IE #define IF #define IG #define IH #define II #define IJ #define IK #define IL #define IM #define IN #define IO #define IP #define IQ #define IR #define IS #define IT #define IU #define IV #define IW #define IX #define IY #define IZ #define Ia #define Ib #define Ic #define Id #define Ie #define If #define Ig #define Ih #define Ii #define Ij #define Ik #define Il #define Im #define In #define JA #define JB #define JC #define JD #define JE #define JF #define JG #define JH #define JI #define JJ #define JK #define JL #define JM #define JN #define JO #define JP #define JQ #define JR #define JS #define JT #define JU #define JV #define JW #define JX #define JY #define JZ #define Ja #define Jb #define Jc #define Jd #define Je #define Jf #define Jg #define Jh #define Ji #define Jj #define Jk #define Jl #define Jm #define Jn #define KA #define KB #define KC #define KD #define KE #define KF #define KG #define KH #define KI #define KJ #define KK #define KL #define KM #define KN #define KO #define KP #define KQ #define KR #define KS #define KT #define KU #define KV #define KW #define KX #define KY #define KZ #define Ka #define Kb #define Kc #define Kd #define Ke #define Kf #define Kg #define Kh #define Ki #define Kj #define Kk #define Kl #define Km #define Kn #define LA #define LB #define LC #define LD #define LE #define LF #define LG #define LH #define LI #define LJ #define LK #define LL #define LM #define LN #define LO #define LP #define LQ #define LR #define LS #define LT #define LU #define LV #define LW #define LX #define LY #define LZ #define La #define Lb #define Lc #define Ld #define Le #define Lf #define Lg #define Lh #define Li #define Lj #define Lk #define Ll #define Lm #define Ln #define MA #define MB #define MC #define MD #define ME #define MF #define MG #define MH #define MI #define MJ #define MK #define ML #define MM #define MN #define MO #define MP #define MQ #define MR #define MS #define MT #define MU #define MV #define MW #define MX #define MY #define MZ #define Ma #define Mb #define Mc #define Md #define Me #define Mf #define Mg #define Mh #define Mi #define Mj #define Mk #define Ml #define Mm #define Mn #define NA #define NB #define NC #define ND #define NE #define NF #define NG #define NH #define NI #define NJ #define NK #define NL #define NM #define NN #define NO #define NP #define NQ #define NR #define NS #define NT #define NU #define NV #define NW #define NX #define NY #define NZ #define Na #define Nb #define Nc #define Nd #define Ne #define Nf #define Ng #define Nh #define Ni #define Nj #define Nk #define Nl #define Nm #define Nn #define OA #define OB #define OC #define OD #define OE #define OF #define OG #define OH #define OI #define OJ #define OK #define OL #define OM #define ON #define OO #define OP #define OQ #define OR #define OS #define OT #define OU #define OV #define OW #define OX #define OY #define OZ #define Oa #define Ob #define Oc #define Od #define Oe #define Of #define Og #define Oh #define Oi #define Oj #define Ok #define Ol #define Om #define On #define PA #define PB #define PC #define PD #define PE #define PF #define PG #define PH #define PI #define PJ #define PK #define PL #define PM #define PN #define PO #define PP #define PQ #define PR #define PS #define PT #define PU #define PV #define PW #define PX #define PY #define PZ #define Pa #define Pb #define Pc #define Pd #define Pe #define Pf #define Pg #define Ph #define Pi #define Pj #define Pk #define Pl #define Pm #define Pn #define QA #define QB #define QC #define QD #define QE #define QF #define QG #define QH #define QI #define QJ #define QK #define QL #define QM #define QN #define QO #define QP #define QQ #define QR #define QS #define QT #define QU #define QV #define QW #define QX #define QY #define QZ #define Qa #define Qb #define Qc #define Qd #define Qe #define Qf #define Qg #define Qh #define Qi #define Qj #define Qk #define Ql #define Qm #define Qn #define RA #define RB #define RC #define RD #define RE #define RF #define RG #define RH #define RI #define RJ #define RK #define RL #define RM #define RN #define RO #define RP #define RQ #define RR #define RS #define RT #define RU #define RV #define RW #define RX #define RY #define RZ #define Ra #define Rb #define Rc #define Rd #define Re #define Rf #define Rg #define Rh #define Ri #define Rj #define Rk #define Rl #define Rm #define Rn #define SA #define SB #define SC #define SD #define SE #define SF #define SG #define SH #define SI #define SJ #define SK #define SL #define SM #define SN #define SO #define SP #define SQ #define SR #define SS #define ST #define SU #define SV #define SW #define SX #define SY #define SZ #define Sa #define Sb #define Sc #define Sd #define Se #define Sf #define Sg #define Sh #define Si #define Sj #define Sk #define Sl #define Sm #define Sn #define TA #define TB #define TC #define TD #define TE #define TF #define TG #define TH #define TI #define TJ #define TK #define TL #define TM #define TN #define TO #define TP #define TQ #define TR #define TS #define TT #define TU #define TV #define TW #define TX #define TY #define TZ #define Ta #define Tb #define Tc #define Td #define Te #define Tf #define Tg #define Th #define Ti #define Tj #define Tk #define Tl #define Tm #define Tn #define UA #define UB #define UC #define UD #define UE #define UF #define UG #define UH #define UI #define UJ #define UK #define UL #define UM #define UN #define UO #define UP #define UQ #define UR #define US #define UT #define UU #define UV #define UW #define UX #define UY #define UZ #define Ua #define Ub #define Uc #define Ud #define Ue #define Uf #define Ug #define Uh #define Ui #define Uj #define Uk #define Ul #define Um #define Un #define VA #define VB #define VC #define VD #define VE #define VF #define VG #define VH #define VI #define VJ #define VK #define VL #define VM #define VN #define VO #define VP #define VQ #define VR #define VS #define VT #define VU #define VV #define VW #define VX #define VY #define VZ #define Va #define Vb #define Vc #define Vd #define Ve #define Vf #define Vg #define Vh #define Vi #define Vj #define Vk #define Vl #define Vm #define Vn #define WA #define WB #define WC #define WD #define WE #define WF #define WG #define WH #define WI #define WJ #define WK #define WL #define WM #define WN #define WO #define WP #define WQ #define WR #define WS #define WT #define WU #define WV #define WW #define WX #define WY #define WZ #define Wa #define Wb #define Wc #define Wd #define We #define Wf #define Wg #define Wh #define Wi #define Wj #define Wk #define Wl #define Wm #define Wn #define XA #define XB #define XC #define XD #define XE #define XF #define XG #define XH #define XI #define XJ #define XK #define XL #define XM #define XN #define XO #define XP #define XQ #define XR #define XS #define XT #define XU #define XV #define XW #define XX #define XY #define XZ #define Xa #define Xb #define Xc #define Xd #define Xe #define Xf #define Xg #define Xh #define Xi #define Xj #define Xk #define Xl #define Xm #define Xn #define YA #define YB #define YC #define YD #define YE #define YF #define YG #define YH #define YI #define YJ #define YK #define YL #define YM #define YN #define YO #define YP #define YQ #define YR #define YS #define YT #define YU #define YV #define YW #define YX #define YY #define YZ #define Ya #define Yb #define Yc #define Yd #define Ye #define Yf #define Yg #define Yh #define Yi #define Yj #define Yk #define Yl #define Ym #define Yn #define ZA #define ZB #define ZC #define ZD #define ZE #define ZF #define ZG #define ZH #define ZI #define ZJ #define ZK #define ZL #define ZM #define ZN #define ZO #define ZP #define ZQ #define ZR #define ZS #define ZT #define ZU #define ZV #define ZW #define ZX 1 mcpp-2.7.2/test-c/nest7.h0000644000175000017500000000006510216765467012031 00000000000000/* nest7.h */ nest = 7; #include "nest8.h" mcpp-2.7.2/test-c/n_8.c0000644000175000017500000000052610216765467011452 00000000000000/* n_8.c: #error directive. */ /* 8.1: Argument of #error directive is not a subject of macro expansion. Output to stderr as an example: Preprocessing error directive: MACRO is not a positive number. from line 10 of file "n_8.c" */ #define MACRO 0 #if MACRO <= 0 #error MACRO is not a positive number. #endif mcpp-2.7.2/test-c/nest13.h0000644000175000017500000000004310216765467012102 00000000000000/* nest13.h */ #include "nest14.h" mcpp-2.7.2/test-c/u_1_7_ksc.c0000644000175000017500000000055210216765467012537 00000000000000/* u_1_7_ksc.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "korean") /* For Visual C */ #pragma __setlocale( "ksc5601") /* For MCPP */ main( void) { char * cp = str( ""); /* 0xb1a0 */ return 0; } mcpp-2.7.2/test-c/unbal4.h0000644000175000017500000000003310216765467012151 00000000000000/* unbal4.h */ int unbal4\ mcpp-2.7.2/test-c/nest12.h0000644000175000017500000000004310216765467012101 00000000000000/* nest12.h */ #include "nest13.h" mcpp-2.7.2/test-c/u_1_11.c0000644000175000017500000000055310216765467011753 00000000000000/* u_1_11.c: Undefined behaviors on undefined #include syntax or header- name. */ /* u.1.11: Header-name containing ', ", \ or "/*". */ /* Probably illegal filename and fails to open. */ #include "../*line.h" main( void) { /* \ is a legal path-delimiter in MS-DOS or some other OS's. */ #include "..\test-t\line.h" return 0; } mcpp-2.7.2/test-c/u_1_7_sjis.c0000644000175000017500000000055610216765467012733 00000000000000/* u_1_7_sjis.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "japanese") /* For Visual C */ #pragma __setlocale( "sjis") /* For MCPP */ main( void) { char * cp = str( "8"); /* 0x9138 */ return 0; } mcpp-2.7.2/test-c/n_3.c0000644000175000017500000000121410216765467011440 00000000000000/* n_3.c: Handling of comment. */ #include "defs.h" #define str( a) # a main( void) { int abcd = 4; fputs( "started\n", stderr); /* 3.1: A comment is converted to one space. */ assert( strcmp( str( abc/* comment */de), "abc de") == 0); /* 3.2: // is not a comment of C. */ /* assert( strcmp( str( //), "//") == 0); */ /* 3.3: Comment is parsed prior to the parsing of preprocessing directive. */ #if 0 "nonsence"; /* #else still in comment */ #else #define MACRO_abcd /* in comment */ abcd #endif assert( MACRO_abcd == 4); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/nest15.h0000644000175000017500000000006310216765467012106 00000000000000/* nest15.h */ #ifdef X0F nest = 0x0f; #endif mcpp-2.7.2/test-c/n_13_7.c0000644000175000017500000000115210216765467011750 00000000000000/* n_13_7.c: Short-circuit evaluation of #if expression. */ #include "defs.h" #define MACRO_0 0 main( void) { fputs( "started\n", stderr); /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error cannot occur. */ #if 0 && 10 / 0 exit( 1); #endif #if not_defined && 10 / not_defined exit( 1); #endif #if MACRO_0 && 10 / MACRO_0 > 1 exit( 1); #endif #if MACRO_0 ? 10 / MACRO_0 : 0 exit( 1); #endif #if MACRO_0 == 0 || 10 / MACRO_0 > 1 /* Valid block */ fputs( "success\n", stderr); return 0; #else exit( 1); #endif } mcpp-2.7.2/test-c/u_1_24.c0000644000175000017500000000241510216765467011756 00000000000000/* u_1_24.c: Undefined behaviors on empty argument of macro call. */ /* u.1.24: Empty argument of macro call. */ /* * Note: Since no argument and one empty argument cannot be distinguished * syntactically, additional dummy argument may be necessary for an * intermediate macro to process one empty argument (if possible). */ #include #define ARG( a, dummy) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s, dummy)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b main( void) { int x = 1; int y = 2; /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); or other undefined behavior. */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); or other undefined behavior. */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( CON, )", "CON"); or other undefined behavior. */ SHOWS( APPEND( CON, )); /* printf( "%s : %s\n", "APPEND( , )", ""); or other undefined behavior. */ SHOWS( APPEND( , )); return 0; } mcpp-2.7.2/test-c/e_18_4.c0000644000175000017500000000161410216765467011744 00000000000000/* e_18_4.c: #define syntax errors. */ /* 18.4: Not an identifier. */ #define "string" #define 123 /* 18.5: No argument. */ #define /* 18.6: Empty parameter list. */ #define math( op, a, ) op( (a), (b)) /* 18.7: Duplicate parameter names. */ #define math( op, a, a) op( (a), (b)) /* 18.8: Argument is not an identifier. */ #define NUMARGS( 1, +, 2) (1 + 2) /* 18.9: No space between macro name and replacement text. */ /* C90 (Corrigendum 1) forbids this if and only the replacement text begins with a non-basic-character. C99 forbids this even when the replacement text begins with basic- character. */ /* From ISO 9899:1990 / Corrigendum 1. */ #define THIS$AND$THAT(a, b) ((a) + (b)) /* Note: the following definition is legal (object-like macro). #define THIS $AND$THAT(a, b) ((a) + (b)) */ main( void) { return 0; } mcpp-2.7.2/test-c/e_12_8.c0000644000175000017500000000033110216765467011735 00000000000000/* e_12_8.c: Out of range of integer pp-token in #if expression. */ /* 12.8: Preprocessing number perhaps out of range of unsigned long. */ #if 123456789012345678901 #endif main( void) { return 0; } mcpp-2.7.2/test-c/e_14.c0000644000175000017500000000133310216765467011513 00000000000000/* e_14.c: Illegal #if expressions. */ #define A 1 #define B 1 /* 14.1: String literal is not allowed in #if expression. */ #if "string" #endif /* The second error ? */ /* 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. */ #if A = B #endif #if A++ B #endif #if A --B #endif #if A.B #endif /* 14.3: Unterminated #if expression. */ #if 0 < #endif #if ( (A == B) #endif /* 14.4: Unbalanced parenthesis in #if defined operator. */ #if defined ( MACRO #endif /* 14.5: No argument. */ #if #endif /* 14.6: Macro expanding to 0 token in #if expression. */ #define ZERO_TOKEN #if ZERO_TOKEN #endif main( void) { return 0; } mcpp-2.7.2/test-c/unspcs.c0000644000175000017500000000243310216765467012300 00000000000000/* * unspcs.c: * 1998/08 made public kmatsui * * These texts are unportable ones, because the order of the evaluation is * unspecified. Good preprocessor will warn at these texts even if the * results are valid. Good preprocessor will also document the order of * evaluation and the behavior on invalid results. * Note: Order of evaluation of sub-expressions (other than operands of &&, * ||, ? :) of #if expression is also unspecified. The order, however, never * affects the result, because #if expression never cause side effect, so no * warning is necessary. Precedence and grouping rules of operators are other * things than order of evaluation, and shall be obeyed by preprocessor. */ #include "defs.h" #define str( a) # a #define xstr( a) str( a) main( void) { /* s.1.1: Order of evaluation of #, ## operators. */ #define MAKWIDESTR( s) L ## # s /* Either of L"name"; or L# name; ("L#" is not a valid pp-token). */ assert( MAKWIDESTR( name)[ 0] == L'n'); /* s.1.2: Order of evaluation of ## operators. */ #define glue3( a, b, c) a ## b ## c /* "1.a" or undefined, since .a is not a valid pp-token, while 1. and 1.a are valid pp-tokens. */ puts( xstr( glue3( 1, ., a))); return 0; } mcpp-2.7.2/test-c/e_27_7.c0000644000175000017500000000046110216765467011746 00000000000000/* e_27_7.c: Error of rescanning. */ #define sub( x, y) (x - y) /* 27.7: */ #define TWO_TOKENS a,b #define SUB( x, y) sub( x, y) /* Too many arguments error while rescanning after once replaced to: sub( a,b, 1); */ SUB( TWO_TOKENS, 1); main( void) { return 0; } mcpp-2.7.2/test-c/m_34_utf8.c0000644000175000017500000000105410216765467012473 00000000000000/* m_34_utf8.c: Multi-byte character constant encoded in UTF-8. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "utf8") /* For MCPP */ #pragma setlocale( "utf8") /* For MCPP on VC */ #if '字' == '\xe5\xad\x97' ptr = "Multi-byte character is encoded in UTF-8."; #else ptr = "I cannot understand UTF-8."; #endif assert( strcmp( ptr, "I cannot understand UTF-8.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_8_2.c0000644000175000017500000000014710216765467011672 00000000000000/* n_8_2.c: Argument of #error is optional. */ /* 8.2: #error should be executed. */ #error mcpp-2.7.2/test-c/m_34_ksc.c0000644000175000017500000000106110216765467012363 00000000000000/* m_34_ksc.c: Multi-byte character constant encoded in KSC-5601. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "ksc5601") /* For MCPP */ #pragma setlocale( "korean") /* For Visual C */ #if '' == '\xed\xae' ptr = "Multi-byte character is encoded in KSC-5601."; #else ptr = "I cannot understand KSC-5601."; #endif assert( strcmp( ptr, "I cannot understand KSC-5601.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_33_gb.c0000644000175000017500000000137510216765467012202 00000000000000/* m_33_gb.c: Wide character constant encoded in GB-2312. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "gb2312") /* For MCPP */ #pragma setlocale( "chinese-simplified") /* For Visual C */ #if L'' == '\xd7' * BYTES_VAL + '\xd6' ptr = "Wide character is encoded in GB 2312."; #elif L'' == '\xd6' * BYTES_VAL + '\xd7' ptr = "Wide character is encoded in GB 2312." "Inverted order of evaluation."; #else ptr = "I cannot understand GB-2312."; #endif assert( strcmp( ptr, "I cannot understand GB-2312.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_16.c0000644000175000017500000000035210216765467011515 00000000000000/* e_16.c: Trailing junk of #else, #endif. */ /* 16.1: Trailing junk of #else. */ #define MACRO_0 0 #if MACRO_0 #else MACRO_0 /* 16.2: Trailing junk of #endif. */ #endif MACRO_0 main( void) { return 0; } mcpp-2.7.2/test-c/n_22.c0000644000175000017500000000120310216765467011517 00000000000000/* n_22.c: Tokenization of preprocessing number. */ #include "defs.h" #define str( a) # a #define xstr( a) str( a) #define EXP 1 main( void) { fputs( "started\n", stderr); /* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */ assert( strcmp( xstr( 12E+EXP), "12E+EXP") == 0); /* 22.2: .2e-EXP is also a preprocessing number. */ assert( strcmp( xstr( .2e-EXP), ".2e-EXP") == 0); /* 22.3: + or - is allowed only following E or e, 12+EXP is not a preprocessing number. */ assert( strcmp( xstr( 12+EXP), "12+1") == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_33_jis.c0000644000175000017500000000164710216765467012401 00000000000000/* m_33_jis.c: Wide character constant encoded in ISO-2022-JP. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "jis") /* For MCPP */ #pragma setlocale( "jis") /* For MCPP on VC */ #if L'$B;z(B' == 0x3b * BYTES_VAL + 0x7a /* This line doesn't work unless "shift states" are processed. */ ptr = "Wide character is encoded in ISO-2022-JP."; #elif L'$B;z(B' == 0x7a * BYTES_VAL + 0x3b /* This line doesn't work unless "shift states" are processed. */ ptr = "Wide character is encoded in ISO-2022-JP." "Inverted order of evaluation."; #else ptr = "I cannot understand ISO-2022-JP."; #endif assert( strcmp( ptr, "I cannot understand ISO-2022-JP.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_36_big5.c0000644000175000017500000000135710452237450012427 00000000000000/* m_36_big5.c: Handling of '\\' in BigFive multi-byte character. */ #include "defs.h" #define str( a) # a main( void) { fputs( "started\n", stdout); /* 36.1: 0x5c in multi-byte character is not an escape character */ #pragma __setlocale( "big5") /* For MCPP */ #pragma setlocale( "chinese-traditional") /* For Visual C */ #if 'r' == '\xa6\x72' && '\' != '\xa5\x5c' fputs( "Bad handling of '\\' in multi-byte character", stdout); exit( 1); #endif /* 36.2: # operater should not insert '\\' before 0x5c in multi-byte character */ assert( strcmp( str( "\Z"), "\"\Z\"") == 0); fputs( "\Z" "\"\Z\"\n", stdout); fputs( "success\n", stdout); return 0; } mcpp-2.7.2/test-c/nest5.h0000644000175000017500000000006510216765467012027 00000000000000/* nest5.h */ nest = 5; #include "nest6.h" mcpp-2.7.2/test-c/nest4.h0000644000175000017500000000006510216765467012026 00000000000000/* nest4.h */ nest = 4; #include "nest5.h" mcpp-2.7.2/test-c/e_14_9.c0000644000175000017500000000023510216765467011743 00000000000000/* e_14_9.c: Out of range in #if expression (division by 0). */ /* 14.9: Divided by 0. */ #if 1 / 0 #endif int main( void) { return 0; } mcpp-2.7.2/test-c/n_1.c0000644000175000017500000000134510216765467011443 00000000000000/* n_1.c: Conversion of trigraph sequences. */ #include "defs.h" char quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ', '?', '?', '%', ' ', '?', '?', '^', ' ', '?', '#', '\0' }; main( void) { int ab = 1, cd = 2; fputs( "started\n", stderr); /* 1.1: The following 9 sequences are valid trigraph sequences. */ assert( strcmp( "??( ??) ??/??/ ??' ??< ??> ??! ??- ??=" ,"[ ] \\ ^ { } | ~ #") == 0); /* 1.2: In directive line. */ ??= define OR( a, b) a ??! b assert( OR( ab, cd) == 3); /* 1.3: Any sequence other than above 9 is not a trigraph sequence. */ assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_31.c0000644000175000017500000000034110216765467011510 00000000000000/* e_31.c: Illegal macro calls. */ #define sub( x, y) (x - y) /* 31.1: Too many arguments error. */ sub( x, y, z); /* 31.2: Too few arguments error. */ sub( x); main( void) { return 0; } mcpp-2.7.2/test-c/n_29.c0000644000175000017500000000056010216765467011533 00000000000000/* n_29.c: #undef directive. */ #include "defs.h" main( void) { int DEFINED = 1; fputs( "started\n", stderr); /* 29.1: Undefined macro is not a macro. */ #define DEFINED #undef DEFINED assert( DEFINED == 1); /* 29.2: Undefining undefined name is not an error. */ #undef UNDEFINED fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/u_1_25.c0000644000175000017500000000107610216765467011761 00000000000000/* u_1_25.c: Undefined behaviors on undefined macro argument. */ #include #define str( a) # a #define sub( x, y) (x - y) #define SUB sub main( void) { int a = 1, b = 2; /* u.1.25: Macro argument otherwise parsed as a directive. */ /* "#define NAME"; or other undefined behaviour. */ puts( str( #define NAME )); #if 0 /* Added by C90: Corrigendum 1 (1994) and deleted by C99 */ /* u.1.26: Expanded macro replacement list end with name of function-like macro. */ SUB( a, b); #endif return 0; } mcpp-2.7.2/test-c/u_1_17.c0000644000175000017500000000122610216765467011757 00000000000000/* u_1_17.c: Undefined behaviors on out-of-range #line number. */ #include main( void) { /* u.1.17: Line number argument of #line directive should be in range of [1,32767]. */ #line 32767 /* valid here */ /* line 32767 */ /* line 32768 ? : out of range */ printf( "%d\n", __LINE__); /* 32769 ? or -32767 ?, maybe warned as an out-of-range */ #line 0 #line 32768 /* u.1.18: Line number argument of #line directive should be written in decimal digits. */ #line 0x1000 /* 23, u_1_17.c or other undefined results. */ printf( "%d, %s\n", __LINE__, __FILE__); return 0; } mcpp-2.7.2/test-c/n_6.c0000644000175000017500000000126010216765467011444 00000000000000/* n_6.c: #include directive. */ #include "defs.h" /* 6.1: Header-name quoted by " and " as well as by < and > can include standard headers. */ /* Note: Standard headers can be included any times. */ #include "ctype.h" #include main( void) { int abc = 3; fputs( "started\n", stderr); assert( isalpha( 'a')); /* 6.2: Macro is allowed in #include line. */ #define HEADER "header.h" #include HEADER assert( MACRO_abc == 3); /* 6.3: With macro nonsence but legal. */ #undef MACRO_abc #define ZERO_TOKEN #include ZERO_TOKEN HEADER ZERO_TOKEN assert( MACRO_abc == 3); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_33_ksc.c0000644000175000017500000000140510216765467012364 00000000000000/* m_33_ksc.c: Wide character constant encoded in KSC-5601. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "ksc5601") /* For MCPP */ #pragma setlocale( "korean") /* For Visual C */ #if L'' == '\xed' * BYTES_VAL + '\xae' ptr = "Wide character is encoded in KSC-5601."; #elif L'' == '\xae' * BYTES_VAL + '\xed' ptr = "Wide character is encoded in KSC-5601." "Inverted order of evaluation."; #else ptr = "I cannot understand KSC-5601."; #endif assert( strcmp( ptr, "I cannot understand KSC-5601.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/unbal6.h0000644000175000017500000000013510216765467012156 00000000000000/* unbal6.h */ #define UNBAL6( a, b) ((a) + (b)) UNBAL6 ( x , mcpp-2.7.2/test-c/n_26.c0000644000175000017500000000203110216765467011523 00000000000000/* n_26.c: The name once replaced is not furthur replaced. */ #include "defs.h" int f( a) int a; { return a; } int g( a) int a; { return a * 2; } main( void) { int x = 1; int AB = 1; int Z[1]; fputs( "started\n", stderr); Z[0] = 1; /* 26.1: Directly recursive object-like macro definition. */ /* Z[0]; */ #define Z Z[0] assert( Z == 1); /* 26.2: Intermediately recursive object-like macro definition. */ /* AB; */ #define AB BA #define BA AB assert( AB == 1); /* 26.3: Directly recursive function-like macro definition. */ /* x + f(x); */ #define f(a) a + f(a) assert( f( x) == 2); /* 26.4: Intermediately recursive function-like macro definition. */ /* x + x + g( x); */ #define g(a) a + h( a) #define h(a) a + g( a) assert( g( x) == 4); /* 26.5: Rescanning encounters the non-replaced macro name. */ /* Z[0] + f( Z[0]); */ assert( f( Z) == 2); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_33_big5.c0000644000175000017500000000140510216765467012432 00000000000000/* m_33_big5.c: Wide character constant encoded in Big-Five. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "big5") /* For MCPP */ #pragma setlocale( "chinese-traditional") /* For Visual C */ #if L'r' == '\xa6' * BYTES_VAL + '\x72' ptr = "Wide character is encoded in Big-Five."; #elif L'r' == '\x72' * BYTES_VAL + '\xa6' ptr = "Wide character is encoded in Big-Five." "Inverted order of evaluation."; #else ptr = "I cannot understand Big-Five."; #endif assert( strcmp( ptr, "I cannot understand Big-Five.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_24.c0000644000175000017500000000176310216765467011534 00000000000000/* n_24.c: # operator in macro definition. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 24.1: */ #define str( a) # a assert( strcmp( str( a+b), "a+b") == 0); /* 24.2: White spaces between tokens of operand are converted to one space. */ assert( strcmp( str( ab /* comment */ + cd ), "ab + cd") == 0); /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ assert( strcmp( str( '"' + "' \""), "'\"' + \"' \\\"\"") == 0); /* 24.4: Line splicing by is done prior to token parsing. */ assert( strcmp( str( "ab\ c"), "\"abc\"") == 0); /* 24.5: Token separator inserted by macro expansion should be removed. (Meanwhile, tokens should not be merged. See 21.2.) */ #define xstr( a) str( a) #define f(a) a assert( strcmp( xstr( x-f(y)), "x-y") == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_13.c0000644000175000017500000000203110216765467011517 00000000000000/* n_13.c: Valid operators in #if expression. */ /* Valid operators are (precedence in this order) : defined, (unary)+, (unary)-, ~, !, *, /, %, +, -, <<, >>, <, >, <=, >=, ==, !=, &, ^, |, &&, ||, ? : */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 13.1: Bit shift. */ #if 1 << 2 != 4 || 8 >> 1 != 4 fputs( "Bad arithmetic of <<, >> operators.\n", stderr); exit( 1); #endif /* 13.2: Bitwise operators. */ #if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 fputs( "Bad arithmetic of ^, |, & operators.\n", stderr); exit( 1); #endif /* 13.3: Result of ||, && operators is either of 1 or 0. */ #if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 fputs( "Bad arithmetic of ||, && operators.\n", stderr); exit( 1); #endif /* 13.4: ?, : operator. */ #if (0 ? 1 : 2) != 2 fputs( "Bad arithmetic of ?: operator.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_29_3.c0000644000175000017500000000036110216765467011743 00000000000000/* e_29_3.c: #undef errors. */ /* 29.3: Not an identifier. */ #undef "string" #undef 123 /* 29.4: Excessive token sequence. */ #undef MACRO_0 Junk /* 29.5: No argument. */ #undef main( void) { return 0; } mcpp-2.7.2/test-c/u_1_13.c0000644000175000017500000000033110216765467011747 00000000000000/* u_1_13.c: Undefined behaviors on undefined #include syntax or header- name. */ /* u.1.13: Excessive argument in #include directive. */ #include Junk main( void) { return 0; } mcpp-2.7.2/test-c/n_13_8.c0000644000175000017500000000235110216765467011753 00000000000000/* n_13_8.c: Grouping of sub-expressions in #if expression. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 13.8: Unary operators are grouped from right to left. */ #if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) fputs( "Bad grouping of -, +, !, ~ in #if expression.\n", stderr); exit( 1); #endif /* 13.9: ?: operators are grouped from right to left. */ #if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 fputs( "Bad grouping of ? : in #if expression.\n", stderr); exit( 1); #endif /* 13.10: Other operators are grouped from left to right. */ #if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) fputs( "Bad grouping of >>, << in #if expression.\n", stderr); exit( 1); #endif /* 13.11: Test of precedence. */ #if 3*10/2 >> !0*2 >> !+!-9 != 1 fputs( "Bad grouping of -, +, !, *, /, >> in #if expression.\n", stderr); exit( 1); #endif /* 13.12: Overall test. Grouped as: ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) ? 7 : 0) != 7 evaluated to FALSE. */ #if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 fputs( "Bad arithmetic of #if expression.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_2.c0000644000175000017500000000160110216765467011437 00000000000000/* n_2.c: Line splicing by sequence. */ #include "defs.h" main( void) { int ab = 1, cd = 2, ef = 3, abcde = 5; fputs( "started\n", stderr); /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ #define FUNC( a, b, c) \ a + b + c assert( FUNC( ab, cd, ef) == 6); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c assert (FUNC( ab, cd, ef) == 6); /* 2.3: In a string literal. */ assert (strcmp( "abc\ de", "abcde") == 0); /* 2.4: in midst of an identifier. */ assert( abc\ de == 5); /* 2.5: by trigraph. */ assert( abc??/ de == 5); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/warns.c0000644000175000017500000001376610216765467012132 00000000000000/* * warns.c: * 1998/08 made public kmatsui * 2002/12 slightly modified kmatsui * 2003/11 added a few samples kmatsui */ /* * The following texts are legal but suspicious ones. Good preprocessor * will warn at these texts. */ #include "defs.h" main( void) { /* w.1.1: "/*" in comment. */ /* comment /* nested comment and no closing */ /* w.1.2: Rescanning of replacement text involves succeding text. */ #define sub( x, y) (x - y) #define head sub( int a = 1, b = 2, c; c = head a,b ); assert( c == -1); #define OBJECT_LIKE FUNCTION_LIKE #define FUNCTION_LIKE( x, y) (x + y) c = OBJECT_LIKE( a, b); assert( c == 3); /* w.2.1: Negative number converted to positive in #if expression. */ #if -1 < 0U #endif /* w.2.2: Out of range of unsigned type (wraps around and never overflow) in #if expression. */ #if 0U - 1 #endif /* * The following texts are legal but non-portable ones, since these requires * translation limits greater than the minima quaranteed by C90. Good * preprocessor will warn at these texts (at least when user wants), unless * it diagnose these as errors. */ { int nest; int A0B0C0D0E0F0G0H0O0O1O2O3P0P1P2 = 123; /* w.3.1: Number of parameters in macro: more than 31. */ #define glue63( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ o0 ## o1 ## o2 ## o3 ## p0 ## p1 ## p2 /* w.3.2: Number of arguments in macro call: more than 31. */ assert( glue63( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3) == 123); /* w.3.3: Initial significant characters in an identifier: more than 31. */ { int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; assert( A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef == 63); } /* w.3.4: Nested conditional inclusion: more than 8 levels. */ nest = 0; #define X0F #include "ifdef15.h" assert( nest == 0x0f); /* w.3.5: Nested source file inclusion: more than 8 levels. */ nest = 0; #define X0F #include "nest1.h" assert( nest == 0x0f); /* w.3.6: Parenthesized expression: more than 32 levels. */ nest = 0; #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif assert( nest == 63); } /* w.3.7: Characters in a string (after concatenation): more than 509. */ { char *string1023 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" ; assert( strlen( string1023) == 1023); } /* w.3.8: Characters in a logical source line: more than 509. */ { int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int g123456789012345678901234567890 = 123456; \ int h123456789012345678901234567890 = 123457; \ int i123456789012345678901234567890 = 123458; \ int j123456789012345678901234567890 = 123459; \ int k123456789012345678901234567890 = 123460; \ int l123456789012345678901234567890 = 123461; \ int m123456789012345678901234567890 = 123462; \ int n123456789012345678901234567890 = 123463; \ int o123456789012345678901234567890 = 123464; \ int p123456789012345678901234567890 = 123465; \ int q123456789012345678901234567890 = 123466; \ int r123456789012345678901234567890 = 123467; \ int s123456789012345678901234567890 = 123468; \ int t1234567890123456 = 123469; } /* w.3.9: Macro definitions: more than 1024 (including predefined ones). */ #include "m1024.h" assert( ZX == 1); return 0; } mcpp-2.7.2/test-c/undefs.c0000644000175000017500000001613310216765467012253 00000000000000/* * undefs.c: * 1998/08 made public kmatsui * 2002/12 slightly revised kmatsui * 2003/11 slightly revised kmatsui * * Each of the following texts causes undefined behavior. Good pre- * processor will diagnose or warn at these texts, or at least document the * behavior on these cases. */ #include #define str( a) # a main( void) { int a = 1, b = 2; char * string; /* u.1.1: End of a source file without . */ #include "unbal3.h" int e_1; /* u.1.2: End of a source file with . */ #include "unbal4.h" ; /* u.1.3: End of a source file with an unterminated comment. */ #include "unbal5.h" */ /* u.1.4: End of a source file with an uncompleted macro call. */ #include "unbal6.h" y); /* u.1.5: Illegal characters (in other than string literal, character constant, header-name or comment). */ #if 1 ||2 /* 0x01e ^ ^ 0x1f */ #endif /* Maybe the second error. */ /* u.1.6: [VT], [FF] in directive line. */ #if 1 || 2 /* [VT] ^ ^ [FF] */ #endif /* Maybe the second error. */ /* u.1.7: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #if '== 0x8e /* ^ 0x8e */ #endif /* Maybe the second error. */ /* u.1.8: Unterminated character constant. */ /* The following "comment" may not interpreted as a comment but swallowed by the unterminated character constant. */ #error I can't understand. /* Token error prior to execution of #error. */ /* u.1.9: Unterminated string literal. */ string = "String literal across the lines. " ; /* u.1.10: Unterminated header-name. */ #include Junk /* u.1.14: #line directive without an argument of line number. */ #line "filename" /* u.1.15: #line directive with the second argument of other than string literal. */ #line 1234 filename /* u.1.16: Excessive argument in #line directive. */ #line 2345 "filename" Junk /* 90, undefs.c or other undefined results. */ printf( "%d, %s\n", __LINE__, __FILE__); /* u.1.17: Line number argument of #line directive should be in range of [1,32767]. */ #line 32767 /* valid here */ /* line 32767 */ /* line 32768 ? : out of range */ printf( "%d\n", __LINE__); /* 32769 ? or -32767 ?, maybe warned as an out-of-range */ #line 0 #line 32768 /* u.1.18: Line number argument of #line directive should be written in decimal digits. */ #line 0x1000 #line 108 /* Restore to correct line number. */ /* u.1.19: A macro expanded to "defined" in #if expression. */ #define DEFINED defined #if DEFINED DEFINED #endif #undef __linux__ #undef __arm__ #define __linux__ 1 #define HAVE_MREMAP defined(__linux__) && !defined(__arm__) /* Wrong macro definition. * This macro should be defined as follows. * #if defined(__linux__) && !defined(__arm__) * #define HAVE_MREMAP 1 * #endif */ #if HAVE_MREMAP mremap(); #endif /* u.1.20: Undefining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ or "defined" in #undef directive. */ #undef __LINE__ /* 131 or other undefined result. */ printf( "%d\n", __LINE__); /* u.1.21: Defining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ or "defined" in #define directive. */ #define __LINE__ 1234 /* 137 or other undefined result. */ printf( "%d\n", __LINE__); #define defined defined #if defined defined # error I am not a good preprocessor. #endif /* u.1.22: Result of ## operator is not a valid pp-token. */ #define NUM( dig, exp) dig ## E+ ## exp /* * "E+" is a sequence of two pp-tokens "E" and "+", not a single pp-token. * The first ## concatenates the last pp-token of first argument with "E", * and the second ## concatenates "+" with the first pp-token of the second * argument. * While "12E" (one of the sequence generated by the token concatenation) * is a valid pp-token, "+34" (the another sequence) is not a valid pp-token * and causes an undefined behavior. */ printf( "%e\n", NUM( 12, 34)); /* u.1.23: Result of # operator is not a valid string literal. */ /* "\\"\""; This sequence is parsed to three tokens "\\" \ "", and will be diagnosed by compiler-proper unless diagnosed by preprocessor. */ puts( str( \"")); /* u.1.24: Empty argument of macro call. */ /* * Note: Since no argument and one empty argument cannot be distinguished * syntactically, additional dummy argument may be necessary for an * intermediate macro to process one empty argument (if possible). */ #define ARG( a, dummy) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s, dummy)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); or other undefined behavior. */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); or other undefined behavior. */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( CON, )", "CON"); or other undefined behavior. */ SHOWS( APPEND( CON, )); /* printf( "%s : %s\n", "APPEND( , )", ""); or other undefined behavior. */ SHOWS( APPEND( , )); /* u.1.25: Macro argument otherwise parsed as a directive. */ /* "#define NAME"; or other undefined behaviour. */ puts( str( #define NAME )); #define sub( x, y) (x - y) #define SUB sub #if 0 /* Added by C90: Corrigendum 1 (1994) and deleted by C99 */ /* u.1.26: Expanded macro replacement list end with name of function-like macro. */ SUB( a, b); #endif /* u.1.27: Unknown preprocessing directive (other than #pragma). */ #ifdefined MACRO #endif /* The second error. */ #define D define /* u.1.28: There are following two ways of preprocessing. 1: "D" isn't expanded, because # is the first token of the line. Preprocessor reports that "D" is an unknown directive. 2: "D" is expanded, because that is not a directive. Compiler-phase will diagnose the output of preprocess. Anyway, preprocessor should not interprete this line as a preprocessing directive. */ #D A B /* u.2.1: Undefined escape sequence. */ #if '\x' #endif /* u.2.2: Illegal bit shift count. */ #if 1 << -1 #endif #if 1 << 64 #endif return 0; } mcpp-2.7.2/test-c/n_32.c0000644000175000017500000000102310216765467011520 00000000000000/* n_32.c: Escape sequence in character constant in #if expression. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 32.1: Character octal escape sequence. */ #if '\123' != 83 fputs( "Bad evaluation of octal escape sequence.\n", stderr); exit( 1); #endif /* 32.2: Character hexadecimal escape sequence. */ #if '\x1b' != '\033' fputs( "Bad evaluation of hexadecimal escape sequence.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/u_1_28.c0000644000175000017500000000103210216765467011754 00000000000000/* u_1_28.c: Macro expanding to name identical to directive. */ #define D define /* u.1.28: There are following two ways of preprocessing. 1: "D" isn't expanded, because # is the first token of the line. Preprocessor reports that "D" is an unknown directive. 2: "D" is expanded, because that is not a directive. Compiler-phase will diagnose the output of preprocess. Anyway, preprocessor should not interprete this line as a preprocessing directive. */ #D A B main( void) { return 0; } mcpp-2.7.2/test-c/n_18.c0000644000175000017500000000133010216765467011525 00000000000000/* n_18.c: #define directive. */ #include "defs.h" main( void) { int c = 3; /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) fputs( "started\n", stderr); /* 18.1: Definition of an object-like macro. */ assert( OBJ_LIKE == 0); #define ZERO_TOKEN #ifndef ZERO_TOKEN fputs( "Can't define macro to 0-token.\n", stderr); exit( 1); #endif /* 18.2: Definition of a function-like macro. */ assert( FTN_LIKE( c) == 3); /* 18.3: Spelling in string identical to parameter is not a parameter. */ #define STR( n1, n2) "n1:n2" assert( strcmp( STR( 1, 2), "n1:n2") == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/i_32_3.c0000644000175000017500000000101510216765467011736 00000000000000/* i_32_3.c: Character constant in #if expression. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 32.3: */ #if 'a' != 0x61 fputs( "Not ASCII character set, or bad evaluation of character constant." , stderr); exit( 1); #endif /* 32.4: '\a' and '\v' */ #if '\a' != 7 || '\v' != 11 fputs( "Not ASCII character set, or bad evaluation of escape sequences." , stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_5.c0000644000175000017500000000075310216765467011451 00000000000000/* n_5.c: Spaces or tabs are allowed at any place in pp-directive line, including between the top of a pp-directive line and '#', and between the '#' and the directive. */ #include "defs.h" main( void) { int abcde = 5; /* |**|[TAB]# |**|[TAB]define |**| MACRO_abcde[TAB]|**| abcde |**| */ /**/ # /**/ define /**/ MACRO_abcde /**/ abcde /**/ fputs( "started\n", stderr); assert( MACRO_abcde == 5); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_35_2.c0000644000175000017500000000036310216765467011741 00000000000000/* e_35_2.c: Out of range of character constant. */ /* In ASCII character set. */ /* 35.2: */ #if 'abcdefghi' == '\x61\x62\x63\x64\x65\x66\x67\x68\x69' /* Perhaps out of range. */ #endif main( void) { return 0; } mcpp-2.7.2/test-c/e_31_3.c0000644000175000017500000000043510216765467011736 00000000000000/* e_31_3.c: Macro call in control line should complete in the line. */ #define glue( a, b) a ## b #define str( s) # s #define xstr( s) str( s) /* 31.3: Unterminated macro call. */ #include xstr( glue( header, .h)) main( void) { return 0; } mcpp-2.7.2/test-c/ifdef15.h0000644000175000017500000000111310216765467012207 00000000000000/* ifdef15.h */ #ifdef X01 #else #ifdef X02 #else #ifdef X03 #else #ifdef X04 #else #ifdef X05 #else #ifdef X06 #else #ifdef X07 #else #ifdef X08 #else #ifdef X09 #else #ifdef X0A #else #ifdef X0B #else #ifdef X0C #else #ifdef X0D #else #ifdef X0E #else #ifdef X0F nest = 0x0f; #endif /* X0F */ #endif /* X0E */ #endif /* X0D */ #endif /* X0C */ #endif /* X0B */ #endif /* X0A */ #endif /* X09 */ #endif /* X08 */ #endif /* X07 */ #endif /* X06 */ #endif /* X05 */ #endif /* X04 */ #endif /* X03 */ #endif /* X02 */ #endif /* X01 */ mcpp-2.7.2/test-c/m_33_utf8.c0000644000175000017500000000147510216765467012501 00000000000000/* m_33_utf8.c: Wide character constant encoded in UTF-8. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "utf8") /* For MCPP */ #pragma setlocale( "utf8") /* For MCPP on VC */ #if L'字' == '\xe5' * BYTES_VAL * BYTES_VAL + '\xad' * BYTES_VAL + '\x97' ptr = "Wide character is encoded in UTF-8."; #elif L'字' == '\x97' * BYTES_VAL * BYTES_VAL + '\xad' * BYTES_VAL + '\xe5' ptr = "Wide character is encoded in UTF-8." "Inverted order of evaluation."; #else ptr = "I cannot understand UTF-8."; #endif assert( strcmp( ptr, "I cannot understand UTF-8.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/nest2.h0000644000175000017500000000006510216765467012024 00000000000000/* nest2.h */ nest = 2; #include "nest3.h" mcpp-2.7.2/test-c/m_34_sjis.c0000644000175000017500000000106410216765467012556 00000000000000/* m_34_sjis.c: Multi-byte character constant encoded in shift-JIS. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "sjis") /* For MCPP */ #pragma setlocale( "japanese") /* For Visual C */ #if '' == '\x8e\x9a' ptr = "Multi-byte character is encoded in shift-JIS."; #else ptr = "I cannot understand shift-JIS."; #endif assert( strcmp( ptr, "I cannot understand shift-JIS.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/m_33_eucjp.c0000644000175000017500000000140110216765467012706 00000000000000/* m_33_eucjp.c: Wide character constant encoded in EUC-JP. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "eucjp") /* For MCPP */ #pragma setlocale( "eucjp") /* For MCPP on VC */ #if L'' == '\xbb' * BYTES_VAL + '\xfa' ptr = "Wide character is encoded in EUC-JP."; #elif L'' == '\xfa' * BYTES_VAL + '\xbb' ptr = "Wide character is encoded in EUC-JP." "Inverted order of evaluation."; #else ptr = "I cannot understand EUC-JP."; #endif assert( strcmp( ptr, "I cannot understand EUC-JP.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_7.c0000644000175000017500000000113610216765467011447 00000000000000/* n_7.c: #line directive. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 7.1: Line number and filename. */ #line 1234 "cpp" assert( __LINE__ == 1234); assert( strcmp( __FILE__, "cpp") == 0); /* 7.2: Filename argument is optional. */ #line 2345 assert( __LINE__ == 2345); assert( strcmp( __FILE__, "cpp") == 0); /* 7.3: Argument with macro. */ #define LINE_AND_FILENAME 1234 "n_7.c" #line LINE_AND_FILENAME assert( __LINE__ == 1234); assert( strcmp( __FILE__, "n_7.c") == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_7_4.c0000644000175000017500000000027710216765467011666 00000000000000/* e_7_4.c: #line error. */ /* 7.4: string literal in #line directive shall be a character string literal. */ #line 123 L"wide" main( void) { return 0; } mcpp-2.7.2/test-c/n_28.c0000644000175000017500000000133710216765467011535 00000000000000/* n_28.c: __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and __STDC_VERSION__ are predefined. */ #include "defs.h" main( void) { char * date = __DATE__; char * fname = __FILE__; fputs( "started\n", stderr); /* 28.1: */ /* Remove directory part (if any). */ fname += strlen( fname) - 6; assert( strcmp( fname, "n_28.c") == 0); /* 28.2: */ assert( __LINE__ == 19); /* 28.3: */ assert( strlen( __DATE__) == 11); assert( date[ 4] != '0'); /* 28.4: */ assert( strlen( __TIME__) == 8); /* 28.5: */ assert( __STDC__); /* 28.6: */ assert( __STDC_VERSION__); /* 28.7: */ #include "line.h" fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/n_4.c0000644000175000017500000000062510216765467011446 00000000000000/* n_4.c: Special tokens. */ #include "defs.h" main( void) { /* 4.1: Digraph spellings in directive line. */ %: define stringize( a) %: a fputs( "started\n", stderr); assert( strcmp( stringize( abc), "abc") == 0); /* 4.2: Digraph spellings are retained in stringization. */ assert( strcmp( stringize( <:), "<" ":") == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/LICENSE0000644000175000017500000000266410763014720011616 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/test-c/i_35.c0000644000175000017500000000056210216765467011525 00000000000000/* i_35.c: Multi-character character constant. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* In ASCII character set. */ /* 35.1: */ #if ('ab' != '\x61\x62') || ('\aa' != '\7\x61') fputs( "Bad handling of multi-character character constant.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_19_3.c0000644000175000017500000000147210216765467011746 00000000000000/* e_19_3.c: Redefinitions of macros. */ #include "defs.h" #define str( s) # s #define xstr( s) str( s) /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* The following redefinitions should be diagnosed. */ /* 19.3: */ #define OBJ_LIKE (0) /* different token sequence */ /* 19.4: */ #undef OBJ_LIKE #define OBJ_LIKE (1-1) #define OBJ_LIKE (1 - 1) /* different white space */ /* 19.5: */ #define FTN_LIKE(b) ( a ) /* different parameter usage */ /* 19.6: */ #undef FTN_LIKE #define FTN_LIKE(a) ( a ) #define FTN_LIKE(b) ( b ) /* different parameter spelling */ /* 19.7: Not in ISO C "Examples" */ #define FTN_LIKE OBJ_LIKE main( void) { return 0; } mcpp-2.7.2/test-c/header.h0000644000175000017500000000005010216765467012213 00000000000000/* header.h */ #define MACRO_abc abc mcpp-2.7.2/test-c/u_1_7_gb.c0000644000175000017500000000055210216765467012347 00000000000000/* u_1_7_gb.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "chinese-simplified") /* For Visual C */ #pragma __setlocale( "gb2312") /* For MCPP */ main( void) { char * cp = str( ""); /* 0xb1a0 */ return 0; } mcpp-2.7.2/test-c/u_1_14.c0000644000175000017500000000061410216765467011754 00000000000000/* u_1_14.c: Undefined behaviors on undefined #line syntax. */ main( void) { /* u.1.14: #line directive without an argument of line number. */ #line "filename" /* u.1.15: #line directive with the second argument of other than string literal. */ #line 1234 filename /* u.1.16: Excessive argument in #line directive. */ #line 2345 "filename" Junk return 0; } mcpp-2.7.2/test-c/u_1_5.c0000644000175000017500000000065410216765467011700 00000000000000/* u_1_5.c: Undefined behaviors on illegal characters. */ /* u.1.5: Illegal characters (in other than string literal, character constant, header-name or comment). */ #if 1 ||2 /* 0x01e ^ ^ 0x1f */ #endif /* Maybe the second error. */ /* u.1.6: [VT], [FF] in directive line. */ #if 1 || 2 /* [VT] ^ ^ [FF] */ #endif /* Maybe the second error. */ main( void) { return 0; } mcpp-2.7.2/test-c/e_4_3.c0000644000175000017500000000037610216765467011662 00000000000000/* e_4_3.c: Illegal pp-token. */ /* 4.3: Empty character constant is an error. */ #if '' == 0 /* This line is invalid, maybe skipped. */ #endif /* This line maybe the second error. */ main( void) { return 0; } mcpp-2.7.2/test-c/line.h0000644000175000017500000000021410216765467011714 00000000000000/* line.h */ { char * file = __FILE__; file += strlen( file) - 6; assert( __LINE__ == 6 && strcmp( file, "line.h") == 0); } mcpp-2.7.2/test-c/m_34_eucjp.c0000644000175000017500000000106310216765467012713 00000000000000/* m_34_eucjp.c: Multi-byte character constant encoded in EUC-JP. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "eucjp") /* For MCPP */ #pragma setlocale( "eucjp") /* For MCPP on VC */ #if '' == '\xbb\xfa' ptr = "Multi-byte character is encoded in EUC-JP."; #else ptr = "I cannot understand EUC-JP."; #endif assert( strcmp( ptr, "I cannot understand EUC-JP.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/u_1_23.c0000644000175000017500000000054110516602673011743 00000000000000/* u_1_23.c: Undefined behaviors on generating invalid pp-token by # operator. */ #include #define str( a) # a main( void) { /* "\\"\""; This sequence is parsed to three tokens "\\" \ "", and will be diagnosed by compiler-proper unless diagnosed by preprocessor. */ puts( str( \"")); return 0; } mcpp-2.7.2/test-c/n_21.c0000644000175000017500000000072710216765467011530 00000000000000/* n_21.c: Tokenization (No preprocessing tokens are merged implicitly). */ #include "defs.h" main( void) { int a = 1, x = 2, y = -3; fputs( "started\n", stderr); /* 21.1: */ #define MINUS - assert( -MINUS-a == -1); /* 21.2: */ #define sub( a, b) a-b /* '(a)-(b)' is better */ #define Y -y /* '(-y)' is better */ /* x- -y */ assert( sub( x, Y) == -1); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_33_2.c0000644000175000017500000000047210216765467011740 00000000000000/* e_33_2.c: Out of range of numerical escape sequence in wide-char. */ /* 33.2: Value of a numerical escape sequence in wide-character constant should be in the range of wchar_t. */ #if L'\xabcdef012' == 0xbcdef012 /* Perhaps out of range. */ #endif main( void) { return 0; } mcpp-2.7.2/test-c/n_19.c0000644000175000017500000000106310216765467011531 00000000000000/* n_19.c: Valid re-definitions of macros. */ #include "defs.h" main( void) { int c = 1; fputs( "started\n", stderr); /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* 19.1: */ #define OBJ_LIKE /* white space */ (1-1) /* other */ /* 19.2: */ #define FTN_LIKE( a )( /* note the white space */ \ a /* other stuff on this line */ ) assert( FTN_LIKE( c) == 1); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/nest10.h0000644000175000017500000000004310216765467012077 00000000000000/* nest10.h */ #include "nest11.h" mcpp-2.7.2/test-c/n_25.c0000644000175000017500000000224710216765467011533 00000000000000/* n_25.c: Macro arguments are pre-expanded (unless the argument is an operand of # or ## operator) separately, that is, are macro-replaced completely prior to rescanning. */ #include "defs.h" #define ZERO_TOKEN #define MACRO_0 0 #define MACRO_1 1 #define TWO_ARGS a,b #define sub( x, y) (x - y) #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) #define str( a) # a main( void) { int a = 1, b = 2, abc = 3, MACRO_0MACRO_1 = 2; fputs( "started\n", stderr); /* 25.1: "TWO_ARGS" is read as one argument to "sub", then expanded to "a,b", then "x" is substituted by "a,b". */ assert( sub( TWO_ARGS, 1) == 1); /* 25.2: An argument pre-expanded to 0-token. */ /* ( - 1); */ assert( sub( ZERO_TOKEN, a) == -1); /* 25.3: "glue( a, b)" is pre-expanded. */ assert( xglue( glue( a, b), c) == 3); /* 25.4: Operands of ## operator are not pre-expanded. */ assert( glue( MACRO_0, MACRO_1) == 2); /* 25.5: Operand of # operator is not pre-expanded. */ assert( strcmp( str( ZERO_TOKEN), "ZERO_TOKEN") == 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_14_10.c0000644000175000017500000000041310216765467012011 00000000000000/* e_14_10.c: Overflow of constant expression in #if directive. */ /* 14.10: */ #include #if LONG_MAX - LONG_MIN #endif #if LONG_MAX + 1 #endif #if LONG_MIN - 1 #endif #if LONG_MAX * 2 #endif int main( void) { return 0; } mcpp-2.7.2/test-c/side_cpp0000644000175000017500000000341610506451066012321 00000000000000 n_1: Trigraph sequences. n_2: Line splicing by . n_3: Handling of comment. n_4: Tokens spelled by digraphs. n_5: Spaces or tabs in pp-directive. n_6: #include directive. n_7: #line directive. n_9: #pragma directive. n_10: #if, #elif pp-directive. n_11: Operator "defined" in #if. n_12: Pp-number and type of #if expr. n_13: Valid operators in #if expr. n_13.5: Usual arithmetic conversion. n_13.7: Short-circuit evaluation of #if. n_13.8: Grouping of #if sub-expressions. n_13.13: #if expression with macros. n_15: #ifdef, #ifndef directives. n_18: #define directive. n_19: Valid re-definitions of macros. n_20: Macro name identical to keyword. n_21: Tokenization (no token merging). n_22: Tokenization of pp-number. n_23: ## operator in macro definition. n_24: # operator in macro definition. n_25: Pre-expansion of macro args. n_26: No recursive replacement. n_27: Rescanning of a macro. n_28: Standard pre-defined macros. n_29: #undef directive. n_30: Macro call crossing lines. n_32: Escape sequence in char-const. n_37: Translation limits. i_32.3: Character constant in #if. i_35: Multi-character character const. i_35.3: Multi-character wide character. Total number of tests unpassed. mcpp-2.7.2/test-c/u_1_12.c0000644000175000017500000000032510216765467011751 00000000000000/* u_1_12.c: Undefined behaviors on undefined #include syntax or header- name. */ /* u.1.12: Argument of #include other than header-name. */ #include filename main( void) { return 0; } mcpp-2.7.2/test-c/n_13_5.c0000644000175000017500000000157410216765467011756 00000000000000/* n_13_5.c: Arithmetic conversion in #if expressions. */ #include "defs.h" main( void) { fputs( "started\n", stderr); /* 13.5: The usual arithmetic conversion is not performed on bit shift. */ #if -1 << 3U > 0 fputs( "Bad conversion of bit shift operands.\n", stderr); exit( 1); #endif /* 13.6: Usual arithmetic conversions. */ #if -1 <= 0U /* -1 is converted to unsigned long. */ fputs( "Bad arithmetic conversion.\n", stderr); exit( 1); #endif #if -1 * 1U <= 0 fputs( "Bad arithmetic conversion.\n", stderr); exit( 1); #endif /* Second and third operands of conditional operator are converted to the same type, thus -1 is converted to unsigned long. */ #if (1 ? -1 : 0U) <= 0 fputs( "Bad arithmetic conversion.\n", stderr); exit( 1); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_32_5.c0000644000175000017500000000041410216765467011736 00000000000000/* e_32_5.c: Range error of character constant. */ /* 32.5: Value of a numerical escape sequence in character constant should be in the range of char. */ #if '\x123' == 0x123 /* Out of range. */ #endif main( void) { return 0; } mcpp-2.7.2/test-c/m_33_sjis.c0000644000175000017500000000141110216765467012551 00000000000000/* m_33_sjis.c: Wide character constant encoded in shift-JIS. */ #include "defs.h" #include #define BYTES_VAL (1 << CHAR_BIT) main( void) { char * ptr; fputs( "started\n", stderr); /* 33.1: L'ch'. */ #pragma __setlocale( "sjis") /* For MCPP */ #pragma setlocale( "japanese") /* For Visual C */ #if L'' == '\x8e' * BYTES_VAL + '\x9a' ptr = "Wide character is encoded in shift-JIS."; #elif L'' == '\x9a' * BYTES_VAL + '\x8e' ptr = "Wide character is encoded in shift-JIS." "Inverted order of evaluation."; #else ptr = "I cannot understand shift-JIS."; #endif assert( strcmp( ptr, "I cannot understand shift-JIS.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_24_6.c0000644000175000017500000000026310216765467011742 00000000000000/* e_24_6.c: Operand of # operator in function-like macro definition should be a parameter. */ /* 24.6: */ #define FUNC( a) # b main( void) { return 0; } mcpp-2.7.2/test-c/u_1_7_big5.c0000644000175000017500000000055610216765467012611 00000000000000/* u_1_7_big5.c: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "chinese-traditional") /* For Visual C */ #pragma __setlocale( "big5") /* For MCPP */ main( void) { char * cp = str( ""); /* 0xa181 */ return 0; } mcpp-2.7.2/test-c/unbal2.h0000644000175000017500000000011410216765467012147 00000000000000/* unbal2.h */ #define UNBAL2 1 #if UNBAL2 /* line 5 */ #else mcpp-2.7.2/test-c/n_3_4.c0000644000175000017500000000050210216765467011662 00000000000000/* n_3_4.c: Handling of comment and . */ /* 3.4: Comment and in #error line. */ #error Message of first physical line. \ Message of second physical and first logical line. /* this comment splices the lines */ Message of forth physical and third logical line. mcpp-2.7.2/test-c/nest11.h0000644000175000017500000000004310216765467012100 00000000000000/* nest11.h */ #include "nest12.h" mcpp-2.7.2/test-c/m_34_big5.c0000644000175000017500000000106110216765467012431 00000000000000/* m_34_big5.t: Multi-byte character constant encoded in Big-Five. */ #include "defs.h" main( void) { char * ptr; fputs( "started\n", stderr); /* 34.1: */ #pragma __setlocale( "big5") /* For MCPP */ #pragma setlocale( "chinese-traditional") /* For Visual C */ #if 'r' == '\xa6\x72' ptr = "Multi-byte character is encoded in Big-Five."; #else ptr = "I cannot understand Big-Five."; #endif assert( strcmp( ptr, "I cannot understand Big-Five.") != 0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-c/e_std.c0000644000175000017500000001756010216765467012072 00000000000000/* * e_std.c * * 1998/08 made public kmatsui * 2002/08 revised not to conflict with C99 Standard kmatsui * 2003/11 added a few samples kmatsui * * Samples to test Standard C preprocessing. * Preprocessor must diagnose all of these samples appropriately. */ void e_19_3( void); void e_25_6( void); void e_27_6( void); void e_31( void); main( void) { e_19_3(); e_25_6(); e_27_6(); e_31(); return 0; } /* Illegal pp-token. */ /* 4.3: Empty character constant is an error. */ #if '' == 0 /* This line is invalid, maybe skipped. */ #endif /* This line maybe the second error. */ /* #line error. */ /* 7.4: string literal in #line directive shall be a character string literal. */ #line 123 L"wide" /* Out of range of integer pp-token in #if expression. */ /* Note: Tests of character constant overflow are in 32.5, 33.2, 35.2. */ /* 12.8: Preprocessing number perhaps out of range of unsigned long. */ #if 123456789012345678901 #endif /* Illegal #if expressions. */ #define A 1 #define B 1 /* 14.1: String literal is not allowed in #if expression. */ #if "string" #endif /* The second error ? */ /* 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. */ #if A = B #endif #if A++ B #endif #if A --B #endif #if A.B #endif /* 14.3: Unterminated #if expression. */ #if 0 < #endif #if ( (A == B) #endif /* 14.4: Unbalanced parenthesis in #if defined operator. */ #if defined ( MACRO #endif /* 14.5: No argument. */ #if #endif /* 14.6: Macro expanding to 0 token in #if expression. */ #define ZERO_TOKEN #if ZERO_TOKEN #endif /* There is no keyword in #if expression. */ /* 14.7: sizeof operator is disallowed. */ /* Evaluated as: 0 (0) Constant expression syntax error. */ #if sizeof (int) #endif /* 14.8: type cast is disallowed. */ /* Evaluated as: (0)0x8000 Also a constant expression error. */ #if (int)0x8000 < 0 #endif /* Out of range in #if expression (division by 0). */ /* 14.9: Divided by 0. */ #if 1 / 0 #endif /* Overflow of constant expression in #if directive. */ /* 14.10: */ #include #if LONG_MAX - LONG_MIN #endif #if LONG_MAX + 1 #endif #if LONG_MIN - 1 #endif #if LONG_MAX * 2 #endif /* #ifdef, #ifndef syntax errors. */ /* 15.3: Not an identifier. */ #ifdef "string" #endif #ifdef 123 #endif /* 15.4: Excessive token sequence. */ #ifdef A Junk #endif /* 15.5: No argument. */ #ifndef #endif /* Trailing junk of #else, #endif. */ /* 16.1: Trailing junk of #else. */ #define MACRO_0 0 #if MACRO_0 #else MACRO_0 /* 16.2: Trailing junk of #endif. */ #endif MACRO_0 /* Ill-formed group in a source file. */ #define MACRO_1 1 /* 17.1: Error of #endif without #if. */ #endif /* 17.2: Error of #else without #if. */ #else /* 17.3: Error of #else after #else. */ #if MACRO_1 #else /* line 168 */ #if 1 #else #endif #else #endif /* 17.4: Error of #elif after #else. */ #if MACRO_1 == 1 #else /* line 177 */ #elif MACRO_1 == 0 #endif /* 17.5: Error of #endif without #if in an included file. */ #if 1 #include "unbal1.h" /* 17.6: Error of unterminated #if section in an included file. */ #include "unbal2.h" #endif /* 17.7: Error of unterminated #if section. */ /* An error would be reported at end of file. */ #if MACRO_1 == 0 /* line 191 */ #else /* #define syntax errors. */ /* 18.4: Not an identifier. */ #define "string" #define 123 /* 18.5: No argument. */ #define /* 18.6: Empty parameter list. */ #define math( op, a, ) op( (a), (b)) /* 18.7: Duplicate parameter names. */ #define math( op, a, a) op( (a), (b)) /* 18.8: Parameter is not an identifier. */ #define NUMARGS( 1, +, 2) (1 + 2) /* 18.9: No space between macro name and replacement text. */ /* C90 (Corrigendum 1) forbids this if and only the replacement text begins with a non-basic-character. C99 forbids this even when the replacement text begins with basic- character. */ /* From ISO 9899:1990 / Corrigendum 1. */ #define THIS$AND$THAT(a, b) ((a) + (b)) /* Note: the following definition is legal (object-like macro). #define THIS $AND$THAT(a, b) ((a) + (b)) */ /* Redefinitions of macros. */ #define str( s) # s #define xstr( s) str( s) /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) void e_19_3( void) { /* The following redefinitions should be diagnosed. */ /* 19.3: */ #define OBJ_LIKE (0) /* different token sequence */ /* 19.4: */ #undef OBJ_LIKE #define OBJ_LIKE (1-1) #define OBJ_LIKE (1 - 1) /* different white space */ /* 19.5: */ #define FTN_LIKE(b) ( a ) /* different parameter usage */ /* 19.6: */ #undef FTN_LIKE #define FTN_LIKE(a) ( a ) #define FTN_LIKE(b) ( b ) /* different parameter spelling */ /* 19.7: Not in ISO C "Examples" */ #define FTN_LIKE OBJ_LIKE } /* ## operator shall not occur at the beginning or at the end of replacement list for either form of macro definition. */ /* 23.3: In object-like macro. */ #define con ## name #define cat 12 ## /* 23.4: In function-like macro. */ #define CON( a, b) ## a ## b #define CAT( b, c) b ## c ## /* Operand of # operator in function-like macro definition shall be a parameter name. */ /* 24.6: */ #define FUNC( a) # b /* Macro arguments are pre-expanded separately. */ /* 25.6: */ #define sub( x, y) (x - y) #define head sub( #define body(x,y) x,y #define tail ) #define head_body_tail( a, b, c) a b c void e_25_6( void) { /* "head" is once replaced to "sub(", then rescanning of "sub(" causes an uncompleted macro call. Expansion of an argument should complete within the argument. */ head_body_tail( head, body(a,b), tail); } /* Error of rescanning. */ /* 27.7: */ #define TWO_ARGS a,b #define SUB( x, y) sub( x, y) void e_27_7( void) { /* Too many arguments error while rescanning after once replaced to: sub( a,b, 1); */ SUB( TWO_ARGS, 1); } /* #undef errors. */ /* 29.3: Not an identifier. */ #undef "string" #undef 123 /* 29.4: Excessive token sequence. */ #undef MACRO_0 Junk /* 29.5: No argument. */ #undef /* Illegal macro calls. */ void e_31( void) { int x = 1, y = 2; /* 31.1: Too many arguments error. */ sub( x, y, z); /* 31.2: Too few arguments error. */ sub( x); } /* Macro call in control line should complete in the line. */ #define glue( a, b) a ## b /* 31.3: Unterminated macro call. */ #include xstr( glue( header, .h)) /* Range error of character constant. */ /* 32.5: Value of a numerical escape sequence in character constant should be in the range of char. */ #if '\x123' == 0x123 /* Out of range. */ #endif /* Out of range of numerical escape sequence in wide-char. */ /* 33.2: Value of a numerical escape sequence in wide-character constant should be in the range of wchar_t. */ #if L'\xabcdef012' == 0xbcde012 /* Perhaps out of range. */ #endif /* Out of range of character constant. */ /* In ASCII character set. */ /* 35.2: */ #if 'abcdefghi' == '\x61\x62\x63\x64\x65\x66\x67\x68\x69' /* Perhaps out of range. */ #endif /* Error of "unterminated #if section started at line 191" will be reported at end of file. */ mcpp-2.7.2/test-c/n_23.c0000644000175000017500000000072010216765467011523 00000000000000/* n_23.c: ## operator in macro definition. */ #include "defs.h" #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) #define MACRO_0 0 #define MACRO_1 1 main( void) { int xy = 1; fputs( "started\n", stderr); /* 23.1: */ assert( glue( x, y) == 1); /* 23.2: Generate a preprocessing number. */ #define EXP 2 assert( xglue( .12e+, EXP) == 12.0); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/NEWS0000644000175000017500000000746011113244474010111 00000000000000This file summarizes new major features of each MCPP release. (kmatsui) MCPP V.2.7.2 (2008/11) 1. This is a bug-fixed version of V.2.7.1, fixing several bugs of the previous release. 2. Enabled some CPU-specific predefined macros in compiler-independent- build as well as compiler-specific-build. MCPP V.2.7.1 (2008/05) 1. This is a bug-fixed version of V.2.7, fixing several bugs of the previous release. 2. Made subroutine-build also install an mcpp executable and minimal documents as well as libmcpp for a convenience of library package. MCPP V.2.7 (2008/03) 1. Implemented -K option to enable macro notification mode. This mode is designed for C/C++ refactoring tools and embeds macro annotations into comments. This mode is also enabled by '#pragma MCPP debug macro_call' sub-directive. 2. Fixed several bugs of the previous release, including a bug of UTF-8 multibyte character handling. 3. Ported to Mac OS X / GCC and Visual C++ 2008. 4. Made GCC-specific-build closer to GCC. 5. Added documentation on source checking of firefox 3.0pre. MCPP V.2.6.4 (2007/05) 1. This is a bug-fixed version of V.2.6.3, fixing memory leaks in subroutine-build, and fixing a bug of accessing non-allocated memory. 2. Also changed the installation directory of some documents in stand- alone-and-compiler-independent-build by configure or by binary packages. MCPP V.2.6.3 (2007/04) 1. Revised subtle points of #include and '#pragma once' handling, such as dereferencing symbolic linked directory and others. 2. Relaxed syntax checking and token checking in lang_asm mode. Implemented variadic macro of GCC3-specification for GCC-specific- build. Increased compatibility of GCC-specific-build to GCC. 3. Implemented optional memory buffer output (other than file) in subroutine-build. 4. Added 'mcpplib' target to make subroutine-build in configure.ac and noconfig/*.mak. 5. Abolished 'install-data' and 'uninstall-data' targets of configured makefile. On the other hand, made 'install' target install also mcpp-manual.html. 6. Provided stand-alone-and-compiler-independent-build binary packages port, rpm, deb, zip and their corresponding source packages on SourceForge. 7. Added documentation on source checking of glibc 2.4. MCPP V.2.6.2 (2006/11) 1. Fixed several bugs of the previous release. 2. Added subroutine-build to use MCPP as a subroutine from other main program. 3. Changed the terms of building methods in the documents. The building methods now have two axis: 1. stand-alone-build vs subroutine-build 2. compiler-independent-build vs compiler-specific-build Refer to INSTALL #1. Note that this change of terminology does not affect the two building methods of stand-alone preprocessor so far: 'compiler- independent-build' and 'compiler-specific-build'. ('compiler- independent-build' was called 'stand-alone-build' in the previous releases). 4. Rewrote and converted the text files in 'doc' and 'doc-jp' directories into html files. MCPP V.2.6.1 (2006/08) 1. Fixed several bugs of the previous release. 2. Revised path-list handling on CygWIN. 3. Added porting to MinGW/MSYS. MCPP V.2.6 (2006/07) 1. Integrated STANDARD mode and PRE_STANDARD mode into one executable, differentiating the modes by the execution time options. 2. Changed --enable-maintainer-mode option of configure to --enable- replace-cpp option which generates compiler-specific-build of mcpp. 3. Made compiler-independent-build really independent from any compiler- systems. It no longer requires GCC-specific header files. 4. Removed settings for pre-C90 compiler. Removed settings for MS-DOS compiler, DJGPP and Plan9. 5. Added portings to GCC V.4.0, CygWIN 1.5.18, Visual C++ 2005 and LCC- Win32 2006-03. mcpp-2.7.2/README0000644000175000017500000000430210575261664010275 00000000000000<< What is MCPP >> MCPP is a C/C++ preprocessor with the following features: 1. Implements all of C90, C99 and C++98 features. It has the highest conformance. 2. Accompanies a validation suite to test the C/C++ preprocessors comprehensively. When it is applied to the existing preprocessors, MCPP shows outstanding result. 3. Has a variety of accurate diagnostic messages. This allows examination of most preprocessing problems of source, like potential bugs or portability problems. 4. Has various #pragma directives to output debug information. 5. Supports the various encodings of multi-byte characters for Japan, China, Taiwan and Korea. 6. Highly portable. Supports many compiler systems on UNIX-like systems and Windows. It can replace resident preprocessor of the compiler system. It can also behave independently from any compiler systems. Moreover, it can be built as a subroutine from any other main program, too. 7. Preprocessors of various behavior specifications can be generated from the source. 8. Is an open source software released under BSD-style-license. 9. Full documentations in Japanese and English are attached. MCPP is probably the best C preprocessor in the world. MCPP was selected as one of the "Exploratory Software Projects" of the Information-technology Promotion Agency (IPA), Japan, in year 2002 and 2003. With its achievements, the author was evaluated as one of the highest rank programmers. The sources and documents of MCPP are found at: http://mcpp.sourceforge.net/ Please read mcpp-summary.pdf for the overview of MCPP and Validation Suite. Please read INSTALL (INSTALL-jp) for how to install MCPP on your system from the source. Refer to the above web page for installation of the binary packages of MCPP. All the files except mcpp-summary.pdf are normal text files. In the .tar.gz file, newline of the text files are [LF], and encoding of INSTALL-jp is EUC-JP. In the .zip file, newline of the text files are [CR][LF], and encoding of INSTALL-jp is shift-JIS. I would like to hear from many C programmers for reviews, comments and the interest to participate in development. Kiyoshi Matsui mcpp-2.7.2/config/0000777000175000017500000000000011113211442010721 500000000000000mcpp-2.7.2/config/mb_big50000644000175000017500000000007710460713034012100 00000000000000AC_CHECK_MBCHAR_IS_ESCAPE_FREE( [BIGFIVE], [bigfive], [\Z]) mcpp-2.7.2/config/depcomp0000755000175000017500000003710010274175751012236 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mcpp-2.7.2/config/missing0000755000175000017500000002540610274175750012265 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mcpp-2.7.2/config/config.sub0000755000175000017500000007730010466646770012661 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mcpp-2.7.2/config/config.guess0000755000175000017500000012626010466646770013216 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mcpp-2.7.2/config/cygwin_root0000755000175000017500000000021511004353067013135 00000000000000#! /bin/sh # split from configure.ac to work around a problem of backslash handling mount | grep ' on / ' | sed 's, on / .*,,' | tr '\\' '/' mcpp-2.7.2/config/ltmain.sh0000644000175000017500000060015710404615640012500 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION="1.5.22 Debian 1.5.22-4" TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built fi build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: mcpp-2.7.2/config/mb_jis0000644000175000017500000000011310460713034012026 00000000000000AC_CHECK_MBCHAR_IS_ESCAPE_FREE( [ISO2022_JP], [iso2022_jp], [$B0\F0(B]) mcpp-2.7.2/config/mb_sjis0000644000175000017500000000007110460713034012214 00000000000000AC_CHECK_MBCHAR_IS_ESCAPE_FREE( [SJIS], [sjis], [\]) mcpp-2.7.2/config/compile0000755000175000017500000000717310274175751012246 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mcpp-2.7.2/config/mingw_root0000755000175000017500000000015511004365626012765 00000000000000#! /bin/sh # split from configure.ac to work around a problem of backslash handling /tmp/a.exe | tr '\\' '/' mcpp-2.7.2/config/install-sh0000755000175000017500000002202110274175750012660 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mcpp-2.7.2/test-l/0000777000175000017500000000000010624535762010710 500000000000000mcpp-2.7.2/test-l/nest36.h0000644000175000017500000000004310216765467012120 00000000000000/* nest36.h */ #include "nest37.h" mcpp-2.7.2/test-l/nest125.h0000644000175000017500000000004510216765467012201 00000000000000/* nest125.h */ #include "nest126.h" mcpp-2.7.2/test-l/nest3.h0000644000175000017500000000004110216765467012030 00000000000000/* nest3.h */ #include "nest4.h" mcpp-2.7.2/test-l/nest76.h0000644000175000017500000000004310216765467012124 00000000000000/* nest76.h */ #include "nest77.h" mcpp-2.7.2/test-l/nest6.h0000644000175000017500000000004110216765467012033 00000000000000/* nest6.h */ #include "nest7.h" mcpp-2.7.2/test-l/nest82.h0000644000175000017500000000004310216765467012121 00000000000000/* nest82.h */ #include "nest83.h" mcpp-2.7.2/test-l/nest81.h0000644000175000017500000000004310216765467012120 00000000000000/* nest81.h */ #include "nest82.h" mcpp-2.7.2/test-l/nest95.h0000644000175000017500000000004310216765467012125 00000000000000/* nest95.h */ #include "nest96.h" mcpp-2.7.2/test-l/nest43.h0000644000175000017500000000004310216765467012116 00000000000000/* nest43.h */ #include "nest44.h" mcpp-2.7.2/test-l/nest64.h0000644000175000017500000000004310216765467012121 00000000000000/* nest64.h */ #include "nest65.h" mcpp-2.7.2/test-l/nest105.h0000644000175000017500000000004510216765467012177 00000000000000/* nest105.h */ #include "nest106.h" mcpp-2.7.2/test-l/nest9.h0000644000175000017500000000004210216765467012037 00000000000000/* nest9.h */ #include "nest10.h" mcpp-2.7.2/test-l/nest106.h0000644000175000017500000000004510216765467012200 00000000000000/* nest106.h */ #include "nest107.h" mcpp-2.7.2/test-l/nest35.h0000644000175000017500000000004310216765467012117 00000000000000/* nest35.h */ #include "nest36.h" mcpp-2.7.2/test-l/nest8.h0000644000175000017500000000004110216765467012035 00000000000000/* nest8.h */ #include "nest9.h" mcpp-2.7.2/test-l/nest27.h0000644000175000017500000000004310216765467012120 00000000000000/* nest27.h */ #include "nest28.h" mcpp-2.7.2/test-l/nest89.h0000644000175000017500000000004310216765467012130 00000000000000/* nest89.h */ #include "nest90.h" mcpp-2.7.2/test-l/nest14.h0000644000175000017500000000004310216765467012114 00000000000000/* nest14.h */ #include "nest15.h" mcpp-2.7.2/test-l/nest118.h0000644000175000017500000000004510216765467012203 00000000000000/* nest118.h */ #include "nest119.h" mcpp-2.7.2/test-l/defs.h0000644000175000017500000000214510216765467011724 00000000000000/* defs.h */ #include /* assert(): Enable one of these three. */ /* Note: This source doesn't use #elif directive to test preprocessor which can't recognize the directive. */ #if 1 /* For the translator which can process properly. */ #include #else #if 0 /* Not to abort on error. */ #define assert( exp) (exp) ? (void)0 : (void) fprintf( stderr, \ "Assertion failed: %s, from line %d of file %s\n", \ # exp, __LINE__, __FILE__) #else #if 0 /* For the translator which can't process or '#' operator properly. */ #define assert( exp) (exp) ? 0 : fputs( "Assertion failed\n", stderr) #endif #endif #endif #ifdef void /* * For the older compilers which can't handle prototype declarations. * You must append these lines in stdio.h. * #undef void * #define void */ extern int strcmp(); extern size_t strlen(); extern void exit(); #else extern int strcmp( const char *, const char *); extern size_t strlen( const char *); extern void exit( int); #endif mcpp-2.7.2/test-l/l_37_7.t0000644000175000017500000002067110216765467012015 00000000000000/* l_37_7.t: Translation limits larger than Standard / 7. */ /* 37.7L: Characters in a string (after concatenation). */ /* 8191 bytes long. */ char *string8189 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ E123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ F123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ G123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; mcpp-2.7.2/test-l/nest45.h0000644000175000017500000000004310216765467012120 00000000000000/* nest45.h */ #include "nest46.h" mcpp-2.7.2/test-l/nest1.h0000644000175000017500000000004110216765467012026 00000000000000/* nest1.h */ #include "nest2.h" mcpp-2.7.2/test-l/nest57.h0000644000175000017500000000004310216765467012123 00000000000000/* nest57.h */ #include "nest58.h" mcpp-2.7.2/test-l/nest67.h0000644000175000017500000000004310216765467012124 00000000000000/* nest67.h */ #include "nest68.h" mcpp-2.7.2/test-l/nest55.h0000644000175000017500000000004310216765467012121 00000000000000/* nest55.h */ #include "nest56.h" mcpp-2.7.2/test-l/nest32.h0000644000175000017500000000004310216765467012114 00000000000000/* nest32.h */ #include "nest33.h" mcpp-2.7.2/test-l/nest71.h0000644000175000017500000000004310216765467012117 00000000000000/* nest71.h */ #include "nest72.h" mcpp-2.7.2/test-l/nest92.h0000644000175000017500000000004310216765467012122 00000000000000/* nest92.h */ #include "nest93.h" mcpp-2.7.2/test-l/nest100.h0000644000175000017500000000004510216765467012172 00000000000000/* nest100.h */ #include "nest101.h" mcpp-2.7.2/test-l/nest127.h0000644000175000017500000000004110216765467012177 00000000000000/* nest127.h */ nest = 0x7f; mcpp-2.7.2/test-l/nest39.h0000644000175000017500000000004310216765467012123 00000000000000/* nest39.h */ #include "nest40.h" mcpp-2.7.2/test-l/nest126.h0000644000175000017500000000004510216765467012202 00000000000000/* nest126.h */ #include "nest127.h" mcpp-2.7.2/test-l/nest69.h0000644000175000017500000000004310216765467012126 00000000000000/* nest69.h */ #include "nest70.h" mcpp-2.7.2/test-l/nest7.h0000644000175000017500000000004110216765467012034 00000000000000/* nest7.h */ #include "nest8.h" mcpp-2.7.2/test-l/nest58.h0000644000175000017500000000004310216765467012124 00000000000000/* nest58.h */ #include "nest59.h" mcpp-2.7.2/test-l/nest116.h0000644000175000017500000000004510216765467012201 00000000000000/* nest116.h */ #include "nest117.h" mcpp-2.7.2/test-l/l_37_5.t0000644000175000017500000000034510216765467012007 00000000000000/* l_37_5.t: Translation limits larger than Standard / 5. */ /* 37.5L: Nested source file inclusion. */ /* Define one of the macros X1F, X3F or it will test 127 levels of #include */ #include "nest1.h" mcpp-2.7.2/test-l/nest86.h0000644000175000017500000000004310216765467012125 00000000000000/* nest86.h */ #include "nest87.h" mcpp-2.7.2/test-l/nest109.h0000644000175000017500000000004510216765467012203 00000000000000/* nest109.h */ #include "nest110.h" mcpp-2.7.2/test-l/nest84.h0000644000175000017500000000004310216765467012123 00000000000000/* nest84.h */ #include "nest85.h" mcpp-2.7.2/test-l/nest61.h0000644000175000017500000000004310216765467012116 00000000000000/* nest61.h */ #include "nest62.h" mcpp-2.7.2/test-l/nest13.h0000644000175000017500000000004310216765467012113 00000000000000/* nest13.h */ #include "nest14.h" mcpp-2.7.2/test-l/nest50.h0000644000175000017500000000004310216765467012114 00000000000000/* nest50.h */ #include "nest51.h" mcpp-2.7.2/test-l/nest99.h0000644000175000017500000000004410216765467012132 00000000000000/* nest99.h */ #include "nest100.h" mcpp-2.7.2/test-l/nest34.h0000644000175000017500000000004310216765467012116 00000000000000/* nest34.h */ #include "nest35.h" mcpp-2.7.2/test-l/nest12.h0000644000175000017500000000004310216765467012112 00000000000000/* nest12.h */ #include "nest13.h" mcpp-2.7.2/test-l/nest25.h0000644000175000017500000000004310216765467012116 00000000000000/* nest25.h */ #include "nest26.h" mcpp-2.7.2/test-l/nest41.h0000644000175000017500000000004310216765467012114 00000000000000/* nest41.h */ #include "nest42.h" mcpp-2.7.2/test-l/nest37.h0000644000175000017500000000004310216765467012121 00000000000000/* nest37.h */ #include "nest38.h" mcpp-2.7.2/test-l/nest15.h0000644000175000017500000000011510216765467012115 00000000000000/* nest15.h */ #ifdef X0F nest = 0x0f; #else #include "nest16.h" #endif mcpp-2.7.2/test-l/nest73.h0000644000175000017500000000004310216765467012121 00000000000000/* nest73.h */ #include "nest74.h" mcpp-2.7.2/test-l/nest112.h0000644000175000017500000000004510216765467012175 00000000000000/* nest112.h */ #include "nest113.h" mcpp-2.7.2/test-l/nest114.h0000644000175000017500000000004510216765467012177 00000000000000/* nest114.h */ #include "nest115.h" mcpp-2.7.2/test-l/l_37_1.t0000644000175000017500000000260710216765467012006 00000000000000/* l_37_1.t: Translation limits larger than Standard / 1. */ /* 37.1L: Number of parameters in macro. */ #define glue255( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7, p7, \ a8, b8, c8, d8, e8, f8, g8, h8, i8, j8, k8, l8, m8, n8, o8, p8, \ a9, b9, c9, d9, e9, f9, g9, h9, i9, j9, k9, l9, m9, n9, o9, p9, \ aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, \ ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb, \ ac, bc, cc, dc, ec, fc, gc, hc, ic, jc, kc, lc, mc, nc, oc, pc, \ ad, bd, cd, dd, ed, fd, gd, hd, id, jd, kd, ld, md, nd, od, pd, \ ae, be, ce, de, ee, fe, ge, he, ie, je, ke, le, me, ne, oe, pe, \ af, bf, cf, df, ef, ff, gf, hf, if, jf, kf, lf, mf, nf, of) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## p7 ## \ p8 ## p9 ## pa ## pb ## pc ## pd ## pe ## of mcpp-2.7.2/test-l/nest52.h0000644000175000017500000000004310216765467012116 00000000000000/* nest52.h */ #include "nest53.h" mcpp-2.7.2/test-l/nest66.h0000644000175000017500000000004310216765467012123 00000000000000/* nest66.h */ #include "nest67.h" mcpp-2.7.2/test-l/nest48.h0000644000175000017500000000004310216765467012123 00000000000000/* nest48.h */ #include "nest49.h" mcpp-2.7.2/test-l/nest115.h0000644000175000017500000000004510216765467012200 00000000000000/* nest115.h */ #include "nest116.h" mcpp-2.7.2/test-l/nest90.h0000644000175000017500000000004310216765467012120 00000000000000/* nest90.h */ #include "nest91.h" mcpp-2.7.2/test-l/nest122.h0000644000175000017500000000004510216765467012176 00000000000000/* nest122.h */ #include "nest123.h" mcpp-2.7.2/test-l/nest68.h0000644000175000017500000000004310216765467012125 00000000000000/* nest68.h */ #include "nest69.h" mcpp-2.7.2/test-l/nest111.h0000644000175000017500000000004510216765467012174 00000000000000/* nest111.h */ #include "nest112.h" mcpp-2.7.2/test-l/l_37_8.c0000644000175000017500000000040010216765467011761 00000000000000/* l_37_8.c: Translation limits larger than Standard / 8. */ /* 37.8L: Length of logical source line. */ /* Define one of the macros X03FF, X07FF, X0FFF, X1FFF or it will test the line of 0x3fff bytes long. */ #include "longline.c" mcpp-2.7.2/test-l/l_37_3.c0000644000175000017500000000322310216765467011762 00000000000000/* l_37_3.c: Translation limits larger than Standard / 3. */ /* 37.3L: Significant initial characters in an internal identifier or a macro name. */ #include "defs.h" main( void) { /* Name of 127 bytes long. */ int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 127; int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdE = -127; #ifndef X7F /* Name of 255 bytes long. */ int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 255; int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdE = -255; #endif fputs( "started\n", stderr); assert( A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde == 127); #ifndef X7F assert( A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde == 255); #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-l/nest87.h0000644000175000017500000000004310216765467012126 00000000000000/* nest87.h */ #include "nest88.h" mcpp-2.7.2/test-l/nest5.h0000644000175000017500000000004110216765467012032 00000000000000/* nest5.h */ #include "nest6.h" mcpp-2.7.2/test-l/nest4.h0000644000175000017500000000004110216765467012031 00000000000000/* nest4.h */ #include "nest5.h" mcpp-2.7.2/test-l/nest49.h0000644000175000017500000000004310216765467012124 00000000000000/* nest49.h */ #include "nest50.h" mcpp-2.7.2/test-l/nest22.h0000644000175000017500000000004310216765467012113 00000000000000/* nest22.h */ #include "nest23.h" mcpp-2.7.2/test-l/nest108.h0000644000175000017500000000004510216765467012202 00000000000000/* nest108.h */ #include "nest109.h" mcpp-2.7.2/test-l/nest123.h0000644000175000017500000000004510216765467012177 00000000000000/* nest123.h */ #include "nest124.h" mcpp-2.7.2/test-l/nest88.h0000644000175000017500000000004310216765467012127 00000000000000/* nest88.h */ #include "nest89.h" mcpp-2.7.2/test-l/nest91.h0000644000175000017500000000004310216765467012121 00000000000000/* nest91.h */ #include "nest92.h" mcpp-2.7.2/test-l/nest44.h0000644000175000017500000000004310216765467012117 00000000000000/* nest44.h */ #include "nest45.h" mcpp-2.7.2/test-l/m8191.h0000644000175000017500000030010210216765467011554 00000000000000/* m8191.h */ #define AAA #define AAB #define AAC #define AAD #define AAE #define AAF #define AAG #define AAH #define AAI #define AAJ #define AAK #define AAL #define AAM #define AAN #define AAO #define AAP #define AAQ #define AAR #define AAS #define AAT #define AAU #define AAV #define AAW #define AAX #define AAY #define AAZ #define ABA #define ABB #define ABC #define ABD #define ABE #define ABF #define ABG #define ABH #define ABI #define ABJ #define ABK #define ABL #define ABM #define ABN #define ABO #define ABP #define ABQ #define ABR #define ABS #define ABT #define ABU #define ABV #define ABW #define ABX #define ABY #define ABZ #define ACA #define ACB #define ACC #define ACD #define ACE #define ACF #define ACG #define ACH #define ACI #define ACJ #define ACK #define ACL #define ACM #define ACN #define ACO #define ACP #define ACQ #define ACR #define ACS #define ACT #define ACU #define ACV #define ACW #define ACX #define ACY #define ACZ #define ADA #define ADB #define ADC #define ADD #define ADE #define ADF #define ADG #define ADH #define ADI #define ADJ #define ADK #define ADL #define ADM #define ADN #define ADO #define ADP #define ADQ #define ADR #define ADS #define ADT #define ADU #define ADV #define ADW #define ADX #define ADY #define ADZ #define AEA #define AEB #define AEC #define AED #define AEE #define AEF #define AEG #define AEH #define AEI #define AEJ #define AEK #define AEL #define AEM #define AEN #define AEO #define AEP #define AEQ #define AER #define AES #define AET #define AEU #define AEV #define AEW #define AEX #define AEY #define AEZ #define AFA #define AFB #define AFC #define AFD #define AFE #define AFF #define AFG #define AFH #define AFI #define AFJ #define AFK #define AFL #define AFM #define AFN #define AFO #define AFP #define AFQ #define AFR #define AFS #define AFT #define AFU #define AFV #define AFW #define AFX #define AFY #define AFZ #define AGA #define AGB #define AGC #define AGD #define AGE #define AGF #define AGG #define AGH #define AGI #define AGJ #define AGK #define AGL #define AGM #define AGN #define AGO #define AGP #define AGQ #define AGR #define AGS #define AGT #define AGU #define AGV #define AGW #define AGX #define AGY #define AGZ #define AHA #define AHB #define AHC #define AHD #define AHE #define AHF #define AHG #define AHH #define AHI #define AHJ #define AHK #define AHL #define AHM #define AHN #define AHO #define AHP #define AHQ #define AHR #define AHS #define AHT #define AHU #define AHV #define AHW #define AHX #define AHY #define AHZ #define AIA #define AIB #define AIC #define AID #define AIE #define AIF #define AIG #define AIH #define AII #define AIJ #define AIK #define AIL #define AIM #define AIN #define AIO #define AIP #define AIQ #define AIR #define AIS #define AIT #define AIU #define AIV #define AIW #define AIX #define AIY #define AIZ #define AJA #define AJB #define AJC #define AJD #define AJE #define AJF #define AJG #define AJH #define AJI #define AJJ #define AJK #define AJL #define AJM #define AJN #define AJO #define AJP #define AJQ #define AJR #define AJS #define AJT #define AJU #define AJV #define AJW #define AJX #define AJY #define AJZ #define AKA #define AKB #define AKC #define AKD #define AKE #define AKF #define AKG #define AKH #define AKI #define AKJ #define AKK #define AKL #define AKM #define AKN #define AKO #define AKP #define AKQ #define AKR #define AKS #define AKT #define AKU #define AKV #define AKW #define AKX #define AKY #define AKZ #define ALA #define ALB #define ALC #define ALD #define ALE #define ALF #define ALG #define ALH #define ALI #define ALJ #define ALK #define ALL #define ALM #define ALN #define ALO #define ALP #define ALQ #define ALR #define ALS #define ALT #define ALU #define ALV #define ALW #define ALX #define ALY #define ALZ #define AMA #define AMB #define AMC #define AMD #define AME #define AMF #define AMG #define AMH #define AMI #define AMJ #define AMK #define AML #define AMM #define AMN #define AMO #define AMP #define AMQ #define AMR #define AMS #define AMT #define AMU #define AMV #define AMW #define AMX #define AMY #define AMZ #define ANA #define ANB #define ANC #define AND #define ANE #define ANF #define ANG #define ANH #define ANI #define ANJ #define ANK #define ANL #define ANM #define ANN #define ANO #define ANP #define ANQ #define ANR #define ANS #define ANT #define ANU #define ANV #define ANW #define ANX #define ANY #define ANZ #define AOA #define AOB #define AOC #define AOD #define AOE #define AOF #define AOG #define AOH #define AOI #define AOJ #define AOK #define AOL #define AOM #define AON #define AOO #define AOP #define AOQ #define AOR #define AOS #define AOT #define AOU #define AOV #define AOW #define AOX #define AOY #define AOZ #define APA #define APB #define APC #define APD #define APE #define APF #define APG #define APH #define API #define APJ #define APK #define APL #define APM #define APN #define APO #define APP #define APQ #define APR #define APS #define APT #define APU #define APV #define APW #define APX #define APY #define APZ #define AQA #define AQB #define AQC #define AQD #define AQE #define AQF #define AQG #define AQH #define AQI #define AQJ #define AQK #define AQL #define AQM #define AQN #define AQO #define AQP #define AQQ #define AQR #define AQS #define AQT #define AQU #define AQV #define AQW #define AQX #define AQY #define AQZ #define ARA #define ARB #define ARC #define ARD #define ARE #define ARF #define ARG #define ARH #define ARI #define ARJ #define ARK #define ARL #define ARM #define ARN #define ARO #define ARP #define ARQ #define ARR #define ARS #define ART #define ARU #define ARV #define ARW #define ARX #define ARY #define ARZ #define ASA #define ASB #define ASC #define ASD #define ASE #define ASF #define ASG #define ASH #define ASI #define ASJ #define ASK #define ASL #define ASM #define ASN #define ASO #define ASP #define ASQ #define ASR #define ASS #define AST #define ASU #define ASV #define ASW #define ASX #define ASY #define ASZ #define ATA #define ATB #define ATC #define ATD #define ATE #define ATF #define ATG #define ATH #define ATI #define ATJ #define ATK #define ATL #define ATM #define ATN #define ATO #define ATP #define ATQ #define ATR #define ATS #define ATT #define ATU #define ATV #define ATW #define ATX #define ATY #define ATZ #define AUA #define AUB #define AUC #define AUD #define AUE #define AUF #define AUG #define AUH #define AUI #define AUJ #define AUK #define AUL #define AUM #define AUN #define AUO #define AUP #define AUQ #define AUR #define AUS #define AUT #define AUU #define AUV #define AUW #define AUX #define AUY #define AUZ #define AVA #define AVB #define AVC #define AVD #define AVE #define AVF #define AVG #define AVH #define AVI #define AVJ #define AVK #define AVL #define AVM #define AVN #define AVO #define AVP #define AVQ #define AVR #define AVS #define AVT #define AVU #define AVV #define AVW #define AVX #define AVY #define AVZ #define AWA #define AWB #define AWC #define AWD #define AWE #define AWF #define AWG #define AWH #define AWI #define AWJ #define AWK #define AWL #define AWM #define AWN #define AWO #define AWP #define AWQ #define AWR #define AWS #define AWT #define AWU #define AWV #define AWW #define AWX #define AWY #define AWZ #define AXA #define AXB #define AXC #define AXD #define AXE #define AXF #define AXG #define AXH #define AXI #define AXJ #define AXK #define AXL #define AXM #define AXN #define AXO #define AXP #define AXQ #define AXR #define AXS #define AXT #define AXU #define AXV #define AXW #define AXX #define AXY #define AXZ #define AYA #define AYB #define AYC #define AYD #define AYE #define AYF #define AYG #define AYH #define AYI #define AYJ #define AYK #define AYL #define AYM #define AYN #define AYO #define AYP #define AYQ #define AYR #define AYS #define AYT #define AYU #define AYV #define AYW #define AYX #define AYY #define AYZ #define AZA #define AZB #define AZC #define AZD #define AZE #define AZF #define AZG #define AZH #define AZI #define AZJ #define AZK #define AZL #define AZM #define AZN #define AZO #define AZP #define AZQ #define AZR #define AZS #define AZT #define AZU #define AZV #define AZW #define AZX #define AZY #define AZZ #define BAA #define BAB #define BAC #define BAD #define BAE #define BAF #define BAG #define BAH #define BAI #define BAJ #define BAK #define BAL #define BAM #define BAN #define BAO #define BAP #define BAQ #define BAR #define BAS #define BAT #define BAU #define BAV #define BAW #define BAX #define BAY #define BAZ #define BBA #define BBB #define BBC #define BBD #define BBE #define BBF #define BBG #define BBH #define BBI #define BBJ #define BBK #define BBL #define BBM #define BBN #define BBO #define BBP #define BBQ #define BBR #define BBS #define BBT #define BBU #define BBV #define BBW #define BBX #define BBY #define BBZ #define BCA #define BCB #define BCC #define BCD #define BCE #define BCF #define BCG #define BCH #define BCI #define BCJ #define BCK #define BCL #define BCM #define BCN #define BCO #define BCP #define BCQ #define BCR #define BCS #define BCT #define BCU #define BCV #define BCW #define BCX #define BCY #define BCZ #define BDA #define BDB #define BDC #define BDD #define BDE #define BDF #define BDG #define BDH #define BDI #define BDJ #define BDK #define BDL #define BDM #define BDN #define BDO #define BDP #define BDQ #define BDR #define BDS #define BDT #define BDU #define BDV #define BDW #define BDX #define BDY #define BDZ #define BEA #define BEB #define BEC #define BED #define BEE #define BEF #define BEG #define BEH #define BEI #define BEJ #define BEK #define BEL #define BEM #define BEN #define BEO #define BEP #define BEQ #define BER #define BES #define BET #define BEU #define BEV #define BEW #define BEX #define BEY #define BEZ #define BFA #define BFB #define BFC #define BFD #define BFE #define BFF #define BFG #define BFH #define BFI #define BFJ #define BFK #define BFL #define BFM #define BFN #define BFO #define BFP #define BFQ #define BFR #define BFS #define BFT #define BFU #define BFV #define BFW #define BFX #define BFY #define BFZ #define BGA #define BGB #define BGC #define BGD #define BGE #define BGF #define BGG #define BGH #define BGI #define BGJ #define BGK #define BGL #define BGM #define BGN #define BGO #define BGP #define BGQ #define BGR #define BGS #define BGT #define BGU #define BGV #define BGW #define BGX #define BGY #define BGZ #define BHA #define BHB #define BHC #define BHD #define BHE #define BHF #define BHG #define BHH #define BHI #define BHJ #define BHK #define BHL #define BHM #define BHN #define BHO #define BHP #define BHQ #define BHR #define BHS #define BHT #define BHU #define BHV #define BHW #define BHX #define BHY #define BHZ #define BIA #define BIB #define BIC #define BID #define BIE #define BIF #define BIG #define BIH #define BII #define BIJ #define BIK #define BIL #define BIM #define BIN #define BIO #define BIP #define BIQ #define BIR #define BIS #define BIT #define BIU #define BIV #define BIW #define BIX #define BIY #define BIZ #define BJA #define BJB #define BJC #define BJD #define BJE #define BJF #define BJG #define BJH #define BJI #define BJJ #define BJK #define BJL #define BJM #define BJN #define BJO #define BJP #define BJQ #define BJR #define BJS #define BJT #define BJU #define BJV #define BJW #define BJX #define BJY #define BJZ #define BKA #define BKB #define BKC #define BKD #define BKE #define BKF #define BKG #define BKH #define BKI #define BKJ #define BKK #define BKL #define BKM #define BKN #define BKO #define BKP #define BKQ #define BKR #define BKS #define BKT #define BKU #define BKV #define BKW #define BKX #define BKY #define BKZ #define BLA #define BLB #define BLC #define BLD #define BLE #define BLF #define BLG #define BLH #define BLI #define BLJ #define BLK #define BLL #define BLM #define BLN #define BLO #define BLP #define BLQ #define BLR #define BLS #define BLT #define BLU #define BLV #define BLW #define BLX #define BLY #define BLZ #define BMA #define BMB #define BMC #define BMD #define BME #define BMF #define BMG #define BMH #define BMI #define BMJ #define BMK #define BML #define BMM #define BMN #define BMO #define BMP #define BMQ #define BMR #define BMS #define BMT #define BMU #define BMV #define BMW #define BMX #define BMY #define BMZ #define BNA #define BNB #define BNC #define BND #define BNE #define BNF #define BNG #define BNH #define BNI #define BNJ #define BNK #define BNL #define BNM #define BNN #define BNO #define BNP #define BNQ #define BNR #define BNS #define BNT #define BNU #define BNV #define BNW #define BNX #define BNY #define BNZ #define BOA #define BOB #define BOC #define BOD #define BOE #define BOF #define BOG #define BOH #define BOI #define BOJ #define BOK #define BOL #define BOM #define BON #define BOO #define BOP #define BOQ #define BOR #define BOS #define BOT #define BOU #define BOV #define BOW #define BOX #define BOY #define BOZ #define BPA #define BPB #define BPC #define BPD #define BPE #define BPF #define BPG #define BPH #define BPI #define BPJ #define BPK #define BPL #define BPM #define BPN #define BPO #define BPP #define BPQ #define BPR #define BPS #define BPT #define BPU #define BPV #define BPW #define BPX #define BPY #define BPZ #define BQA #define BQB #define BQC #define BQD #define BQE #define BQF #define BQG #define BQH #define BQI #define BQJ #define BQK #define BQL #define BQM #define BQN #define BQO #define BQP #define BQQ #define BQR #define BQS #define BQT #define BQU #define BQV #define BQW #define BQX #define BQY #define BQZ #define BRA #define BRB #define BRC #define BRD #define BRE #define BRF #define BRG #define BRH #define BRI #define BRJ #define BRK #define BRL #define BRM #define BRN #define BRO #define BRP #define BRQ #define BRR #define BRS #define BRT #define BRU #define BRV #define BRW #define BRX #define BRY #define BRZ #define BSA #define BSB #define BSC #define BSD #define BSE #define BSF #define BSG #define BSH #define BSI #define BSJ #define BSK #define BSL #define BSM #define BSN #define BSO #define BSP #define BSQ #define BSR #define BSS #define BST #define BSU #define BSV #define BSW #define BSX #define BSY #define BSZ #define BTA #define BTB #define BTC #define BTD #define BTE #define BTF #define BTG #define BTH #define BTI #define BTJ #define BTK #define BTL #define BTM #define BTN #define BTO #define BTP #define BTQ #define BTR #define BTS #define BTT #define BTU #define BTV #define BTW #define BTX #define BTY #define BTZ #define BUA #define BUB #define BUC #define BUD #define BUE #define BUF #define BUG #define BUH #define BUI #define BUJ #define BUK #define BUL #define BUM #define BUN #define BUO #define BUP #define BUQ #define BUR #define BUS #define BUT #define BUU #define BUV #define BUW #define BUX #define BUY #define BUZ #define BVA #define BVB #define BVC #define BVD #define BVE #define BVF #define BVG #define BVH #define BVI #define BVJ #define BVK #define BVL #define BVM #define BVN #define BVO #define BVP #define BVQ #define BVR #define BVS #define BVT #define BVU #define BVV #define BVW #define BVX #define BVY #define BVZ #define BWA #define BWB #define BWC #define BWD #define BWE #define BWF #define BWG #define BWH #define BWI #define BWJ #define BWK #define BWL #define BWM #define BWN #define BWO #define BWP #define BWQ #define BWR #define BWS #define BWT #define BWU #define BWV #define BWW #define BWX #define BWY #define BWZ #define BXA #define BXB #define BXC #define BXD #define BXE #define BXF #define BXG #define BXH #define BXI #define BXJ #define BXK #define BXL #define BXM #define BXN #define BXO #define BXP #define BXQ #define BXR #define BXS #define BXT #define BXU #define BXV #define BXW #define BXX #define BXY #define BXZ #define BYA #define BYB #define BYC #define BYD #define BYE #define BYF #define BYG #define BYH #define BYI #define BYJ #define BYK #define BYL #define BYM #define BYN #define BYO #define BYP #define BYQ #define BYR #define BYS #define BYT #define BYU #define BYV #define BYW #define BYX #define BYY #define BYZ #define BZA #define BZB #define BZC #define BZD #define BZE #define BZF #define BZG #define BZH #define BZI #define BZJ #define BZK #define BZL #define BZM #define BZN #define BZO #define BZP #define BZQ #define BZR #define BZS #define BZT #define BZU #define BZV #define BZW #define BZX #define BZY #define BZZ #define CAA #define CAB #define CAC #define CAD #define CAE #define CAF #define CAG #define CAH #define CAI #define CAJ #define CAK #define CAL #define CAM #define CAN #define CAO #define CAP #define CAQ #define CAR #define CAS #define CAT #define CAU #define CAV #define CAW #define CAX #define CAY #define CAZ #define CBA #define CBB #define CBC #define CBD #define CBE #define CBF #define CBG #define CBH #define CBI #define CBJ #define CBK #define CBL #define CBM #define CBN #define CBO #define CBP #define CBQ #define CBR #define CBS #define CBT #define CBU #define CBV #define CBW #define CBX #define CBY #define CBZ #define CCA #define CCB #define CCC #define CCD #define CCE #define CCF #define CCG #define CCH #define CCI #define CCJ #define CCK #define CCL #define CCM #define CCN #define CCO #define CCP #define CCQ #define CCR #define CCS #define CCT #define CCU #define CCV #define CCW #define CCX #define CCY #define CCZ #define CDA #define CDB #define CDC #define CDD #define CDE #define CDF #define CDG #define CDH #define CDI #define CDJ #define CDK #define CDL #define CDM #define CDN #define CDO #define CDP #define CDQ #define CDR #define CDS #define CDT #define CDU #define CDV #define CDW #define CDX #define CDY #define CDZ #define CEA #define CEB #define CEC #define CED #define CEE #define CEF #define CEG #define CEH #define CEI #define CEJ #define CEK #define CEL #define CEM #define CEN #define CEO #define CEP #define CEQ #define CER #define CES #define CET #define CEU #define CEV #define CEW #define CEX #define CEY #define CEZ #define CFA #define CFB #define CFC #define CFD #define CFE #define CFF #define CFG #define CFH #define CFI #define CFJ #define CFK #define CFL #define CFM #define CFN #define CFO #define CFP #define CFQ #define CFR #define CFS #define CFT #define CFU #define CFV #define CFW #define CFX #define CFY #define CFZ #define CGA #define CGB #define CGC #define CGD #define CGE #define CGF #define CGG #define CGH #define CGI #define CGJ #define CGK #define CGL #define CGM #define CGN #define CGO #define CGP #define CGQ #define CGR #define CGS #define CGT #define CGU #define CGV #define CGW #define CGX #define CGY #define CGZ #define CHA #define CHB #define CHC #define CHD #define CHE #define CHF #define CHG #define CHH #define CHI #define CHJ #define CHK #define CHL #define CHM #define CHN #define CHO #define CHP #define CHQ #define CHR #define CHS #define CHT #define CHU #define CHV #define CHW #define CHX #define CHY #define CHZ #define CIA #define CIB #define CIC #define CID #define CIE #define CIF #define CIG #define CIH #define CII #define CIJ #define CIK #define CIL #define CIM #define CIN #define CIO #define CIP #define CIQ #define CIR #define CIS #define CIT #define CIU #define CIV #define CIW #define CIX #define CIY #define CIZ #define CJA #define CJB #define CJC #define CJD #define CJE #define CJF #define CJG #define CJH #define CJI #define CJJ #define CJK #define CJL #define CJM #define CJN #define CJO #define CJP #define CJQ #define CJR #define CJS #define CJT #define CJU #define CJV #define CJW #define CJX #define CJY #define CJZ #define CKA #define CKB #define CKC #define CKD #define CKE #define CKF #define CKG #define CKH #define CKI #define CKJ #define CKK #define CKL #define CKM #define CKN #define CKO #define CKP #define CKQ #define CKR #define CKS #define CKT #define CKU #define CKV #define CKW #define CKX #define CKY #define CKZ #define CLA #define CLB #define CLC #define CLD #define CLE #define CLF #define CLG #define CLH #define CLI #define CLJ #define CLK #define CLL #define CLM #define CLN #define CLO #define CLP #define CLQ #define CLR #define CLS #define CLT #define CLU #define CLV #define CLW #define CLX #define CLY #define CLZ #define CMA #define CMB #define CMC #define CMD #define CME #define CMF #define CMG #define CMH #define CMI #define CMJ #define CMK #define CML #define CMM #define CMN #define CMO #define CMP #define CMQ #define CMR #define CMS #define CMT #define CMU #define CMV #define CMW #define CMX #define CMY #define CMZ #define CNA #define CNB #define CNC #define CND #define CNE #define CNF #define CNG #define CNH #define CNI #define CNJ #define CNK #define CNL #define CNM #define CNN #define CNO #define CNP #define CNQ #define CNR #define CNS #define CNT #define CNU #define CNV #define CNW #define CNX #define CNY #define CNZ #define COA #define COB #define COC #define COD #define COE #define COF #define COG #define COH #define COI #define COJ #define COK #define COL #define COM #define CON #define COO #define COP #define COQ #define COR #define COS #define COT #define COU #define COV #define COW #define COX #define COY #define COZ #define CPA #define CPB #define CPC #define CPD #define CPE #define CPF #define CPG #define CPH #define CPI #define CPJ #define CPK #define CPL #define CPM #define CPN #define CPO #define CPP #define CPQ #define CPR #define CPS #define CPT #define CPU #define CPV #define CPW #define CPX #define CPY #define CPZ #define CQA #define CQB #define CQC #define CQD #define CQE #define CQF #define CQG #define CQH #define CQI #define CQJ #define CQK #define CQL #define CQM #define CQN #define CQO #define CQP #define CQQ #define CQR #define CQS #define CQT #define CQU #define CQV #define CQW #define CQX #define CQY #define CQZ #define CRA #define CRB #define CRC #define CRD #define CRE #define CRF #define CRG #define CRH #define CRI #define CRJ #define CRK #define CRL #define CRM #define CRN #define CRO #define CRP #define CRQ #define CRR #define CRS #define CRT #define CRU #define CRV #define CRW #define CRX #define CRY #define CRZ #define CSA #define CSB #define CSC #define CSD #define CSE #define CSF #define CSG #define CSH #define CSI #define CSJ #define CSK #define CSL #define CSM #define CSN #define CSO #define CSP #define CSQ #define CSR #define CSS #define CST #define CSU #define CSV #define CSW #define CSX #define CSY #define CSZ #define CTA #define CTB #define CTC #define CTD #define CTE #define CTF #define CTG #define CTH #define CTI #define CTJ #define CTK #define CTL #define CTM #define CTN #define CTO #define CTP #define CTQ #define CTR #define CTS #define CTT #define CTU #define CTV #define CTW #define CTX #define CTY #define CTZ #define CUA #define CUB #define CUC #define CUD #define CUE #define CUF #define CUG #define CUH #define CUI #define CUJ #define CUK #define CUL #define CUM #define CUN #define CUO #define CUP #define CUQ #define CUR #define CUS #define CUT #define CUU #define CUV #define CUW #define CUX #define CUY #define CUZ #define CVA #define CVB #define CVC #define CVD #define CVE #define CVF #define CVG #define CVH #define CVI #define CVJ #define CVK #define CVL #define CVM #define CVN #define CVO #define CVP #define CVQ #define CVR #define CVS #define CVT #define CVU #define CVV #define CVW #define CVX #define CVY #define CVZ #define CWA #define CWB #define CWC #define CWD #define CWE #define CWF #define CWG #define CWH #define CWI #define CWJ #define CWK #define CWL #define CWM #define CWN #define CWO #define CWP #define CWQ #define CWR #define CWS #define CWT #define CWU #define CWV #define CWW #define CWX #define CWY #define CWZ #define CXA #define CXB #define CXC #define CXD #define CXE #define CXF #define CXG #define CXH #define CXI #define CXJ #define CXK #define CXL #define CXM #define CXN #define CXO #define CXP #define CXQ #define CXR #define CXS #define CXT #define CXU #define CXV #define CXW #define CXX #define CXY #define CXZ #define CYA #define CYB #define CYC #define CYD #define CYE #define CYF #define CYG #define CYH #define CYI #define CYJ #define CYK #define CYL #define CYM #define CYN #define CYO #define CYP #define CYQ #define CYR #define CYS #define CYT #define CYU #define CYV #define CYW #define CYX #define CYY #define CYZ #define CZA #define CZB #define CZC #define CZD #define CZE #define CZF #define CZG #define CZH #define CZI #define CZJ #define CZK #define CZL #define CZM #define CZN #define CZO #define CZP #define CZQ #define CZR #define CZS #define CZT #define CZU #define CZV #define CZW #define CZX #define CZY #define CZZ #define DAA #define DAB #define DAC #define DAD #define DAE #define DAF #define DAG #define DAH #define DAI #define DAJ #define DAK #define DAL #define DAM #define DAN #define DAO #define DAP #define DAQ #define DAR #define DAS 0x07ff #ifndef X07FF #define DAT #define DAU #define DAV #define DAW #define DAX #define DAY #define DAZ #define DBA #define DBB #define DBC #define DBD #define DBE #define DBF #define DBG #define DBH #define DBI #define DBJ #define DBK #define DBL #define DBM #define DBN #define DBO #define DBP #define DBQ #define DBR #define DBS #define DBT #define DBU #define DBV #define DBW #define DBX #define DBY #define DBZ #define DCA #define DCB #define DCC #define DCD #define DCE #define DCF #define DCG #define DCH #define DCI #define DCJ #define DCK #define DCL #define DCM #define DCN #define DCO #define DCP #define DCQ #define DCR #define DCS #define DCT #define DCU #define DCV #define DCW #define DCX #define DCY #define DCZ #define DDA #define DDB #define DDC #define DDD #define DDE #define DDF #define DDG #define DDH #define DDI #define DDJ #define DDK #define DDL #define DDM #define DDN #define DDO #define DDP #define DDQ #define DDR #define DDS #define DDT #define DDU #define DDV #define DDW #define DDX #define DDY #define DDZ #define DEA #define DEB #define DEC #define DED #define DEE #define DEF #define DEG #define DEH #define DEI #define DEJ #define DEK #define DEL #define DEM #define DEN #define DEO #define DEP #define DEQ #define DER #define DES #define DET #define DEU #define DEV #define DEW #define DEX #define DEY #define DEZ #define DFA #define DFB #define DFC #define DFD #define DFE #define DFF #define DFG #define DFH #define DFI #define DFJ #define DFK #define DFL #define DFM #define DFN #define DFO #define DFP #define DFQ #define DFR #define DFS #define DFT #define DFU #define DFV #define DFW #define DFX #define DFY #define DFZ #define DGA #define DGB #define DGC #define DGD #define DGE #define DGF #define DGG #define DGH #define DGI #define DGJ #define DGK #define DGL #define DGM #define DGN #define DGO #define DGP #define DGQ #define DGR #define DGS #define DGT #define DGU #define DGV #define DGW #define DGX #define DGY #define DGZ #define DHA #define DHB #define DHC #define DHD #define DHE #define DHF #define DHG #define DHH #define DHI #define DHJ #define DHK #define DHL #define DHM #define DHN #define DHO #define DHP #define DHQ #define DHR #define DHS #define DHT #define DHU #define DHV #define DHW #define DHX #define DHY #define DHZ #define DIA #define DIB #define DIC #define DID #define DIE #define DIF #define DIG #define DIH #define DII #define DIJ #define DIK #define DIL #define DIM #define DIN #define DIO #define DIP #define DIQ #define DIR #define DIS #define DIT #define DIU #define DIV #define DIW #define DIX #define DIY #define DIZ #define DJA #define DJB #define DJC #define DJD #define DJE #define DJF #define DJG #define DJH #define DJI #define DJJ #define DJK #define DJL #define DJM #define DJN #define DJO #define DJP #define DJQ #define DJR #define DJS #define DJT #define DJU #define DJV #define DJW #define DJX #define DJY #define DJZ #define DKA #define DKB #define DKC #define DKD #define DKE #define DKF #define DKG #define DKH #define DKI #define DKJ #define DKK #define DKL #define DKM #define DKN #define DKO #define DKP #define DKQ #define DKR #define DKS #define DKT #define DKU #define DKV #define DKW #define DKX #define DKY #define DKZ #define DLA #define DLB #define DLC #define DLD #define DLE #define DLF #define DLG #define DLH #define DLI #define DLJ #define DLK #define DLL #define DLM #define DLN #define DLO #define DLP #define DLQ #define DLR #define DLS #define DLT #define DLU #define DLV #define DLW #define DLX #define DLY #define DLZ #define DMA #define DMB #define DMC #define DMD #define DME #define DMF #define DMG #define DMH #define DMI #define DMJ #define DMK #define DML #define DMM #define DMN #define DMO #define DMP #define DMQ #define DMR #define DMS #define DMT #define DMU #define DMV #define DMW #define DMX #define DMY #define DMZ #define DNA #define DNB #define DNC #define DND #define DNE #define DNF #define DNG #define DNH #define DNI #define DNJ #define DNK #define DNL #define DNM #define DNN #define DNO #define DNP #define DNQ #define DNR #define DNS #define DNT #define DNU #define DNV #define DNW #define DNX #define DNY #define DNZ #define DOA #define DOB #define DOC #define DOD #define DOE #define DOF #define DOG #define DOH #define DOI #define DOJ #define DOK #define DOL #define DOM #define DON #define DOO #define DOP #define DOQ #define DOR #define DOS #define DOT #define DOU #define DOV #define DOW #define DOX #define DOY #define DOZ #define DPA #define DPB #define DPC #define DPD #define DPE #define DPF #define DPG #define DPH #define DPI #define DPJ #define DPK #define DPL #define DPM #define DPN #define DPO #define DPP #define DPQ #define DPR #define DPS #define DPT #define DPU #define DPV #define DPW #define DPX #define DPY #define DPZ #define DQA #define DQB #define DQC #define DQD #define DQE #define DQF #define DQG #define DQH #define DQI #define DQJ #define DQK #define DQL #define DQM #define DQN #define DQO #define DQP #define DQQ #define DQR #define DQS #define DQT #define DQU #define DQV #define DQW #define DQX #define DQY #define DQZ #define DRA #define DRB #define DRC #define DRD #define DRE #define DRF #define DRG #define DRH #define DRI #define DRJ #define DRK #define DRL #define DRM #define DRN #define DRO #define DRP #define DRQ #define DRR #define DRS #define DRT #define DRU #define DRV #define DRW #define DRX #define DRY #define DRZ #define DSA #define DSB #define DSC #define DSD #define DSE #define DSF #define DSG #define DSH #define DSI #define DSJ #define DSK #define DSL #define DSM #define DSN #define DSO #define DSP #define DSQ #define DSR #define DSS #define DST #define DSU #define DSV #define DSW #define DSX #define DSY #define DSZ #define DTA #define DTB #define DTC #define DTD #define DTE #define DTF #define DTG #define DTH #define DTI #define DTJ #define DTK #define DTL #define DTM #define DTN #define DTO #define DTP #define DTQ #define DTR #define DTS #define DTT #define DTU #define DTV #define DTW #define DTX #define DTY #define DTZ #define DUA #define DUB #define DUC #define DUD #define DUE #define DUF #define DUG #define DUH #define DUI #define DUJ #define DUK #define DUL #define DUM #define DUN #define DUO #define DUP #define DUQ #define DUR #define DUS #define DUT #define DUU #define DUV #define DUW #define DUX #define DUY #define DUZ #define DVA #define DVB #define DVC #define DVD #define DVE #define DVF #define DVG #define DVH #define DVI #define DVJ #define DVK #define DVL #define DVM #define DVN #define DVO #define DVP #define DVQ #define DVR #define DVS #define DVT #define DVU #define DVV #define DVW #define DVX #define DVY #define DVZ #define DWA #define DWB #define DWC #define DWD #define DWE #define DWF #define DWG #define DWH #define DWI #define DWJ #define DWK #define DWL #define DWM #define DWN #define DWO #define DWP #define DWQ #define DWR #define DWS #define DWT #define DWU #define DWV #define DWW #define DWX #define DWY #define DWZ #define DXA #define DXB #define DXC #define DXD #define DXE #define DXF #define DXG #define DXH #define DXI #define DXJ #define DXK #define DXL #define DXM #define DXN #define DXO #define DXP #define DXQ #define DXR #define DXS #define DXT #define DXU #define DXV #define DXW #define DXX #define DXY #define DXZ #define DYA #define DYB #define DYC #define DYD #define DYE #define DYF #define DYG #define DYH #define DYI #define DYJ #define DYK #define DYL #define DYM #define DYN #define DYO #define DYP #define DYQ #define DYR #define DYS #define DYT #define DYU #define DYV #define DYW #define DYX #define DYY #define DYZ #define DZA #define DZB #define DZC #define DZD #define DZE #define DZF #define DZG #define DZH #define DZI #define DZJ #define DZK #define DZL #define DZM #define DZN #define DZO #define DZP #define DZQ #define DZR #define DZS #define DZT #define DZU #define DZV #define DZW #define DZX #define DZY #define DZZ #define EAA #define EAB #define EAC #define EAD #define EAE #define EAF #define EAG #define EAH #define EAI #define EAJ #define EAK #define EAL #define EAM #define EAN #define EAO #define EAP #define EAQ #define EAR #define EAS #define EAT #define EAU #define EAV #define EAW #define EAX #define EAY #define EAZ #define EBA #define EBB #define EBC #define EBD #define EBE #define EBF #define EBG #define EBH #define EBI #define EBJ #define EBK #define EBL #define EBM #define EBN #define EBO #define EBP #define EBQ #define EBR #define EBS #define EBT #define EBU #define EBV #define EBW #define EBX #define EBY #define EBZ #define ECA #define ECB #define ECC #define ECD #define ECE #define ECF #define ECG #define ECH #define ECI #define ECJ #define ECK #define ECL #define ECM #define ECN #define ECO #define ECP #define ECQ #define ECR #define ECS #define ECT #define ECU #define ECV #define ECW #define ECX #define ECY #define ECZ #define EDA #define EDB #define EDC #define EDD #define EDE #define EDF #define EDG #define EDH #define EDI #define EDJ #define EDK #define EDL #define EDM #define EDN #define EDO #define EDP #define EDQ #define EDR #define EDS #define EDT #define EDU #define EDV #define EDW #define EDX #define EDY #define EDZ #define EEA #define EEB #define EEC #define EED #define EEE #define EEF #define EEG #define EEH #define EEI #define EEJ #define EEK #define EEL #define EEM #define EEN #define EEO #define EEP #define EEQ #define EER #define EES #define EET #define EEU #define EEV #define EEW #define EEX #define EEY #define EEZ #define EFA #define EFB #define EFC #define EFD #define EFE #define EFF #define EFG #define EFH #define EFI #define EFJ #define EFK #define EFL #define EFM #define EFN #define EFO #define EFP #define EFQ #define EFR #define EFS #define EFT #define EFU #define EFV #define EFW #define EFX #define EFY #define EFZ #define EGA #define EGB #define EGC #define EGD #define EGE #define EGF #define EGG #define EGH #define EGI #define EGJ #define EGK #define EGL #define EGM #define EGN #define EGO #define EGP #define EGQ #define EGR #define EGS #define EGT #define EGU #define EGV #define EGW #define EGX #define EGY #define EGZ #define EHA #define EHB #define EHC #define EHD #define EHE #define EHF #define EHG #define EHH #define EHI #define EHJ #define EHK #define EHL #define EHM #define EHN #define EHO #define EHP #define EHQ #define EHR #define EHS #define EHT #define EHU #define EHV #define EHW #define EHX #define EHY #define EHZ #define EIA #define EIB #define EIC #define EID #define EIE #define EIF #define EIG #define EIH #define EII #define EIJ #define EIK #define EIL #define EIM #define EIN #define EIO #define EIP #define EIQ #define EIR #define EIS #define EIT #define EIU #define EIV #define EIW #define EIX #define EIY #define EIZ #define EJA #define EJB #define EJC #define EJD #define EJE #define EJF #define EJG #define EJH #define EJI #define EJJ #define EJK #define EJL #define EJM #define EJN #define EJO #define EJP #define EJQ #define EJR #define EJS #define EJT #define EJU #define EJV #define EJW #define EJX #define EJY #define EJZ #define EKA #define EKB #define EKC #define EKD #define EKE #define EKF #define EKG #define EKH #define EKI #define EKJ #define EKK #define EKL #define EKM #define EKN #define EKO #define EKP #define EKQ #define EKR #define EKS #define EKT #define EKU #define EKV #define EKW #define EKX #define EKY #define EKZ #define ELA #define ELB #define ELC #define ELD #define ELE #define ELF #define ELG #define ELH #define ELI #define ELJ #define ELK #define ELL #define ELM #define ELN #define ELO #define ELP #define ELQ #define ELR #define ELS #define ELT #define ELU #define ELV #define ELW #define ELX #define ELY #define ELZ #define EMA #define EMB #define EMC #define EMD #define EME #define EMF #define EMG #define EMH #define EMI #define EMJ #define EMK #define EML #define EMM #define EMN #define EMO #define EMP #define EMQ #define EMR #define EMS #define EMT #define EMU #define EMV #define EMW #define EMX #define EMY #define EMZ #define ENA #define ENB #define ENC #define END #define ENE #define ENF #define ENG #define ENH #define ENI #define ENJ #define ENK #define ENL #define ENM #define ENN #define ENO #define ENP #define ENQ #define ENR #define ENS #define ENT #define ENU #define ENV #define ENW #define ENX #define ENY #define ENZ #define EOA #define EOB #define EOC #define EOD #define EOE #define EOF #define EOG #define EOH #define EOI #define EOJ #define EOK #define EOL #define EOM #define EON #define EOO #define EOP #define EOQ #define EOR #define EOS #define EOT #define EOU #define EOV #define EOW #define EOX #define EOY #define EOZ #define EPA #define EPB #define EPC #define EPD #define EPE #define EPF #define EPG #define EPH #define EPI #define EPJ #define EPK #define EPL #define EPM #define EPN #define EPO #define EPP #define EPQ #define EPR #define EPS #define EPT #define EPU #define EPV #define EPW #define EPX #define EPY #define EPZ #define EQA #define EQB #define EQC #define EQD #define EQE #define EQF #define EQG #define EQH #define EQI #define EQJ #define EQK #define EQL #define EQM #define EQN #define EQO #define EQP #define EQQ #define EQR #define EQS #define EQT #define EQU #define EQV #define EQW #define EQX #define EQY #define EQZ #define ERA #define ERB #define ERC #define ERD #define ERE #define ERF #define ERG #define ERH #define ERI #define ERJ #define ERK #define ERL #define ERM #define ERN #define ERO #define ERP #define ERQ #define ERR #define ERS #define ERT #define ERU #define ERV #define ERW #define ERX #define ERY #define ERZ #define ESA #define ESB #define ESC #define ESD #define ESE #define ESF #define ESG #define ESH #define ESI #define ESJ #define ESK #define ESL #define ESM #define ESN #define ESO #define ESP #define ESQ #define ESR #define ESS #define EST #define ESU #define ESV #define ESW #define ESX #define ESY #define ESZ #define ETA #define ETB #define ETC #define ETD #define ETE #define ETF #define ETG #define ETH #define ETI #define ETJ #define ETK #define ETL #define ETM #define ETN #define ETO #define ETP #define ETQ #define ETR #define ETS #define ETT #define ETU #define ETV #define ETW #define ETX #define ETY #define ETZ #define EUA #define EUB #define EUC #define EUD #define EUE #define EUF #define EUG #define EUH #define EUI #define EUJ #define EUK #define EUL #define EUM #define EUN #define EUO #define EUP #define EUQ #define EUR #define EUS #define EUT #define EUU #define EUV #define EUW #define EUX #define EUY #define EUZ #define EVA #define EVB #define EVC #define EVD #define EVE #define EVF #define EVG #define EVH #define EVI #define EVJ #define EVK #define EVL #define EVM #define EVN #define EVO #define EVP #define EVQ #define EVR #define EVS #define EVT #define EVU #define EVV #define EVW #define EVX #define EVY #define EVZ #define EWA #define EWB #define EWC #define EWD #define EWE #define EWF #define EWG #define EWH #define EWI #define EWJ #define EWK #define EWL #define EWM #define EWN #define EWO #define EWP #define EWQ #define EWR #define EWS #define EWT #define EWU #define EWV #define EWW #define EWX #define EWY #define EWZ #define EXA #define EXB #define EXC #define EXD #define EXE #define EXF #define EXG #define EXH #define EXI #define EXJ #define EXK #define EXL #define EXM #define EXN #define EXO #define EXP #define EXQ #define EXR #define EXS #define EXT #define EXU #define EXV #define EXW #define EXX #define EXY #define EXZ #define EYA #define EYB #define EYC #define EYD #define EYE #define EYF #define EYG #define EYH #define EYI #define EYJ #define EYK #define EYL #define EYM #define EYN #define EYO #define EYP #define EYQ #define EYR #define EYS #define EYT #define EYU #define EYV #define EYW #define EYX #define EYY #define EYZ #define EZA #define EZB #define EZC #define EZD #define EZE #define EZF #define EZG #define EZH #define EZI #define EZJ #define EZK #define EZL #define EZM #define EZN #define EZO #define EZP #define EZQ #define EZR #define EZS #define EZT #define EZU #define EZV #define EZW #define EZX #define EZY #define EZZ #define FAA #define FAB #define FAC #define FAD #define FAE #define FAF #define FAG #define FAH #define FAI #define FAJ #define FAK #define FAL #define FAM #define FAN #define FAO #define FAP #define FAQ #define FAR #define FAS #define FAT #define FAU #define FAV #define FAW #define FAX #define FAY #define FAZ #define FBA #define FBB #define FBC #define FBD #define FBE #define FBF #define FBG #define FBH #define FBI #define FBJ #define FBK #define FBL #define FBM #define FBN #define FBO #define FBP #define FBQ #define FBR #define FBS #define FBT #define FBU #define FBV #define FBW #define FBX #define FBY #define FBZ #define FCA #define FCB #define FCC #define FCD #define FCE #define FCF #define FCG #define FCH #define FCI #define FCJ #define FCK #define FCL #define FCM #define FCN #define FCO #define FCP #define FCQ #define FCR #define FCS #define FCT #define FCU #define FCV #define FCW #define FCX #define FCY #define FCZ #define FDA #define FDB #define FDC #define FDD #define FDE #define FDF #define FDG #define FDH #define FDI #define FDJ #define FDK #define FDL #define FDM #define FDN #define FDO #define FDP #define FDQ #define FDR #define FDS #define FDT #define FDU #define FDV #define FDW #define FDX #define FDY #define FDZ #define FEA #define FEB #define FEC #define FED #define FEE #define FEF #define FEG #define FEH #define FEI #define FEJ #define FEK #define FEL #define FEM #define FEN #define FEO #define FEP #define FEQ #define FER #define FES #define FET #define FEU #define FEV #define FEW #define FEX #define FEY #define FEZ #define FFA #define FFB #define FFC #define FFD #define FFE #define FFF #define FFG #define FFH #define FFI #define FFJ #define FFK #define FFL #define FFM #define FFN #define FFO #define FFP #define FFQ #define FFR #define FFS #define FFT #define FFU #define FFV #define FFW #define FFX #define FFY #define FFZ #define FGA #define FGB #define FGC #define FGD #define FGE #define FGF #define FGG #define FGH #define FGI #define FGJ #define FGK #define FGL #define FGM #define FGN #define FGO #define FGP #define FGQ #define FGR #define FGS #define FGT #define FGU #define FGV #define FGW #define FGX #define FGY #define FGZ #define FHA #define FHB #define FHC #define FHD #define FHE #define FHF #define FHG #define FHH #define FHI #define FHJ #define FHK #define FHL #define FHM #define FHN #define FHO #define FHP #define FHQ #define FHR #define FHS #define FHT #define FHU #define FHV #define FHW #define FHX #define FHY #define FHZ #define FIA #define FIB #define FIC #define FID #define FIE #define FIF #define FIG #define FIH #define FII #define FIJ #define FIK #define FIL #define FIM #define FIN #define FIO #define FIP #define FIQ #define FIR #define FIS #define FIT #define FIU #define FIV #define FIW #define FIX #define FIY #define FIZ #define FJA #define FJB #define FJC #define FJD #define FJE #define FJF #define FJG #define FJH #define FJI #define FJJ #define FJK #define FJL #define FJM #define FJN #define FJO #define FJP #define FJQ #define FJR #define FJS #define FJT #define FJU #define FJV #define FJW #define FJX #define FJY #define FJZ #define FKA #define FKB #define FKC #define FKD #define FKE #define FKF #define FKG #define FKH #define FKI #define FKJ #define FKK #define FKL #define FKM #define FKN #define FKO #define FKP #define FKQ #define FKR #define FKS #define FKT #define FKU #define FKV #define FKW #define FKX #define FKY #define FKZ #define FLA #define FLB #define FLC #define FLD #define FLE #define FLF #define FLG #define FLH #define FLI #define FLJ #define FLK #define FLL #define FLM #define FLN #define FLO #define FLP #define FLQ #define FLR #define FLS #define FLT #define FLU #define FLV #define FLW #define FLX #define FLY #define FLZ #define FMA #define FMB #define FMC #define FMD #define FME #define FMF #define FMG #define FMH #define FMI #define FMJ #define FMK #define FML #define FMM #define FMN #define FMO #define FMP #define FMQ #define FMR #define FMS #define FMT #define FMU #define FMV #define FMW #define FMX #define FMY #define FMZ #define FNA #define FNB #define FNC #define FND #define FNE #define FNF #define FNG #define FNH #define FNI #define FNJ #define FNK #define FNL #define FNM #define FNN #define FNO #define FNP #define FNQ #define FNR #define FNS #define FNT #define FNU #define FNV #define FNW #define FNX #define FNY #define FNZ #define FOA #define FOB #define FOC #define FOD #define FOE #define FOF #define FOG #define FOH #define FOI #define FOJ #define FOK #define FOL #define FOM #define FON #define FOO #define FOP #define FOQ #define FOR #define FOS #define FOT #define FOU #define FOV #define FOW #define FOX #define FOY #define FOZ #define FPA #define FPB #define FPC #define FPD #define FPE #define FPF #define FPG #define FPH #define FPI #define FPJ #define FPK #define FPL #define FPM #define FPN #define FPO #define FPP #define FPQ #define FPR #define FPS #define FPT #define FPU #define FPV #define FPW #define FPX #define FPY #define FPZ #define FQA #define FQB #define FQC #define FQD #define FQE #define FQF #define FQG #define FQH #define FQI #define FQJ #define FQK #define FQL #define FQM #define FQN #define FQO #define FQP #define FQQ #define FQR #define FQS #define FQT #define FQU #define FQV #define FQW #define FQX #define FQY #define FQZ #define FRA #define FRB #define FRC #define FRD #define FRE #define FRF #define FRG #define FRH #define FRI #define FRJ #define FRK #define FRL #define FRM #define FRN #define FRO #define FRP #define FRQ #define FRR #define FRS #define FRT #define FRU #define FRV #define FRW #define FRX #define FRY #define FRZ #define FSA #define FSB #define FSC #define FSD #define FSE #define FSF #define FSG #define FSH #define FSI #define FSJ #define FSK #define FSL #define FSM #define FSN #define FSO #define FSP #define FSQ #define FSR #define FSS #define FST #define FSU #define FSV #define FSW #define FSX #define FSY #define FSZ #define FTA #define FTB #define FTC #define FTD #define FTE #define FTF #define FTG #define FTH #define FTI #define FTJ #define FTK #define FTL #define FTM #define FTN #define FTO #define FTP #define FTQ #define FTR #define FTS #define FTT #define FTU #define FTV #define FTW #define FTX #define FTY #define FTZ #define FUA #define FUB #define FUC #define FUD #define FUE #define FUF #define FUG #define FUH #define FUI #define FUJ #define FUK #define FUL #define FUM #define FUN #define FUO #define FUP #define FUQ #define FUR #define FUS #define FUT #define FUU #define FUV #define FUW #define FUX #define FUY #define FUZ #define FVA #define FVB #define FVC #define FVD #define FVE #define FVF #define FVG #define FVH #define FVI #define FVJ #define FVK #define FVL #define FVM #define FVN #define FVO #define FVP #define FVQ #define FVR #define FVS #define FVT #define FVU #define FVV #define FVW #define FVX #define FVY #define FVZ #define FWA #define FWB #define FWC #define FWD #define FWE #define FWF #define FWG #define FWH #define FWI #define FWJ #define FWK #define FWL #define FWM #define FWN #define FWO #define FWP #define FWQ #define FWR #define FWS #define FWT #define FWU #define FWV #define FWW #define FWX #define FWY #define FWZ #define FXA #define FXB #define FXC #define FXD #define FXE #define FXF #define FXG #define FXH #define FXI #define FXJ #define FXK #define FXL #define FXM #define FXN #define FXO #define FXP #define FXQ #define FXR #define FXS #define FXT #define FXU #define FXV #define FXW #define FXX #define FXY #define FXZ #define FYA #define FYB #define FYC #define FYD #define FYE #define FYF #define FYG #define FYH #define FYI #define FYJ #define FYK #define FYL #define FYM #define FYN #define FYO #define FYP #define FYQ #define FYR #define FYS #define FYT #define FYU #define FYV #define FYW #define FYX #define FYY #define FYZ #define FZA #define FZB #define FZC #define FZD #define FZE #define FZF #define FZG #define FZH #define FZI #define FZJ #define FZK #define FZL #define FZM #define FZN #define FZO #define FZP #define FZQ #define FZR #define FZS #define FZT #define FZU #define FZV #define FZW #define FZX #define FZY #define FZZ #define GAA #define GAB #define GAC #define GAD #define GAE #define GAF #define GAG #define GAH #define GAI #define GAJ #define GAK #define GAL #define GAM #define GAN #define GAO #define GAP #define GAQ #define GAR #define GAS #define GAT #define GAU #define GAV #define GAW #define GAX #define GAY #define GAZ #define GBA #define GBB #define GBC #define GBD #define GBE #define GBF #define GBG #define GBH #define GBI #define GBJ #define GBK #define GBL #define GBM 0x0fff #ifndef X0FFF #define GBN #define GBO #define GBP #define GBQ #define GBR #define GBS #define GBT #define GBU #define GBV #define GBW #define GBX #define GBY #define GBZ #define GCA #define GCB #define GCC #define GCD #define GCE #define GCF #define GCG #define GCH #define GCI #define GCJ #define GCK #define GCL #define GCM #define GCN #define GCO #define GCP #define GCQ #define GCR #define GCS #define GCT #define GCU #define GCV #define GCW #define GCX #define GCY #define GCZ #define GDA #define GDB #define GDC #define GDD #define GDE #define GDF #define GDG #define GDH #define GDI #define GDJ #define GDK #define GDL #define GDM #define GDN #define GDO #define GDP #define GDQ #define GDR #define GDS #define GDT #define GDU #define GDV #define GDW #define GDX #define GDY #define GDZ #define GEA #define GEB #define GEC #define GED #define GEE #define GEF #define GEG #define GEH #define GEI #define GEJ #define GEK #define GEL #define GEM #define GEN #define GEO #define GEP #define GEQ #define GER #define GES #define GET #define GEU #define GEV #define GEW #define GEX #define GEY #define GEZ #define GFA #define GFB #define GFC #define GFD #define GFE #define GFF #define GFG #define GFH #define GFI #define GFJ #define GFK #define GFL #define GFM #define GFN #define GFO #define GFP #define GFQ #define GFR #define GFS #define GFT #define GFU #define GFV #define GFW #define GFX #define GFY #define GFZ #define GGA #define GGB #define GGC #define GGD #define GGE #define GGF #define GGG #define GGH #define GGI #define GGJ #define GGK #define GGL #define GGM #define GGN #define GGO #define GGP #define GGQ #define GGR #define GGS #define GGT #define GGU #define GGV #define GGW #define GGX #define GGY #define GGZ #define GHA #define GHB #define GHC #define GHD #define GHE #define GHF #define GHG #define GHH #define GHI #define GHJ #define GHK #define GHL #define GHM #define GHN #define GHO #define GHP #define GHQ #define GHR #define GHS #define GHT #define GHU #define GHV #define GHW #define GHX #define GHY #define GHZ #define GIA #define GIB #define GIC #define GID #define GIE #define GIF #define GIG #define GIH #define GII #define GIJ #define GIK #define GIL #define GIM #define GIN #define GIO #define GIP #define GIQ #define GIR #define GIS #define GIT #define GIU #define GIV #define GIW #define GIX #define GIY #define GIZ #define GJA #define GJB #define GJC #define GJD #define GJE #define GJF #define GJG #define GJH #define GJI #define GJJ #define GJK #define GJL #define GJM #define GJN #define GJO #define GJP #define GJQ #define GJR #define GJS #define GJT #define GJU #define GJV #define GJW #define GJX #define GJY #define GJZ #define GKA #define GKB #define GKC #define GKD #define GKE #define GKF #define GKG #define GKH #define GKI #define GKJ #define GKK #define GKL #define GKM #define GKN #define GKO #define GKP #define GKQ #define GKR #define GKS #define GKT #define GKU #define GKV #define GKW #define GKX #define GKY #define GKZ #define GLA #define GLB #define GLC #define GLD #define GLE #define GLF #define GLG #define GLH #define GLI #define GLJ #define GLK #define GLL #define GLM #define GLN #define GLO #define GLP #define GLQ #define GLR #define GLS #define GLT #define GLU #define GLV #define GLW #define GLX #define GLY #define GLZ #define GMA #define GMB #define GMC #define GMD #define GME #define GMF #define GMG #define GMH #define GMI #define GMJ #define GMK #define GML #define GMM #define GMN #define GMO #define GMP #define GMQ #define GMR #define GMS #define GMT #define GMU #define GMV #define GMW #define GMX #define GMY #define GMZ #define GNA #define GNB #define GNC #define GND #define GNE #define GNF #define GNG #define GNH #define GNI #define GNJ #define GNK #define GNL #define GNM #define GNN #define GNO #define GNP #define GNQ #define GNR #define GNS #define GNT #define GNU #define GNV #define GNW #define GNX #define GNY #define GNZ #define GOA #define GOB #define GOC #define GOD #define GOE #define GOF #define GOG #define GOH #define GOI #define GOJ #define GOK #define GOL #define GOM #define GON #define GOO #define GOP #define GOQ #define GOR #define GOS #define GOT #define GOU #define GOV #define GOW #define GOX #define GOY #define GOZ #define GPA #define GPB #define GPC #define GPD #define GPE #define GPF #define GPG #define GPH #define GPI #define GPJ #define GPK #define GPL #define GPM #define GPN #define GPO #define GPP #define GPQ #define GPR #define GPS #define GPT #define GPU #define GPV #define GPW #define GPX #define GPY #define GPZ #define GQA #define GQB #define GQC #define GQD #define GQE #define GQF #define GQG #define GQH #define GQI #define GQJ #define GQK #define GQL #define GQM #define GQN #define GQO #define GQP #define GQQ #define GQR #define GQS #define GQT #define GQU #define GQV #define GQW #define GQX #define GQY #define GQZ #define GRA #define GRB #define GRC #define GRD #define GRE #define GRF #define GRG #define GRH #define GRI #define GRJ #define GRK #define GRL #define GRM #define GRN #define GRO #define GRP #define GRQ #define GRR #define GRS #define GRT #define GRU #define GRV #define GRW #define GRX #define GRY #define GRZ #define GSA #define GSB #define GSC #define GSD #define GSE #define GSF #define GSG #define GSH #define GSI #define GSJ #define GSK #define GSL #define GSM #define GSN #define GSO #define GSP #define GSQ #define GSR #define GSS #define GST #define GSU #define GSV #define GSW #define GSX #define GSY #define GSZ #define GTA #define GTB #define GTC #define GTD #define GTE #define GTF #define GTG #define GTH #define GTI #define GTJ #define GTK #define GTL #define GTM #define GTN #define GTO #define GTP #define GTQ #define GTR #define GTS #define GTT #define GTU #define GTV #define GTW #define GTX #define GTY #define GTZ #define GUA #define GUB #define GUC #define GUD #define GUE #define GUF #define GUG #define GUH #define GUI #define GUJ #define GUK #define GUL #define GUM #define GUN #define GUO #define GUP #define GUQ #define GUR #define GUS #define GUT #define GUU #define GUV #define GUW #define GUX #define GUY #define GUZ #define GVA #define GVB #define GVC #define GVD #define GVE #define GVF #define GVG #define GVH #define GVI #define GVJ #define GVK #define GVL #define GVM #define GVN #define GVO #define GVP #define GVQ #define GVR #define GVS #define GVT #define GVU #define GVV #define GVW #define GVX #define GVY #define GVZ #define GWA #define GWB #define GWC #define GWD #define GWE #define GWF #define GWG #define GWH #define GWI #define GWJ #define GWK #define GWL #define GWM #define GWN #define GWO #define GWP #define GWQ #define GWR #define GWS #define GWT #define GWU #define GWV #define GWW #define GWX #define GWY #define GWZ #define GXA #define GXB #define GXC #define GXD #define GXE #define GXF #define GXG #define GXH #define GXI #define GXJ #define GXK #define GXL #define GXM #define GXN #define GXO #define GXP #define GXQ #define GXR #define GXS #define GXT #define GXU #define GXV #define GXW #define GXX #define GXY #define GXZ #define GYA #define GYB #define GYC #define GYD #define GYE #define GYF #define GYG #define GYH #define GYI #define GYJ #define GYK #define GYL #define GYM #define GYN #define GYO #define GYP #define GYQ #define GYR #define GYS #define GYT #define GYU #define GYV #define GYW #define GYX #define GYY #define GYZ #define GZA #define GZB #define GZC #define GZD #define GZE #define GZF #define GZG #define GZH #define GZI #define GZJ #define GZK #define GZL #define GZM #define GZN #define GZO #define GZP #define GZQ #define GZR #define GZS #define GZT #define GZU #define GZV #define GZW #define GZX #define GZY #define GZZ #define HAA #define HAB #define HAC #define HAD #define HAE #define HAF #define HAG #define HAH #define HAI #define HAJ #define HAK #define HAL #define HAM #define HAN #define HAO #define HAP #define HAQ #define HAR #define HAS #define HAT #define HAU #define HAV #define HAW #define HAX #define HAY #define HAZ #define HBA #define HBB #define HBC #define HBD #define HBE #define HBF #define HBG #define HBH #define HBI #define HBJ #define HBK #define HBL #define HBM #define HBN #define HBO #define HBP #define HBQ #define HBR #define HBS #define HBT #define HBU #define HBV #define HBW #define HBX #define HBY #define HBZ #define HCA #define HCB #define HCC #define HCD #define HCE #define HCF #define HCG #define HCH #define HCI #define HCJ #define HCK #define HCL #define HCM #define HCN #define HCO #define HCP #define HCQ #define HCR #define HCS #define HCT #define HCU #define HCV #define HCW #define HCX #define HCY #define HCZ #define HDA #define HDB #define HDC #define HDD #define HDE #define HDF #define HDG #define HDH #define HDI #define HDJ #define HDK #define HDL #define HDM #define HDN #define HDO #define HDP #define HDQ #define HDR #define HDS #define HDT #define HDU #define HDV #define HDW #define HDX #define HDY #define HDZ #define HEA #define HEB #define HEC #define HED #define HEE #define HEF #define HEG #define HEH #define HEI #define HEJ #define HEK #define HEL #define HEM #define HEN #define HEO #define HEP #define HEQ #define HER #define HES #define HET #define HEU #define HEV #define HEW #define HEX #define HEY #define HEZ #define HFA #define HFB #define HFC #define HFD #define HFE #define HFF #define HFG #define HFH #define HFI #define HFJ #define HFK #define HFL #define HFM #define HFN #define HFO #define HFP #define HFQ #define HFR #define HFS #define HFT #define HFU #define HFV #define HFW #define HFX #define HFY #define HFZ #define HGA #define HGB #define HGC #define HGD #define HGE #define HGF #define HGG #define HGH #define HGI #define HGJ #define HGK #define HGL #define HGM #define HGN #define HGO #define HGP #define HGQ #define HGR #define HGS #define HGT #define HGU #define HGV #define HGW #define HGX #define HGY #define HGZ #define HHA #define HHB #define HHC #define HHD #define HHE #define HHF #define HHG #define HHH #define HHI #define HHJ #define HHK #define HHL #define HHM #define HHN #define HHO #define HHP #define HHQ #define HHR #define HHS #define HHT #define HHU #define HHV #define HHW #define HHX #define HHY #define HHZ #define HIA #define HIB #define HIC #define HID #define HIE #define HIF #define HIG #define HIH #define HII #define HIJ #define HIK #define HIL #define HIM #define HIN #define HIO #define HIP #define HIQ #define HIR #define HIS #define HIT #define HIU #define HIV #define HIW #define HIX #define HIY #define HIZ #define HJA #define HJB #define HJC #define HJD #define HJE #define HJF #define HJG #define HJH #define HJI #define HJJ #define HJK #define HJL #define HJM #define HJN #define HJO #define HJP #define HJQ #define HJR #define HJS #define HJT #define HJU #define HJV #define HJW #define HJX #define HJY #define HJZ #define HKA #define HKB #define HKC #define HKD #define HKE #define HKF #define HKG #define HKH #define HKI #define HKJ #define HKK #define HKL #define HKM #define HKN #define HKO #define HKP #define HKQ #define HKR #define HKS #define HKT #define HKU #define HKV #define HKW #define HKX #define HKY #define HKZ #define HLA #define HLB #define HLC #define HLD #define HLE #define HLF #define HLG #define HLH #define HLI #define HLJ #define HLK #define HLL #define HLM #define HLN #define HLO #define HLP #define HLQ #define HLR #define HLS #define HLT #define HLU #define HLV #define HLW #define HLX #define HLY #define HLZ #define HMA #define HMB #define HMC #define HMD #define HME #define HMF #define HMG #define HMH #define HMI #define HMJ #define HMK #define HML #define HMM #define HMN #define HMO #define HMP #define HMQ #define HMR #define HMS #define HMT #define HMU #define HMV #define HMW #define HMX #define HMY #define HMZ #define HNA #define HNB #define HNC #define HND #define HNE #define HNF #define HNG #define HNH #define HNI #define HNJ #define HNK #define HNL #define HNM #define HNN #define HNO #define HNP #define HNQ #define HNR #define HNS #define HNT #define HNU #define HNV #define HNW #define HNX #define HNY #define HNZ #define HOA #define HOB #define HOC #define HOD #define HOE #define HOF #define HOG #define HOH #define HOI #define HOJ #define HOK #define HOL #define HOM #define HON #define HOO #define HOP #define HOQ #define HOR #define HOS #define HOT #define HOU #define HOV #define HOW #define HOX #define HOY #define HOZ #define HPA #define HPB #define HPC #define HPD #define HPE #define HPF #define HPG #define HPH #define HPI #define HPJ #define HPK #define HPL #define HPM #define HPN #define HPO #define HPP #define HPQ #define HPR #define HPS #define HPT #define HPU #define HPV #define HPW #define HPX #define HPY #define HPZ #define HQA #define HQB #define HQC #define HQD #define HQE #define HQF #define HQG #define HQH #define HQI #define HQJ #define HQK #define HQL #define HQM #define HQN #define HQO #define HQP #define HQQ #define HQR #define HQS #define HQT #define HQU #define HQV #define HQW #define HQX #define HQY #define HQZ #define HRA #define HRB #define HRC #define HRD #define HRE #define HRF #define HRG #define HRH #define HRI #define HRJ #define HRK #define HRL #define HRM #define HRN #define HRO #define HRP #define HRQ #define HRR #define HRS #define HRT #define HRU #define HRV #define HRW #define HRX #define HRY #define HRZ #define HSA #define HSB #define HSC #define HSD #define HSE #define HSF #define HSG #define HSH #define HSI #define HSJ #define HSK #define HSL #define HSM #define HSN #define HSO #define HSP #define HSQ #define HSR #define HSS #define HST #define HSU #define HSV #define HSW #define HSX #define HSY #define HSZ #define HTA #define HTB #define HTC #define HTD #define HTE #define HTF #define HTG #define HTH #define HTI #define HTJ #define HTK #define HTL #define HTM #define HTN #define HTO #define HTP #define HTQ #define HTR #define HTS #define HTT #define HTU #define HTV #define HTW #define HTX #define HTY #define HTZ #define HUA #define HUB #define HUC #define HUD #define HUE #define HUF #define HUG #define HUH #define HUI #define HUJ #define HUK #define HUL #define HUM #define HUN #define HUO #define HUP #define HUQ #define HUR #define HUS #define HUT #define HUU #define HUV #define HUW #define HUX #define HUY #define HUZ #define HVA #define HVB #define HVC #define HVD #define HVE #define HVF #define HVG #define HVH #define HVI #define HVJ #define HVK #define HVL #define HVM #define HVN #define HVO #define HVP #define HVQ #define HVR #define HVS #define HVT #define HVU #define HVV #define HVW #define HVX #define HVY #define HVZ #define HWA #define HWB #define HWC #define HWD #define HWE #define HWF #define HWG #define HWH #define HWI #define HWJ #define HWK #define HWL #define HWM #define HWN #define HWO #define HWP #define HWQ #define HWR #define HWS #define HWT #define HWU #define HWV #define HWW #define HWX #define HWY #define HWZ #define HXA #define HXB #define HXC #define HXD #define HXE #define HXF #define HXG #define HXH #define HXI #define HXJ #define HXK #define HXL #define HXM #define HXN #define HXO #define HXP #define HXQ #define HXR #define HXS #define HXT #define HXU #define HXV #define HXW #define HXX #define HXY #define HXZ #define HYA #define HYB #define HYC #define HYD #define HYE #define HYF #define HYG #define HYH #define HYI #define HYJ #define HYK #define HYL #define HYM #define HYN #define HYO #define HYP #define HYQ #define HYR #define HYS #define HYT #define HYU #define HYV #define HYW #define HYX #define HYY #define HYZ #define HZA #define HZB #define HZC #define HZD #define HZE #define HZF #define HZG #define HZH #define HZI #define HZJ #define HZK #define HZL #define HZM #define HZN #define HZO #define HZP #define HZQ #define HZR #define HZS #define HZT #define HZU #define HZV #define HZW #define HZX #define HZY #define HZZ #define IAA #define IAB #define IAC #define IAD #define IAE #define IAF #define IAG #define IAH #define IAI #define IAJ #define IAK #define IAL #define IAM #define IAN #define IAO #define IAP #define IAQ #define IAR #define IAS #define IAT #define IAU #define IAV #define IAW #define IAX #define IAY #define IAZ #define IBA #define IBB #define IBC #define IBD #define IBE #define IBF #define IBG #define IBH #define IBI #define IBJ #define IBK #define IBL #define IBM #define IBN #define IBO #define IBP #define IBQ #define IBR #define IBS #define IBT #define IBU #define IBV #define IBW #define IBX #define IBY #define IBZ #define ICA #define ICB #define ICC #define ICD #define ICE #define ICF #define ICG #define ICH #define ICI #define ICJ #define ICK #define ICL #define ICM #define ICN #define ICO #define ICP #define ICQ #define ICR #define ICS #define ICT #define ICU #define ICV #define ICW #define ICX #define ICY #define ICZ #define IDA #define IDB #define IDC #define IDD #define IDE #define IDF #define IDG #define IDH #define IDI #define IDJ #define IDK #define IDL #define IDM #define IDN #define IDO #define IDP #define IDQ #define IDR #define IDS #define IDT #define IDU #define IDV #define IDW #define IDX #define IDY #define IDZ #define IEA #define IEB #define IEC #define IED #define IEE #define IEF #define IEG #define IEH #define IEI #define IEJ #define IEK #define IEL #define IEM #define IEN #define IEO #define IEP #define IEQ #define IER #define IES #define IET #define IEU #define IEV #define IEW #define IEX #define IEY #define IEZ #define IFA #define IFB #define IFC #define IFD #define IFE #define IFF #define IFG #define IFH #define IFI #define IFJ #define IFK #define IFL #define IFM #define IFN #define IFO #define IFP #define IFQ #define IFR #define IFS #define IFT #define IFU #define IFV #define IFW #define IFX #define IFY #define IFZ #define IGA #define IGB #define IGC #define IGD #define IGE #define IGF #define IGG #define IGH #define IGI #define IGJ #define IGK #define IGL #define IGM #define IGN #define IGO #define IGP #define IGQ #define IGR #define IGS #define IGT #define IGU #define IGV #define IGW #define IGX #define IGY #define IGZ #define IHA #define IHB #define IHC #define IHD #define IHE #define IHF #define IHG #define IHH #define IHI #define IHJ #define IHK #define IHL #define IHM #define IHN #define IHO #define IHP #define IHQ #define IHR #define IHS #define IHT #define IHU #define IHV #define IHW #define IHX #define IHY #define IHZ #define IIA #define IIB #define IIC #define IID #define IIE #define IIF #define IIG #define IIH #define III #define IIJ #define IIK #define IIL #define IIM #define IIN #define IIO #define IIP #define IIQ #define IIR #define IIS #define IIT #define IIU #define IIV #define IIW #define IIX #define IIY #define IIZ #define IJA #define IJB #define IJC #define IJD #define IJE #define IJF #define IJG #define IJH #define IJI #define IJJ #define IJK #define IJL #define IJM #define IJN #define IJO #define IJP #define IJQ #define IJR #define IJS #define IJT #define IJU #define IJV #define IJW #define IJX #define IJY #define IJZ #define IKA #define IKB #define IKC #define IKD #define IKE #define IKF #define IKG #define IKH #define IKI #define IKJ #define IKK #define IKL #define IKM #define IKN #define IKO #define IKP #define IKQ #define IKR #define IKS #define IKT #define IKU #define IKV #define IKW #define IKX #define IKY #define IKZ #define ILA #define ILB #define ILC #define ILD #define ILE #define ILF #define ILG #define ILH #define ILI #define ILJ #define ILK #define ILL #define ILM #define ILN #define ILO #define ILP #define ILQ #define ILR #define ILS #define ILT #define ILU #define ILV #define ILW #define ILX #define ILY #define ILZ #define IMA #define IMB #define IMC #define IMD #define IME #define IMF #define IMG #define IMH #define IMI #define IMJ #define IMK #define IML #define IMM #define IMN #define IMO #define IMP #define IMQ #define IMR #define IMS #define IMT #define IMU #define IMV #define IMW #define IMX #define IMY #define IMZ #define INA #define INB #define INC #define IND #define INE #define INF #define ING #define INH #define INI #define INJ #define INK #define INL #define INM #define INN #define INO #define INP #define INQ #define INR #define INS #define INT #define INU #define INV #define INW #define INX #define INY #define INZ #define IOA #define IOB #define IOC #define IOD #define IOE #define IOF #define IOG #define IOH #define IOI #define IOJ #define IOK #define IOL #define IOM #define ION #define IOO #define IOP #define IOQ #define IOR #define IOS #define IOT #define IOU #define IOV #define IOW #define IOX #define IOY #define IOZ #define IPA #define IPB #define IPC #define IPD #define IPE #define IPF #define IPG #define IPH #define IPI #define IPJ #define IPK #define IPL #define IPM #define IPN #define IPO #define IPP #define IPQ #define IPR #define IPS #define IPT #define IPU #define IPV #define IPW #define IPX #define IPY #define IPZ #define IQA #define IQB #define IQC #define IQD #define IQE #define IQF #define IQG #define IQH #define IQI #define IQJ #define IQK #define IQL #define IQM #define IQN #define IQO #define IQP #define IQQ #define IQR #define IQS #define IQT #define IQU #define IQV #define IQW #define IQX #define IQY #define IQZ #define IRA #define IRB #define IRC #define IRD #define IRE #define IRF #define IRG #define IRH #define IRI #define IRJ #define IRK #define IRL #define IRM #define IRN #define IRO #define IRP #define IRQ #define IRR #define IRS #define IRT #define IRU #define IRV #define IRW #define IRX #define IRY #define IRZ #define ISA #define ISB #define ISC #define ISD #define ISE #define ISF #define ISG #define ISH #define ISI #define ISJ #define ISK #define ISL #define ISM #define ISN #define ISO #define ISP #define ISQ #define ISR #define ISS #define IST #define ISU #define ISV #define ISW #define ISX #define ISY #define ISZ #define ITA #define ITB #define ITC #define ITD #define ITE #define ITF #define ITG #define ITH #define ITI #define ITJ #define ITK #define ITL #define ITM #define ITN #define ITO #define ITP #define ITQ #define ITR #define ITS #define ITT #define ITU #define ITV #define ITW #define ITX #define ITY #define ITZ #define IUA #define IUB #define IUC #define IUD #define IUE #define IUF #define IUG #define IUH #define IUI #define IUJ #define IUK #define IUL #define IUM #define IUN #define IUO #define IUP #define IUQ #define IUR #define IUS #define IUT #define IUU #define IUV #define IUW #define IUX #define IUY #define IUZ #define IVA #define IVB #define IVC #define IVD #define IVE #define IVF #define IVG #define IVH #define IVI #define IVJ #define IVK #define IVL #define IVM #define IVN #define IVO #define IVP #define IVQ #define IVR #define IVS #define IVT #define IVU #define IVV #define IVW #define IVX #define IVY #define IVZ #define IWA #define IWB #define IWC #define IWD #define IWE #define IWF #define IWG #define IWH #define IWI #define IWJ #define IWK #define IWL #define IWM #define IWN #define IWO #define IWP #define IWQ #define IWR #define IWS #define IWT #define IWU #define IWV #define IWW #define IWX #define IWY #define IWZ #define IXA #define IXB #define IXC #define IXD #define IXE #define IXF #define IXG #define IXH #define IXI #define IXJ #define IXK #define IXL #define IXM #define IXN #define IXO #define IXP #define IXQ #define IXR #define IXS #define IXT #define IXU #define IXV #define IXW #define IXX #define IXY #define IXZ #define IYA #define IYB #define IYC #define IYD #define IYE #define IYF #define IYG #define IYH #define IYI #define IYJ #define IYK #define IYL #define IYM #define IYN #define IYO #define IYP #define IYQ #define IYR #define IYS #define IYT #define IYU #define IYV #define IYW #define IYX #define IYY #define IYZ #define IZA #define IZB #define IZC #define IZD #define IZE #define IZF #define IZG #define IZH #define IZI #define IZJ #define IZK #define IZL #define IZM #define IZN #define IZO #define IZP #define IZQ #define IZR #define IZS #define IZT #define IZU #define IZV #define IZW #define IZX #define IZY #define IZZ #define JAA #define JAB #define JAC #define JAD #define JAE #define JAF #define JAG #define JAH #define JAI #define JAJ #define JAK #define JAL #define JAM #define JAN #define JAO #define JAP #define JAQ #define JAR #define JAS #define JAT #define JAU #define JAV #define JAW #define JAX #define JAY #define JAZ #define JBA #define JBB #define JBC #define JBD #define JBE #define JBF #define JBG #define JBH #define JBI #define JBJ #define JBK #define JBL #define JBM #define JBN #define JBO #define JBP #define JBQ #define JBR #define JBS #define JBT #define JBU #define JBV #define JBW #define JBX #define JBY #define JBZ #define JCA #define JCB #define JCC #define JCD #define JCE #define JCF #define JCG #define JCH #define JCI #define JCJ #define JCK #define JCL #define JCM #define JCN #define JCO #define JCP #define JCQ #define JCR #define JCS #define JCT #define JCU #define JCV #define JCW #define JCX #define JCY #define JCZ #define JDA #define JDB #define JDC #define JDD #define JDE #define JDF #define JDG #define JDH #define JDI #define JDJ #define JDK #define JDL #define JDM #define JDN #define JDO #define JDP #define JDQ #define JDR #define JDS #define JDT #define JDU #define JDV #define JDW #define JDX #define JDY #define JDZ #define JEA #define JEB #define JEC #define JED #define JEE #define JEF #define JEG #define JEH #define JEI #define JEJ #define JEK #define JEL #define JEM #define JEN #define JEO #define JEP #define JEQ #define JER #define JES #define JET #define JEU #define JEV #define JEW #define JEX #define JEY #define JEZ #define JFA #define JFB #define JFC #define JFD #define JFE #define JFF #define JFG #define JFH #define JFI #define JFJ #define JFK #define JFL #define JFM #define JFN #define JFO #define JFP #define JFQ #define JFR #define JFS #define JFT #define JFU #define JFV #define JFW #define JFX #define JFY #define JFZ #define JGA #define JGB #define JGC #define JGD #define JGE #define JGF #define JGG #define JGH #define JGI #define JGJ #define JGK #define JGL #define JGM #define JGN #define JGO #define JGP #define JGQ #define JGR #define JGS #define JGT #define JGU #define JGV #define JGW #define JGX #define JGY #define JGZ #define JHA #define JHB #define JHC #define JHD #define JHE #define JHF #define JHG #define JHH #define JHI #define JHJ #define JHK #define JHL #define JHM #define JHN #define JHO #define JHP #define JHQ #define JHR #define JHS #define JHT #define JHU #define JHV #define JHW #define JHX #define JHY #define JHZ #define JIA #define JIB #define JIC #define JID #define JIE #define JIF #define JIG #define JIH #define JII #define JIJ #define JIK #define JIL #define JIM #define JIN #define JIO #define JIP #define JIQ #define JIR #define JIS #define JIT #define JIU #define JIV #define JIW #define JIX #define JIY #define JIZ #define JJA #define JJB #define JJC #define JJD #define JJE #define JJF #define JJG #define JJH #define JJI #define JJJ #define JJK #define JJL #define JJM #define JJN #define JJO #define JJP #define JJQ #define JJR #define JJS #define JJT #define JJU #define JJV #define JJW #define JJX #define JJY #define JJZ #define JKA #define JKB #define JKC #define JKD #define JKE #define JKF #define JKG #define JKH #define JKI #define JKJ #define JKK #define JKL #define JKM #define JKN #define JKO #define JKP #define JKQ #define JKR #define JKS #define JKT #define JKU #define JKV #define JKW #define JKX #define JKY #define JKZ #define JLA #define JLB #define JLC #define JLD #define JLE #define JLF #define JLG #define JLH #define JLI #define JLJ #define JLK #define JLL #define JLM #define JLN #define JLO #define JLP #define JLQ #define JLR #define JLS #define JLT #define JLU #define JLV #define JLW #define JLX #define JLY #define JLZ #define JMA #define JMB #define JMC #define JMD #define JME #define JMF #define JMG #define JMH #define JMI #define JMJ #define JMK #define JML #define JMM #define JMN #define JMO #define JMP #define JMQ #define JMR #define JMS #define JMT #define JMU #define JMV #define JMW #define JMX #define JMY #define JMZ #define JNA #define JNB #define JNC #define JND #define JNE #define JNF #define JNG #define JNH #define JNI #define JNJ #define JNK #define JNL #define JNM #define JNN #define JNO #define JNP #define JNQ #define JNR #define JNS #define JNT #define JNU #define JNV #define JNW #define JNX #define JNY #define JNZ #define JOA #define JOB #define JOC #define JOD #define JOE #define JOF #define JOG #define JOH #define JOI #define JOJ #define JOK #define JOL #define JOM #define JON #define JOO #define JOP #define JOQ #define JOR #define JOS #define JOT #define JOU #define JOV #define JOW #define JOX #define JOY #define JOZ #define JPA #define JPB #define JPC #define JPD #define JPE #define JPF #define JPG #define JPH #define JPI #define JPJ #define JPK #define JPL #define JPM #define JPN #define JPO #define JPP #define JPQ #define JPR #define JPS #define JPT #define JPU #define JPV #define JPW #define JPX #define JPY #define JPZ #define JQA #define JQB #define JQC #define JQD #define JQE #define JQF #define JQG #define JQH #define JQI #define JQJ #define JQK #define JQL #define JQM #define JQN #define JQO #define JQP #define JQQ #define JQR #define JQS #define JQT #define JQU #define JQV #define JQW #define JQX #define JQY #define JQZ #define JRA #define JRB #define JRC #define JRD #define JRE #define JRF #define JRG #define JRH #define JRI #define JRJ #define JRK #define JRL #define JRM #define JRN #define JRO #define JRP #define JRQ #define JRR #define JRS #define JRT #define JRU #define JRV #define JRW #define JRX #define JRY #define JRZ #define JSA #define JSB #define JSC #define JSD #define JSE #define JSF #define JSG #define JSH #define JSI #define JSJ #define JSK #define JSL #define JSM #define JSN #define JSO #define JSP #define JSQ #define JSR #define JSS #define JST #define JSU #define JSV #define JSW #define JSX #define JSY #define JSZ #define JTA #define JTB #define JTC #define JTD #define JTE #define JTF #define JTG #define JTH #define JTI #define JTJ #define JTK #define JTL #define JTM #define JTN #define JTO #define JTP #define JTQ #define JTR #define JTS #define JTT #define JTU #define JTV #define JTW #define JTX #define JTY #define JTZ #define JUA #define JUB #define JUC #define JUD #define JUE #define JUF #define JUG #define JUH #define JUI #define JUJ #define JUK #define JUL #define JUM #define JUN #define JUO #define JUP #define JUQ #define JUR #define JUS #define JUT #define JUU #define JUV #define JUW #define JUX #define JUY #define JUZ #define JVA #define JVB #define JVC #define JVD #define JVE #define JVF #define JVG #define JVH #define JVI #define JVJ #define JVK #define JVL #define JVM #define JVN #define JVO #define JVP #define JVQ #define JVR #define JVS #define JVT #define JVU #define JVV #define JVW #define JVX #define JVY #define JVZ #define JWA #define JWB #define JWC #define JWD #define JWE #define JWF #define JWG #define JWH #define JWI #define JWJ #define JWK #define JWL #define JWM #define JWN #define JWO #define JWP #define JWQ #define JWR #define JWS #define JWT #define JWU #define JWV #define JWW #define JWX #define JWY #define JWZ #define JXA #define JXB #define JXC #define JXD #define JXE #define JXF #define JXG #define JXH #define JXI #define JXJ #define JXK #define JXL #define JXM #define JXN #define JXO #define JXP #define JXQ #define JXR #define JXS #define JXT #define JXU #define JXV #define JXW #define JXX #define JXY #define JXZ #define JYA #define JYB #define JYC #define JYD #define JYE #define JYF #define JYG #define JYH #define JYI #define JYJ #define JYK #define JYL #define JYM #define JYN #define JYO #define JYP #define JYQ #define JYR #define JYS #define JYT #define JYU #define JYV #define JYW #define JYX #define JYY #define JYZ #define JZA #define JZB #define JZC #define JZD #define JZE #define JZF #define JZG #define JZH #define JZI #define JZJ #define JZK #define JZL #define JZM #define JZN #define JZO #define JZP #define JZQ #define JZR #define JZS #define JZT #define JZU #define JZV #define JZW #define JZX #define JZY #define JZZ #define KAA #define KAB #define KAC #define KAD #define KAE #define KAF #define KAG #define KAH #define KAI #define KAJ #define KAK #define KAL #define KAM #define KAN #define KAO #define KAP #define KAQ #define KAR #define KAS #define KAT #define KAU #define KAV #define KAW #define KAX #define KAY #define KAZ #define KBA #define KBB #define KBC #define KBD #define KBE #define KBF #define KBG #define KBH #define KBI #define KBJ #define KBK #define KBL #define KBM #define KBN #define KBO #define KBP #define KBQ #define KBR #define KBS #define KBT #define KBU #define KBV #define KBW #define KBX #define KBY #define KBZ #define KCA #define KCB #define KCC #define KCD #define KCE #define KCF #define KCG #define KCH #define KCI #define KCJ #define KCK #define KCL #define KCM #define KCN #define KCO #define KCP #define KCQ #define KCR #define KCS #define KCT #define KCU #define KCV #define KCW #define KCX #define KCY #define KCZ #define KDA #define KDB #define KDC #define KDD #define KDE #define KDF #define KDG #define KDH #define KDI #define KDJ #define KDK #define KDL #define KDM #define KDN #define KDO #define KDP #define KDQ #define KDR #define KDS #define KDT #define KDU #define KDV #define KDW #define KDX #define KDY #define KDZ #define KEA #define KEB #define KEC #define KED #define KEE #define KEF #define KEG #define KEH #define KEI #define KEJ #define KEK #define KEL #define KEM #define KEN #define KEO #define KEP #define KEQ #define KER #define KES #define KET #define KEU #define KEV #define KEW #define KEX #define KEY #define KEZ #define KFA #define KFB #define KFC #define KFD #define KFE #define KFF #define KFG #define KFH #define KFI #define KFJ #define KFK #define KFL #define KFM #define KFN #define KFO #define KFP #define KFQ #define KFR #define KFS #define KFT #define KFU #define KFV #define KFW #define KFX #define KFY #define KFZ #define KGA #define KGB #define KGC #define KGD #define KGE #define KGF #define KGG #define KGH #define KGI #define KGJ #define KGK #define KGL #define KGM #define KGN #define KGO #define KGP #define KGQ #define KGR #define KGS #define KGT #define KGU #define KGV #define KGW #define KGX #define KGY #define KGZ #define KHA #define KHB #define KHC #define KHD #define KHE #define KHF #define KHG #define KHH #define KHI #define KHJ #define KHK #define KHL #define KHM #define KHN #define KHO #define KHP #define KHQ #define KHR #define KHS #define KHT #define KHU #define KHV #define KHW #define KHX #define KHY #define KHZ #define KIA #define KIB #define KIC #define KID #define KIE #define KIF #define KIG #define KIH #define KII #define KIJ #define KIK #define KIL #define KIM #define KIN #define KIO #define KIP #define KIQ #define KIR #define KIS #define KIT #define KIU #define KIV #define KIW #define KIX #define KIY #define KIZ #define KJA #define KJB #define KJC #define KJD #define KJE #define KJF #define KJG #define KJH #define KJI #define KJJ #define KJK #define KJL #define KJM #define KJN #define KJO #define KJP #define KJQ #define KJR #define KJS #define KJT #define KJU #define KJV #define KJW #define KJX #define KJY #define KJZ #define KKA #define KKB #define KKC #define KKD #define KKE #define KKF #define KKG #define KKH #define KKI #define KKJ #define KKK #define KKL #define KKM #define KKN #define KKO #define KKP #define KKQ #define KKR #define KKS #define KKT #define KKU #define KKV #define KKW #define KKX #define KKY #define KKZ #define KLA #define KLB #define KLC #define KLD #define KLE #define KLF #define KLG #define KLH #define KLI #define KLJ #define KLK #define KLL #define KLM #define KLN #define KLO #define KLP #define KLQ #define KLR #define KLS #define KLT #define KLU #define KLV #define KLW #define KLX #define KLY #define KLZ #define KMA #define KMB #define KMC #define KMD #define KME #define KMF #define KMG #define KMH #define KMI #define KMJ #define KMK #define KML #define KMM #define KMN #define KMO #define KMP #define KMQ #define KMR #define KMS #define KMT #define KMU #define KMV #define KMW #define KMX #define KMY #define KMZ #define KNA #define KNB #define KNC #define KND #define KNE #define KNF #define KNG #define KNH #define KNI #define KNJ #define KNK #define KNL #define KNM #define KNN #define KNO #define KNP #define KNQ #define KNR #define KNS #define KNT #define KNU #define KNV #define KNW #define KNX #define KNY #define KNZ #define KOA #define KOB #define KOC #define KOD #define KOE #define KOF #define KOG #define KOH #define KOI #define KOJ #define KOK #define KOL #define KOM #define KON #define KOO #define KOP #define KOQ #define KOR #define KOS #define KOT #define KOU #define KOV #define KOW #define KOX #define KOY #define KOZ #define KPA #define KPB #define KPC #define KPD #define KPE #define KPF #define KPG #define KPH #define KPI #define KPJ #define KPK #define KPL #define KPM #define KPN #define KPO #define KPP #define KPQ #define KPR #define KPS #define KPT #define KPU #define KPV #define KPW #define KPX #define KPY #define KPZ #define KQA #define KQB #define KQC #define KQD #define KQE #define KQF #define KQG #define KQH #define KQI #define KQJ #define KQK #define KQL #define KQM #define KQN #define KQO #define KQP #define KQQ #define KQR #define KQS #define KQT #define KQU #define KQV #define KQW #define KQX #define KQY #define KQZ #define KRA #define KRB #define KRC #define KRD #define KRE #define KRF #define KRG #define KRH #define KRI #define KRJ #define KRK #define KRL #define KRM #define KRN #define KRO #define KRP #define KRQ #define KRR #define KRS #define KRT #define KRU #define KRV #define KRW #define KRX #define KRY #define KRZ #define KSA #define KSB #define KSC #define KSD #define KSE #define KSF #define KSG #define KSH #define KSI #define KSJ #define KSK #define KSL #define KSM #define KSN #define KSO #define KSP #define KSQ #define KSR #define KSS #define KST #define KSU #define KSV #define KSW #define KSX #define KSY #define KSZ #define KTA #define KTB #define KTC #define KTD #define KTE #define KTF #define KTG #define KTH #define KTI #define KTJ #define KTK #define KTL #define KTM #define KTN #define KTO #define KTP #define KTQ #define KTR #define KTS #define KTT #define KTU #define KTV #define KTW #define KTX #define KTY #define KTZ #define KUA #define KUB #define KUC #define KUD #define KUE #define KUF #define KUG #define KUH #define KUI #define KUJ #define KUK #define KUL #define KUM #define KUN #define KUO #define KUP #define KUQ #define KUR #define KUS #define KUT #define KUU #define KUV #define KUW #define KUX #define KUY #define KUZ #define KVA #define KVB #define KVC #define KVD #define KVE #define KVF #define KVG #define KVH #define KVI #define KVJ #define KVK #define KVL #define KVM #define KVN #define KVO #define KVP #define KVQ #define KVR #define KVS #define KVT #define KVU #define KVV #define KVW #define KVX #define KVY #define KVZ #define KWA #define KWB #define KWC #define KWD #define KWE #define KWF #define KWG #define KWH #define KWI #define KWJ #define KWK #define KWL #define KWM #define KWN #define KWO #define KWP #define KWQ #define KWR #define KWS #define KWT #define KWU #define KWV #define KWW #define KWX #define KWY #define KWZ #define KXA #define KXB #define KXC #define KXD #define KXE #define KXF #define KXG #define KXH #define KXI #define KXJ #define KXK #define KXL #define KXM #define KXN #define KXO #define KXP #define KXQ #define KXR #define KXS #define KXT #define KXU #define KXV #define KXW #define KXX #define KXY #define KXZ #define KYA #define KYB #define KYC #define KYD #define KYE #define KYF #define KYG #define KYH #define KYI #define KYJ #define KYK #define KYL #define KYM #define KYN #define KYO #define KYP #define KYQ #define KYR #define KYS #define KYT #define KYU #define KYV #define KYW #define KYX #define KYY #define KYZ #define KZA #define KZB #define KZC #define KZD #define KZE #define KZF #define KZG #define KZH #define KZI #define KZJ #define KZK #define KZL #define KZM #define KZN #define KZO #define KZP #define KZQ #define KZR #define KZS #define KZT #define KZU #define KZV #define KZW #define KZX #define KZY #define KZZ #define LAA #define LAB #define LAC #define LAD #define LAE #define LAF #define LAG #define LAH #define LAI #define LAJ #define LAK #define LAL #define LAM #define LAN #define LAO #define LAP #define LAQ #define LAR #define LAS #define LAT #define LAU #define LAV #define LAW #define LAX #define LAY #define LAZ #define LBA #define LBB #define LBC #define LBD #define LBE #define LBF #define LBG #define LBH #define LBI #define LBJ #define LBK #define LBL #define LBM #define LBN #define LBO #define LBP #define LBQ #define LBR #define LBS #define LBT #define LBU #define LBV #define LBW #define LBX #define LBY #define LBZ #define LCA #define LCB #define LCC #define LCD #define LCE #define LCF #define LCG #define LCH #define LCI #define LCJ #define LCK #define LCL #define LCM #define LCN #define LCO #define LCP #define LCQ #define LCR #define LCS #define LCT #define LCU #define LCV #define LCW #define LCX #define LCY #define LCZ #define LDA #define LDB #define LDC #define LDD #define LDE #define LDF #define LDG #define LDH #define LDI #define LDJ #define LDK #define LDL #define LDM #define LDN #define LDO #define LDP #define LDQ #define LDR #define LDS #define LDT #define LDU #define LDV #define LDW #define LDX #define LDY #define LDZ #define LEA #define LEB #define LEC #define LED #define LEE #define LEF #define LEG #define LEH #define LEI #define LEJ #define LEK #define LEL #define LEM #define LEN #define LEO #define LEP #define LEQ #define LER #define LES #define LET #define LEU #define LEV #define LEW #define LEX #define LEY #define LEZ #define LFA #define LFB #define LFC #define LFD #define LFE #define LFF #define LFG #define LFH #define LFI #define LFJ #define LFK #define LFL #define LFM #define LFN #define LFO #define LFP #define LFQ #define LFR #define LFS #define LFT #define LFU #define LFV #define LFW #define LFX #define LFY #define LFZ #define LGA #define LGB #define LGC #define LGD #define LGE #define LGF #define LGG #define LGH #define LGI #define LGJ #define LGK #define LGL #define LGM #define LGN #define LGO #define LGP #define LGQ #define LGR #define LGS #define LGT #define LGU #define LGV #define LGW #define LGX #define LGY #define LGZ #define LHA #define LHB #define LHC #define LHD #define LHE #define LHF #define LHG #define LHH #define LHI #define LHJ #define LHK #define LHL #define LHM #define LHN #define LHO #define LHP #define LHQ #define LHR #define LHS #define LHT #define LHU #define LHV #define LHW #define LHX #define LHY #define LHZ #define LIA #define LIB #define LIC #define LID #define LIE #define LIF #define LIG #define LIH #define LII #define LIJ #define LIK #define LIL #define LIM #define LIN #define LIO #define LIP #define LIQ #define LIR #define LIS #define LIT #define LIU #define LIV #define LIW #define LIX #define LIY #define LIZ #define LJA #define LJB #define LJC #define LJD #define LJE #define LJF #define LJG #define LJH #define LJI #define LJJ #define LJK #define LJL #define LJM #define LJN #define LJO #define LJP #define LJQ #define LJR #define LJS #define LJT #define LJU #define LJV #define LJW #define LJX #define LJY #define LJZ #define LKA #define LKB #define LKC #define LKD #define LKE #define LKF #define LKG #define LKH #define LKI #define LKJ #define LKK #define LKL #define LKM #define LKN #define LKO #define LKP #define LKQ #define LKR #define LKS #define LKT #define LKU #define LKV #define LKW #define LKX #define LKY #define LKZ #define LLA #define LLB #define LLC #define LLD #define LLE #define LLF #define LLG #define LLH #define LLI #define LLJ #define LLK #define LLL #define LLM #define LLN #define LLO #define LLP #define LLQ #define LLR #define LLS #define LLT #define LLU #define LLV #define LLW #define LLX #define LLY #define LLZ #define LMA #define LMB #define LMC #define LMD #define LME #define LMF #define LMG #define LMH #define LMI #define LMJ #define LMK #define LML #define LMM #define LMN #define LMO #define LMP #define LMQ #define LMR #define LMS #define LMT #define LMU #define LMV #define LMW #define LMX #define LMY #define LMZ #define LNA #define LNB #define LNC #define LND #define LNE #define LNF #define LNG #define LNH #define LNI #define LNJ #define LNK #define LNL #define LNM #define LNN #define LNO #define LNP #define LNQ #define LNR #define LNS #define LNT #define LNU #define LNV #define LNW #define LNX #define LNY #define LNZ #define LOA #define LOB #define LOC #define LOD #define LOE #define LOF #define LOG #define LOH #define LOI #define LOJ #define LOK #define LOL #define LOM #define LON #define LOO #define LOP #define LOQ #define LOR #define LOS #define LOT #define LOU #define LOV #define LOW #define LOX #define LOY #define LOZ #define LPA #define LPB #define LPC #define LPD #define LPE #define LPF #define LPG #define LPH #define LPI #define LPJ #define LPK #define LPL #define LPM #define LPN #define LPO #define LPP #define LPQ #define LPR #define LPS #define LPT #define LPU #define LPV #define LPW #define LPX #define LPY #define LPZ #define LQA #define LQB #define LQC #define LQD #define LQE #define LQF #define LQG #define LQH #define LQI #define LQJ #define LQK #define LQL #define LQM #define LQN #define LQO #define LQP #define LQQ #define LQR #define LQS #define LQT #define LQU #define LQV #define LQW #define LQX #define LQY #define LQZ #define LRA #define LRB #define LRC #define LRD #define LRE #define LRF #define LRG #define LRH #define LRI #define LRJ #define LRK #define LRL #define LRM #define LRN #define LRO #define LRP #define LRQ #define LRR #define LRS #define LRT #define LRU #define LRV #define LRW #define LRX #define LRY #define LRZ #define LSA #define LSB #define LSC #define LSD #define LSE #define LSF #define LSG #define LSH #define LSI #define LSJ #define LSK #define LSL #define LSM #define LSN #define LSO #define LSP #define LSQ #define LSR #define LSS #define LST #define LSU #define LSV #define LSW #define LSX #define LSY #define LSZ #define LTA #define LTB #define LTC #define LTD #define LTE #define LTF #define LTG #define LTH #define LTI #define LTJ #define LTK #define LTL #define LTM #define LTN #define LTO #define LTP #define LTQ #define LTR #define LTS #define LTT #define LTU #define LTV #define LTW #define LTX #define LTY #define LTZ #define LUA #define LUB #define LUC #define LUD #define LUE #define LUF #define LUG #define LUH #define LUI #define LUJ #define LUK #define LUL #define LUM #define LUN #define LUO #define LUP #define LUQ #define LUR #define LUS #define LUT #define LUU #define LUV #define LUW #define LUX #define LUY #define LUZ #define LVA #define LVB #define LVC #define LVD #define LVE #define LVF #define LVG #define LVH #define LVI #define LVJ #define LVK #define LVL #define LVM #define LVN #define LVO #define LVP #define LVQ #define LVR #define LVS #define LVT #define LVU #define LVV #define LVW #define LVX #define LVY #define LVZ #define LWA #define LWB #define LWC #define LWD #define LWE #define LWF #define LWG #define LWH #define LWI #define LWJ #define LWK #define LWL #define LWM #define LWN #define LWO #define LWP #define LWQ #define LWR #define LWS #define LWT #define LWU #define LWV #define LWW #define LWX #define LWY #define LWZ #define LXA #define LXB #define LXC #define LXD #define LXE #define LXF #define LXG #define LXH #define LXI #define LXJ #define LXK #define LXL #define LXM #define LXN #define LXO #define LXP #define LXQ #define LXR #define LXS #define LXT #define LXU #define LXV #define LXW #define LXX #define LXY #define LXZ #define LYA #define LYB #define LYC #define LYD #define LYE #define LYF #define LYG #define LYH #define LYI #define LYJ #define LYK #define LYL #define LYM #define LYN #define LYO #define LYP #define LYQ #define LYR #define LYS #define LYT #define LYU #define LYV #define LYW #define LYX #define LYY #define LYZ #define LZA #define LZB #define LZC #define LZD #define LZE #define LZF #define LZG #define LZH #define LZI #define LZJ #define LZK #define LZL #define LZM #define LZN #define LZO #define LZP #define LZQ #define LZR #define LZS #define LZT #define LZU #define LZV #define LZW #define LZX #define LZY #define LZZ #define MAA #define MAB #define MAC #define MAD #define MAE #define MAF #define MAG #define MAH #define MAI #define MAJ #define MAK #define MAL #define MAM #define MAN #define MAO #define MAP #define MAQ #define MAR #define MAS #define MAT #define MAU #define MAV #define MAW #define MAX #define MAY #define MAZ #define MBA #define MBB #define MBC #define MBD #define MBE #define MBF #define MBG #define MBH #define MBI #define MBJ #define MBK #define MBL #define MBM #define MBN #define MBO #define MBP #define MBQ #define MBR #define MBS #define MBT #define MBU #define MBV #define MBW #define MBX #define MBY #define MBZ #define MCA #define MCB #define MCC #define MCD #define MCE #define MCF #define MCG #define MCH #define MCI #define MCJ #define MCK #define MCL #define MCM #define MCN #define MCO #define MCP #define MCQ #define MCR #define MCS #define MCT #define MCU #define MCV #define MCW #define MCX #define MCY #define MCZ #define MDA 0x1fff #endif #endif mcpp-2.7.2/test-l/l_37_9.t0000644000175000017500000000032710216765467012013 00000000000000/* l_37_9.t: Translation limits larger than Standard / 9. */ /* 37.9L: Number of macro definitions. */ #include "m8191.h" #ifdef X0FFF /* 0x0fff; */ GBM; #else /* 0x1fff; */ MDA; #endif mcpp-2.7.2/test-l/nest78.h0000644000175000017500000000004310216765467012126 00000000000000/* nest78.h */ #include "nest79.h" mcpp-2.7.2/test-l/nest60.h0000644000175000017500000000004310216765467012115 00000000000000/* nest60.h */ #include "nest61.h" mcpp-2.7.2/test-l/nest101.h0000644000175000017500000000004510216765467012173 00000000000000/* nest101.h */ #include "nest102.h" mcpp-2.7.2/test-l/nest20.h0000644000175000017500000000004310216765467012111 00000000000000/* nest20.h */ #include "nest21.h" mcpp-2.7.2/test-l/nest53.h0000644000175000017500000000004310216765467012117 00000000000000/* nest53.h */ #include "nest54.h" mcpp-2.7.2/test-l/nest113.h0000644000175000017500000000004510216765467012176 00000000000000/* nest113.h */ #include "nest114.h" mcpp-2.7.2/test-l/nest75.h0000644000175000017500000000004310216765467012123 00000000000000/* nest75.h */ #include "nest76.h" mcpp-2.7.2/test-l/nest19.h0000644000175000017500000000004310216765467012121 00000000000000/* nest19.h */ #include "nest20.h" mcpp-2.7.2/test-l/ifdef255.h0000644000175000017500000001126610216765467012320 00000000000000/* ifdef255.h */ #ifdef X80 #else #ifdef X81 #else #ifdef X82 #else #ifdef X83 #else #ifdef X84 #else #ifdef X85 #else #ifdef X86 #else #ifdef X87 #else #ifdef X88 #else #ifdef X89 #else #ifdef X8A #else #ifdef X8B #else #ifdef X8C #else #ifdef X8D #else #ifdef X8E #else #ifdef X8F #else #ifdef X90 #else #ifdef X91 #else #ifdef X92 #else #ifdef X93 #else #ifdef X94 #else #ifdef X95 #else #ifdef X96 #else #ifdef X97 #else #ifdef X98 #else #ifdef X99 #else #ifdef X9A #else #ifdef X9B #else #ifdef X9C #else #ifdef X9D #else #ifdef X9E #else #ifdef X9F #else #ifdef XA0 #else #ifdef XA1 #else #ifdef XA2 #else #ifdef XA3 #else #ifdef XA4 #else #ifdef XA5 #else #ifdef XA6 #else #ifdef XA7 #else #ifdef XA8 #else #ifdef XA9 #else #ifdef XAA #else #ifdef XAB #else #ifdef XAC #else #ifdef XAD #else #ifdef XAE #else #ifdef XAF #else #ifdef XB0 #else #ifdef XB1 #else #ifdef XB2 #else #ifdef XB3 #else #ifdef XB4 #else #ifdef XB5 #else #ifdef XB6 #else #ifdef XB7 #else #ifdef XB8 #else #ifdef XB9 #else #ifdef XBA #else #ifdef XBB #else #ifdef XBC #else #ifdef XBD #else #ifdef XBE #else #ifdef XBF #else #ifdef XC0 #else #ifdef XC1 #else #ifdef XC2 #else #ifdef XC3 #else #ifdef XC4 #else #ifdef XC5 #else #ifdef XC6 #else #ifdef XC7 #else #ifdef XC8 #else #ifdef XC9 #else #ifdef XCA #else #ifdef XCB #else #ifdef XCC #else #ifdef XCD #else #ifdef XCE #else #ifdef XCF #else #ifdef XD0 #else #ifdef XD1 #else #ifdef XD2 #else #ifdef XD3 #else #ifdef XD4 #else #ifdef XD5 #else #ifdef XD6 #else #ifdef XD7 #else #ifdef XD8 #else #ifdef XD9 #else #ifdef XDA #else #ifdef XDB #else #ifdef XDC #else #ifdef XDD #else #ifdef XDE #else #ifdef XDF #else #ifdef XE0 #else #ifdef XE1 #else #ifdef XE2 #else #ifdef XE3 #else #ifdef XE4 #else #ifdef XE5 #else #ifdef XE6 #else #ifdef XE7 #else #ifdef XE8 #else #ifdef XE9 #else #ifdef XEA #else #ifdef XEB #else #ifdef XEC #else #ifdef XED #else #ifdef XEE #else #ifdef XEF #else #ifdef XF0 #else #ifdef XF1 #else #ifdef XF2 #else #ifdef XF3 #else #ifdef XF4 #else #ifdef XF5 #else #ifdef XF6 #else #ifdef XF7 #else #ifdef XF8 #else #ifdef XF9 #else #ifdef XFA #else #ifdef XFB #else #ifdef XFC #else #ifdef XFD #else #ifdef XFE #else #ifdef XFF nest = 0xff; #else nest = 0xff; #endif /* XFF */ #endif /* XFE */ #endif /* XFD */ #endif /* XFC */ #endif /* XFB */ #endif /* XFA */ #endif /* XF9 */ #endif /* XF8 */ #endif /* XF7 */ #endif /* XF6 */ #endif /* XF5 */ #endif /* XF4 */ #endif /* XF3 */ #endif /* XF2 */ #endif /* XF1 */ #endif /* XF0 */ #endif /* XEF */ #endif /* XEE */ #endif /* XED */ #endif /* XEC */ #endif /* XEB */ #endif /* XEA */ #endif /* XE9 */ #endif /* XE8 */ #endif /* XE7 */ #endif /* XE6 */ #endif /* XE5 */ #endif /* XE4 */ #endif /* XE3 */ #endif /* XE2 */ #endif /* XE1 */ #endif /* XE0 */ #endif /* XDF */ #endif /* XDE */ #endif /* XDD */ #endif /* XDC */ #endif /* XDB */ #endif /* XDA */ #endif /* XD9 */ #endif /* XD8 */ #endif /* XD7 */ #endif /* XD6 */ #endif /* XD5 */ #endif /* XD4 */ #endif /* XD3 */ #endif /* XD2 */ #endif /* XD1 */ #endif /* XD0 */ #endif /* XCF */ #endif /* XCE */ #endif /* XCD */ #endif /* XCC */ #endif /* XCB */ #endif /* XCA */ #endif /* XC9 */ #endif /* XC8 */ #endif /* XC7 */ #endif /* XC6 */ #endif /* XC5 */ #endif /* XC4 */ #endif /* XC3 */ #endif /* XC2 */ #endif /* XC1 */ #endif /* XC0 */ #endif /* XBF */ #endif /* XBE */ #endif /* XBD */ #endif /* XBC */ #endif /* XBB */ #endif /* XBA */ #endif /* XB9 */ #endif /* XB8 */ #endif /* XB7 */ #endif /* XB6 */ #endif /* XB5 */ #endif /* XB4 */ #endif /* XB3 */ #endif /* XB2 */ #endif /* XB1 */ #endif /* XB0 */ #endif /* XAF */ #endif /* XAE */ #endif /* XAD */ #endif /* XAC */ #endif /* XAB */ #endif /* XAA */ #endif /* XA9 */ #endif /* XA8 */ #endif /* XA7 */ #endif /* XA6 */ #endif /* XA5 */ #endif /* XA4 */ #endif /* XA3 */ #endif /* XA2 */ #endif /* XA1 */ #endif /* XA0 */ #endif /* X9F */ #endif /* X9E */ #endif /* X9D */ #endif /* X9C */ #endif /* X9B */ #endif /* X9A */ #endif /* X99 */ #endif /* X98 */ #endif /* X97 */ #endif /* X96 */ #endif /* X95 */ #endif /* X94 */ #endif /* X93 */ #endif /* X92 */ #endif /* X91 */ #endif /* X90 */ #endif /* X8F */ #endif /* X8E */ #endif /* X8D */ #endif /* X8C */ #endif /* X8B */ #endif /* X8A */ #endif /* X89 */ #endif /* X88 */ #endif /* X87 */ #endif /* X86 */ #endif /* X85 */ #endif /* X84 */ #endif /* X83 */ #endif /* X82 */ #endif /* X81 */ #endif /* X80 */ mcpp-2.7.2/test-l/nest42.h0000644000175000017500000000004310216765467012115 00000000000000/* nest42.h */ #include "nest43.h" mcpp-2.7.2/test-l/nest17.h0000644000175000017500000000004310216765467012117 00000000000000/* nest17.h */ #include "nest18.h" mcpp-2.7.2/test-l/nest93.h0000644000175000017500000000004310216765467012123 00000000000000/* nest93.h */ #include "nest94.h" mcpp-2.7.2/test-l/l_37_3.t0000644000175000017500000000123610216765467012005 00000000000000/* l_37_3.t: Translation limits larger than Standard / 3. */ /* 37.3L: Significant initial characters in an internal identifier or a macro name. */ /* Name of 127 bytes long. */ int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 127; #ifndef X7F /* Name of 255 bytes long. */ int A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 255; #endif mcpp-2.7.2/test-l/nest80.h0000644000175000017500000000004310216765467012117 00000000000000/* nest80.h */ #include "nest81.h" mcpp-2.7.2/test-l/longline.c0000644000175000017500000010411310216765467012603 00000000000000/* longline.c: source of long logical line. */ typedef unsigned int size_t; \ typedef struct __sfpos { \ char _pos[8]; \ } fpos_t; \ struct __sbuf { \ unsigned char *_base; \ int _size; \ }; \ typedef struct __sFILE { \ unsigned char *_p; \ int _r; \ int _w; \ short _flags; \ short _file; \ struct __sbuf _bf; \ int _lbfsize; \ \ \ void *_cookie; \ int (*_close) (void *) ; \ int (*_read) (void *, char *, int) ; \ fpos_t (*_seek) (void *, fpos_t, int) ; \ int (*_write) (void *, const char *, int) ; \ \ \ struct __sbuf _ub; \ unsigned char *_up; \ int _ur; \ \ \ unsigned char _ubuf[3]; \ unsigned char _nbuf[1]; \ \ \ struct __sbuf _lb; \ \ \ int _blksize; \ fpos_t _offset; \ } FILE; \ \ \ extern FILE __sF[]; \ \ \ void clearerr (FILE *) ; \ int fclose (FILE *) ; \ int feof (FILE *) ; \ int ferror (FILE *) ; \ int fflush (FILE *) ; \ int fgetc (FILE *) ; \ int fgetpos (FILE *, fpos_t *) ; \ char *fgets (char *, size_t, FILE *) ; \ FILE *fopen (const char *, const char *) ; \ int fprintf (FILE *, const char *, ...) ; \ int fputc (int, FILE *) ; \ int fputs (const char *, FILE *) ; \ \ #ifndef X03FF size_t fread (void *, size_t, size_t, FILE *) ; \ FILE *freopen (const char *, const char *, FILE *) ; \ int fscanf (FILE *, const char *, ...) ; \ int fseek (FILE *, long, int) ; \ int fsetpos (FILE *, const fpos_t *) ; \ long ftell (const FILE *) ; \ size_t fwrite (const void *, size_t, size_t, FILE *) ; \ int getc (FILE *) ; \ int getchar (void) ; \ char *gets (char *) ; \ \ extern int sys_nerr; \ extern const char * const sys_errlist[]; \ \ void perror (const char *) ; \ int printf (const char *, ...) ; \ int putc (int, FILE *) ; \ int putchar (int) ; \ int puts (const char *) ; \ int remove (const char *) ; \ int rename (const char *, const char *) ; \ void rewind (FILE *) ; \ int scanf (const char *, ...) ; \ void setbuf (FILE *, char *) ; \ int setvbuf (FILE *, char *, int, size_t) ; \ int sprintf (char *, const char *, ...) ; \ int sscanf (const char *, const char *, ...) ; \ FILE *tmpfile (void) ; \ char *tmpnam (char *) ; \ int ungetc (int, FILE *) ; \ int vfprintf (FILE *, const char *, char * ) ; \ int vprintf (const char *, char * ) ; \ int vsprintf (char *, const char *, char * ) ; \ \ \ char *ctermid (char *) ; \ FILE *fdopen (int, const char *) ; \ int fileno (FILE *) ; \ \ \ char *fgetln (FILE *, size_t *) ; \ int fpurge (FILE *) ; \ int getw (FILE *) ; \ int pclose (FILE *) ; \ FILE *popen (const char *, const char *) ; \ int putw (int, FILE *) ; \ void setbuffer (FILE *, char *, int) ; \ int setlinebuf (FILE *) ; \ char *tempnam (const char *, const char *) ; \ int snprintf (char *, size_t, const char *, ...) ; \ int vsnprintf (char *, size_t, const char *, char * ) ; \ int vscanf (const char *, char * ) ; \ int vsscanf (const char *, const char *, char * ) ; \ FILE *zopen (const char *, const char *, int) ; \ \ \ FILE *funopen (const void *, int (*)(void *, char *, int), int (*)(void *, const char *, int), fpos_t (*)(void *, fpos_t, int), int (*)(void *)) ; \ \ \ int __srget (FILE *) ; \ int __svfscanf (FILE *, const char *, char * ) ; \ int __swbuf (int, FILE *) ; \ \ typedef int rune_t; \ \ #ifndef X07FF typedef int wchar_t; \ typedef struct { \ rune_t min; \ rune_t max; \ rune_t map; \ unsigned long *types; \ } _RuneEntry; \ \ typedef struct { \ int nranges; \ _RuneEntry *ranges; \ } _RuneRange; \ \ typedef struct { \ char magic[8]; \ char encoding[32]; \ \ rune_t (*sgetrune) \ (const char *, unsigned int, char const **) ; \ int (*sputrune) \ (rune_t, char *, unsigned int, char **) ; \ rune_t invalid_rune; \ \ unsigned long runetype[ (1 <<8 ) ]; \ rune_t maplower[ (1 <<8 ) ]; \ rune_t mapupper[ (1 <<8 ) ]; \ _RuneRange runetype_ext; \ _RuneRange maplower_ext; \ _RuneRange mapupper_ext; \ \ void *variable; \ int variable_len; \ } _RuneLocale; \ \ \ \ extern _RuneLocale _DefaultRuneLocale; \ extern _RuneLocale *_CurrentRuneLocale; \ \ unsigned long ___runetype ( int ) ; \ int ___tolower ( int ) ; \ int ___toupper ( int ) ; \ \ \ int __istype ( int , unsigned long) ; \ int __isctype ( int , unsigned long) ; \ int toupper ( int ) ; \ int tolower ( int ) ; \ \ extern int errno; \ \ void *memchr (const void *, int, size_t) ; \ int memcmp (const void *, const void *, size_t) ; \ void *memcpy (void *, const void *, size_t) ; \ void *memmove (void *, const void *, size_t) ; \ void *memset (void *, int, size_t) ; \ char *strcat (char *, const char *) ; \ char *strchr (const char *, int) ; \ int strcmp (const char *, const char *) ; \ int strcoll (const char *, const char *) ; \ char *strcpy (char *, const char *) ; \ size_t strcspn (const char *, const char *) ; \ char *strerror (int) ; \ size_t strlen (const char *) ; \ char *strncat (char *, const char *, size_t) ; \ int strncmp (const char *, const char *, size_t) ; \ char *strncpy (char *, const char *, size_t) ; \ char *strpbrk (const char *, const char *) ; \ char *strrchr (const char *, int) ; \ size_t strspn (const char *, const char *) ; \ char *strstr (const char *, const char *) ; \ char *strtok (char *, const char *) ; \ size_t strxfrm (char *, const char *, size_t) ; \ \ \ \ int bcmp (const void *, const void *, size_t) ; \ void bcopy (const void *, void *, size_t) ; \ void bzero (void *, size_t) ; \ int ffs (int) ; \ char *index (const char *, int) ; \ void *memccpy (void *, const void *, int, size_t) ; \ char *rindex (const char *, int) ; \ int strcasecmp (const char *, const char *) ; \ char *strdup (const char *) ; \ void strmode (int, char *) ; \ int strncasecmp (const char *, const char *, size_t) ; \ char *strsep (char **, const char *) ; \ void swab (const void *, void *, size_t) ; \ \ \ typedef struct { \ int quot; \ int rem; \ } div_t; \ \ typedef struct { \ long quot; \ long rem; \ } ldiv_t; \ extern int __mb_cur_max; \ \ \ void \ abort (void) ; \ int \ abs (int) ; \ int atexit (void (*)(void)) ; \ double atof (const char *) ; \ int atoi (const char *) ; \ long atol (const char *) ; \ void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *)) ; \ void *calloc (size_t, size_t) ; \ div_t \ div (int, int) ; \ void \ exit (int) ; \ void free (void *) ; \ char *getenv (const char *) ; \ long \ labs (long) ; \ ldiv_t \ ldiv (long, long) ; \ void *malloc (size_t) ; \ void qsort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ int rand (void) ; \ void *realloc (void *, size_t) ; \ void srand (unsigned) ; \ double strtod (const char *, char **) ; \ long strtol (const char *, char **, int) ; \ unsigned long \ strtoul (const char *, char **, int) ; \ int system (const char *) ; \ \ \ int mblen (const char *, size_t) ; \ size_t mbstowcs (wchar_t *, const char *, size_t) ; \ int wctomb (char *, wchar_t) ; \ int mbtowc (wchar_t *, const char *, size_t) ; \ size_t wcstombs (char *, const wchar_t *, size_t) ; \ \ \ int putenv (const char *) ; \ int setenv (const char *, const char *, int) ; \ \ \ \ double drand48 (void) ; \ double erand48 (unsigned short[3]) ; \ long lrand48 (void) ; \ long nrand48 (unsigned short[3]) ; \ long mrand48 (void) ; \ long jrand48 (unsigned short[3]) ; \ void srand48 (long) ; \ unsigned short *seed48 (unsigned short[3]) ; \ void lcong48 (unsigned short[7]) ; \ \ void *alloca (size_t) ; \ \ char *getbsize (int *, long *) ; \ char *cgetcap (char *, char *, int) ; \ int cgetclose (void) ; \ \ #ifndef X0FFF int cgetent (char **, char **, char *) ; \ int cgetfirst (char **, char **) ; \ int cgetmatch (char *, char *) ; \ int cgetnext (char **, char **) ; \ int cgetnum (char *, char *, long *) ; \ int cgetset (char *) ; \ int cgetstr (char *, char *, char **) ; \ int cgetustr (char *, char *, char **) ; \ \ int daemon (int, int) ; \ char *devname (int, int) ; \ int getloadavg (double [], int) ; \ \ extern char *optarg; \ extern int opterr, optind, optopt; \ int getopt (int, char * const *, const char *) ; \ \ extern char *suboptarg; \ int getsubopt (char **, char * const *, char **) ; \ \ char *group_from_gid (unsigned long, int) ; \ int heapsort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ char *initstate (unsigned, char *, int) ; \ int mergesort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ int radixsort (const unsigned char **, int, const unsigned char *, unsigned) ; \ int sradixsort (const unsigned char **, int, const unsigned char *, unsigned) ; \ long random (void) ; \ char *realpath (const char *, char resolved_path[]) ; \ char *setstate (char *) ; \ void srandom (unsigned) ; \ char *user_from_uid (unsigned long, int) ; \ void unsetenv (const char *) ; \ \ \ typedef int ptrdiff_t; \ typedef unsigned long clock_t; \ \ \ \ \ typedef long time_t; \ struct tm { \ int tm_sec; \ int tm_min; \ int tm_hour; \ int tm_mday; \ int tm_mon; \ int tm_year; \ int tm_wday; \ int tm_yday; \ int tm_isdst; \ long tm_gmtoff; \ char *tm_zone; \ }; \ \ char *asctime (const struct tm *) ; \ clock_t clock (void) ; \ char *ctime (const time_t *) ; \ double difftime (time_t, time_t) ; \ struct tm *gmtime (const time_t *) ; \ struct tm *localtime (const time_t *) ; \ time_t mktime (struct tm *) ; \ size_t strftime (char *, size_t, const char *, const struct tm *) ; \ time_t time (time_t *) ; \ \ \ void tzset (void) ; \ \ \ \ char *timezone (int, int) ; \ void tzsetwall (void) ; \ \ \ extern int getopt( int argc, char * const * argv, const char * opts); \ extern char * stpcpy( char * dest, const char * src); \ typedef struct defbuf { \ struct defbuf * link; \ short nargs; \ \ char * parmnames; \ \ char * repl; \ char name[1]; \ } DEFBUF; \ typedef struct fileinfo { \ char * bptr; \ unsigned line; \ FILE * fp; \ long pos; \ struct fileinfo * parent; \ struct ifinfo * initif; \ char * filename; \ char * buffer; \ } FILEINFO; \ typedef struct ifinfo { \ int stat; \ unsigned ifline; \ unsigned elseline; \ } IFINFO; \ typedef struct val_sign { \ long val; \ int sign; \ } VAL_SIGN; \ extern int cflag; \ extern int eflag; \ extern int iflag; \ extern int lflag; \ extern int pflag; \ extern int qflag; \ \ extern int tflag; \ \ \ \ extern int digraphs; \ \ extern int stdc_val; \ extern long cplus; \ extern int stdc2; \ extern int has_pragma; \ \ extern int std_line_prefix; \ extern int warn_level; \ extern int errors; \ extern unsigned line; \ extern int wrongline; \ extern int keepcomments; \ extern int no_output; \ extern int in_directive; \ extern int in_define; \ extern unsigned macro_line; \ extern int openum; \ extern IFINFO * ifptr; \ extern FILEINFO * infile; \ extern int mkdep; \ \ extern char * workp; \ extern char * const work_end; \ extern char identifier[ 0xFF + 1]; \ extern const char type[]; \ extern IFINFO ifstack[]; \ extern char work[]; \ extern int debug; \ extern void curfile( void); \ extern int openfile( const char * filename, int local); \ extern void unpredefine( int clearall); \ \ extern int control( int newlines); \ extern DEFBUF * lookid( const char * name); \ extern DEFBUF * install( const char * name, int nargs, const char * parmnames \ , const char * repl); \ extern int undefine( const char * name); \ extern void dumpadef( const char * why, const DEFBUF * dp, int newdef); \ extern void dumpdef( void); \ \ extern long eval( void); \ extern VAL_SIGN * evalnum( const char * nump); \ \ extern DEFBUF * is_macro( char ** cp); \ extern char * expand( DEFBUF * defp, char * out, char * out_end); \ \ extern int get_unexpandable( int c, int diag); \ extern void skipnl( void); \ extern int skipws( void); \ extern int scantoken( int c, char ** out_pp, char * out_end); \ extern char * scanquote( int delim, char * out, char * out_end, int diag); \ extern int get( void); \ \ extern int trigraph( char * in); \ extern void unget( void); \ extern FILEINFO * ungetstring( const char * text, const char * name); \ extern char * savestring( const char * text); \ extern FILEINFO * getfile( const char * name, size_t bufsize); \ extern char * (xmalloc)( size_t size); \ extern char * (xrealloc)( char * ptr, size_t size); \ extern void cfatal( const char * format, const char * arg1, int arg2 \ , const char * arg3); \ extern void cerror( const char * format, const char * arg1, int arg2 \ , const char * arg3); \ extern void cwarn( const char * format, const char * arg1, int arg2 \ , const char * arg3); \ \ extern void dooptions( int argc, char ** argv, char ** in_pp \ , char ** out_pp); \ extern int reopen_stdout( const char * filename); \ extern void setstdin( char * cp); \ extern void put_start_file( char * filename); \ extern void sharp( void); \ extern void putfname( char * filename); \ extern int getredirection( int argc, char ** argv); \ \ extern void put_depend( const char * filename); \ \ extern int doinclude( void); \ \ extern void dopragma( void); \ extern void put_source( const char * src); \ extern void alloc_mem( void); \ \ \ \ extern void dumpstring( const char * why, const char * text); \ extern void dumpunget( const char * why); \ \ extern void print_heap( void); \ static void scanid( int c); \ static char * scannumber( int c, char * out, char * out_end); \ static char * scanop( int c, char * out); \ static char * parse_line( void); \ static char * read_a_comment( char * sp); \ static char * getline( int in_comment); \ static void at_eof( int in_comment); \ void dumptoken( int token_type, const char * cp); \ int \ \ get_unexpandable( int c, int diag) \ { \ DEFBUF * defp; \ FILEINFO * file; \ FILE * fp = 0 ; \ int token_type = 0 ; \ \ while (c != '\0' && c != '\n' \ && (fp = infile->fp, \ (token_type = scantoken( c, (workp = work, &workp), work_end)) == 65 ) \ && fp != 0 \ && (defp = is_macro( (char **) 0 )) != 0 ) { \ expand( defp, work, work_end); \ file = ungetstring( work, defp->name); \ c = skipws(); \ if (file != infile && macro_line != 65535U && (warn_level & 1)) \ cwarn( "Macro \"%s\" is expanded to 0 token" \ , defp->name, 0, ((char *) 0 ) ); \ } \ \ if (c == '\n' || c == '\0' ) { \ unget(); \ return 0 ; \ } \ \ if (diag && fp == 0 && token_type == 65 ) { \ \ if ( (strcmp(identifier, "defined") == 0) && (warn_level & 1)) \ cwarn( "Macro \"%s\" is expanded to \"defined\"" \ , defp->name, 0, ((char *) 0 ) ); \ } \ return token_type; \ } \ \ void \ \ skipnl( void) \ { \ while (infile && infile->fp == 0 ) { \ infile->bptr += strlen( infile->bptr); \ get(); \ } \ if (infile) \ infile->bptr += strlen( infile->bptr); \ } \ \ int \ \ skipws( void) \ { \ int c; \ \ do { \ c = get(); \ } \ \ while (c == ' ' || c == 0x1F ); \ return c; \ } \ int \ \ scantoken( int c, char ** out_pp, char * out_end) \ { \ char * out = *out_pp; \ int ch_type; \ int token_type = 0; \ int ch; \ \ \ ch_type = type[ c] & (~ ((char)128) & 255 ); \ switch (ch_type) { \ case 1 : \ switch (c) { \ \ case 'L': \ ch = (*infile->bptr++ & 255 ) ; \ if (type[ ch] & 16 ) { \ if (ch == '"') \ token_type = 68 ; \ else \ token_type = 70 ; \ c = ch; \ *out++ = 'L'; \ break; \ } else { \ (infile->bptr--) ; \ } \ \ default: \ scanid( c); \ out = stpcpy( out, identifier); \ token_type = 65 ; \ break; \ } \ if (token_type == 65 ) \ break; \ \ case 16 : \ out = scanquote( c, out, out_end, 0 ); \ if (token_type == 0) { \ if (c == '"') \ token_type = 67 ; \ else \ token_type = 69 ; \ } \ break; \ case 4 : \ ch = (*infile->bptr++ & 255 ) ; \ (infile->bptr--) ; \ if (type[ ch] != 2 ) \ goto operat; \ \ case 2 : \ out = scannumber( c, out, out_end); \ token_type = 66 ; \ break; \ case 8 : \ operat: out = scanop( c, out); \ token_type = 71 ; \ break; \ default: \ if \ \ \ \ ((type[ c] & 32 ) || c == 0x1E || c == 0x1D ) \ \ token_type = 73 ; \ else \ token_type = 72 ; \ *out++ = c; \ *out = '\0' ; \ break; \ } \ \ if (out_end < out) \ cfatal( "Buffer overflow scanning token \"%s\"" \ , *out_pp, 0, ((char *) 0 ) ); \ \ if (debug & 2 ) \ dumptoken( token_type, *out_pp); \ *out_pp = out; \ \ return token_type; \ } \ \ static void \ \ scanid( int c) \ { \ static char * const limit = &identifier[ 0xFF ]; \ int long_ident = 0 ; \ char * bp; \ \ bp = identifier; \ \ do { \ *bp++ = c; \ \ #ifndef X1FFF c = (*infile->bptr++ & 255 ) ; \ } while ((type[ c] & ( 1 | 2 )) && bp < limit); \ if (type[ c] & ( 1 | 2 )) { \ long_ident = 1 ; \ do { \ c = (*infile->bptr++ & 255 ) ; \ } while (type[ c] & ( 1 | 2 )); \ } \ (infile->bptr--) ; \ *bp = '\0' ; \ \ if (long_ident && (warn_level & 1)) \ cwarn( "Too long identifier truncated to \"%s\"" \ , identifier, 0, ((char *) 0 ) ); \ \ if (infile->fp && bp - identifier > 0x1F && (warn_level & 2)) \ cwarn( "Identifier longer than %.0s%d bytes \"%s\"" \ , ((char *) 0 ) , 0x1F , identifier); \ } \ \ char * \ \ scanquote( int delim, char * out, char * out_end, int diag) \ { \ const char * const skip_line = ", skipped the line"; \ const char * skip; \ int c; \ int c1; \ char * out_p = out; \ \ *out_p++ = delim; \ \ if (delim == '<') \ delim = '>'; \ \ \ while ((c = (*infile->bptr++ & 255 ) ) != '\0' ) { \ \ \ if (type[ c] & 64 ) { \ c1 = (*infile->bptr++ & 255 ) ; \ if (type[ c1] & ((char)128) ) { \ *out_p++ = c; \ *out_p++ = c1; \ goto chk_limit; \ } else { \ (infile->bptr--) ; \ *out_p++ = c; \ if (infile->fp != 0 && ifstack[0].stat && diag) { \ *out_p = c1; \ *(out_p + 1) = '\0' ; \ if (warn_level & 1) \ cwarn( \ "Illegal multi-byte character sequence \"%s\" in quotation", \ out_p - 1, 0, ((char *) 0 ) ); \ } \ continue; \ } \ } \ \ if (c == delim) { \ break; \ } else if (c == '\\' \ \ && delim != '>' \ \ ) { \ *out_p++ = c; \ c = (*infile->bptr++ & 255 ) ; \ \ if (type[ c] & 64 ) { \ (infile->bptr--) ; \ continue; \ } \ } else if (c == ' ' && delim == '>' && infile->fp == 0 ) { \ continue; \ \ } else if (c == '\n') { \ break; \ } \ if (diag && __istype((c), 0x00000200L ) && ((type[ c] & 32 ) == 0) && (warn_level & 1)) \ cwarn( \ "Illegal control character %.0s0x%02x in quotation" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ *out_p++ = c; \ chk_limit: \ if (out_end < out_p) { \ *out_end = '\0' ; \ cfatal( "Too long quotation %s", out, 0, ((char *) 0 ) ); \ } \ } \ \ if (c == '\n' || c == '\0' ) \ (infile->bptr--) ; \ if (c == delim) \ *out_p++ = delim; \ *out_p = '\0' ; \ if (diag) { \ skip = (infile->fp == 0 ) ? ((char *) 0 ) : skip_line; \ if (c != delim) { \ if (delim == '"') \ cerror( "Unterminated string literal %s%.0d%s" \ , out, 0, skip); \ else if (delim == '\'') \ cerror( "Unterminated character constant %s%.0d%s" \ , out, 0, skip); \ \ else \ cerror( "Unterminated header name %s%.0d%s" \ , out, 0, skip); \ \ out_p = 0 ; \ } else if (delim == '\'' && out_p - out <= 2) { \ cerror( "Empty character constant %s%.0d%s" \ , out, 0, skip); \ out_p = 0 ; \ } \ if (out_p - out > 0x1FD && (warn_level & 2)) \ cwarn( "Quotation longer than %.0s%d bytes %s" \ , ((char *) 0 ) , 0x1FD , out); \ \ } \ \ return out_p; \ } \ static char * \ \ scannumber( int c, char * out, char * out_end) \ { \ char * out_p = out; \ \ do { \ *out_p++ = c; \ if (c == 'E' || c == 'e') { \ c = (*infile->bptr++ & 255 ) ; \ if (c == '+' || c == '-') { \ *out_p++ = c; \ c = (*infile->bptr++ & 255 ) ; \ } \ } else { \ c = (*infile->bptr++ & 255 ) ; \ } \ } while (type[ c] & ( 2 | 4 | 1 )); \ \ *out_p = '\0' ; \ if (out_end < out_p) \ cfatal( "Too long pp-number token \"%s\"" \ , out, 0, ((char *) 0 ) ); \ (infile->bptr--) ; \ return out_p; \ } \ static char * \ \ scanop( int c, char * out) \ { \ int c2, c3; \ \ int c4; \ \ \ *out++ = c; \ \ switch (c) { \ case '~': openum = 5 ; break; \ case '(': openum = 2 ; break; \ case ')': openum = 27 ; break; \ case '?': openum = 25 ; break; \ case ';': case '[': case ']': case '{': \ case '}': case ',': \ openum = 32 ; \ break; \ default: \ openum = 33 ; \ } \ \ if (openum != 33 ) { \ *out = '\0' ; \ return out; \ } \ \ c2 = (*infile->bptr++ & 255 ) ; \ *out++ = c2; \ \ switch (c) { \ case '=': \ openum = ((c2 == '=') ? 18 : 32 ); \ break; \ case '!': \ openum = ((c2 == '=') ? 19 : 6 ); \ break; \ case '&': \ switch (c2) { \ case '&': openum = 23 ; break; \ case '=': break; \ default : openum = 20 ; break; \ } \ break; \ case '|': \ switch (c2) { \ case '|': openum = 24 ; break; \ case '=': break; \ default : openum = 22 ; break; \ } \ break; \ case '<': \ switch (c2) { \ case '<': c3 = (*infile->bptr++ & 255 ) ; \ if (c3 == '=') { \ openum = 34 ; \ *out++ = c3; \ } else { \ openum = 12 ; \ (infile->bptr--) ; \ } \ break; \ case '=': openum = 15 ; break; \ \ case ':': \ if (digraphs) \ openum = 0x42 ; \ else \ openum = 14 ; \ break; \ case '%': \ if (digraphs) \ openum = 0x40 ; \ else \ openum = 14 ; \ break; \ \ default : openum = 14 ; break; \ } \ break; \ case '>': \ switch (c2) { \ case '>': c3 = (*infile->bptr++ & 255 ) ; \ if (c3 == '=') { \ openum = 34 ; \ *out++ = c3; \ } else { \ openum = 13 ; \ (infile->bptr--) ; \ } \ break; \ case '=': openum = 17 ; break; \ default : openum = 16 ; break; \ } \ break; \ case '#': \ \ if (in_define) \ openum = ((c2 == '#') ? 31 : 30 ); \ else \ \ openum = 32 ; \ break; \ case '+': \ switch (c2) { \ case '+': \ case '=': break; \ default : openum = 10 ; break; \ } \ break; \ case '-': \ switch (c2) { \ case '-': \ case '=': \ \ break; \ case '>': \ \ if (cplus) { \ if ((c3 = (*infile->bptr++ & 255 ) ) == '*') { \ openum = 34 ; \ *out++ = c3; \ } else { \ \ (infile->bptr--) ; \ } \ } \ break; \ default : openum = 11 ; break; \ } \ break; \ case '%': \ switch (c2) { \ case '=': break; \ \ case '>': \ if (digraphs) \ openum = 0x41 ; \ else \ openum = 9 ; \ break; \ case ':': \ if (! digraphs || ! in_define) { \ openum = 9 ; \ } else if ((c3 = (*infile->bptr++ & 255 ) ) == '%') { \ if ((c4 = (*infile->bptr++ & 255 ) ) == ':') { \ openum = 31 ; \ *out++ = c3; \ *out++ = c4; \ } else { \ (infile->bptr--) ; \ (infile->bptr--) ; \ openum = 30 ; \ } \ } else { \ (infile->bptr--) ; \ openum = 30 ; \ } \ break; \ \ default : openum = 9 ; break; \ } \ break; \ case '*': \ if (c2 != '=') \ openum = 7 ; \ \ break; \ case '/': \ if (c2 != '=') \ openum = 8 ; \ \ break; \ case '^': \ if (c2 != '=') \ openum = 21 ; \ \ break; \ case '.': \ \ if (c2 == '.') { \ c3 = (*infile->bptr++ & 255 ) ; \ if (c3 == '.') { \ openum = 34 ; \ *out++ = c3; \ break; \ } else { \ (infile->bptr--) ; \ openum = 32 ; \ } \ } \ \ else if (cplus && c2 == '*') \ ; \ \ else \ openum = 32 ; \ break; \ case ':': \ \ if (stdc2 && c2 == ':') \ ; \ \ else if (c2 == '>' && digraphs) \ openum = 0x43 ; \ \ else \ openum = 26 ; \ break; \ default: \ \ cfatal( "Bug: Punctuator is mis-implemented %.0s0x%x" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ \ openum = 32 ; \ break; \ } \ \ switch (openum) { \ \ case 30 : \ \ if (c == '%') break; \ \ \ case 32 : \ case 6 : case 20 : case 22 : case 14 : \ case 16 : case 10 : case 11 : case 9 : \ case 7 : case 8 : case 21 : case 5 : \ case 26 : \ \ (infile->bptr--) ; \ out--; \ break; \ default: \ break; \ } \ \ *out = '\0' ; \ return out; \ } \ int \ \ get( void) \ { \ int len; \ int c; \ FILEINFO * file; \ \ if ((file = infile) == 0 ) \ return 0 ; \ if (debug & 32 ) { \ printf( "get(%s), line %u, bptr = %d, buffer" \ , file->filename ? file->filename : "NULL" \ , line, (int) (file->bptr - file->buffer)); \ dumpstring( ((char *) 0 ) , file->buffer); \ dumpunget( "get entrance"); \ } \ if ((c = (*file->bptr++ & 255 )) != '\0' ) { \ \ return c; \ } \ if (file->fp && \ parse_line() != 0 ) \ return get(); \ infile = file->parent; \ if (infile == 0 ) \ return 0 ; \ free(( char *)file->buffer); \ if (file->filename) \ free( file->filename); \ if (file->fp) { \ fclose( file->fp); \ if (! (strcmp("stdin", infile->filename) == 0) ) { \ infile->fp = fopen( infile->filename, "r"); \ fseek( infile->fp, infile->pos, 0 ); \ } \ len = (int) (infile->bptr - infile->buffer); \ infile->buffer = xrealloc( infile->buffer, 0x4000 ); \ \ infile->bptr = infile->buffer + len; \ line = infile->line; \ wrongline = 1 ; \ } \ free(( char *)file); \ return get(); \ } \ \ static char * \ \ parse_line( void) \ { \ char * temp; \ char * limit; \ char * tp; \ char * sp; \ int c; \ \ if ((sp = getline( 0 )) == 0 ) \ return 0 ; \ tp = temp = xmalloc( (size_t) 0x4000 ); \ limit = temp + 0x4000 - 2; \ \ while ((c = *sp++ & 255 ) != '\n') { \ \ switch (c) { \ case '/': \ switch (*sp++) { \ case '*': \ if ((sp = read_a_comment( sp)) == 0 ) { \ free( temp); \ return 0 ; \ } \ \ \ \ \ \ if (temp < tp && *(tp - 1) != ' ') \ *tp++ = ' '; \ break; \ \ case '/': \ if (stdc2) { \ \ if (keepcomments) { \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('/')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('/'), (&__sF[1])) : (*((&__sF[1]))->_p = ('/'), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('*')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('*'), (&__sF[1])) : (*((&__sF[1]))->_p = ('*'), (int)*((&__sF[1]))->_p++)) ; \ while ((c = *sp++) != '\n') \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('*')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('*'), (&__sF[1])) : (*((&__sF[1]))->_p = ('*'), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('/')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('/'), (&__sF[1])) : (*((&__sF[1]))->_p = ('/'), (int)*((&__sF[1]))->_p++)) ; \ } \ goto end_line; \ } \ \ default: \ *tp++ = '/'; \ sp--; \ break; \ } \ break; \ case '\r': \ case '\f': \ \ \ \ case '\v': \ \ if (warn_level & 1) \ cwarn( "Converted %.0s0x%02x to a space" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ case '\t': \ case ' ': \ \ if (temp < tp && *(tp - 1) != ' ') \ *tp++ = ' '; \ break; \ case '"': \ case '\'': \ infile->bptr = sp; \ \ tp = scanquote( c, tp, limit, 1 ); \ if (tp == 0 ) { \ free( temp); \ return parse_line(); \ } \ sp = infile->bptr; \ break; \ default: \ if ( __istype((c), 0x00000200L ) ) { \ cerror( \ "Illegal control character %.0s0x%x, skipped the character" \ , ((char *) 0 ) , c, ((char *) 0 ) ); \ } else { \ *tp++ = c; \ } \ break; \ } \ \ if (limit < tp) { \ *tp = '\0' ; \ cfatal( "Too long line spliced by comments :%s" \ , temp, 0, ((char *) 0 ) ); \ } \ } \ \ \ end_line: \ \ if (temp < tp && *(tp - 1) == ' ') \ tp--; \ *tp++ = '\n'; \ *tp = '\0' ; \ infile->bptr = strcpy( infile->buffer, temp); \ free( temp); \ if (macro_line != 0 && macro_line != 65535U ) { \ \ \ \ \ \ \ \ \ \ \ if (*(infile->buffer) == '#' \ \ || (*(infile->buffer) == '%' && *(infile->buffer + 1) == ':') \ \ ) \ \ if (warn_level & 1) \ cwarn( \ "Macro started at line %.0s%u swallowed directive-like line" \ , ((char *) 0 ) , macro_line, ((char *) 0 ) ); \ } \ return infile->buffer; \ } \ \ static char * \ \ read_a_comment( char * sp) \ { \ int c; \ \ if (keepcomments) { \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('/')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('/'), (&__sF[1])) : (*((&__sF[1]))->_p = ('/'), (int)*((&__sF[1]))->_p++)) ; \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = ('*')), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)('*'), (&__sF[1])) : (*((&__sF[1]))->_p = ('*'), (int)*((&__sF[1]))->_p++)) ; \ } \ c = *sp++; \ \ while (1) { \ if (keepcomments) \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ \ switch (c) { \ case '/': \ if ((c = *sp++) != '*') \ continue; \ if (warn_level & 1) \ cwarn( "\"/*\" in comment", ((char *) 0 ) , 0, ((char *) 0 ) ); \ if (keepcomments) \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ \ case '*': \ if ((c = *sp++) != '/') \ continue; \ if (keepcomments) \ (--((&__sF[1]))->_w < 0 ? ((&__sF[1]))->_w >= ((&__sF[1]))->_lbfsize ? (*((&__sF[1]))->_p = (c)), *((&__sF[1]))->_p != '\n' ? (int)*((&__sF[1]))->_p++ : __swbuf('\n', (&__sF[1])) : __swbuf((int)(c), (&__sF[1])) : (*((&__sF[1]))->_p = (c), (int)*((&__sF[1]))->_p++)) ; \ return sp; \ case '\n': \ if (! keepcomments) \ wrongline = 1 ; \ if ((sp = getline( 1 )) == 0 ) \ return 0 ; \ break; \ default: \ break; \ } \ \ c = *sp++; \ } \ \ return sp; \ } \ \ static char * \ \ getline( int in_comment) \ { \ \ int converted = 0 ; \ \ \ int esc; \ \ int len; \ char * ptr; \ \ if (infile == 0 ) \ return 0 ; \ ptr = infile->bptr = infile->buffer; \ \ while (fgets( ptr, (int) (infile->buffer + 0x4000 - ptr), infile->fp) \ != 0 ) { \ \ line++; \ if (line == 32768U && (warn_level & 1)) \ cwarn( "Line number %.0s\"%u\" got beyond range" \ , ((char *) 0 ) , line, ((char *) 0 ) ); \ \ if (debug & ( 2 | 32 )) { \ printf( "\n#line %u (%s)", line \ , infile->filename ? infile->filename : "NULL"); \ dumpstring( ((char *) 0 ) , ptr); \ } \ \ len = strlen( ptr); \ if ( 0x4000 - 1 <= ptr - infile->buffer + len \ && *(ptr + len - 1) != '\n') { \ if ( 0x4000 - 1 <= len) \ cfatal( "Too long source line" \ , ((char *) 0 ) , 0, ((char *) 0 ) ); \ else \ cfatal( "Too long logical line" \ , ((char *) 0 ) , 0, ((char *) 0 ) ); \ } \ if (*(ptr + len - 1) != '\n') \ break; \ if (lflag) \ put_source( ptr); \ \ if (tflag) \ converted = trigraph( ptr); \ if (converted) \ len = strlen( ptr); \ \ \ \ len -= 2; \ if (len >= 0) { \ esc = (*(ptr + len) == '\\'); \ if (esc) { \ ptr = infile->bptr += len; \ wrongline = 1 ; \ continue; \ } \ } \ \ \ if (ptr - infile->buffer + len + 2 > 0x1FD + 1 && (warn_level & 2)) \ \ cwarn( "Logical source line longer than %.0s%d bytes" \ , ((char *) 0 ) , 0x1FD , ((char *) 0 ) ); \ \ return infile->bptr = infile->buffer; \ } \ \ \ if ( (((infile->fp)->_flags & 0x0040 ) != 0) ) \ cfatal( "File read error", ((char *) 0 ) , 0, ((char *) 0 ) ); \ at_eof( in_comment); \ if (iflag) { \ no_output--; \ keepcomments = cflag && ifstack[0].stat && !no_output; \ } \ return 0 ; \ } \ \ \ \ \ \ int \ \ trigraph( char * in) \ { \ const char * const tritext = "=(/)'-\0#[\\]^{|}~"; \ int count = 0; \ const char * tp; \ \ while ((in = strchr( in, '?')) != 0 ) { \ if (*++in != '?') \ continue; \ while (*++in == '?') \ ; \ if ((tp = strchr( tritext, *in)) == 0 ) \ continue; \ in[ -2] = tp[ 10 ]; \ in--; \ memmove( in, in + 2, strlen( in + 1)); \ count++; \ } \ \ if (count && (warn_level & 8)) \ cwarn( "%.0s%d trigraph(s) converted" \ , ((char *) 0 ) , count, ((char *) 0 ) ); \ return count; \ } \ static void \ \ at_eof( int in_comment) \ { \ const char * const format \ = "End of %s with %.0d%s"; \ const char * const unterm_if_format \ = "End of %s within #if (#ifdef) section started at line %u"; \ const char * const unterm_macro_format \ = "End of %s within macro call started at line %u"; \ const char * const input \ = infile->parent ? "file" : "input"; \ const char * const no_newline \ = "no newline, skipped the line"; \ const char * const unterm_com \ = "unterminated comment, skipped the line"; \ \ const char * const backsl = "\\, skipped the line"; \ int len; \ char * cp = infile->buffer; \ IFINFO * ifp; \ \ len = strlen( cp); \ if (len && *(cp += (len - 1)) != '\n') { \ line++; \ *++cp = '\n'; \ *++cp = '\0' ; \ cerror( format, input, 0, no_newline); \ } \ \ \ if (infile->buffer < infile->bptr) \ cerror( format, input, 0, backsl); \ \ \ if (in_comment) \ cerror( format, input, 0, unterm_com); \ \ if (infile->initif < ifptr) { \ ifp = infile->initif + 1; \ \ cerror( unterm_if_format, input, ifp->ifline, ((char *) 0 ) ); \ ifptr = infile->initif; \ ifstack[0].stat = ifptr->stat; \ } \ \ if (macro_line != 0 && macro_line != 65535U ) { \ \ cerror( unterm_macro_format, input, macro_line, ((char *) 0 ) ); \ macro_line = 65535U ; \ } \ } \ \ void \ \ unget( void) \ { \ if (infile != 0 ) { \ --infile->bptr; \ \ if (infile->bptr < infile->buffer) \ cfatal( "Bug: Too much pushback", ((char *) 0 ) , 0, ((char *) 0 ) ); \ \ } \ \ \ if (debug & 32 ) \ dumpunget( "after unget"); \ \ } \ \ FILEINFO * \ \ ungetstring( const char * text, const char * name) \ { \ FILEINFO * file; \ size_t size; \ \ if (text) \ size = strlen( text) + 1; \ else \ size = 1; \ file = getfile( name, size); \ if (text) \ memcpy( file->buffer, text, size); \ else \ *file->buffer = '\0' ; \ return file; \ } \ \ char * \ \ savestring( const char * text) \ { \ char * result; \ size_t size; \ \ size = strlen( text) + 1; \ result = xmalloc( size); \ memcpy( result, text, size); \ return result; \ } \ \ FILEINFO * \ \ getfile( const char * name, size_t bufsize) \ { \ FILEINFO * file; \ size_t s_name; \ \ file = (FILEINFO *) xmalloc( sizeof (FILEINFO)); \ file->buffer = xmalloc( bufsize); \ if (name) { \ s_name = strlen( name) + 1; \ file->filename = (char *) xmalloc( s_name); \ memcpy( file->filename, name, s_name); \ } else { \ file->filename = 0 ; \ } \ \ file->bptr = file->buffer; \ return file; } \ #endif #endif #endif #endif mcpp-2.7.2/test-l/nest121.h0000644000175000017500000000004510216765467012175 00000000000000/* nest121.h */ #include "nest122.h" mcpp-2.7.2/test-l/l_37_6.t0000644000175000017500000001026610216765467012013 00000000000000/* l_37_6.t: Translation limits larger than Standard / 6. */ /* 37.6L: Parenthesized expression. */ #ifndef X3F /* nest = 127; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \ (0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \ (0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \ (0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \ (0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \ (0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \ (0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \ (0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \ (0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + 0x7F) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -0x80 nest = 127; #endif #ifndef X7F /* nest = 255; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \ (0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \ (0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \ (0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \ (0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \ (0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \ (0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \ (0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \ (0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + (0x7F - \ (0x80 + (0x81 - (0x82 + (0x83 - (0x84 + (0x85 - (0x86 + (0x87 - \ (0x88 + (0x89 - (0x8A + (0x8B - (0x8C + (0x8D - (0x8E + (0x8F - \ (0x90 + (0x91 - (0x92 + (0x93 - (0x94 + (0x95 - (0x96 + (0x97 - \ (0x98 + (0x99 - (0x9A + (0x9B - (0x9C + (0x9D - (0x9E + (0x9F - \ (0xA0 + (0xA1 - (0xA2 + (0xA3 - (0xA4 + (0xA5 - (0xA6 + (0xA7 - \ (0xA8 + (0xA9 - (0xAA + (0xAB - (0xAC + (0xAD - (0xAE + (0xAF - \ (0xB0 + (0xB1 - (0xB2 + (0xB3 - (0xB4 + (0xB5 - (0xB6 + (0xB7 - \ (0xB8 + (0xB9 - (0xBA + (0xBB - (0xBC + (0xBD - (0xBE + (0xBF - \ (0xC0 + (0xC1 - (0xC2 + (0xC3 - (0xC4 + (0xC5 - (0xC6 + (0xC7 - \ (0xC8 + (0xC9 - (0xCA + (0xCB - (0xCC + (0xCD - (0xCE + (0xCF - \ (0xD0 + (0xD1 - (0xD2 + (0xD3 - (0xD4 + (0xD5 - (0xD6 + (0xD7 - \ (0xD8 + (0xD9 - (0xDA + (0xDB - (0xDC + (0xDD - (0xDE + (0xDF - \ (0xE0 + (0xE1 - (0xE2 + (0xE3 - (0xE4 + (0xE5 - (0xE6 + (0xE7 - \ (0xE8 + (0xE9 - (0xEA + (0xEB - (0xEC + (0xED - (0xEE + (0xEF - \ (0xF0 + (0xF1 - (0xF2 + (0xF3 - (0xF4 + (0xF5 - (0xF6 + (0xF7 - \ (0xF8 + (0xF9 - (0xFA + (0xFB - (0xFC + (0xFD - (0xFE + 0xFF) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -0x100 nest = 255; #endif #endif #endif mcpp-2.7.2/test-l/nest77.h0000644000175000017500000000004310216765467012125 00000000000000/* nest77.h */ #include "nest78.h" mcpp-2.7.2/test-l/nest16.h0000644000175000017500000000004310216765467012116 00000000000000/* nest16.h */ #include "nest17.h" mcpp-2.7.2/test-l/l_37_4.t0000644000175000017500000000027010216765467012003 00000000000000/* l_37_4.t: Translation limits larger than Standard / 4. */ /* 37.4L: Nested conditional inclusion. */ /* Define one of the macros X7F, XFF. */ #include "ifdef127.h" mcpp-2.7.2/test-l/nest26.h0000644000175000017500000000004310216765467012117 00000000000000/* nest26.h */ #include "nest27.h" mcpp-2.7.2/test-l/nest2.h0000644000175000017500000000004110216765467012027 00000000000000/* nest2.h */ #include "nest3.h" mcpp-2.7.2/test-l/nest46.h0000644000175000017500000000004310216765467012121 00000000000000/* nest46.h */ #include "nest47.h" mcpp-2.7.2/test-l/l_37_7.c0000644000175000017500000002113310216765467011766 00000000000000/* l_37_7.c: Translation limits larger than Standard / 7. */ #include "defs.h" main( void) { /* 37.7L: Characters in a string (after concatenation). */ /* 8191 bytes long. */ char *string8189 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ E123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ F123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ G123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; fputs( "started\n", stderr); assert( strlen( string8189) == 8189); fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-l/nest70.h0000644000175000017500000000004310216765467012116 00000000000000/* nest70.h */ #include "nest71.h" mcpp-2.7.2/test-l/nest97.h0000644000175000017500000000004310216765467012127 00000000000000/* nest97.h */ #include "nest98.h" mcpp-2.7.2/test-l/l_37_2.t0000644000175000017500000000242510216765467012005 00000000000000/* l_37_2.t: Translation limits larger than Standard / 2. */ /* 37.2L: Number of arguments in macro call. */ #include "l_37_1.t" /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6P7P8P9PAPBPCPDPEOF; */ glue255( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7, P7, A8, B8, C8, D8, E8, F8, G8, H8, I8, J8, K8, L8, M8, N8, O8, P8, A9, B9, C9, D9, E9, F9, G9, H9, I9, J9, K9, L9, M9, N9, O9, P9, AA, BA, CA, DA, EA, FA, GA, HA, IA, JA, KA, LA, MA, NA, OA, PA, AB, BB, CB, DB, EB, FB, GB, HB, IB, JB, KB, LB, MB, NB, OB, PB, AC, BC, CC, DC, EC, FC, GC, HC, IC, JC, KC, LC, MC, NC, OC, PC, AD, BD, CD, DD, ED, FD, GD, HD, ID, JD, KD, LD, MD, ND, OD, PD, AE, BE, CE, DE, EE, FE, GE, HE, IE, JE, KE, LE, ME, NE, OE, PE, AF, BF, CF, DF, EF, FF, GF, HF, IF, JF, KF, LF, MF, NF, OF); mcpp-2.7.2/test-l/nest119.h0000644000175000017500000000004510216765467012204 00000000000000/* nest119.h */ #include "nest120.h" mcpp-2.7.2/test-l/LICENSE0000644000175000017500000000266410216765467011645 00000000000000/*- * Copyright (c) 1998, 2002-2004 Kiyoshi Matsui * All rights reserved. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/test-l/ifdef127.h0000644000175000017500000001131510216765467012311 00000000000000/* ifdef127.h */ #ifdef X01 #else #ifdef X02 #else #ifdef X03 #else #ifdef X04 #else #ifdef X05 #else #ifdef X06 #else #ifdef X07 #else #ifdef X08 #else #ifdef X09 #else #ifdef X0A #else #ifdef X0B #else #ifdef X0C #else #ifdef X0D #else #ifdef X0E #else #ifdef X0F nest = 0x0f; #else #ifdef X10 #else #ifdef X11 #else #ifdef X12 #else #ifdef X13 #else #ifdef X14 #else #ifdef X15 #else #ifdef X16 #else #ifdef X17 #else #ifdef X18 #else #ifdef X19 #else #ifdef X1A #else #ifdef X1B #else #ifdef X1C #else #ifdef X1D #else #ifdef X1E #else #ifdef X1F nest = 0x1f; #else #ifdef X20 #else #ifdef X21 #else #ifdef X22 #else #ifdef X23 #else #ifdef X24 #else #ifdef X25 #else #ifdef X26 #else #ifdef X27 #else #ifdef X28 #else #ifdef X29 #else #ifdef X2A #else #ifdef X2B #else #ifdef X2C #else #ifdef X2D #else #ifdef X2E #else #ifdef X2F #else #ifdef X30 #else #ifdef X31 #else #ifdef X32 #else #ifdef X33 #else #ifdef X34 #else #ifdef X35 #else #ifdef X36 #else #ifdef X37 #else #ifdef X38 #else #ifdef X39 #else #ifdef X3A #else #ifdef X3B #else #ifdef X3C #else #ifdef X3D #else #ifdef X3E #else #ifdef X3F nest = 0x3f; #else #ifdef X40 #else #ifdef X41 #else #ifdef X42 #else #ifdef X43 #else #ifdef X44 #else #ifdef X45 #else #ifdef X46 #else #ifdef X47 #else #ifdef X48 #else #ifdef X49 #else #ifdef X4A #else #ifdef X4B #else #ifdef X4C #else #ifdef X4D #else #ifdef X4E #else #ifdef X4F #else #ifdef X50 #else #ifdef X51 #else #ifdef X52 #else #ifdef X53 #else #ifdef X54 #else #ifdef X55 #else #ifdef X56 #else #ifdef X57 #else #ifdef X58 #else #ifdef X59 #else #ifdef X5A #else #ifdef X5B #else #ifdef X5C #else #ifdef X5D #else #ifdef X5E #else #ifdef X5F #else #ifdef X60 #else #ifdef X61 #else #ifdef X62 #else #ifdef X63 #else #ifdef X64 #else #ifdef X65 #else #ifdef X66 #else #ifdef X67 #else #ifdef X68 #else #ifdef X69 #else #ifdef X6A #else #ifdef X6B #else #ifdef X6C #else #ifdef X6D #else #ifdef X6E #else #ifdef X6F #else #ifdef X70 #else #ifdef X71 #else #ifdef X72 #else #ifdef X73 #else #ifdef X74 #else #ifdef X75 #else #ifdef X76 #else #ifdef X77 #else #ifdef X78 #else #ifdef X79 #else #ifdef X7A #else #ifdef X7B #else #ifdef X7C #else #ifdef X7D #else #ifdef X7E #else #ifdef X7F nest = 0x7f; #else #include "ifdef255.h" #endif /* X7F */ #endif /* X7E */ #endif /* X7D */ #endif /* X7C */ #endif /* X7B */ #endif /* X7A */ #endif /* X79 */ #endif /* X78 */ #endif /* X77 */ #endif /* X76 */ #endif /* X75 */ #endif /* X74 */ #endif /* X73 */ #endif /* X72 */ #endif /* X71 */ #endif /* X70 */ #endif /* X6F */ #endif /* X6E */ #endif /* X6D */ #endif /* X6C */ #endif /* X6B */ #endif /* X6A */ #endif /* X69 */ #endif /* X68 */ #endif /* X67 */ #endif /* X66 */ #endif /* X65 */ #endif /* X64 */ #endif /* X63 */ #endif /* X62 */ #endif /* X61 */ #endif /* X60 */ #endif /* X5F */ #endif /* X5E */ #endif /* X5D */ #endif /* X5C */ #endif /* X5B */ #endif /* X5A */ #endif /* X59 */ #endif /* X58 */ #endif /* X57 */ #endif /* X56 */ #endif /* X55 */ #endif /* X54 */ #endif /* X53 */ #endif /* X52 */ #endif /* X51 */ #endif /* X50 */ #endif /* X4F */ #endif /* X4E */ #endif /* X4D */ #endif /* X4C */ #endif /* X4B */ #endif /* X4A */ #endif /* X49 */ #endif /* X48 */ #endif /* X47 */ #endif /* X46 */ #endif /* X45 */ #endif /* X44 */ #endif /* X43 */ #endif /* X42 */ #endif /* X41 */ #endif /* X40 */ #endif /* X3F */ #endif /* X3E */ #endif /* X3D */ #endif /* X3C */ #endif /* X3B */ #endif /* X3A */ #endif /* X39 */ #endif /* X38 */ #endif /* X37 */ #endif /* X36 */ #endif /* X35 */ #endif /* X34 */ #endif /* X33 */ #endif /* X32 */ #endif /* X31 */ #endif /* X30 */ #endif /* X2F */ #endif /* X2E */ #endif /* X2D */ #endif /* X2C */ #endif /* X2B */ #endif /* X2A */ #endif /* X29 */ #endif /* X28 */ #endif /* X27 */ #endif /* X26 */ #endif /* X25 */ #endif /* X24 */ #endif /* X23 */ #endif /* X22 */ #endif /* X21 */ #endif /* X20 */ #endif /* X1F */ #endif /* X1E */ #endif /* X1D */ #endif /* X1C */ #endif /* X1B */ #endif /* X1A */ #endif /* X19 */ #endif /* X18 */ #endif /* X17 */ #endif /* X16 */ #endif /* X15 */ #endif /* X14 */ #endif /* X13 */ #endif /* X12 */ #endif /* X11 */ #endif /* X10 */ #endif /* X0F */ #endif /* X0E */ #endif /* X0D */ #endif /* X0C */ #endif /* X0B */ #endif /* X0A */ #endif /* X09 */ #endif /* X08 */ #endif /* X07 */ #endif /* X06 */ #endif /* X05 */ #endif /* X04 */ #endif /* X03 */ #endif /* X02 */ #endif /* X01 */ mcpp-2.7.2/test-l/nest124.h0000644000175000017500000000004510216765467012200 00000000000000/* nest124.h */ #include "nest125.h" mcpp-2.7.2/test-l/nest23.h0000644000175000017500000000004310216765467012114 00000000000000/* nest23.h */ #include "nest24.h" mcpp-2.7.2/test-l/nest51.h0000644000175000017500000000004310216765467012115 00000000000000/* nest51.h */ #include "nest52.h" mcpp-2.7.2/test-l/nest59.h0000644000175000017500000000004310216765467012125 00000000000000/* nest59.h */ #include "nest60.h" mcpp-2.7.2/test-l/nest62.h0000644000175000017500000000004310216765467012117 00000000000000/* nest62.h */ #include "nest63.h" mcpp-2.7.2/test-l/nest47.h0000644000175000017500000000004310216765467012122 00000000000000/* nest47.h */ #include "nest48.h" mcpp-2.7.2/test-l/nest104.h0000644000175000017500000000004510216765467012176 00000000000000/* nest104.h */ #include "nest105.h" mcpp-2.7.2/test-l/nest54.h0000644000175000017500000000004310216765467012120 00000000000000/* nest54.h */ #include "nest55.h" mcpp-2.7.2/test-l/nest79.h0000644000175000017500000000004310216765467012127 00000000000000/* nest79.h */ #include "nest80.h" mcpp-2.7.2/test-l/nest74.h0000644000175000017500000000004310216765467012122 00000000000000/* nest74.h */ #include "nest75.h" mcpp-2.7.2/test-l/nest30.h0000644000175000017500000000004310216765467012112 00000000000000/* nest30.h */ #include "nest31.h" mcpp-2.7.2/test-l/nest72.h0000644000175000017500000000004310216765467012120 00000000000000/* nest72.h */ #include "nest73.h" mcpp-2.7.2/test-l/nest38.h0000644000175000017500000000004310216765467012122 00000000000000/* nest38.h */ #include "nest39.h" mcpp-2.7.2/test-l/nest21.h0000644000175000017500000000004310216765467012112 00000000000000/* nest21.h */ #include "nest22.h" mcpp-2.7.2/test-l/nest94.h0000644000175000017500000000004310216765467012124 00000000000000/* nest94.h */ #include "nest95.h" mcpp-2.7.2/test-l/nest10.h0000644000175000017500000000004310216765467012110 00000000000000/* nest10.h */ #include "nest11.h" mcpp-2.7.2/test-l/nest63.h0000644000175000017500000000011510216765467012120 00000000000000/* nest63.h */ #ifdef X3F nest = 0x3f; #else #include "nest64.h" #endif mcpp-2.7.2/test-l/nest83.h0000644000175000017500000000004310216765467012122 00000000000000/* nest83.h */ #include "nest84.h" mcpp-2.7.2/test-l/nest29.h0000644000175000017500000000004310216765467012122 00000000000000/* nest29.h */ #include "nest30.h" mcpp-2.7.2/test-l/nest85.h0000644000175000017500000000004310216765467012124 00000000000000/* nest85.h */ #include "nest86.h" mcpp-2.7.2/test-l/nest98.h0000644000175000017500000000004310216765467012130 00000000000000/* nest98.h */ #include "nest99.h" mcpp-2.7.2/test-l/nest33.h0000644000175000017500000000004310216765467012115 00000000000000/* nest33.h */ #include "nest34.h" mcpp-2.7.2/test-l/nest103.h0000644000175000017500000000004510216765467012175 00000000000000/* nest103.h */ #include "nest104.h" mcpp-2.7.2/test-l/nest31.h0000644000175000017500000000011510216765467012113 00000000000000/* nest31.h */ #ifdef X1F nest = 0x1f; #else #include "nest32.h" #endif mcpp-2.7.2/test-l/l_37_6.c0000644000175000017500000001051710216765467011771 00000000000000/* l_37_6.t: Translation limits larger than Standard / 6. */ #include "defs.h" main( void) { int nest; fputs( "started\n", stderr); /* 37.6L: Parenthesized expression. */ #ifndef X3F #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \ (0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \ (0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \ (0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \ (0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \ (0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \ (0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \ (0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \ (0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + 0x7F) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -0x80 nest = 127; #endif assert( nest == 127); #ifndef X7F #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \ (0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \ (0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \ (0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \ (0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \ (0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \ (0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \ (0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \ (0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + (0x7F - \ (0x80 + (0x81 - (0x82 + (0x83 - (0x84 + (0x85 - (0x86 + (0x87 - \ (0x88 + (0x89 - (0x8A + (0x8B - (0x8C + (0x8D - (0x8E + (0x8F - \ (0x90 + (0x91 - (0x92 + (0x93 - (0x94 + (0x95 - (0x96 + (0x97 - \ (0x98 + (0x99 - (0x9A + (0x9B - (0x9C + (0x9D - (0x9E + (0x9F - \ (0xA0 + (0xA1 - (0xA2 + (0xA3 - (0xA4 + (0xA5 - (0xA6 + (0xA7 - \ (0xA8 + (0xA9 - (0xAA + (0xAB - (0xAC + (0xAD - (0xAE + (0xAF - \ (0xB0 + (0xB1 - (0xB2 + (0xB3 - (0xB4 + (0xB5 - (0xB6 + (0xB7 - \ (0xB8 + (0xB9 - (0xBA + (0xBB - (0xBC + (0xBD - (0xBE + (0xBF - \ (0xC0 + (0xC1 - (0xC2 + (0xC3 - (0xC4 + (0xC5 - (0xC6 + (0xC7 - \ (0xC8 + (0xC9 - (0xCA + (0xCB - (0xCC + (0xCD - (0xCE + (0xCF - \ (0xD0 + (0xD1 - (0xD2 + (0xD3 - (0xD4 + (0xD5 - (0xD6 + (0xD7 - \ (0xD8 + (0xD9 - (0xDA + (0xDB - (0xDC + (0xDD - (0xDE + (0xDF - \ (0xE0 + (0xE1 - (0xE2 + (0xE3 - (0xE4 + (0xE5 - (0xE6 + (0xE7 - \ (0xE8 + (0xE9 - (0xEA + (0xEB - (0xEC + (0xED - (0xEE + (0xEF - \ (0xF0 + (0xF1 - (0xF2 + (0xF3 - (0xF4 + (0xF5 - (0xF6 + (0xF7 - \ (0xF8 + (0xF9 - (0xFA + (0xFB - (0xFC + (0xFD - (0xFE + 0xFF) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -0x100 nest = 255; #endif assert( nest == 255); #endif #endif fputs( "success\n", stderr); return 0; } mcpp-2.7.2/test-l/nest65.h0000644000175000017500000000004310216765467012122 00000000000000/* nest65.h */ #include "nest66.h" mcpp-2.7.2/test-l/nest56.h0000644000175000017500000000004310216765467012122 00000000000000/* nest56.h */ #include "nest57.h" mcpp-2.7.2/test-l/nest24.h0000644000175000017500000000004310216765467012115 00000000000000/* nest24.h */ #include "nest25.h" mcpp-2.7.2/test-l/nest96.h0000644000175000017500000000004310216765467012126 00000000000000/* nest96.h */ #include "nest97.h" mcpp-2.7.2/test-l/nest28.h0000644000175000017500000000004310216765467012121 00000000000000/* nest28.h */ #include "nest29.h" mcpp-2.7.2/test-l/nest18.h0000644000175000017500000000004310216765467012120 00000000000000/* nest18.h */ #include "nest19.h" mcpp-2.7.2/test-l/nest120.h0000644000175000017500000000004510216765467012174 00000000000000/* nest120.h */ #include "nest121.h" mcpp-2.7.2/test-l/nest110.h0000644000175000017500000000004510216765467012173 00000000000000/* nest110.h */ #include "nest111.h" mcpp-2.7.2/test-l/nest107.h0000644000175000017500000000004510216765467012201 00000000000000/* nest107.h */ #include "nest108.h" mcpp-2.7.2/test-l/nest117.h0000644000175000017500000000004510216765467012202 00000000000000/* nest117.h */ #include "nest118.h" mcpp-2.7.2/test-l/nest102.h0000644000175000017500000000004510216765467012174 00000000000000/* nest102.h */ #include "nest103.h" mcpp-2.7.2/test-l/nest40.h0000644000175000017500000000004310216765467012113 00000000000000/* nest40.h */ #include "nest41.h" mcpp-2.7.2/test-l/nest11.h0000644000175000017500000000004310216765467012111 00000000000000/* nest11.h */ #include "nest12.h" mcpp-2.7.2/INSTALL0000644000175000017500000005755211112254500010440 00000000000000This file explains how to generate executables by compiling the MCPP source. For further details, please refer to mcpp-porting.html. 1. Types of MCPP executables There are several types of MCPP executable corresponding to its building methods. The building methods of MCPP have following two axis: 1. stand-alone-build vs subroutine-build 2. compiler-independent-build vs compiler-specific-build stand-alone-build: The preprocessor which is invoked as a command. Some of this type is invoked by compiler-driver. subroutine-build: The preprocessor to be called as a subroutine (repeatedly, if required) from other main program. compiler-independent-build: The preprocessor which behaves on its own not depending on any compiler system. The invocation options, for example, are the same across the compilers with which MCPP is compiled. Although it can preprocess source files, it cannot behave as an integrated part of a compiler system. compiler-specific-build: The preprocessor to replace (if possible) the resident preprocessor of certain compiler system. It has some specifications for the compiler system only and is installed into the compiler-system-specific directory. This document does not explain subroutine-build. As for it, please refer to mcpp-porting.html 3.12. All the explanations below are of stand-alone-build. 2. Configure and make To compile MCPP, the configure script can be used on UNIX-like systems and CygWIN, MinGW. You can do configure and make in any directory. In this document ${mcpp-dir} represents the path of 'mcpp-${VERSION}' directory. The ${VERSION} represents the version of MCPP such as 2.6.4 or 2.7.1. The configure script searches for compilers by name of 'cc' ('c++') and 'gcc' ('g++') according to the path list set in the environment variable $PATH. So, if you use compilers named like 'gcc-4.3.0' and 'g++-4.3.0', you have to specify them by CC and CXX environment variables, or link them to 'gcc' and 'g++', prior to do configure. If you use a pair of compilers other than the one first found in the path list, you have to change the $PATH such as: export PATH=/my/gcc/bin:$PATH The setting should be kept the same while you do 'configure' and 'make'. Do not specify a compiler by CC or CXX variable with any directory part, even in an absolute path, when it is not the first one found in the $PATH, because $PATH influences everything of configure. 2.1. The compiler-independent-build If you type the commands as: ${mcpp-dir}/configure; make; make install the compiler-independent executable will be generated and installed by name of 'mcpp'. Also a few document files will be installed. ${mcpp-dir}/configure --prefix=/usr; make; make install will install the executable into 'bin' directory in the directory specified by '--prefix' option. If this option is omitted, the directory defaults to '/usr/local'. 'make install' usually requires root privilege, and you can do it by: sudo make install or by first 'su', then 'configure; make; make install'. On FreeBSD, you'd better to use 'gmake' instead of 'make'. To strip the executable, do: make install-strip instead of 'make install'. To uninstall the executable, do: make uninstall If you specify 'DESTDIR=DIR' option with make (un)install, all the files will be installed under (or uninstalled from) the 'DIR' directory. For example, make DESTDIR=/tmp/mcpp install will install MCPP into '/tmp/mcpp/usr/local/bin/', (Non-existent directories will be generated. If '--prefix=DIR' option was specified in configure, '/usr/local' part will be replaced by 'DIR'). This option is used to make a binary package. GCC 4.1 or later has the option '-fstack-protector' ('-fstack-protector- all'). You can enable it by adding "CFLAGS+='-fstack-protector'" option to make command. The same can be said on GCC-specific-build. Also, you can use "CFLAGS+='-ggdb -O0'" option to debug mcpp by gdb. 'make install' of compiler-independent-build installs a few documents as well as the executable. This is for the convenience of making a binary package. Note that on Linux, Mac OS X, CygWIN and MinGW, the system's standard headers have certain defects, and some workarounds are necessary for the compiler-independent-build of MCPP. See mcpp-manual.html 3.9.9 for this problem. 2.2. The compiler-specific-build This line of commands will generate a compiler-specific executable and will install it into the compiler-specific directory. ${mcpp-dir}/configure --enable-replace-cpp; make; make install 'make install', 'make install-strip', 'make uninstall' are the same as compiler-independent-build. The prefix directory is automatocally set from the path of GCC: for example, '/usr/local' of '/usr/local/bin/gcc'. If you specify --prefix option for configure and it conflicts with the GCC path, the --prefix option will be ignored. 'DESTDIR' option of make has also no relevance to the executable's installation. For the compiler systems other than GCC, however, it may not be compiled or installed properly if some porting work has not been done beforehand and if some of the options are not specified with configure. 2.2.1 When the compiler system is GCC When the compiler system is GCC, the appropriate settings will be set by the configure without any options other than '--enable-replace-cpp'. After configuring, do 'make'. 2.2.1.1. make install After configuring and 'make', the 'make install' command installs MCPP into the compiler's directory (e.g. /usr/libexec or /usr/lib/gcc-lib/ SYSTEM/VERSION). This is the directory where cc1 (cpp0), which is called by gcc, is located. 'make install' saves GCC / cc1, cc1plus (cpp0) and setups gcc and g++ command appropriately to call MCPP. This setting is different depending on GCC being V.2.* or V.3.*-4.*. (Refer section 3.9.5 and 3.9.7 of mcpp-manual.html). In addition, it generates some GCC-version-dependent header files under 'mcpp-gcc*' directory in compiler-specific include directory. 2.2.1.2. make check In the MCPP Validation Suite, there is an edition which can be used as testsuite of GCC. If GCC / testsuite has been installed, 'make check' can test MCPP using the testsuite edition of Validation Suite. Because this edition is to be used as a part of GCC / testsuite, the testsuite should be installed and ready to execute in advance. GCC / testsuite is usually a part of the source code of GCC. (It can be a separate package in some cases.) You can use any version of testsuite from GCC V.2.95.* to V.4.2.*. Also, 'configure' needs an option to specify the directory where GCC / testsuite is located, as: ${mcpp-dir}/configure --with-gcc-testsuite-dir=DIR \ --enable-replace-cpp If the directory where GCC source is located is ${gcc-source}, this 'DIR' should become: ${gcc-source}/gcc/testsuite Configured as above, 'make check' after 'make; make install' copies the testsuite edition of Validation Suite into GCC / testsuite, and applies required settings according to whether GCC is V.2.* or V.3.*-4.*. When the name of the gcc command is not 'gcc', for example 'gcc-4.1.2' or 'powerpc-apple-darwin9-gcc-4.0.1', 'make check' links 'gcc' to that name temporarily, because GCC testsuite expects literal 'gcc' for the name. Then, the testsuite will be executed. Usually, 'make check' would be run before 'make install' in the normal software, but this order is reversed in MCPP. This is because testsuite cannot be applied to MCPP unless MCPP is called from gcc. Due to this, the option '--enable- replace-cpp' is also required. Depending on the location of ${gcc-source} directory, you should do 'sudo make check' instead of 'make check'. In this case, make sure that gcc is the same between root and the current user. The testsuite edition of Validation Suite can also be applied to cc1, cc1plus (cpp0) of GCC V.2.95 and later, not only for MCPP. (Refer cpp- test.html 3.2.3). 2.2.1.3. make uninstall When you type 'make uninstall', the executables of MCPP will get deleted. The header files in mcpp-gcc* directory will be deleted, too. The settings of gcc and cc1, cc1plus (cpp0) will be reset to the initial state. When the re-execution of configure is required after completing 'make install' for some reason, 'make uninstall' needs to be done beforehand. This is because the configure should check GCC, not MCPP. If you have done 'make check', the 'make uninstall' will also remove the testsuite edition of Validation Suite. If you want to use Validation Suite for GCC, copy it manually. The Makefiles generated by configure are necessary to do 'make uninstall', so you should not remove them. When you do 'make distclean', first do 'make uninstall', because it is a little troublesome to uninstall GCC-specific-MCPP manually. Also you should do 'make uninstall; make distclean' even before updating configure or Makefile.in, when you update MCPP. 2.2.2. When the compiler system is Apple-GCC on Mac OS X Although Mac OS X is one of the UNIX-like systems, it has some peculiarities such as "framework" directories. Its system compiler is a GCC with many extensions added by Apple. Moreover, since the appearance of Intel-Mac, both of the compiler system for x86 and the compiler system for powerpc, one is a native compiler and the other is a cross compiler, begun to co-exist in a same machine. And even a so-called "universal binary", which is a bundle of binaries for x86 and powerpc, hence is able to work on either machine, has become popular. The structure of compiler systems is rather complex. To install MCPP for this complex system, the command sequence of 2.2.1 is not sufficient. Here, I explain the case of Mac OS X / Apple-GCCs apart from other UNIX. I am using Mac OS X Leopard on Intel-Mac, so I take the examples of the system. If you use Powerpc-Mac, read the section below swapping 'i686' and 'powerpc'. On Tiger, read 'darwin9' as 'darwin8'. Apple provides GCC 4.0.1, and also provides GCC 3.3 as an addition. I explain only GCC 4.0.1, and omit GCC 3.3, because it has not been properly compiled at least on Leopard. 2.2.2.1. Native compiler versus cross compiler It is simple to compile and install MCPP for a native compiler, i.e. for x86 on Intel-Mac. The command sequence in 2.2.1 is sufficient for it. Making of MCPP with a cross compiler, however, is not so easy. Generally, the configure script of MCPP does not support cross compiling, because it contains a few tests to be compiled and executed. A binary for a target environment cannot be run on a build environment usually. If we test the build environment instead, the results are not necessarily the same with the target. Nevertheless, on Mac OS X, we can exceptionally configure cross- compiling for different CPUs in most cases. First, Intel-Mac automatically executes a ppc binary with an emulator. Second, if the build environment and the target differ only in CPU and its related settings, and OS, its version and GCC's version are all the same between them, we can substitute most of the tests of the target with that of the build. On Intel-Mac, for a compiler-independent-build, you should specify the C compiler (the name of compiler driver) and C++ compiler by the environment-variables CC and CXX. There are many gccs and g++s in /usr/ bin of Mac OS X. In Mac OS X Leopard on Intel-Mac, powerpc-apple- darwin9-gcc-4.0.1 and powerpc-apple-darwin9-g++-4.0.1 are the C compiler and the C++ compiler for powerpc. (Actually, all the gccs and g++s in /usr/bin are universal binaries of i386 and ppc.) In addition, you should specify the target system by --target option. In this case, you should use the compiler's name removing '-gcc-4.0.1', i.e. powerpc-apple- darwin9. This is the configure command to make compiler-independent- build: ${mcpp-dir}/configure --target=powerpc-apple-darwin9 \ CC=powerpc-apple-darwin9-gcc-4.0.1 \ CXX=powerpc-apple-darwin9-g++-4.0.1 On the other hand, ppc-Mac cannot execute an x86 binary, so you cannot make the compiler-independent-build with this method. Instead, you can cross-compile it manually, using the difference file and mac_osx.mak. See mcpp-porting.html#3.1.4 and #3.11, if needed. You can also make a universal binary on ppc-Mac with its native compiler using the configure, as explained in the next section. To make a GCC-specific-build, you should specify the C compiler by --with-target-cc= option instead of CC and CXX as: (the configure deduce the name of C++ compiler from the name of C compiler, replacing 'gcc' with 'g++'.) ${mcpp-dir}/configure --target=powerpc-apple-darwin9 \ --with-target-cc=powerpc-apple-darwin9-gcc-4.0.1 \ --enable-replace-cpp This configuration does not contain any running test of the target, so it can be used on ppc-Mac too, changing 'powerpc' with 'i686'. When the version of the default native compiler (gcc and g++) greatly differs from that of the cross compiler specified by --with-target-cc= option, you should specify a native compiler of a version as close as possible to the target by the environment-variables CC and CXX. The compiler specified by CC (CXX) is to be used to build MCPP, while the compiler specified by --with-target-cc= is the target compiler into which MCPP is installed. The cross compiler differs from the native compiler in libexec directory, compiler-specific include directory and predefined macros. The configure with these options appropriately sets them. These options should be used for configure, not for make command. Note that a cross compiler itself runs on a host system, so does a compiler-specific-build MCPP installed "to a cross compiler". On the other hand, a compiler-independent-build MCPP compiled "with a cross compiler" runs on a target system. Also note that both of the GCC- specific-build for the native compiler and for the cross compiler are compiled by the native compiler, therefore, if you install both, you should first install the one for the cross compiler. 2.2.2.2. Making a universal binary To make a universal binary, specify the CPUs by -arch options and add them to the 'make' command as "CFLAGS+='-arch i386 -arch ppc'". The valid CPU types are 'i386', 'x86_64', 'ppc' and 'ppc64'. For example, this command generates a bundled binary for 4 CPU types. make CFLAGS+='-arch i386 -arch x86_64 -arch ppc -arch ppc64' The configure needs no special option for universal binary, it needs only options for non-universal binary, if any. GCC has '-isysroot DIR' or '--sysroot=DIR' options, which change root of system include directories to DIR. These options are not limited to Mac OS, but are commonly used on Mac OS to compile a universal binary in order to widen compatibility with older version of Mac OS. For example, if '-isysroot /Developer/SDKs/MacOSX10.4u.sdk' is specified, /usr/ include becomes /Developer/SDKs/MacOSX10.4u.sdk/usr/include. This is an example to compile a universal binary compatible with Mac OS X 10.4 (Tiger) on 10.5 (Leopard). When you use this option in making MCPP, you should also specify the version of SDK by -mmacosx-version-min= option. Any universal binary of MCPP can be generated with a combination of the above configure options and these make options, on either of compiler- independent-build or GCC-specific-build, and on either of native compiler or cross compiler. This example shows the sequence to generate a universal binary of compiler-independent-build compatible with Tiger for i386 and ppc. (Actually, you should write the '*' in one line.) ${mcpp-dir}/configure make CFLAGS+='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ -mmacosx-version-min=10.4 -arch i386 -arch ppc' sudo make install 2.2.3. When the compiler system is not GCC When the compiler system is not GCC, some options need to be specified in the configure. Also, to use MCPP replacing the preprocessor of the compiler system, the "porting" or adding source code is required. MCPP have already been ported to GCC, because the author is using GCC on Linux, FreeBSD, Mac OS X, CygWIN and MinGW systems, and so the informations can be collected by the configure. However, as he does not know any compiler systems on UNIX-like systems other than GCC, he does not even know what or how it needs to be checked by the configure, let alone the porting. For compiler systems other than GCC on UNIX systems, please compile with the following procedures. 2.2.3.1. Configure by specifying options First, do configure by specifying some options, for example: ${mcpp-dir}/configure --enable-replace-cpp --bindir=DIR \ --with-cxx-include-dir=CXXDIR \ --enable-SYSTEM-STD-macro=_MACRO=val Specify the directory where the preprocessor, which is called from the compiler-driver, is located with --bindir, specify the C++ specific include directory with --with-cxx-include-dir and specify the predefined macro of the resident preprocessor with --enable-SYSTEM-STD-macro or other options. If you type ${mcpp-dir}/configure --help some options will be displayed. Then, after doing 'make; make install', some work for making MCPP callable from the compiler driver is required. Please see the setup on GCC for how to do this. 2.2.3.2. "Porting" work To be able to use the MCPP replacing the preprocessor of the compiler system, it is required to do "porting" work by adding source code. These are the execution options for the compiler system or the implementation of #pragma directives. Especially, when there are some execution time options which are used frequently but different from MCPP, they at least need to be implemented. In order to do that, define the macro to designate the compiler in configed.H, and write some codes in system.c. (Refer mcpp-porting.html 4.2). 2.2.3.3. Re-configure by adding an option Once porting of source is completed, re-configure by adding the option --with-compiler-name=COMPILER. 'COMPILER' is the macro for the compiler defined in configed.H. After 'make; make install' is done successfully, do 'make clean; make' which recompiles MCPP using the installed MCPP. If it passes, it can be said that basic porting has been done successfully. 2.2.4. The limitations of the configure In the compilation of compiler-specific-build of MCPP, the specifications of the target system (the compiler system which will use MCPP as a preprocessor) must be understood in detail. At the same time the host system (the compiler system with which MCPP is compiled) need to be understood. In case these two are not the same, the source code of MCPP is written with the settings of both systems separately in the header file (configed.H). However, the configure cannot detect both of them at the same time. Therefore, it assumes the target system is the same as the host system. If these two systems are not the same, Part 2 of the configed.H needs to be modified. Cross-compiling is not supported by the configure of MCPP, either. Some tests which cannot be executed by the cross-compiler are included as well. In case of cross-compiling, the default values will be set, but this may not work. 3. 'make' on the Windows compiler systems Since all compiler systems on Windows other than CygWIN and MinGW are not subject to the 'configure', they need a bit of modification of the source in order to do 'make'. As there are difference files for already ported systems, a patch can be applied by using them. The procedure for the use of the difference files is explained below. Even the systems subject to the 'configure' can also be controlled in detail by editing the makefile and header files directly. 3.1. Applying a patch The difference files and makefiles for various compiler systems are available in 'noconfig' directory. The source of MCPP is defaulted to FreeBSD / GCC 3.4 setting. The difference files are used in order to modify this source for the particular compiler systems. The makefile is written for using the make command attached to each compiler system. In the 'src' directory, run as below. All of the following process should be done within the 'src' directory. patch -c < ..\noconfig\which-compiler.dif copy ..\noconfig\which-compiler.mak Makefile 'patch' is a UNIX command, but it can be used in Windows as it has been ported. Of course, you can directly edit the noconfig.H file referring the difference file. 3.2. Modifying noconfig.H and Makefile if required The settings of various directories in the difference files are based on the environment of the author, hence you have to modify them. If the version of the compiler system is different from that of the difference file, modify the header file noconfig.H. (See noconfig.H itself and mcpp-porting.html 3.1). Similarly, if the multi-byte character for normal use is not Japanese, change the macro definition MBCHAR in noconfig.H. Also, define BINDIR in the Makefile to the directory in which MCPP executable should be installed. As for the Makefile for Visual C, remove '#' of this line and make 'install' target effective. #install : 3.3. Compiler-independent-build Now, you can do 'make' and 'make install' successfully for the compiler- independent executable. (For Visual C, use 'nmake' instead of 'make'). 3.4. Compiler-specific-build To make the compiler-specific-build, rewrite BINDIR in the Makefile to the directory in which the executables of the compiler system are located. Then, rewrite this line in noconfig.H: #define COMPILER INDEPENDENT Replace 'INDEPENDENT' with the macro to designate the compiler. Then do 'make' and 'make install'. 'COMPILER' can be overwritten also by make option, hence the file can be left as it is. For example, in Visual C, 'nmake COMPLIER=MSC' and 'nmake COMPILER=MSC install' or in Borland C, 'make -DCOMPILER=BORLANDC' and 'make -DCOMPILER=BORLANDC install'. If the target system and the compiling system are different, noconfig.H / Part 1 should be set to the specifications of the target system and Part 2 should be set for the compiling system. The Makefile that should be used is the compiling system's one, and modify the installation directory to the target system's one. Since most compiler systems on Windows integrate preprocessor into its compiler, it is impossible to replace the preprocessor of such a one- path compiler with MCPP. To use MCPP, a source program should be first preprocessed with MCPP and then the output should be passed to the compiler. To use MCPP with a one-path compiler, the procedure should be written in makefile. For sample procedures, refer to the makefile's settings used to recompile MCPP using MCPP itself. In Visual C++, if you create "makefile project" by IDE using the attached makefile, all the functions of IDE, such as source level debug, become available. (Refer mcpp-manual.html 2.10) 3.5. Test On Windows, any include directory is not preset except MinGW/GCC- specific-build and GygWIN, hence you should specify them by the environment variable INCLUDE (and CPLUS_INCLUDE, if necessary). GCC / testsuite cannot be used in Windows, MCPP needs to be checked directly by preprocessing the test samples in test-t, test-c and test-l directories. If you use tool/cpp_test.c, it can test some parts automatically. (Refer cpp-test.html 3.2.2). For the compiler-specific-build of MCPP, if you re-compile MCPP with the "pre-preprocess" functionality of MCPP, by using MCPP itself as the preprocessor of the compiler system, you can check whether it has been ported successfully for the compiler system. (Refer mcpp-porting.html 3. 7) 4. Please send me the information for porting. To port to the compiler systems which have not been ported yet, lots of information is required. It will be great to hear from many people. Please let me know if you know the values for options of the 'configure', for compiler systems other than GCC. I would like to work on configure. ac. 5. Validation Suite MCPP provides "Validation Suite" which tests and evaluates C/C++ preprocessor comprehensively. Validation Suite has 265 items and can be applied to any preprocessor as well as MCPP. Refer to 3.1 and 3.2 of cpp-test.html. November, 2008 Kiyoshi Matsui mcpp-2.7.2/Makefile.in0000644000175000017500000005422011113211444011442 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @REPLACE_CPP_TRUE@am__append_1 = tests . subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure ChangeLog \ INSTALL NEWS config/compile config/config.guess \ config/config.sub config/depcomp config/install-sh \ config/ltmain.sh config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man1_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = src tests . DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ Target_Cpu = @Target_Cpu@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cpp_call = @cpp_call@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gcc_maj_ver = @gcc_maj_ver@ gcc_min_ver = @gcc_min_ver@ gcc_path = @gcc_path@ gcc_testsuite_dir = @gcc_testsuite_dir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_system = @host_system@ host_vendor = @host_vendor@ htmldir = @htmldir@ inc_dir = @inc_dir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cc = @target_cc@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign SUBDIRS = src $(am__append_1) @REPLACE_CPP_FALSE@man_page = mcpp @REPLACE_CPP_TRUE@man_page = mcpp-gcc man1_MANS = $(man_page).1 EXTRA_DIST = $(top_srcdir)/LICENSE $(top_srcdir)/INSTALL* \ $(top_srcdir)/ChangeLog.old $(top_srcdir)/NEWS \ $(top_srcdir)/mcpp.1 $(top_srcdir)/mcpp-gcc.1 $(top_srcdir)/config \ $(top_srcdir)/src/preproc.c $(top_srcdir)/src/noconfig.H \ $(top_srcdir)/src/cc1.c $(top_srcdir)/src/*set_mcpp.sh \ $(top_srcdir)/src/testmain.c $(top_srcdir)/src/mcpp_lib.def \ $(top_srcdir)/tests/*_test.sh $(top_srcdir)/noconfig \ $(top_srcdir)/cpp-test $(top_srcdir)/test-t \ $(top_srcdir)/test-c $(top_srcdir)/test-l $(top_srcdir)/tool \ $(top_srcdir)/doc $(top_srcdir)/doc-jp all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps'; \ cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @REPLACE_CPP_TRUE@install-exec-hook: @REPLACE_CPP_TRUE@uninstall-hook: clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-info: install-info-recursive install-man: install-man1 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-exec-am install-strip uninstall-am .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-hook uninstall-man uninstall-man1 @REPLACE_CPP_FALSE@install-exec-hook: @REPLACE_CPP_FALSE@ $(top_srcdir)/config/install-sh -d "$(DESTDIR)$(prefix)/share/doc/mcpp" @REPLACE_CPP_FALSE@ cp -pf $(top_srcdir)/LICENSE $(top_srcdir)/README $(top_srcdir)/NEWS \ @REPLACE_CPP_FALSE@ $(DESTDIR)$(prefix)/share/doc/mcpp @REPLACE_CPP_FALSE@ cp -pf $(top_srcdir)/doc/mcpp-manual.html \ @REPLACE_CPP_FALSE@ $(DESTDIR)$(prefix)/share/doc/mcpp @REPLACE_CPP_FALSE@ cp -pf $(top_srcdir)/doc-jp/mcpp-manual.html \ @REPLACE_CPP_FALSE@ $(DESTDIR)$(prefix)/share/doc/mcpp/mcpp-manual-jp.html @REPLACE_CPP_FALSE@uninstall-hook: @REPLACE_CPP_FALSE@ rm -rf $(DESTDIR)$(prefix)/share/doc/mcpp # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mcpp-2.7.2/LICENSE0000644000175000017500000000266410741675563010435 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/configure0000755000175000017500000265547311113211445011330 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for mcpp 2.7.2. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='mcpp' PACKAGE_TARNAME='mcpp' PACKAGE_VERSION='2.7.2' PACKAGE_STRING='mcpp 2.7.2' PACKAGE_BUGREPORT='kmatsui@t3.rim.or.jp' ac_unique_file="src/main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP LN_S ECHO AR RANLIB DLLTOOL AS OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL target_cc gcc_path host_system Target_Cpu inc_dir gcc_maj_ver gcc_min_ver cpp_call gcc_testsuite_dir GNUC_TRUE GNUC_FALSE MCPP_LIB_TRUE MCPP_LIB_FALSE REPLACE_CPP_TRUE REPLACE_CPP_FALSE MINGW_TRUE MINGW_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures mcpp 2.7.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/mcpp] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of mcpp 2.7.2:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-replace-cpp Replace the resident preprocessor with mcpp --enable-SYSTEM-STD-macro=name[=replace] specify the SYSTEM-specific STD-style predefined macro. In all this and the following 5 options, 'STD'-style name begins with an '_', 'OLD'-style name begins with an alphabetic and if '=replace' is missing the macro is defined as 1. --enable-SYSTEM-OLD-macro=name[=replace] specify the SYSTEM-specific OLD-style predefined macro. --enable-CPU-STD-macro=name[=replace] specify the CPU-specific STD-style predefined macro. --enable-CPU-OLD-macro=name[=replace] specify the CPU-specific OLD-style predefined macro. --enable-COMPILER-STD-macro=name[=replace] specify the COMPILER-specific STD-style predefined macro. --enable-COMPILER-OLD-macro=name[=replace] specify the COMPILER-specific OLD-style predefined macro. --enable-mcpplib Build libmcpp rather than stand-alone mcpp Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-target-cc Specify the target compiler to build mcpp into on Mac OS X --with-compiler-name=NAME specify the compiler name which is used as the definition of COMPILER macro --with-cxx-include-dir=directory specify the C++ include directory by absolute path [none] --with-gcc-testsuite-dir=directory specify the gcc testsuite directory to do make check. e.g. /usr/src/rpm/SOURCES/gcc-2.95.4/gcc/testsuite, /usr/local/src/gcc-3.2/gcc/testsuite, etc. The testsuite of mcpp uses gcc testsuite, hence needs gcc source or at least gcc testsuite. This option needs --enable-replace-cpp option. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF mcpp configure 2.7.2 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by mcpp $as_me 2.7.2, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.10' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mcpp' VERSION='2.7.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4539 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; *-*-cygwin* | *-*-mingw* | *-*-pw32*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 echo "${ECHO_T}$DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { echo "$as_me:$LINENO: result: $AS" >&5 echo "${ECHO_T}$AS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 echo "${ECHO_T}$ac_ct_AS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 echo "${ECHO_T}$OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac need_locks="$enable_libtool_lock" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to kmatsui@t3.rim.or.jp ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=yes # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7222: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7226: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7490: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7494: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7594: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7598: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12327: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12331: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12431: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12435: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13992: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13996: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14096: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14100: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16283: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16287: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16551: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16555: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16655: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16659: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion { echo "$as_me:$LINENO: checking whether the cpp is target preprocessor" >&5 echo $ECHO_N "checking whether the cpp is target preprocessor... $ECHO_C" >&6; } mcpp=`$CPP $CFLAGS -xc -v /dev/null 2>&1 | grep 'MCPP'` if test "x$mcpp" != x; then { { echo "$as_me:$LINENO: error: Do 'make uninstall' before configuring again." >&5 echo "$as_me: error: Do 'make uninstall' before configuring again." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } case $host_os in linux*) cat >>confdefs.h <<\_ACEOF #define HOST_SYSTEM SYS_LINUX _ACEOF ac_c_define_HOST_SYSTEM=SYS_LINUX ;; freebsd*) cat >>confdefs.h <<\_ACEOF #define HOST_SYSTEM SYS_FREEBSD _ACEOF ac_c_define_HOST_SYSTEM=SYS_FREEBSD ;; darwin*) cat >>confdefs.h <<\_ACEOF #define HOST_SYSTEM SYS_MAC _ACEOF ac_c_define_HOST_SYSTEM=SYS_MAC ;; cygwin*) cat >>confdefs.h <<\_ACEOF #define HOST_SYSTEM SYS_CYGWIN _ACEOF ac_c_define_HOST_SYSTEM=SYS_CYGWIN ;; mingw*) cat >>confdefs.h <<\_ACEOF #define HOST_SYSTEM SYS_MINGW _ACEOF ac_c_define_HOST_SYSTEM=SYS_MINGW ;; *) { echo "$as_me:$LINENO: WARNING: Unsupported host OS, assuming to be an UNIX variant" >&5 echo "$as_me: WARNING: Unsupported host OS, assuming to be an UNIX variant" >&2;} cat >>confdefs.h <<\_ACEOF #define HOST_SYSTEM SYS_UNIX _ACEOF ac_c_define_HOST_SYSTEM=SYS_UNIX ;; esac host_system=$ac_c_define_HOST_SYSTEM case $target_os in linux*) cat >>confdefs.h <<\_ACEOF #define SYSTEM SYS_LINUX _ACEOF ;; freebsd*) cat >>confdefs.h <<\_ACEOF #define SYSTEM SYS_FREEBSD _ACEOF ;; darwin*) cat >>confdefs.h <<\_ACEOF #define SYSTEM SYS_MAC _ACEOF ;; cygwin*) cat >>confdefs.h <<\_ACEOF #define SYSTEM SYS_CYGWIN _ACEOF ;; mingw*) cat >>confdefs.h <<\_ACEOF #define SYSTEM SYS_MINGW _ACEOF ;; *) { echo "$as_me:$LINENO: WARNING: Unsupported target OS" >&5 echo "$as_me: WARNING: Unsupported target OS" >&2;} cat >>confdefs.h <<\_ACEOF #define SYSTEM SYS_UNIX _ACEOF ;; esac ## --enable-replace-cpp option # Check whether --enable-replace-cpp was given. if test "${enable_replace_cpp+set}" = set; then enableval=$enable_replace_cpp; else ## the compiler name will be defined later cat >>confdefs.h <<\_ACEOF #define COMPILER INDEPENDENT _ACEOF ## else define COMPILER as INDEPENDENT fi ## Generally this configure does not support cross-compiling. ## Nevertheless, it can configure cross-compiler of Apple-GCC (i686 vs ppc). if test x$enable_replace_cpp = xyes \ && test $ac_c_define_HOST_SYSTEM = SYS_MAC \ && test $host_cpu != $target_cpu; then ## Enable to build mcpp into cross-compiler of Apple-GCC ## --with-target-cc option # Check whether --with-target_cc was given. if test "${with_target_cc+set}" = set; then withval=$with_target_cc; if test x${withval+set} = xset; then target_cc=$withval target_name=`echo $target_cc | sed 's/-gcc.*$//'` if test $target_name != $target_alias; then { { echo "$as_me:$LINENO: error: The argument of --with-target-cc option conflicts with --target option." >&5 echo "$as_me: error: The argument of --with-target-cc option conflicts with --target option." >&2;} { (exit 1); exit 1; }; } fi fi fi fi { echo "$as_me:$LINENO: checking for target cpu" >&5 echo $ECHO_N "checking for target cpu... $ECHO_C" >&6; } ## These are not predefined macros of MCPP. MCPP will define predefined macros ## on compile time based on the CPU macro, and possibly redefine them at an ## execution time. case $target_cpu in x86_64|amd64) Target_Cpu=x86_64 ;; i?86*) Target_Cpu=i386 ;; powerpc64|ppc64) Target_Cpu=ppc64 ;; powerpc|ppc|ppc7400) Target_Cpu=ppc ;; *) Target_Cpu=$target_cpu ;; esac { echo "$as_me:$LINENO: result: $Target_Cpu" >&5 echo "${ECHO_T}$Target_Cpu" >&6; } cat >>confdefs.h <<_ACEOF #define CPU "$Target_Cpu" _ACEOF ## Build into cross-compiler on Mac OS if test x$enable_replace_cpp = xyes \ && test $ac_c_define_HOST_SYSTEM = SYS_MAC \ && test x${target_cc+set} = xset; then arch_opt="-arch $Target_Cpu" fi for ac_header in unistd.h, stdint.h, inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to kmatsui@t3.rim.or.jp ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for intmax_t" >&5 echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } if test "${ac_cv_type_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef intmax_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_intmax_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; } if test $ac_cv_type_intmax_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTMAX_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi for ac_func in stpcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking if the cases of filename are folded" >&5 echo $ECHO_N "checking if the cases of filename are folded... $ECHO_C" >&6; } if test "${ac_cv_fname_fold+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else touch hJkL ac_cv_fname_fold=no if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: cannot run on cross-compiling so assumes that the cases of filename are not folded." >&5 echo "$as_me: WARNING: cannot run on cross-compiling so assumes that the cases of filename are not folded." >&2;} else cat >conftest.$ac_ext <<_ACEOF #include #include void exit(); int main( void) { if (fopen( "HjKl", "r") == NULL) exit( errno); else exit( 0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_fname_fold=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm hJkL fi { echo "$as_me:$LINENO: result: $ac_cv_fname_fold" >&5 echo "${ECHO_T}$ac_cv_fname_fold" >&6; } if test x$ac_cv_fname_fold = xyes; then cat >>confdefs.h <<\_ACEOF #define FNAME_FOLD 1 _ACEOF fi cat >>confdefs.h <<_ACEOF #define OBJEXT "$ac_cv_objext" _ACEOF # AC_CHECK_MOD_LL( modifier, additional include header) # Try the printf length modifier for the longest integer. # The redundant sscanf() is for some compilers which cannot handle # long long integer token. if test x$ac_cv_type_intmax_t = xyes; then { echo "$as_me:$LINENO: checking printf length modifier for the longest integer" >&5 echo $ECHO_N "checking printf length modifier for the longest integer... $ECHO_C" >&6; } if test "${ac_cv_c_printf_modifier+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: cannot run on cross-compiling so assumes the length modifier of long long is \"%ll\"" >&5 echo "$as_me: WARNING: cannot run on cross-compiling so assumes the length modifier of long long is \"%ll\"" >&2;} cat >>confdefs.h <<\_ACEOF #define LL_FORM "ll" _ACEOF ac_cv_c_printf_modifier=ll else cat >conftest.$ac_ext <<_ACEOF #include #include int strcmp(); void exit(); #include int main( void) { char buf[ 20]; intmax_t num; sscanf( "1234567890123456789", "%jd", &num); sprintf( buf, "%jd", num); assert( strcmp( buf, "1234567890123456789") == 0); exit( 0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_printf_modifier=j else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_printf_modifier" >&5 echo "${ECHO_T}$ac_cv_c_printf_modifier" >&6; } if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \ || test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then sleep 1 # wait for cleanup fi fi if test x$ac_cv_type_long_long = xyes; then for modifier in ll I64 q L do { echo "$as_me:$LINENO: checking printf length modifier for the longest integer" >&5 echo $ECHO_N "checking printf length modifier for the longest integer... $ECHO_C" >&6; } if test "${ac_cv_c_printf_modifier+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: cannot run on cross-compiling so assumes the length modifier of long long is \"%ll\"" >&5 echo "$as_me: WARNING: cannot run on cross-compiling so assumes the length modifier of long long is \"%ll\"" >&2;} cat >>confdefs.h <<\_ACEOF #define LL_FORM "ll" _ACEOF ac_cv_c_printf_modifier=ll else cat >conftest.$ac_ext <<_ACEOF #include #include int strcmp(); void exit(); int main( void) { char buf[ 20]; long long num; sscanf( "1234567890123456789", "%${modifier}d", &num); sprintf( buf, "%${modifier}d", num); assert( strcmp( buf, "1234567890123456789") == 0); exit( 0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_printf_modifier=${modifier} else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_printf_modifier" >&5 echo "${ECHO_T}$ac_cv_c_printf_modifier" >&6; } if test x${ac_cv_c_printf_modifier+set} = xset; then break fi if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \ || test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then sleep 1 # wait for cleanup fi done fi if test x${ac_cv_c_printf_modifier+set} = xset; then cat >>confdefs.h <<_ACEOF #define LL_FORM "$ac_cv_c_printf_modifier" _ACEOF fi if test $ac_c_define_HOST_SYSTEM = SYS_FREEBSD && \ test x$mcpp_ac_c_define_SYSTEM_SP_STD != x__FreeBSD__; then fbsd_ver=`echo '__FreeBSD__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'` cat >>confdefs.h <<_ACEOF #define SYSTEM_EXT_VAL "$fbsd_ver" _ACEOF fi if test x$ac_cv_c_compiler_gnu = xyes; then cat >>confdefs.h <<\_ACEOF #define HOST_COMPILER GNUC _ACEOF cat >>confdefs.h <<\_ACEOF #define HOST_CMP_NAME "GCC" _ACEOF { echo "$as_me:$LINENO: checking for value of __GNUC__" >&5 echo $ECHO_N "checking for value of __GNUC__... $ECHO_C" >&6; } gcc_maj_ver=`echo '__GNUC__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'` { echo "$as_me:$LINENO: result: $gcc_maj_ver" >&5 echo "${ECHO_T}$gcc_maj_ver" >&6; } cat >>confdefs.h <<_ACEOF #define GCC_MAJOR_VERSION "$gcc_maj_ver" _ACEOF { echo "$as_me:$LINENO: checking for value of __GNUC_MINOR__" >&5 echo $ECHO_N "checking for value of __GNUC_MINOR__... $ECHO_C" >&6; } gcc_min_ver=`echo __GNUC_MINOR__ | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'` { echo "$as_me:$LINENO: result: $gcc_min_ver" >&5 echo "${ECHO_T}$gcc_min_ver" >&6; } cat >>confdefs.h <<_ACEOF #define GCC_MINOR_VERSION "$gcc_min_ver" _ACEOF cw=`pwd` if test x$srcdir = "x." || test x$srcdir = x; then src_dir=$cw else src_dir=$srcdir fi if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN; then { echo "$as_me:$LINENO: checking the root directory" >&5 echo $ECHO_N "checking the root directory... $ECHO_C" >&6; } if test "${ac_cv_cygwin_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_cygwin_root=`$src_dir/config/cygwin_root` fi { echo "$as_me:$LINENO: result: $ac_cv_cygwin_root" >&5 echo "${ECHO_T}$ac_cv_cygwin_root" >&6; } cat >>confdefs.h <<_ACEOF #define CYGWIN_ROOT_DIRECTORY "$ac_cv_cygwin_root" _ACEOF fi if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then { echo "$as_me:$LINENO: checking the root directory" >&5 echo $ECHO_N "checking the root directory... $ECHO_C" >&6; } if test "${ac_cv_msys_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cd /tmp cat > getcwd.c <<\_EOF #include #include #include int main( int argc, char ** argv) { char buf[ PATH_MAX]; getcwd( buf, PATH_MAX); puts( buf); return 0; } _EOF $CC getcwd.c cd / ac_cv_msys_root=`$src_dir/config/mingw_root` fi { echo "$as_me:$LINENO: result: $ac_cv_msys_root" >&5 echo "${ECHO_T}$ac_cv_msys_root" >&6; } { echo "$as_me:$LINENO: checking the /mingw directory" >&5 echo $ECHO_N "checking the /mingw directory... $ECHO_C" >&6; } if test "${ac_cv_mingw_dir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cd /mingw ac_cv_mingw_dir=`$src_dir/config/mingw_root` fi { echo "$as_me:$LINENO: result: $ac_cv_mingw_dir" >&5 echo "${ECHO_T}$ac_cv_mingw_dir" >&6; } cd $cw rm -f /tmp/getcwd.c /tmp/a.exe cat >>confdefs.h <<_ACEOF #define MSYS_ROOT_DIRECTORY "$ac_cv_msys_root" _ACEOF cat >>confdefs.h <<_ACEOF #define MINGW_DIRECTORY "$ac_cv_mingw_dir" _ACEOF fi else # not gcc # mcpp_AC_C_DEFINE( SYSTEM | CPU | COMPILER, STD | OLD, $enableval) # Specify the target-specific predefined macro. # mcpp_AC_C_PREDEF( SYSTEM | CPU | COMPILER, STD | OLD, additional description) # Specify the target-specific predefined macro via mcpp_AC_C_DEFINE. # Check whether --enable-SYSTEM-STD-macro was given. if test "${enable_SYSTEM_STD_macro+set}" = set; then enableval=$enable_SYSTEM_STD_macro; if test x$enableval = xyes || test x$enableval = xno; then { { echo "$as_me:$LINENO: error: This option requires an argument as 'name[=replace]'." >&5 echo "$as_me: error: This option requires an argument as 'name[=replace]'." >&2;} { (exit 1); exit 1; }; } fi name=`echo $enableval | sed 's/=.*//'` mcpp_macro=SYSTEM_SP_STD stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with '_'." >&5 echo "$as_me: error: The macro name '$name' should begin with '_'." >&2;} { (exit 1); exit 1; }; } fi else stripped_name=`echo $name | sed 's/^[A-Za-z]//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with an alphabetic letter." >&5 echo "$as_me: error: The macro name '$name' should begin with an alphabetic letter." >&2;} { (exit 1); exit 1; }; } fi fi if test x$name = x$enableval; then replace=1 else replace=`echo $enableval | sed 's/^.*=//'` fi cat >>confdefs.h <<_ACEOF #define $mcpp_macro "$name" _ACEOF cat >>confdefs.h <<_ACEOF #define ${mcpp_macro}_VAL "$replace" _ACEOF mcpp_ac_c_define_SYSTEM_STD=$name fi # Check whether --enable-SYSTEM-OLD-macro was given. if test "${enable_SYSTEM_OLD_macro+set}" = set; then enableval=$enable_SYSTEM_OLD_macro; if test x$enableval = xyes || test x$enableval = xno; then { { echo "$as_me:$LINENO: error: This option requires an argument as 'name[=replace]'." >&5 echo "$as_me: error: This option requires an argument as 'name[=replace]'." >&2;} { (exit 1); exit 1; }; } fi name=`echo $enableval | sed 's/=.*//'` mcpp_macro=SYSTEM_SP_OLD stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with '_'." >&5 echo "$as_me: error: The macro name '$name' should begin with '_'." >&2;} { (exit 1); exit 1; }; } fi else stripped_name=`echo $name | sed 's/^[A-Za-z]//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with an alphabetic letter." >&5 echo "$as_me: error: The macro name '$name' should begin with an alphabetic letter." >&2;} { (exit 1); exit 1; }; } fi fi if test x$name = x$enableval; then replace=1 else replace=`echo $enableval | sed 's/^.*=//'` fi cat >>confdefs.h <<_ACEOF #define $mcpp_macro "$name" _ACEOF cat >>confdefs.h <<_ACEOF #define ${mcpp_macro}_VAL "$replace" _ACEOF mcpp_ac_c_define_SYSTEM_OLD=$name fi # Check whether --enable-CPU-STD-macro was given. if test "${enable_CPU_STD_macro+set}" = set; then enableval=$enable_CPU_STD_macro; if test x$enableval = xyes || test x$enableval = xno; then { { echo "$as_me:$LINENO: error: This option requires an argument as 'name[=replace]'." >&5 echo "$as_me: error: This option requires an argument as 'name[=replace]'." >&2;} { (exit 1); exit 1; }; } fi name=`echo $enableval | sed 's/=.*//'` mcpp_macro=CPU_SP_STD stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with '_'." >&5 echo "$as_me: error: The macro name '$name' should begin with '_'." >&2;} { (exit 1); exit 1; }; } fi else stripped_name=`echo $name | sed 's/^[A-Za-z]//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with an alphabetic letter." >&5 echo "$as_me: error: The macro name '$name' should begin with an alphabetic letter." >&2;} { (exit 1); exit 1; }; } fi fi if test x$name = x$enableval; then replace=1 else replace=`echo $enableval | sed 's/^.*=//'` fi cat >>confdefs.h <<_ACEOF #define $mcpp_macro "$name" _ACEOF cat >>confdefs.h <<_ACEOF #define ${mcpp_macro}_VAL "$replace" _ACEOF mcpp_ac_c_define_CPU_STD=$name fi # Check whether --enable-CPU-OLD-macro was given. if test "${enable_CPU_OLD_macro+set}" = set; then enableval=$enable_CPU_OLD_macro; if test x$enableval = xyes || test x$enableval = xno; then { { echo "$as_me:$LINENO: error: This option requires an argument as 'name[=replace]'." >&5 echo "$as_me: error: This option requires an argument as 'name[=replace]'." >&2;} { (exit 1); exit 1; }; } fi name=`echo $enableval | sed 's/=.*//'` mcpp_macro=CPU_SP_OLD stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with '_'." >&5 echo "$as_me: error: The macro name '$name' should begin with '_'." >&2;} { (exit 1); exit 1; }; } fi else stripped_name=`echo $name | sed 's/^[A-Za-z]//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with an alphabetic letter." >&5 echo "$as_me: error: The macro name '$name' should begin with an alphabetic letter." >&2;} { (exit 1); exit 1; }; } fi fi if test x$name = x$enableval; then replace=1 else replace=`echo $enableval | sed 's/^.*=//'` fi cat >>confdefs.h <<_ACEOF #define $mcpp_macro "$name" _ACEOF cat >>confdefs.h <<_ACEOF #define ${mcpp_macro}_VAL "$replace" _ACEOF mcpp_ac_c_define_CPU_OLD=$name fi # Check whether --enable-COMPILER-STD-macro was given. if test "${enable_COMPILER_STD_macro+set}" = set; then enableval=$enable_COMPILER_STD_macro; if test x$enableval = xyes || test x$enableval = xno; then { { echo "$as_me:$LINENO: error: This option requires an argument as 'name[=replace]'." >&5 echo "$as_me: error: This option requires an argument as 'name[=replace]'." >&2;} { (exit 1); exit 1; }; } fi name=`echo $enableval | sed 's/=.*//'` mcpp_macro=COMPILER_SP_STD stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with '_'." >&5 echo "$as_me: error: The macro name '$name' should begin with '_'." >&2;} { (exit 1); exit 1; }; } fi else stripped_name=`echo $name | sed 's/^[A-Za-z]//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with an alphabetic letter." >&5 echo "$as_me: error: The macro name '$name' should begin with an alphabetic letter." >&2;} { (exit 1); exit 1; }; } fi fi if test x$name = x$enableval; then replace=1 else replace=`echo $enableval | sed 's/^.*=//'` fi cat >>confdefs.h <<_ACEOF #define $mcpp_macro "$name" _ACEOF cat >>confdefs.h <<_ACEOF #define ${mcpp_macro}_VAL "$replace" _ACEOF mcpp_ac_c_define_COMPILER_STD=$name fi # Check whether --enable-COMPILER-OLD-macro was given. if test "${enable_COMPILER_OLD_macro+set}" = set; then enableval=$enable_COMPILER_OLD_macro; if test x$enableval = xyes || test x$enableval = xno; then { { echo "$as_me:$LINENO: error: This option requires an argument as 'name[=replace]'." >&5 echo "$as_me: error: This option requires an argument as 'name[=replace]'." >&2;} { (exit 1); exit 1; }; } fi name=`echo $enableval | sed 's/=.*//'` mcpp_macro=COMPILER_SP_OLD stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'` if test x$stripped_mcpp_macro != x$mcpp_macro; then stripped_name=`echo $name | sed 's/^_//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with '_'." >&5 echo "$as_me: error: The macro name '$name' should begin with '_'." >&2;} { (exit 1); exit 1; }; } fi else stripped_name=`echo $name | sed 's/^[A-Za-z]//'` if test x$stripped_name = x$name; then { { echo "$as_me:$LINENO: error: The macro name '$name' should begin with an alphabetic letter." >&5 echo "$as_me: error: The macro name '$name' should begin with an alphabetic letter." >&2;} { (exit 1); exit 1; }; } fi fi if test x$name = x$enableval; then replace=1 else replace=`echo $enableval | sed 's/^.*=//'` fi cat >>confdefs.h <<_ACEOF #define $mcpp_macro "$name" _ACEOF cat >>confdefs.h <<_ACEOF #define ${mcpp_macro}_VAL "$replace" _ACEOF mcpp_ac_c_define_COMPILER_OLD=$name fi fi ## MacOS has "framework" directories. if test $ac_c_define_HOST_SYSTEM = SYS_MAC; then { echo "$as_me:$LINENO: checking for the MacOS-specific framework directory" >&5 echo $ECHO_N "checking for the MacOS-specific framework directory... $ECHO_C" >&6; } frameworks=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | sed 's/^ *//' | sed 's/ .*$//' | $EGREP '/Frameworks$'` n=1 for dir in $frameworks do case $n in 1) framework1=$dir;; 2) framework2=$dir;; 3) framework3=$dir;; esac let n=n+1 done if test x${framework1+set} = xset; then cat >>confdefs.h <<_ACEOF #define FRAMEWORK1 "$framework1" _ACEOF { echo "$as_me:$LINENO: result: $framework1" >&5 echo "${ECHO_T}$framework1" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi if test x${framework2+set} = xset; then cat >>confdefs.h <<_ACEOF #define FRAMEWORK2 "$framework2" _ACEOF { echo "$as_me:$LINENO: result: $framework2" >&5 echo "${ECHO_T}$framework2" >&6; } fi if test x${framework3+set} = xset; then cat >>confdefs.h <<_ACEOF #define FRAMEWORK3 "$framework3" _ACEOF { echo "$as_me:$LINENO: result: $framework3" >&5 echo "${ECHO_T}$framework3" >&6; } fi fi ## SYS_MAC ## --enable-mcpplib option # Check whether --enable-mcpplib was given. if test "${enable_mcpplib+set}" = set; then enableval=$enable_mcpplib; fi if test x$enable_mcpplib = xyes; then ## mcpplib mode cat >>confdefs.h <<\_ACEOF #define MCPP_LIB 1 _ACEOF if test x$enable_replace_cpp = xyes; then { echo "$as_me:$LINENO: WARNING: Ignores enable-replace-cpp option" >&5 echo "$as_me: WARNING: Ignores enable-replace-cpp option" >&2;} enable_replace_cpp=no fi else if test x$enable_replace_cpp = xyes; then ## replace-cpp mode # AC_C_INCLUDE_PREF( CURRENT | SOURCE | NEXT) # Check the include preference ('NEXT' means CURRENT & SOURCE) { echo "$as_me:$LINENO: checking include preference - relative to current or source directory" >&5 echo $ECHO_N "checking include preference - relative to current or source directory... $ECHO_C" >&6; } if test "${ac_cv_c_include_pref+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mkdir mcpp-tmp cd mcpp-tmp mkdir dir ../next ../next/dir echo '#include "dir/what.h"' > ../next/header.h echo '#include "next.h"' >> ../next/header.h echo 'CURRENT' > dir/what.h echo 'SOURCE' > ../next/dir/what.h echo 'NEXT' > ../next/next.h cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "../next/header.h" _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "SOURCE" >/dev/null 2>&1; then ac_cv_c_include_pref=SOURCE fi rm -f conftest* if test x$ac_cv_c_include_pref != xSOURCE; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "../next/header.h" _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "CURRENT" >/dev/null 2>&1; then ac_cv_c_include_pref=CURRENT fi rm -f conftest* if test x$ac_cv_c_include_pref = xCURRENT; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "../next/header.h" _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "NEXT" >/dev/null 2>&1; then ac_cv_c_include_pref=NEXT fi rm -f conftest* if test x$ac_cv_c_include_pref = xNEXT; then ac_cv_c_include_pref="(CURRENT & SOURCE)" fi else { { echo "$as_me:$LINENO: error: Failed to include header file." >&5 echo "$as_me: error: Failed to include header file." >&2;} { (exit 1); exit 1; }; } fi fi cd .. rm -rf mcpp-tmp next if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \ || test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then sleep 1 # wait for cleanup fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_include_pref" >&5 echo "${ECHO_T}$ac_cv_c_include_pref" >&6; } cat >>confdefs.h <<_ACEOF #define SEARCH_INIT $ac_cv_c_include_pref _ACEOF { echo "$as_me:$LINENO: checking if the argument of pragma is macro expanded" >&5 echo $ECHO_N "checking if the argument of pragma is macro expanded... $ECHO_C" >&6; } if test "${ac_cv_c_pragma_is_expanded+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #define once #pragma once _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_pragma_is_expanded=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_pragma_is_expanded=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_pragma_is_expanded" >&5 echo "${ECHO_T}$ac_cv_c_pragma_is_expanded" >&6; } if test x$ac_cv_c_pragma_is_expanded = xyes; then cat >>confdefs.h <<\_ACEOF #define EXPAND_PRAGMA 1 _ACEOF fi { echo "$as_me:$LINENO: checking if digraphs can be used" >&5 echo $ECHO_N "checking if digraphs can be used... $ECHO_C" >&6; } if test "${ac_cv_c_digraph+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF %:if 1 %:endif _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_cv_c_digraph=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_digraph=no fi rm -f conftest.err conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_digraph" >&5 echo "${ECHO_T}$ac_cv_c_digraph" >&6; } if test x$ac_cv_c_digraph = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DIGRAPHS 1 _ACEOF fi { echo "$as_me:$LINENO: checking preprocessor output format of line directive" >&5 echo $ECHO_N "checking preprocessor output format of line directive... $ECHO_C" >&6; } if test "${ac_cv_c_line_format+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_line_format=\"`echo '#line 4321' | $CPP - | grep 432 | sed 's/432.*$//'`\" ## Note: the output line number may be 4320 on GCC 2.* or other preprocessors. fi { echo "$as_me:$LINENO: result: $ac_cv_c_line_format" >&5 echo "${ECHO_T}$ac_cv_c_line_format" >&6; } cat >>confdefs.h <<_ACEOF #define LINE_PREFIX $ac_cv_c_line_format _ACEOF if test "x$ac_cv_c_line_format" = "x\"#line \""; then ac_cv_c_std_line_prefix=1 else ac_cv_c_std_line_prefix=0 fi cat >>confdefs.h <<_ACEOF #define STD_LINE_PREFIX $ac_cv_c_std_line_prefix _ACEOF { echo "$as_me:$LINENO: checking default value of __STDC__" >&5 echo $ECHO_N "checking default value of __STDC__... $ECHO_C" >&6; } if test "${ac_cv_c_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else stdc=`echo '__STDC__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'` if test x"$stdc" = x"__STDC__"; then ac_cv_c_stdc=0 else ac_cv_c_stdc=$stdc fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_stdc" >&5 echo "${ECHO_T}$ac_cv_c_stdc" >&6; } cat >>confdefs.h <<_ACEOF #define STDC $ac_cv_c_stdc _ACEOF { echo "$as_me:$LINENO: checking default value of __STDC_VERSION__" >&5 echo $ECHO_N "checking default value of __STDC_VERSION__... $ECHO_C" >&6; } if test "${ac_cv_c_stdc_ver+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else stdc_ver=`echo '__STDC_VERSION__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'` if test x"$stdc_ver" = x"__STDC_VERSION__"; then ac_cv_c_stdc_ver=0 else ac_cv_c_stdc_ver=$stdc_ver fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_stdc_ver" >&5 echo "${ECHO_T}$ac_cv_c_stdc_ver" >&6; } cat >>confdefs.h <<_ACEOF #define STDC_VERSION $ac_cv_c_stdc_ver _ACEOF if test x${ac_cv_c_compiler_gnu} != xyes; then # Specify the compiler's name # Check whether --with-compiler-name was given. if test "${with_compiler_name+set}" = set; then withval=$with_compiler_name; cat >>confdefs.h <<_ACEOF #define COMPILER $compiler_name _ACEOF else { { echo "$as_me:$LINENO: error: --with-compiler-name=NAME option should be specified to define COMPILER macro." >&5 echo "$as_me: error: --with-compiler-name=NAME option should be specified to define COMPILER macro." >&2;} { (exit 1); exit 1; }; } fi # Specify the C++ header file directory # Check whether --with-cxx-include-dir was given. if test "${with_cxx_include_dir+set}" = set; then withval=$with_cxx_include_dir; case "${withval}" in \\/* | A-Za-z:\\/*) cxx_include_dir=`echo $withval | sed 's,/$,,'; 's,\\$,,'` cat >>confdefs.h <<_ACEOF #define CPLUS_INCLUDE_DIR1 $cxx_include_dir _ACEOF ;; *) { { echo "$as_me:$LINENO: error: $withval should be an absolute path." >&5 echo "$as_me: error: $withval should be an absolute path." >&2;} { (exit 1); exit 1; }; } ;; esac fi fi # not gcc { echo "$as_me:$LINENO: checking for some compiler specific elements" >&5 echo "$as_me: checking for some compiler specific elements" >&6;} # Define GCC specific elements. if test x$ac_cv_c_compiler_gnu = xyes; then cat >>confdefs.h <<\_ACEOF #define COMPILER GNUC _ACEOF cpp_call=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | $EGREP '/cpp|/cc1' | sed 's/^ *//; s/ .*//'` { echo "$as_me:$LINENO: checking for the directory to install mcpp" >&5 echo $ECHO_N "checking for the directory to install mcpp... $ECHO_C" >&6; } cpp_name=`expr $cpp_call : '.*/\(.*\)'` bindir=`expr $cpp_call : "\(.*\)/$cpp_name"` { echo "$as_me:$LINENO: result: $bindir" >&5 echo "${ECHO_T}$bindir" >&6; } # Extract the first word of "$CC", so it can be a program name with args. set dummy $CC; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_gcc_path+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $gcc_path in [\\/]* | ?:[\\/]*) ac_cv_path_gcc_path="$gcc_path" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_path="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi gcc_path=$ac_cv_path_gcc_path if test -n "$gcc_path"; then { echo "$as_me:$LINENO: result: $gcc_path" >&5 echo "${ECHO_T}$gcc_path" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi cc_path=`echo $CC | $EGREP "/"` if test x$cc_path != x; then { { echo "$as_me:$LINENO: error: Environment variables CC and CXX for GCC-specific-build should not contain a directory part." >&5 echo "$as_me: error: Environment variables CC and CXX for GCC-specific-build should not contain a directory part." >&2;} { (exit 1); exit 1; }; }; fi ## force to set $prefix to GCC's prefix ## (i.e. "/usr/local" of "/usr/local/bin/gcc") gcc_prefix=`echo $gcc_path | $EGREP "/bin/$CC\$" | sed "s,/bin/$CC\$,,"` if test "x$gcc_prefix" != xNONE; then if test "x$prefix" != xNONE && "x$gcc_prefix" != "x$prefix"; then { echo "$as_me:$LINENO: WARNING: Ignored --prefix option, since it conflicts with GCC path" >&5 echo "$as_me: WARNING: Ignored --prefix option, since it conflicts with GCC path" >&2;} fi prefix=$gcc_prefix else if test "x$prefix" = xNONE; then prefix=$ac_default_prefix fi fi lang_save=$LANG export LANG=C { echo "$as_me:$LINENO: checking for the compiler-specific C include directory" >&5 echo $ECHO_N "checking for the compiler-specific C include directory... $ECHO_C" >&6; } exclude="^/usr(/local|)/include\$|^${prefix}(/local|)/include\$|/Frameworks|End of search list" c_include_dirs=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | sed '1,/<...> search starts here/d' | sed '/End of search list/q' | sed 's/^ *//' | $EGREP -v "$exclude"` n=1 for dir in $c_include_dirs do case $n in 1) c_include_dir1=$dir;; 2) c_include_dir2=$dir;; 3) c_include_dir3=$dir;; esac let n=n+1 done if test x${c_include_dir1+set} = xset; then cat >>confdefs.h <<_ACEOF #define C_INCLUDE_DIR1 "$c_include_dir1" _ACEOF { echo "$as_me:$LINENO: result: $c_include_dir1" >&5 echo "${ECHO_T}$c_include_dir1" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi if test x${c_include_dir2+set} = xset; then cat >>confdefs.h <<_ACEOF #define C_INCLUDE_DIR2 "$c_include_dir2" _ACEOF { echo "$as_me:$LINENO: result: $c_include_dir2" >&5 echo "${ECHO_T}$c_include_dir2" >&6; } fi if test x${c_include_dir3+set} = xset; then cat >>confdefs.h <<_ACEOF #define C_INCLUDE_DIR3 "$c_include_dir3" _ACEOF { echo "$as_me:$LINENO: result: $c_include_dir3" >&5 echo "${ECHO_T}$c_include_dir3" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking for the compiler-specific C++ include directory" >&5 echo $ECHO_N "checking for the compiler-specific C++ include directory... $ECHO_C" >&6; } exclude="^/usr(/local|)/include\$|^${prefix}(/local|)/include\$|/Frameworks|^${c_include_dir1}\$|^${c_include_dir2}\$|^${c_include_dir3}\$" cxx_include_dirs=`${CXXCPP} ${CXXFLAGS} $arch_opt -xc++ -v /dev/null 2>&1 | sed '1,/<...> search starts here/d' | sed '/End of search list/q' | sed '/End of search list/d' | sed 's/^ *//' | $EGREP -v "$exclude"` n=1 for dir in ${cxx_include_dirs} do case $n in 1) cxx_include_dir1=$dir;; 2) cxx_include_dir2=$dir;; 3) cxx_include_dir3=$dir;; 4) cxx_include_dir4=$dir;; esac let n=n+1 done if test x${cxx_include_dir1+set} = xset; then cat >>confdefs.h <<_ACEOF #define CPLUS_INCLUDE_DIR1 "$cxx_include_dir1" _ACEOF { echo "$as_me:$LINENO: result: $cxx_include_dir1" >&5 echo "${ECHO_T}$cxx_include_dir1" >&6; } fi if test x${cxx_include_dir2+set} = xset; then cat >>confdefs.h <<_ACEOF #define CPLUS_INCLUDE_DIR2 "$cxx_include_dir2" _ACEOF { echo "$as_me:$LINENO: result: $cxx_include_dir2" >&5 echo "${ECHO_T}$cxx_include_dir2" >&6; } fi if test x${cxx_include_dir3+set} = xset; then cat >>confdefs.h <<_ACEOF #define CPLUS_INCLUDE_DIR3 "$cxx_include_dir3" _ACEOF { echo "$as_me:$LINENO: result: $cxx_include_dir3" >&5 echo "${ECHO_T}$cxx_include_dir3" >&6; } fi if test x${cxx_include_dir4+set} = xset; then cat >>confdefs.h <<_ACEOF #define CPLUS_INCLUDE_DIR4 "$cxx_include_dir4" _ACEOF { echo "$as_me:$LINENO: result: $cxx_include_dir4" >&5 echo "${ECHO_T}$cxx_include_dir4" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu export LANG=$lang_save ## the directory into which mcpp_g*.h header files are generated ## '/mcpp-gcc' will be appended to 'inc_dir' if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then inc_dir=$c_include_dir2 else if test x${c_include_dir1+set} = xset; then inc_dir=$c_include_dir1 else inc_dir="$prefix"/include fi fi cat >>confdefs.h <<_ACEOF #define INC_DIR "$inc_dir" _ACEOF { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi if test x$gcc_maj_ver = x2; then { echo "$as_me:$LINENO: checking for value of predefined macro '__SIZE_TYPE__'" >&5 echo $ECHO_N "checking for value of predefined macro '__SIZE_TYPE__'... $ECHO_C" >&6; } if test "${size_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else size_type=`echo '__SIZE_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'` fi { echo "$as_me:$LINENO: result: $size_type" >&5 echo "${ECHO_T}$size_type" >&6; } cat >>confdefs.h <<_ACEOF #define COMPILER_SP1_VAL "$size_type" _ACEOF { echo "$as_me:$LINENO: checking for value of predefined macro '__PTRDIFF_TYPE__'" >&5 echo $ECHO_N "checking for value of predefined macro '__PTRDIFF_TYPE__'... $ECHO_C" >&6; } if test "${ptrdiff_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ptrdiff_type=`echo '__PTRDIFF_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *$//'` fi { echo "$as_me:$LINENO: result: $ptrdiff_type" >&5 echo "${ECHO_T}$ptrdiff_type" >&6; } cat >>confdefs.h <<_ACEOF #define COMPILER_SP2_VAL "$ptrdiff_type" _ACEOF { echo "$as_me:$LINENO: checking for value of predefined macro '__WCHAR_TYPE__'" >&5 echo $ECHO_N "checking for value of predefined macro '__WCHAR_TYPE__'... $ECHO_C" >&6; } if test "${wchar_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else wchar_type=`echo '__WCHAR_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *$//'` fi { echo "$as_me:$LINENO: result: $wchar_type" >&5 echo "${ECHO_T}$wchar_type" >&6; } cat >>confdefs.h <<_ACEOF #define COMPILER_SP3_VAL "$wchar_type" _ACEOF fi fi ## Handling of multi-byte characters containing '0x5c' codes: ## These tests cannot be executed without appropriate options for the ## compiler. So, here we define all of these macros as FALSE. ## User should edit config.h by hand after executing this script. ## These should be 0 for GCC at least upto V.4.1. cat >>confdefs.h <<\_ACEOF #define SJIS_IS_ESCAPE_FREE 0 _ACEOF cat >>confdefs.h <<\_ACEOF #define ISO2022_JP_IS_ESCAPE_FREE 0 _ACEOF cat >>confdefs.h <<\_ACEOF #define BIGFIVE_IS_ESCAPE_FREE 0 _ACEOF fi ## replace-cpp mode fi ## build-cpp mode or replace-cpp mode # Check whether --with-gcc-testsuite-dir was given. if test "${with_gcc_testsuite_dir+set}" = set; then withval=$with_gcc_testsuite_dir; if test x${withval+set} = xset; then if test x$enable_replace_cpp = xyes; then gcc_testsuite_dir=`echo $withval | sed 's,/$,,'` else { { echo "$as_me:$LINENO: error: --with-gcc-testsuite-dir option requires --enable-replace-cpp option." >&5 echo "$as_me: error: --with-gcc-testsuite-dir option requires --enable-replace-cpp option." >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:$LINENO: error: --with-gcc-testsuite-dir option requires an argument." >&5 echo "$as_me: error: --with-gcc-testsuite-dir option requires an argument." >&2;} { (exit 1); exit 1; }; } fi fi if test x$ac_cv_c_compiler_gnu = xyes; then GNUC_TRUE= GNUC_FALSE='#' else GNUC_TRUE='#' GNUC_FALSE= fi if test x$enable_mcpplib = xyes; then MCPP_LIB_TRUE= MCPP_LIB_FALSE='#' else MCPP_LIB_TRUE='#' MCPP_LIB_FALSE= fi if test x$enable_replace_cpp = xyes; then REPLACE_CPP_TRUE= REPLACE_CPP_FALSE='#' else REPLACE_CPP_TRUE='#' REPLACE_CPP_FALSE= fi if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then MINGW_TRUE= MINGW_FALSE='#' else MINGW_TRUE='#' MINGW_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${GNUC_TRUE}" && test -z "${GNUC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GNUC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GNUC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MCPP_LIB_TRUE}" && test -z "${MCPP_LIB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MCPP_LIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MCPP_LIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${REPLACE_CPP_TRUE}" && test -z "${REPLACE_CPP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"REPLACE_CPP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"REPLACE_CPP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MINGW_TRUE}" && test -z "${MINGW_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MINGW\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MINGW\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by mcpp $as_me 2.7.2, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ mcpp config.status 2.7.2 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim DLLTOOL!$DLLTOOL$ac_delim AS!$AS$ac_delim OBJDUMP!$OBJDUMP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim target_cc!$target_cc$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF gcc_path!$gcc_path$ac_delim host_system!$host_system$ac_delim Target_Cpu!$Target_Cpu$ac_delim inc_dir!$inc_dir$ac_delim gcc_maj_ver!$gcc_maj_ver$ac_delim gcc_min_ver!$gcc_min_ver$ac_delim cpp_call!$cpp_call$ac_delim gcc_testsuite_dir!$gcc_testsuite_dir$ac_delim GNUC_TRUE!$GNUC_TRUE$ac_delim GNUC_FALSE!$GNUC_FALSE$ac_delim MCPP_LIB_TRUE!$MCPP_LIB_TRUE$ac_delim MCPP_LIB_FALSE!$MCPP_LIB_FALSE$ac_delim REPLACE_CPP_TRUE!$REPLACE_CPP_TRUE$ac_delim REPLACE_CPP_FALSE!$REPLACE_CPP_FALSE$ac_delim MINGW_TRUE!$MINGW_TRUE$ac_delim MINGW_FALSE!$MINGW_FALSE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi mcpp-2.7.2/INSTALL-jp0000644000175000017500000005467511112254570011061 00000000000000 ǤϡMCPP Υ򥳥ѥ뤷Ƽ¹ԥץˡ ޤܺ٤Ϥ mcpp-porting.html 򸫤Ƥ 1¹ԥץμ MCPP μ¹ԥץ build ˡ˱ƲफޤBuild ˡˤϼΣĤμޤ 1. stand-alone-build vs subroutine-build 2. compiler-independent-build vs compiler-specific-build stand-alone-build: ĤΥޥɤȤñΤưץץåǤ ϤΥѥ顦ɥ饤ФƤӽФΤ⤢ޤ subroutine-build: ¾Υᥤץ椫饵֥롼Ȥơɬפ 鷫֤˸ƤӽФΤǤ compiler-independent-build: ϤΩưץץåǤ ¹ԻץʤɤλͤϽϤΤˤ餺Ǥץץ 뤳ȤǤޤϤΰȤư뤳ȤϤǤ compiler-specific-build: νϤΥץץåʤ⤷ǽʤ ؤ뤿ΤΤǤνϤѤλͤνϤ ѤΥǥ쥯ȥ˥󥹥ȡ뤵ޤ Subroutine-build ˤĤƤϤǤάޤmcpp-porting.html 3. 12 򸫤ƤʲϤ٤ stand-alone-build ˤĤƤǤ 2configure make MCPP 򥳥ѥ뤹ˤϡUNIX ϤΥƥप CygWIN, MinGW Ǥ configure ץȤȤȤǤޤconfigure make ǤդΥǥ 쥯ȥǼ¹ԤǤޤʲǤ mcpp-${VERSION} ǥ쥯ȥΤ path ${mcpp-dir} ɽޤ${VERSION} 2.6.4, 2.7.1 MCPP ΥСǤ Configure ϥѥ cc (c++) ޤ gcc (g++) Ȥ̾ǡĶ $PATH ˥åȤ줿 path list ν˥ޤäơgcc-4. 3.0, g++-4.3.0 Ȥä̾ΥѥȤʤ顢configure ˤ Ķѿ CC, CXX ǻꤹ뤫ޤ gcc, g++ ˥󥯤ƤƤ ⤷path list Ǻǽ˥륳ѥʳΥѥ Ȥʤ顢$PATH 򼡤Τ褦ѹʤФʤޤ export PATH=/my/gcc/bin:$PATH make ޤǰݻƤPath list Ǻǽ˥ 륳ѥʳΥѥ CC, CXX ǻꤷƤϤޤ󡣤 ХѥǻꤷƤǤPath list configure Τ٤Ƥ˱ƶ Ϳ뤫Ǥ 21compiler-independent-build ${mcpp-dir}/configure; make; make install Ȥȡcompiler-independent Ǥμ¹ԥץब mcpp Ȥ ̾ǥ󥹥ȡ뤵ޤΥɥȤ⥤󥹥ȡ뤵ޤ ${mcpp-dir}/configure --prefix=/usr; make; make install Ȥϡprefix ǻꤵ줿ǥ쥯ȥ bin ǥ쥯ȥ 󥹥ȡ뤵ޤꤷʤ /usr/local ꤷΤƱ Ȥˤʤޤ make install ˤ̾ root ¤ɬפʤΤǡ sudo make install Ȥޤ뤤 su Ƥ configure; make; make install Ȥޤ ʤFreeBSD Ǥ make ǤϤʤ gmake ȤäƤ ¹ԥץ strip ˤϡmake install Τ make install-strip Ȥޤ make uninstall ȤȡMCPP μ¹ԥץϺޤ make (un)install Ǥ DESTDIR=DIR ȤץꤹȡDIR Υǥ쥯ȥ˥󥹥ȡ뤵ޤ㤨С make DESTDIR=/tmp/mcpp install Ȥȡ/tmp/mcpp/usr/local/bin/ MCPP 󥹥ȡ뤵ޤ¸ ʤǥ쥯ȥϺ롣configure --prefix=DIR ץ ꤷƤ '/usr/local' ʬ 'DIR' ֤ˡХʥꡦѥ ˤϤˡȤޤ GCC 4.1 ʹߤˤ -fstack-protector (-fstack-protector-all) Ȥ 󤬤ޤmake CFLAGS+='-fstack-protector' Ȥץ ꤹ뤳ȤǤͭˤ뤳ȤǤޤ GCC-specific- build ǤƱͤǤMCPP gdb ǥǥХåˤ CFLAGS+='-ggdb -O0' Ȥޤ compiler-independent-build Ǥ make install ǺǾ¤ΥɥȤ 󥹥ȡ뤵褦ˤޤϥХʥꡦѥåĤ ˹碌ΤǤ Linux, Mac OS X, CygWIN, MinGW Ǥϥƥɸإå˷٤ ǡcompiler-independent-build MCPP ǤϤкɬפǤ ˤĤƤ mcpp-manual.html 3.9.9 򸫤Ƥ 22compiler-specific-build ${mcpp-dir}/configure --enable-replace-cpp; make; make install Ȥȡcompiler-specific Ǥμ¹ԥץबơνϤ ѤΥǥ쥯ȥ˥󥹥ȡ뤵ޤ make install-strip, make uninstall compiler-independent-build Ʊ Ǥ prefix ǥ쥯ȥ GCC path 鼫ưŪꤵޤ㤨 GCC path /usr/local/bin/gcc ǤС/usr/local prefix Ȥޤ configure --prefix ץꤷƤ⡢줬 GCC path ̷ Ƥ̵뤵ޤޤmake Ǥ DESTDIR ץ⡢¹ԥץ Υ󥹥ȡˤϴطޤ GCC ʳνϤǤ˰ܿȤԤconfigure Ǥˤ ĤΥץꤷʤȡŬڤʥѥȥ󥹥ȡ뤬ޤ 221Ϥ GCC ξ 2211make install --enable-replace-cpp ץ configure 硢make install ϥѥ֤ǥ쥯ȥ/usr/libexec, /usr/lib/gcc-lib/i686- pc-linux-gnu/VERSION ˤ˼¹ԥץब󥹥ȡ뤵ޤ gcc θƤӽФ cc1 (cpp0) ֤Ƥǥ쥯ȥǤmake install GCC / cc1, cc1plus (cpp0) ¸ǡgcc, g++ MCPP Ƥӽ 褦Ŭڤ򤷤ޤ GCC V.2.* Ǥ뤫 V.3.*, 4.* Ǥ뤫ˤäưäƤޤmcpp-manual.html 3.9.5, 3.9.7 򻲾Ȥ ȡˡޤGCC ΥС˱إåե뤬 compiler-specific include directory mcpp-gcc* Ȥǥ쥯ȥޤ 2212make check MCPP θڥåȤˤ GCC testsuite б edition ޤ GCC / testsuite 󥹥ȡ뤵Ƥϡmake check ˤäƤ testsuite ǸڥåȤ MCPP Standard ⡼ɤΥƥȤ򤹤뤳ȤǤ ޤTestsuite ǸڥåȤ GCC / testsuite ΰȤƻȤ褦ˤ äƤΤǡ餫 GCC / testsuite 󥹥ȡ뤵¹ԤǤ ֤ˤʤäƤ뤳ȤɬפǤGCC / testsuite ̾ GCC Υΰ ȤʤäƤޤ̤ΥѥåȤʤäƤ⤢ˡGCC V.2.95.* ʹߤ testsuite ȤޤV.4.3.* ΤΤˤϼ㴳꤬ΤǡV. 4.2.* ޤǤΤΤȤäƤ ޤconfigure GCC / testsuite ֤Ƥǥ쥯ȥ ꤷƤɬפޤΤˤϼΤ褦ˤޤ ${mcpp-dir}/configure --with-gcc-testsuite-dir=DIR \ --enable-replace-cpp 'DIR' GCC Υ֤Ƥǥ쥯ȥ ${gcc-source} ȡ ${gcc-source}/gcc/testsuite ȤʤϤǤ configure Ƥơmake; make install make check ȤȡڥåȤ testsuite Ǥ GCC / testsuite ˥ԡ졢 GCC V.2.* Ǥ뤫Ȥ V.3.*, 4.* Ǥ뤫˱ɬפ꤬ ޤTestsuite Ǥ gcc ̾ʸ̤ 'gcc' ǤʤФʤޤ󤬡 MCPP 򥤥󥹥ȡ뤷 gcc ̾äƤϡgcc Ȥ̾ Ūˤ̾ symbolic link ޤ testsuite ¹Ԥޤ ̾ΥեȥǤ make install make check ޤMCPP Ͻդˤʤޤgcc MCPP ƤӽФ褦ˤƤʤ testsuite MCPP ŬѤǤʤǤޤΤ --enable- replace-cpp ץɬפǤ ${gcc-source} Τ꤫ˤäƤ make check sudo make check Ȥ Фʤޤ󤬡ξ root ȸ桼Ȥ 'which gcc' η̤ פƤʤФʤʤȤդƤ Testsuite ǸڥåȤ MCPP ǤʤGCC V.2.95 ʹߤ cc1, cc1plus (cpp0) ˤŬѤ뤳ȤǤޤcpp-test.html 3.2.3 ȡˡ 2213make uninstall make uninstall ȤȡMCPP μ¹ԥץϺޤ mcpp-gcc* ǥ쥯ȥΥإåեޤgcc, cc1, cc1plus (cpp0) Ͻ֤ޤΤĤ make install configure Ƽ¹Ԥϡ make uninstall ʤФʤޤ Configure Ĵ٤ʤΤ GCC Ǥ MCPP ǤϤʤǤ GCC / testsuite ˸ڥåȤ󥹥ȡ뤵ƤС make uninstall ǺޤGCC ˸ڥåȤŬѤˤϡưǸ ڥåȤ򥳥ԡƤ GCC-specific-build configure 줿ܤ Makefile MCPP uninstall ȤɬפʤΤǡΤޤ޻ĤƤƤmake distclean ϡ make uninstall ¹ԤƤư uninstall ΤϾ֤뤫ǤƱͤˡconfigure Makefile.in ϡ make uninstall; make distclean ƤʤФʤޤMCPP update դƤ 222Ϥ Mac OS X Apple-GCC ξ Mac OS X UNIX ϤȤϸframework directory ȼǤ ƤޤGCC Apple ˤ¿γĥܤ줿Τƥॳѥ ˤʤäƤޤ Intel-Mac оʹߤϡx86 ѤΥѥ饷 ƥ powerpc ѤΥѥ饷ƥȤϥͥƥ֥ѥ ¾ϥѥǤƱޥ˶¸褦ˤʤꡢx86 Ѥμ ԥץ powerpc Ѥμ¹ԥץ򣱤Ĥ«ͤƤɤΥޥ ư褦ˤ universal binary ȤΤޤǺ褦ˤʤäƤ ΤǡʤʣʹˤʤäƤޤ ʣʥƥ MCPP 򥤥󥹥ȡ뤹Τϡ221ˡ Ǥ­ޤ󡣤ǡMac OS X / Apple-GCC ξ̤ˤȤꤢ ޤ Intel-Mac Mac OS X Leopard ȤäƤΤǤ ȤޤPowerpc-Mac Ǥ i686 powerpc դˤɤǤ ޤTiger Ǥ darwin9 darwin8 ɤؤƤ ʤǤȤꤢΤ GCC 4.0.1 ǤΤۤ GCC 3.3 Apple ˤäѰդƤޤʤȤ Leopard ΤΤѥ 뤵ƤʤΤǡȤꤢޤ 2221ͥƥ֥ѥȥѥ ޤnative ѥIntel-Mac ʤ i686 GCCѤ MCPP 򥤥 ȡΤϴñǡ221ˡǤߤޤ ѥѤ MCPP 򥤥󥹥ȡ뤹ΤϡñǤ ޤMCPP configure ϰ̤ˤϥѥ󥰤бƤ ޤ󡣥ץץ򥳥ѥ뤷 run ƥȤĤ ޤƤ뤫ǤåȴĶѤΥХʥӥɴĶǼ¹Ԥ뤳 ϡ̤ϤǤޤ󡣤ޤӥɴĶΥƥȤ򤷤Ƥ⡢η̤ϥ åȴĶȤϰäƤ뤫⤷ޤ Mac OS X ξ㳰ŪˡѥбǤ礬 ¿ޤޤIntel-Mac ppc ѤΥХʥ򥨥ߥ졼Ǽư Ԥ褦ˤʤäƤޤޤCPU äƤ OS ȤΥС GCC ΥСƱǤСӥɴĶǤΥƥȤǥåȴĶΥ Ȥ¿ѤǤޤ Intel-Mac Ǥ compiler-independent-build ǤϤޤCC, CXX Ȥ ѿ C ѥ C++ ѥꤷޤMac OS X /usr/bin ˤϤĤ gcc g++ ޤIntel-Mac Mac OS X Leopard powerpc-apple-darwin9-gcc-4.0.1, powerpc-apple-darwin9-g++-4.0.1 Ȥ Τ powerpc Ѥ C ѥ C++ ѥǤʼºݤˤ /usr/bin gcc, g++ Ϥ٤ i386, ppc ΥХʥ碌 universal binary Ǥˡˡåȥƥ --target ץǻꤷޤ ξϥѥ̾ -gcc-4.0.1 ʬ powerpc- apple-darwin9 Ȥޤɡʤޤ ${mcpp-dir}/configure --target=powerpc-apple-darwin9 \ CC=powerpc-apple-darwin9-gcc-4.0.1 \ CXX=powerpc-apple-darwin9-g++-4.0.1 ¾ ppc-Mac Ǥ x86 ΥХʥ¹ԤǤʤΤǡ configure Ǥ compiler-independent-build ΥѥϤǤޤ󡣺ʬե mac_osx.mak ȤäưѥǤХѥǤ Τǡɬפʤ mcpp-porting.html#3.1.4, #3.11 򸫤Ƥޤ configure Ǥ⼡ˡȤСppc-Mac native compiler universal binary 뤳ȤϤǤޤ GCC-specific-build Ǥ CC, CXX ϻȤ鷺Τ褦 --with-target-cc= Ȥץ C ѥꤷޤʤ̾ gcc g++ Τ C++ ѥȲᤷޤˡ ${mcpp-dir}/configure --target=powerpc-apple-darwin9 \ --with-target-cc=powerpc-apple-darwin9-gcc-4.0.1 \ --enable-replace-cpp ϥåȴĶμ¹ԥƥȤϴޤޤʤΤǡpowerpc i686 ֤ ppcMac ǻȤϤǤ ǥեȤΥͥƥ֥ѥgcc, g++ˤ --with-target-cc= ǻ ꤹ륯ѥȤ礭С󤬰äƤϡΥ ѥˤʤ٤ᤤСΥͥƥ֥ѥĶѿ CC, CXX ǻꤷƤCC (CXX) ǻꤹΤ MCPP ӥɤ뤿 ѥǤꡢ--with-target-cc= ǻꤹΤ MCPP 򥤥󥹥ȡ뤹 륿åȤΥѥǤ ѥϥͥƥ֥ѥȤ libexec directory, compiler- specific include directory, ޥۤʤޤ餬 ץˤäŬڤꤵޤΥץ make Ǥ ʤ configure ǻꤹɬפޤ ʤѥϥۥȥƥưΤʤΤǡΡ֥ ѥˡץ󥹥ȡ뤵 compiler-specific-build MCPP ƱͤǤ¾ǡ֥ѥǡץѥ뤵줿 compiler- independent-build MCPP ϡåȥƥưΤˤʤޤ GCC-specific-build ϥͥƥ֥ѥ˥󥹥ȡ뤵Τ ѥ˥󥹥ȡ뤵Τ⡢Ȥ˥ͥƥ֥ѥ ѥ뤵ޤΤᡢ򥤥󥹥ȡ뤹ϡ ѥѤ˥󥹥ȡ뤹ɬפޤ 2222Universal binary make Universal binary ˤϡmake CFLAGS+='-arch i386 -arch ppc' Ȥ褦ˡоݤȤ CPU -arch ץǻꤷޤ Ǥ CPU i386, x86_64, ppc, ppc64 ΣǤmake CFLAGS+='-arch i386 -arch x86_64 -arch ppc -arch ppc64' Ȥȣ CPU б ΤǤޤconfigure universal binary ǤʤƱǡ̤ʥ ץɬפޤ GCC ˤ -isysroot DIRʤޤ --sysroot=DIRˤȤץ󤬤 줬ꤵȡƥإå include directory Ȥƥǥե Ȥ include directory DIR ƬդΤȤޤΥץ Mac OS ˸¤äΤǤϤޤ󤬡Mac OS Ǥ universal binary Υѥˤ줬ȤƤޤMac OS ΥС֤θߴϰ 򹭤뤿Ǥ㤨С-isysroot /Developer/SDKs/MacOSX10.4u.sdk Ȥ ȡ/usr/include /Developer/SDKs/MacOSX10.4u.sdk/usr/include Ȥʤ ޤ Mac OS X 10.5 (Leopard) 10.4 (Tiger) ȸߴ universal binary 򥳥ѥ뤹뤿ΤΤǤMCPP make Ǥ ˤϡ -mmacosx-version-min= Ȥץ SDK Ʊ ꤹɬפޤ MCPP universal binary ϡ嵭 configure ץȤ make ץȤ߹碌뤳Ȥǡcompiler-independent-build, GCC- specific-build ΤɤǤ⡢native-compiler, cross-compiler Τɤ 뤳ȤǤޤ㤨 compiler-independent-build Tiger i386 ppc ѤΤΤˤϤޤʼºݤˤϡ'*' \ Ԥʬ뤳ȤϤǤʤˡ ${mcpp-dir}/configure make CFLAGS+='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ -mmacosx-version-min=10.4 -arch i386 -arch ppc' sudo make install 223Ϥ GCC Ǥʤ Ϥ GCC Ǥʤ configure ǤĤΥץꤷʤ Фʤޤ󡣤ޤνϤΥץץåִǤ褦ˡ ɤ­ְܿ׺ȤɬפǤԼȤ Linux, FreeBSD, Mac OS X, CygWIN, MinGW GCC ȤäƤΤǰܿǤꡢconfigure Ǿ뤳ȤǤΤǤUNIX ϥƥ¾νϤˤĤ ƤΤʤΤǡܿϤ configure DzɤĴ٤ɤΤ ʤǤ UNIX ϥƥ GCC ʳνϤǤϡΤ褦ʼǥѥ Ƥ 2231ץꤷ configure ޤĤΥץꤷ configure Ƥߤޤ㤨м 褦ˤޤ ${mcpp-dir}/configure --enable-replace-cpp --bindir=DIR \ --with-cxx-include-dir=CXXDIR \ --enable-SYSTEM-STD-macro=_MACRO=val --bindir ǻꤹΤϡѥɥ饤ФƤӽФץץ å֤ǥ쥯ȥǤ C++ ͭΥ󥯥롼ɥǥ쥯 --with-cxx-include-dir ǡޤϸͭλޥ --enable-SYSTEM-STD-macro ¾Υץǻꤷޤ ${mcpp-dir}/configure --help Ȥȥץɽޤ make; make install ơ˥ѥɥ饤Ф MCPP ӽФ褦˺ٹ򤷤ޤˡˤĤƤϡGCC Ǥˡ򻲹 ˤƤ 2232ְܿ׺ ϤΥץץå MCPP ֤ƻȤˤϡɤ ­ְܿ׺ȤɬפǤϸͭμ¹Իץ #pragma μǤǤ⤷ФлȤ¹Իץ MCPP Ȱۤʤ С¡μɬפǤΤˤϡconfiged.H ǤΥ ѥɽޥǡsystem.c ˥ɤ񤭲äޤ mcpp-porting.html ΤȤ 4.2 򻲾ȡˡ 2233ץɲä configure ʤ ΰܿǤ顢--with-compiler-name=COMPILER Ȥץ ɲä configure ľޤCOMPILER configed.H Υ ѥɽޥǤ make; make install Ǥ顢 make clean; make ȤȡMCPP Ȥä MCPP Υꥳѥ뤬Ԥޤ줬̤С¤ΰܿϤ Ƥޤ 224configure compiler-specific-build MCPP ΥѥǤϥåȽϡMCPP ץץåȤƻȤͽνϡˤλͤܤΤɬפޤ Ʊˡѥ뤹ϤˤĤƤ̤¦̤λͤΤɬפޤ MCPP ΥϤξԤνϤäƤƤ⤫ޤʤ褦ˡξԤ ʬƥإåե (configed.H) 񤤤Ƥޤ configure ǤϤξԤƱĴ٤뤳ȤǤޤ󡣤Τᡢ ȤȤϤȥѥ뤹ϤƱǤȤĴ򤷤ޤ ⤷ξԤνϤ㤦ϡconfiged.H Part 2 Խ뤳 ɬפǤ MCPP configure Ʊͤ˥ѥˤбƤޤ󡣤ޤ ѥǤϼ¹ԤǤʤƥȤ⤤ĤޤޤƤޤ ѥǤϤξϥǥեͤ򥻥åȤޤޤ椫ʤ⤷ ޤ 3Windows νϤǤ make Windows νϤ CygWIN, MinGW ʳ configure оݤˤʤʤ ǡ make 뤳ȤɬפǤǤ˰ܿߤνϤˤ ƤϺʬեѰդƤΤǡȤäƥѥå򤢤Ƥ뤳Ȥ ޤʬեȤμʲޤ ޤconfigure оݤˤʤϤǤ⡢إåե makefile ľ ܡԽ뤳ȤǤΤޤ򤹤뤳ȤǤޤ 31ѥå򤢤Ƥ noconfig Ȥǥ쥯ȥ˳ƼѤκʬե makefile ѰդƤޤMCPP ΥϥǥեȤǤ FreeBSD / GCC 3.4 Ѥ ˤʤäƤޤʬեϤ̤νѤ˽ΤǤ Makefile ϳƽϤ° make Ȥ褦˽񤫤Ƥޤ src ǥ쥯ȥäƼΤ褦ˤޤʲκȤϤ٤ src ǥ 쥯ȥǹԤޤ patch -c < ..\noconfig\which-compiler.dif copy ..\noconfig\which-compiler.mak Makefile patch UNIX ϥƥΥޥɤǤWindows ˤܿƤ ǡȤޤ󡢺ʬե򸫤ơǥǽƤ⤫ ޤޤ 32ɬפʤ餵 noconfig.H, Makefile ʬեǤϳƼǥ쥯ȥ꤬ɮԤδĶ򸵤ˤƤΤǡ ʬδĶ˹碌ƽޤ ȤϤʬեΤΤȤϥС󤬰äƤϡإå ե noconfig.H ˤ˽äޤnoconfig.H ΤΤ mcpp-porting.html 3.1 򻲾ȡˡ̾Ȥ multi-byte character ܸ ϤʤƱͤˡnocongig.H MBCHAR Ȥޥ񤭴 ޤ¹ԥץ򥤥󥹥ȡ뤹ǥ쥯ȥ Makefile BINDIR Ȥѿ˽񤭤ޤVisual C Ѥ Makefile ǤϼιԤ # ơinstall åȤͭˤƤ #install : 33compiler-independent-build make make install ȡcompiler-independent Ǥμ¹ԥ बƥ󥹥ȡ뤵ޤVisual C++ Ǥ make ǤϤʤ nmake Ȥˡ 34compiler-specific-build compiler-specific Ǥ뤿ˤϡޤ Makefile BINDIR 򤽤 Ϥμ¹ԥץ֤Ƥǥ쥯ȥ˽񤭴ޤơ noconfig.H μιԤ 'INDEPENDENT' 򤽤Υѥɽޥ˽񤭴 ơ'make' 'make install' ޤ #define COMPILER INDEPENDENT 'COMPILER' make ΥץǾ񤭤뤳ȤǤΤǡnoconfig.H ɬ񤭴ɬפϤޤ㤨СVisual C Ǥ 'nmake COMPILER=MSC' Ȥ 'nmake COMPILER=MSC install' ޤBorland C Ǥ 'make -DCOMPILER=BORLANDC' Ȥ 'make -DCOMPILER=BORLANDC install' ޤ ⤷åȽϤȥѥ뤹ϤȤäƤϡ noconfig.H / Part 1 򥿡åȽϤλͤ˹碌Part 2 򥳥ѥ 뤹Ϥλͤ˹碌ޤMakefile ϥѥ뤹ѤΤ Ȥ󥹥ȡ뤹ǥ쥯ȥ򥿡åȽѤѹޤ Windows νϤ¿ϥץץåѥΤȰΤ ʤäƤΤǡMCPP 򥤥󥹥ȡ뤷Ƥץץåִ뤳Ȥ Ǥޤ󡣤Ϥ MCPP ȤˤϡΤ褦 makefile ɬפޤnoconfig ǥ쥯ȥγ makefile ˤϡMCPP Ȥ MCPP ꥳѥ뤹꤬񤤤ƤΤǡ򻲹ͤˤƤ Visual C++ ǤϤ makefile ȤäơIDE ǡ֥ᥤեץ ȡפȡIDE Υ٥ǥХåεǽ٤ƻȤ mcpp-manual.html 2.10 ȡˡ 35ƥ Windows Ǥ MinGW / GCC-specific-build CygWIN ʳǤ include directory ꤵʤΤǡINCLUDE ȤĶѿꤷޤɬפ CPLUS_INCLUDE ˡ Windows Ǥ GCC / testsuite ϻȤʤΤǡtest-t, test-c, test-l 쥯ȥˤƥѥץľܡץץƳΤޤtool /cpp_test.c ȤȡΥƥȤǤưŪ˼¹ԤǤޤcpp- test.html 3.2.2 ȡˡ compiler-specific-build ǤϡMCPP ȤץץåȤƻȤäơ MCPP "pre-preprocess" ȤǽȤä MCPP ꥳѥ뤷Ƥߤ ȡνϤǤȤꤢȤ褦ˤʤäɤΤ뤳ȤǤ ޤmcpp-porting.html 3.7 ȡˡ 4ܿΤξ򤪴󤻤 MCPP ޤܿƤʤϤ˰ܿ뤿ˤϡ¿ξɬפ ߤʤξԤƤޤ GCC ʳνϤˤĤ configure Υץǻꤹͤ狼 Τ϶Ƥconfigure.ac ˼Ǥ椭Ȼפޤ 5ָڥåȡפȤ MCPP ˤϡָڥåȡפȤΤ°Ƥޤ C/C++ ץ åˤĤ 265 ܤˤ錄ŰŪʥƥȤɾ򤹤ΤǤ MCPP ǤʤǤդΥץץåŬѤ뤳ȤǤޤλȤ ˤĤƤϡcpp-test.html 3.1, 3.2 򻲾ȤƤ 2008/11 桡 mcpp-2.7.2/test-t/0000777000175000017500000000000011113456216010706 500000000000000mcpp-2.7.2/test-t/n_tlim_8.t0000644000175000017500000000014110216765467012532 00000000000000/* n_tlim_8.t: Length of logical source line: at least 4095 bytes. */ #include "long4095.h" mcpp-2.7.2/test-t/m_33_sjis.t0000644000175000017500000000113210216765467012613 00000000000000/* m_33_sjis.t: Wide character constant encoded in shift-JIS. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "sjis") /* For MCPP */ #pragma setlocale( "japanese") /* For Visual C */ #if L'' == '\x8e' * BYTES_VAL + '\x9a' Wide character is encoded in shift-JIS. #elif L'' == '\x9a' * BYTES_VAL + '\x8e' Wide character is encoded in shift-JIS. Inverted order of evaluation. #else I cannot understand shift-JIS. #endif #if L'' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/n_5.t0000644000175000017500000000054510216765467011512 00000000000000/* n_5.t: Spaces or tabs are allowed at any place in pp-directive line, including between the top of a pp-directive line and '#', and between the '#' and the directive. */ /* 5.1: */ /* |**|[TAB]# |**|[TAB]define |**| MACRO_abcde[TAB]|**| abcde |**| */ /**/ # /**/ define /**/ MACRO_abcde /**/ abcde /**/ /* abcde */ MACRO_abcde mcpp-2.7.2/test-t/nest3.h0000644000175000017500000000006510216765467012046 00000000000000/* nest3.h */ nest = 3; #include "nest4.h" mcpp-2.7.2/test-t/nest6.h0000644000175000017500000000006510216765467012051 00000000000000/* nest6.h */ nest = 6; #include "nest7.h" mcpp-2.7.2/test-t/n_pragma.t0000644000175000017500000000130110216765467012604 00000000000000/* n_pragma.t: _Pragma() operator */ /* based on the proposal to C99 by Bill Homer */ #define Machine_B #include "pragmas.h" /* #pragma vfunction */ Fast_call void f(int n, double * a, double * b) { /* #pragma ivdep */ Independent while(n-- > 0) { *a++ += *b++; } } #define f(N, A, B) \ { int n = (N), double * a = (A), double * b = (B); \ Independent while(n-- > 0) { *a++ += *b++; } \ } #define EXPRAG(x) _Pragma(#x) #define PRAGMA(x) EXPRAG(x) #define LIBFUNC xyz int libfunc() { ... } /* Direct the linker to define alternate entry points for libfunc. */ /* #pragma duplicate libfunc as (lib_func,xyz) */ PRAGMA( duplicate libfunc as (lib_func,LIBFUNC) ) mcpp-2.7.2/test-t/i_32_3.t0000644000175000017500000000052710216765467012007 00000000000000/* i_32_3.t: Character constant in #if expression. */ /* In ASCII character set. */ /* 32.3: */ #if 'a' != 0x61 Not ASCII character set, or bad evaluation of character constant. #endif /* 32.4: '\a' and '\v' */ #if '\a' != 7 || '\v' != 11 Not ASCII character set, or bad evaluation of escape sequences. #endif mcpp-2.7.2/test-t/m_34_eucjp.t0000644000175000017500000000052710216765467012761 00000000000000/* m_34_eucjp.t: Multi-byte character constant encoded in EUC-JP. */ /* 34.1: */ #pragma __setlocale( "eucjp") /* For MCPP */ #pragma setlocale( "eucjp") /* For MCPP on VC */ #if '' == '\xbb\xfa' Multi-byte character is encoded in EUC-JP. #else I cannot understand EUC-JP. #endif mcpp-2.7.2/test-t/n_3_4.t0000644000175000017500000000050210216765467011724 00000000000000/* n_3_4.t: Handling of comment and . */ /* 3.4: Comment and in #error line. */ #error Message of first physical line. \ Message of second physical and first logical line. /* this comment splices the lines */ Message of forth physical and third logical line. mcpp-2.7.2/test-t/n_12.t0000644000175000017500000000164110216765467011566 00000000000000/* n_12.t: Integer preprocessing number token and type of #if expression. */ #include /* 12.1: Type long. */ #if LONG_MAX <= LONG_MIN Bad evaluation of long. #endif #if LONG_MAX <= 1073741823 /* 0x3FFFFFFF */ Bad evaluation of long. #endif /* 12.2: Type unsigned long. */ #if ULONG_MAX / 2 < LONG_MAX Bad evaluation of unsigned long. #endif /* 12.3: Octal number. */ #if 0177777 != 65535 Bad evaluation of octal number. #endif /* 12.4: Hexadecimal number. */ #if 0Xffff != 65535 || 0xFfFf != 65535 Bad evaluation of hexadecimal number. #endif /* 12.5: Suffix 'L' or 'l'. */ #if 0L != 0 || 0l != 0 Bad evaluation of 'L' suffix. #endif /* 12.6: Suffix 'U' or 'u'. */ #if 1U != 1 || 1u != 1 Bad evaluation of 'U' suffix. #endif /* 12.7: Negative integer. */ #if 0 <= -1 Bad evaluation of negative number. #endif mcpp-2.7.2/test-t/m_33_gb.t0000644000175000017500000000112010216765467012230 00000000000000/* m_33_gb.t: Wide character constant encoded in GB-2312. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "gb2312") /* For MCPP */ #pragma setlocale( "chinese-simplified") /* For Visual C */ #if L'' == '\xd7' * BYTES_VAL + '\xd6' Wide character is encoded in GB 2312. #elif L'' == '\xd6' * BYTES_VAL + '\xd7' Wide character is encoded in GB 2312. Inverted order of evaluation. #else I cannot understand GB-2312. #endif #if L'' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/n_25.t0000644000175000017500000000176210216765467011576 00000000000000/* n_25.t: Macro arguments are pre-expanded (unless the argument is an operand of # or ## operator) separately, that is, are macro-replaced completely prior to rescanning. */ #define MACRO_0 0 #define MACRO_1 1 #define ZERO_TOKEN #define TWO_ARGS a,b #define sub( x, y) (x - y) #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) #define str( a) # a /* 25.1: "TWO_ARGS" is read as one argument to "sub" then expanded to "a,b", then "x" is substituted by "a,b". */ /* (a,b - 1); */ sub( TWO_ARGS, 1); /* 25.2: An argument pre-expanded to 0-token. */ /* ( - 1); */ sub( ZERO_TOKEN, 1); /* 25.3: "glue( a, b)" is pre-expanded. */ /* abc; */ xglue( glue( a, b), c); /* 25.4: Operands of ## operator are not pre-expanded. */ /* MACRO_0MACRO_1; */ glue( MACRO_0, MACRO_1); /* 25.5: Operand of # operator is not pre-expanded. */ /* "ZERO_TOKEN"; */ #define ZERO_TOKEN str( ZERO_TOKEN); mcpp-2.7.2/test-t/nest9.h0000644000175000017500000000004210216765467012047 00000000000000/* nest9.h */ #include "nest10.h" mcpp-2.7.2/test-t/n_13.t0000644000175000017500000000142410216765467011566 00000000000000/* n_13.t: Valid operators in #if expression. */ /* Valid operators are (precedence in this order) : defined, (unary)+, (unary)-, ~, !, *, /, %, +, -, <<, >>, <, >, <=, >=, ==, !=, &, ^, |, &&, ||, ? : */ /* 13.1: Bit shift. */ #if 1 << 2 != 4 || 8 >> 1 != 4 Bad arithmetic of <<, >> operators. #endif /* 13.2: Bitwise operators. */ #if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 Bad arithmetic of ^, |, & operators. #endif /* 13.3: Result of ||, && operators is either of 1 or 0. */ #if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 Bad arithmetic of ||, && operators. #endif /* 13.4: ?, : operator. */ #if (0 ? 1 : 2) != 2 Bad arithmetic of ?: operator. #endif mcpp-2.7.2/test-t/unbal5.h0000644000175000017500000000006710216765467012202 00000000000000/* unbal5.h */ int unbal5; /* unterminated comment mcpp-2.7.2/test-t/nest8.h0000644000175000017500000000010710216765467012050 00000000000000/* nest8.h */ nest = 8; #ifndef X8 #include "nest9.h" #endif mcpp-2.7.2/test-t/n_tlim_2.t0000644000175000017500000000270410216765467012533 00000000000000/* n_tlim_2.t: Tests of translation limits. */ /* tlim.1L: Number of parameters of macro definition: at least 127. */ #define glue127( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## o7 /* tlim.2L: Number of arguments of macro call: at least 127. */ /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6O7; */ glue127( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7); mcpp-2.7.2/test-t/e_31_3.t0000644000175000017500000000037510216765467012003 00000000000000/* e_31_3.t: Macro call in control line should complete in the line. */ #define glue( a, b) a ## b #define str( s) # s #define xstr( s) str( s) /* 31.3: Unterminated macro call. */ #include xstr( glue( header, .h)) mcpp-2.7.2/test-t/nest14.h0000644000175000017500000000004310216765467012124 00000000000000/* nest14.h */ #include "nest15.h" mcpp-2.7.2/test-t/e_19_3.t0000644000175000017500000000142710216765467012010 00000000000000/* e_19_3.t: Redefinitions of macros. */ /* Excerpts from ISO C 3.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* The following redefinitions should be diagnosed. */ /* 19.3: */ #define OBJ_LIKE (0) /* different token sequence */ /* (1-1); or (0); */ OBJ_LIKE; /* 19.4: */ #undef OBJ_LIKE #define OBJ_LIKE (1-1) #define OBJ_LIKE (1 - 1) /* different white space */ /* 19.5: */ #define FTN_LIKE(b) ( a ) /* different parameter usage */ /* ( x ); or ( a); */ FTN_LIKE(x); /* 19.6: */ #undef FTN_LIKE #define FTN_LIKE(a) ( a ) #define FTN_LIKE(b) ( b ) /* different parameter spelling */ /* 19.7: Not in ISO C "Examples" */ #define FTN_LIKE OBJ_LIKE mcpp-2.7.2/test-t/n_19.t0000644000175000017500000000064710216765467011602 00000000000000/* n_19.t: Valid re-definitions of macros. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* 19.1: */ #define OBJ_LIKE /* white space */ (1-1) /* other */ /* 19.2: */ #define FTN_LIKE( a )( /* note the white space */ \ a /* other stuff on this line */ ) /* ( c ); */ FTN_LIKE( c); mcpp-2.7.2/test-t/n_tlim_4.t0000644000175000017500000000020310216765467012525 00000000000000/* n_tlim_4.t: Nested conditional inclusion: at least 63 level. */ /* nest = 0x3f; */ #define X3F #include "ifdef15.h" mcpp-2.7.2/test-t/e_14.t0000644000175000017500000000127310216765467011560 00000000000000/* e_14.t: Illegal #if expressions. */ #define A 1 #define B 1 /* 14.1: String literal is not allowed in #if expression. */ #if "string" #endif /* The second error ? */ /* 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. */ #if A = B #endif #if A++ B #endif #if A --B #endif #if A.B #endif /* 14.3: Unterminated #if expression. */ #if 0 < #endif #if ( (A == B) #endif /* 14.4: Unbalanced parenthesis in #if defined operator. */ #if defined ( MACRO #endif /* 14.5: No argument. */ #if #endif /* 14.6: Macro expanding to 0 token in #if expression. */ #define ZERO_TOKEN #if ZERO_TOKEN #endif mcpp-2.7.2/test-t/n_29.t0000644000175000017500000000034210216765467011573 00000000000000/* n_29.t: #undef directive. */ /* 29.1: Undefined macro is not a macro. */ /* DEFINED; */ #define DEFINED #undef DEFINED DEFINED; /* 29.2: Undefining undefined name is not an error. */ #undef UNDEFINED mcpp-2.7.2/test-t/unbal3.h0000644000175000017500000000003210216765467012170 00000000000000/* unbal3.h */ int unbal3;mcpp-2.7.2/test-t/n_cnvucn.t0000644000175000017500000000114010216765467012632 00000000000000/* n_cnvucn.t: C++ Conversion from multi-byte character to UCN. */ /* This conversion takes place in the translation phase 1. */ #define str( a) # a /* "\"\u6F22\u5B57\"" or "\"\\u6F22\\u5B57\"" */ str( "") /* Multi-byte characters in identifier. */ #define ޥ #define ؿͥޥ(1, 2) 1 ## 2 /* ; */ ޥ; /* ̾; */ ؿͥޥ(, ̾); /* Multi-byte character in pp-number. */ #define mkname( a) a ## 1 #define mkstr( a) xmkstr( a) #define xmkstr( a) # a /* "abc1" */ char * mkstr( mkname( abc)); mcpp-2.7.2/test-t/nest1.h0000644000175000017500000000006510216765467012044 00000000000000/* nest1.h */ nest = 1; #include "nest2.h" mcpp-2.7.2/test-t/unbal1.h0000644000175000017500000000002610216765467012171 00000000000000/* unbal1.h */ #endif mcpp-2.7.2/test-t/n_23.t0000644000175000017500000000042110216765467011563 00000000000000/* n_23.t: ## operator in macro definition. */ #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) /* 23.1: */ /* xy; */ glue( x, y); /* 23.2: Generate a preprocessing number. */ /* .12e+2; */ #define EXP 2 xglue( .12e+, EXP); mcpp-2.7.2/test-t/ifdef63.h0000644000175000017500000000230610216765467012240 00000000000000/* ifdef63.h */ #ifdef X20 #else #ifdef X21 #else #ifdef X22 #else #ifdef X23 #else #ifdef X24 #else #ifdef X25 #else #ifdef X26 #else #ifdef X27 #else #ifdef X28 #else #ifdef X29 #else #ifdef X2A #else #ifdef X2B #else #ifdef X2C #else #ifdef X2D #else #ifdef X2E #else #ifdef X2F #else #ifdef X30 #else #ifdef X31 #else #ifdef X32 #else #ifdef X33 #else #ifdef X34 #else #ifdef X35 #else #ifdef X36 #else #ifdef X37 #else #ifdef X38 #else #ifdef X39 #else #ifdef X3A #else #ifdef X3B #else #ifdef X3C #else #ifdef X3D #else #ifdef X3E #else #ifdef X3F ifdef_nest = 0x3f; #endif /* X3F */ #endif /* X3E */ #endif /* X3D */ #endif /* X3C */ #endif /* X3B */ #endif /* X3A */ #endif /* X39 */ #endif /* X38 */ #endif /* X37 */ #endif /* X36 */ #endif /* X35 */ #endif /* X34 */ #endif /* X33 */ #endif /* X32 */ #endif /* X31 */ #endif /* X30 */ #endif /* X2F */ #endif /* X2E */ #endif /* X2D */ #endif /* X2C */ #endif /* X2B */ #endif /* X2A */ #endif /* X29 */ #endif /* X28 */ #endif /* X27 */ #endif /* X26 */ #endif /* X25 */ #endif /* X24 */ #endif /* X23 */ #endif /* X22 */ #endif /* X21 */ #endif /* X20 */ mcpp-2.7.2/test-t/e_14_9.t0000644000175000017500000000017110216765467012004 00000000000000/* e_14_9.t: Out of range in #if expression (division by 0). */ /* 14.9: Divided by 0. */ #if 1 / 0 #endif mcpp-2.7.2/test-t/n_tlim_6.t0000644000175000017500000000143310216765467012535 00000000000000/* n_tlim_6.t: Parenthesized expression: at least 63 level. */ /* nest = 63; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif mcpp-2.7.2/test-t/n_tlim_5.t0000644000175000017500000000020110216765467012524 00000000000000/* n_tlim_5.t: Nested source file inclusion: at least 15 level. */ /* nest = 0x0f; */ #define X0F #include "nest1.h" mcpp-2.7.2/test-t/u_concat.t0000644000175000017500000000055310216765467012623 00000000000000/* u_concat.t: Invalid pp-token generated by ## operator. */ #define _VARIANT_BOOL /##/ /* * The following line intends to be commented out. '//' generated by the * macro is, however, not a valid pp-token. Since any comment is removed * before macro definition or macro expansion, a comment is never generated * by macro. */ _VARIANT_BOOL bool; mcpp-2.7.2/test-t/e_24_6.t0000644000175000017500000000023210216765467012000 00000000000000/* e_24_6.t: Operand of # operator in function-like macro definition shall be a parameter name. */ /* 24.6: */ #define FUNC( a) # b mcpp-2.7.2/test-t/n_vargs.t0000644000175000017500000000125010216765467012462 00000000000000/* n_vargs.t: Macro of variable arguments */ /* from C99 Standard 6.10.3 Examples */ #define debug( ...) fprintf( stderr, __VA_ARGS__) #define showlist( ...) puts( #__VA_ARGS__) #define report( test, ...) ((test) ? puts( #test) \ : printf( __VA_ARGS__)) { /* fprintf( stderr, "Flag"); */ debug( "Flag"); /* fprintf( stderr, "X = %d\n", x); */ debug( "X = %d\n", x); /* puts( "The first, second, and third items."); */ showlist( The first, second, and third items.); /* ((x>y) ? puts( "x>y") : printf( "x is %d but y is %d", x, y)); */ report( x>y, "x is %d but y is %d", x, y); } mcpp-2.7.2/test-t/e_std99.t0000644000175000017500000000315310216765467012307 00000000000000/* * e_std99.t * * 2002/08 made public kmatsui * 2003/11 added a few samples kmatsui * * Samples to test Standard C99 preprocessing. * C99 preprocessor must diagnose all of these samples appropriately. */ /* e_ucn.t: Errors of Universal-character-name sequense. */ #define macro\U0000001F violation of constraint #define macro\uD800 violation of constraint (only C, not for C++) #define macro\u123 too short sequence (violation of syntax rule) #define macro\U1234567 also too short sequence /* e_intmax.t: Overflow of constant expression in #if directive. */ #include #if INTMAX_MAX - INTMAX_MIN #endif #if INTMAX_MAX + 1 #endif #if INTMAX_MIN - 1 #endif #if INTMAX_MAX * 2 #endif #include #if LLONG_MAX - LLONG_MIN #endif #if LLONG_MAX + 1 #endif #if LLONG_MIN - 1 #endif #if LLONG_MAX * 2 #endif /* e_pragma.t: Erroneous use of _Pragma() operator */ /* Operand of _Pragma() should be a string literal */ _Pragma( This is not a string literal) /* e_vargs1.t: Erroneous usage of __VA_ARGS__ */ /* __VA_ARGS__ should not be defined. */ #define __VA_ARGS__ (x, y, z) /* * __VA_ARGS__ should be the parameter name in replacement list * corresponding to '...'. */ #define wrong_macro( a, b, __VA_ARGS__) (a + b - __VA_ARGS__) /* e_vargs2.t: Erroneous macro invocation of variable arguments */ #define debug( ...) fprintf( stderr, __VA_ARGS__) /* No argument to correspond __VA_ARGS__ */ debug(); mcpp-2.7.2/test-t/m_34_ksc.t0000644000175000017500000000052310216765467012427 00000000000000/* m_34_ksc.t: Multi-byte character constant encoded in KSC-5601. */ /* 34.1: */ #pragma __setlocale( "ksc5601") /* For MCPP */ #pragma setlocale( "korean") /* For Visual C */ #if '' == '\xed\xae' Multi-byte character is encoded in KSC-5601. #else I cannot understand KSC-5601. #endif mcpp-2.7.2/test-t/m_36_big5.t0000644000175000017500000000107610216765467012503 00000000000000/* m_36_big5.t: Handling of 0x5c in BigFive multi-byte character. */ #define str( a) # a /* 36.1: 0x5c in multi-byte character is not an escape character */ #pragma __setlocale( "big5") /* For MCPP */ #pragma setlocale( "chinese-traditional") /* For Visual C */ #if 'r' == '\xa6\x72' && '\' != '\xa5\x5c' Bad handling of '\\' in multi-byte character. #endif /* 36.ext: */ "\Z"; /* \xa5\x5c\xc1\x5a */ /* 36.2: # operater should not insert '\\' before 0x5c in multi-byte character. */ str( "\Z"); mcpp-2.7.2/test-t/e_31.t0000644000175000017500000000030110216765467011546 00000000000000/* e_31.t: Illegal macro calls. */ #define sub( a, b) (a - b) /* 31.1: Too many arguments error. */ sub( x, y, z); /* 31.2: Too few arguments error. */ sub( x); mcpp-2.7.2/test-t/u_1_8.t0000644000175000017500000000051410216765467011740 00000000000000/* u_1_8.t: Undefined behaviors on unterminated quotations (1). */ /* u.1.8: Unterminated character constant. */ /* The following "comment" may not interpreted as a comment but swallowed by the unterminated character constant. */ #error I can't understand. /* Token error prior to execution of #error. */ mcpp-2.7.2/test-t/n_3.t0000644000175000017500000000101710216765467011503 00000000000000/* n_3.t: Handling of comment. */ /* 3.1: A comment is converted to one space. */ /* abc de */ abc/* comment */de /* 3.2: // is not a comment of C. */ #if 0 /* This feature is obsolete now. */ /* // is not a comment of C */ // is not a comment of C #endif /* 3.3: Comment is parsed prior to the parsing of preprocessing directive. */ /* abcd */ #if 0 "nonsence"; /* #else still in comment */ #else #define MACRO_abcd /* in comment */ abcd #endif MACRO_abcd mcpp-2.7.2/test-t/nest7.h0000644000175000017500000000006510216765467012052 00000000000000/* nest7.h */ nest = 7; #include "nest8.h" mcpp-2.7.2/test-t/i_35_3.t0000644000175000017500000000034510216765467012010 00000000000000/* i_35_3.t: Multi-character wide character constant. */ /* In ASCII character set. */ /* 35.3: */ #if (L'ab' != L'\x61\x62') || (L'ab' == 'ab') Bad handling of multi-character wide character constant. #endif mcpp-2.7.2/test-t/u_cplus.t0000644000175000017500000000016110216765467012475 00000000000000/* u_cplus.t: C++: #undef or #define __cplusplus causes undefined behavior. */ #undef __cplusplus mcpp-2.7.2/test-t/e_ucn.t0000644000175000017500000000052110216765467012114 00000000000000/* e_ucn.t: Errors of Universal-character-name sequense. */ #define macro\U0000001F /* violation of constraint */ #define macro\uD800 /* violation of constraint (only C, not for C++) */ #define macro\u123 /* too short sequence (violation of syntax rule) */ #define macro\U1234567 /* also too short sequence */ mcpp-2.7.2/test-t/m_34_gb.t0000644000175000017500000000052110216765467012235 00000000000000/* m_34_gb.t: Multi-byte character constant encoded in GB-2312. */ /* 34.1: */ #pragma __setlocale( "gb2312") /* For MCPP */ #pragma setlocale( "chinese-simplified") /* For Visual C */ #if '' == '\xd7\xd6' Multi-byte character is encoded in GB-2312. #else I cannot understand GB-2312. #endif mcpp-2.7.2/test-t/u_1_25.t0000644000175000017500000000073210216765467012021 00000000000000/* u_1_25.t: Miscelaneous undefined macros. */ #define str( a) # a #define sub( x, y) (x - y) #define SUB sub /* u.1.25: Macro argument otherwise parsed as a directive. */ /* "#define NAME"; or other undefined behaviour. */ str( #define NAME ); #if 0 /* Added by C90: Corrigendum 1 (1994) and deleted by C99 */ /* u.1.26: Expanded macro replacement list end with name of function-like macro. */ SUB( a, b); #endif mcpp-2.7.2/test-t/n_tlimit.t0000644000175000017500000001627010216765467012652 00000000000000/* n_tlimit.t: Tests of translation limits of C99. */ /* n_tlim_1: Number of parameters of macro definition: at least 127. */ #define glue127( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## o7 /* n_tlim_2: Number of arguments of macro call: at least 127. */ /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6O7; */ glue127( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7); /* n_tlim_3: Significant initial characters in an internal identifier or a macro name: at least 63 bytes. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; /* n_tlim_4: Nested conditional inclusion: at least 63 level. */ /* ifdef_nest = 0x3f; */ #define X3F #include "ifdef15.h" /* n_tlim_5: Nested source file inclusion: at least 15 level. */ /* nest = 0x0f; */ #define X0F #include "nest1.h" /* n_tlim_6: Parenthesized expression: at least 63 level. */ /* nest = 63; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif /* n_tlim_7: Characters in a string (after concatenation) : at least 4095 bytes. */ /* 4095 bytes long. */ char *string4093 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; /* n_tlim_8: Length of logical source line: at least 4095 bytes. */ #include "long4095.h" /* n_tlim_9: Number of macro definitions: at least 4095. */ #undef ARG #include "m4095.h" /* 0x0fff; */ GBM; mcpp-2.7.2/test-t/n_post.t0000644000175000017500000004573710216765467012347 00000000000000/* * n_post.t * * 1998/08 made public kmatsui * 2002/08 revised not to conflict with C99 Standard kmatsui * * Samples to test "POST_STANDARD" mode of C preprocessing. * POST_STANDARD cpp must process these samples as shown in each comments. * POST_STANDARD cpp must process also #error directive properly, which is * not included here because the directive might cause translator to * terminate. */ #define ZERO_TOKEN #define TWO_ARGS a,b #define MACRO_0 0 #define MACRO_1 1 #define sub( x, y) (x - y) #define str( a) # a #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) /* n_2.t: Line splicing by sequence. */ /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ /* ab + cd + ef ; */ #define FUNC( a, b, c) \ a + b + c FUNC( ab, cd, ef); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ /* ab + cd + ef ; */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c FUNC( ab, cd, ef); /* 2.3: In a string literal. */ /* "abcde" */ "abc\ de" /* 2.4: in midst of an identifier. */ /* abcde */ abc\ de /* n_3.t: Handling of comment. */ /* 3.1: A comment is converted to one space. */ /* abc de */ abc/* comment */de /* 3.2: // is not a comment of C. */ #if 0 /* This feature is obsolete now. */ /* / / is not a comment of C */ // is not a comment of C #endif /* 3.3: Comment is parsed prior to the parsing of preprocessing directive. */ /* abcd */ #if 0 "nonsence"; /* #else still in comment */ #else #define MACRO_abcd /* in comment */ abcd #endif MACRO_abcd /* n_4.t: Special tokens. */ /* 4.1: Digraph spellings in directive line. */ /* "abc" ; */ %: define stringize( a) %: a stringize( abc); /* 4.2: Digraph spellings are converted in translation phase 1. */ /* "[" ; */ stringize( <:); /* n_5.t: Spaces or tabs are allowed at any place in pp-directive line, including between the top of a pp-directive line and '#', and between the '#' and the directive. */ /* 5.1: */ /* |**|[TAB]# |**|[TAB]define |**| MACRO_abcde[TAB]|**| abcde |**| */ /**/ # /**/ define /**/ MACRO_abcde /**/ abcde /**/ /* abcde */ MACRO_abcde /* n_6.t: #include directive. */ /* 6.1: Header-name quoted by " and " as well as by < and > can include standard headers. */ /* Note: Standard headers can be included any times. */ #include "ctype.h" #include /* An obsolescent feature. */ /* 6.2: Macro is allowed in #include line. */ #define HEADER "header.h" /* Before file inclusion: #include "header.h" */ #include HEADER /* abc */ MACRO_abc /* 6.3: With macro nonsence but legal. */ #undef MACRO_abc #include ZERO_TOKEN HEADER ZERO_TOKEN /* abc */ MACRO_abc /* n_7.t: #line directive. */ /* 7.1: Line number and filename. */ /* 1234 ; "cpp" ; */ #line 1234 "cpp" __LINE__; __FILE__; /* 7.2: Filename argument is optional. */ /* 2345 ; "cpp" ; */ #line 2345 __LINE__; __FILE__; /* 7.3: Argument with macro. */ /* 3456 ; "n_7.t" ; */ #define LINE_AND_FILENAME 3456 "n_7.t" #line LINE_AND_FILENAME __LINE__; __FILE__; /* Restore to correct line number and filename. */ #line 149 "n_post.t" /* n_9.t: #pragma directive. */ /* 9.1: Any #pragma directive should be processed or ignored, should not be diagnosed as an error. */ #pragma once #pragma who knows ? /* n_10.t: #if, #elif, #else and #endif pp-directive. */ /* 10.1: */ /* Note: an undefined identifier in #if expression is replaced to 0. */ /* 1 ; */ #if a a; #elif MACRO_0 MACRO_0; #elif MACRO_1 /* Valid block */ MACRO_1; #else 0; #endif /* 10.2: Comments must be processed even if in skipped #if block. */ /* At least tokenization of string literal and character constant is necessary to process comments, e.g. /* is not a comment mark in string literal. */ #ifdef UNDEFINED /* Comment */ "in literal /* is not a comment" #endif /* n_11.t: Operator "defined" in #if or #elif directive. */ /* 11.1: */ #undef MACRO_abc #define MACRO_abc abc /* abc ; */ /* abc ; */ #if defined a a; #else MACRO_abc; #endif #if defined (MACRO_abc) MACRO_abc; #else 0; #endif /* 11.2: "defined" is an unary operator whose result is 1 or 0. */ #if defined MACRO_0 * 3 != 3 Bad handling of "defined" operator. #endif #if (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1) Bad grouping of "defined", !, - operator. #endif /* n_12.t: Integer preprocessing number token and type of #if expression. */ #include "limits.h" /* 12.1: Type long. */ #if LONG_MAX <= LONG_MIN Bad evaluation of long. #endif #if LONG_MAX <= 1073741823 /* 0x3FFFFFFF */ Bad evaluation of long. #endif /* 12.2: Type unsigned long. */ #if ULONG_MAX / 2 < LONG_MAX Bad evaluation of unsigned long. #endif /* 12.3: Octal number. */ #if 0177777 != 65535 Bad evaluation of octal number. #endif /* 12.4: Hexadecimal number. */ #if 0Xffff != 65535 || 0xFfFf != 65535 Bad evaluation of hexadecimal number. #endif /* 12.5: Suffix 'L' or 'l'. */ #if 0L != 0 || 0l != 0 Bad evaluation of 'L' suffix. #endif /* 12.6: Suffix 'U' or 'u'. */ #if 1U != 1 || 1u != 1 Bad evaluation of 'U' suffix. #endif /* n_13.t: Valid operators in #if expression. */ /* Valid operators are (precedence in this order) : defined, (unary)+, (unary)-, ~, !, *, /, %, +, -, <<, >>, <, >, <=, >=, ==, !=, &, ^, |, &&, ||, ? : */ /* 13.1: Bit shift. */ #if 1 << 2 != 4 || 8 >> 1 != 4 Bad arithmetic of <<, >> operators. #endif /* 13.2: Bitwise operators. */ #if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 Bad arithmetic of ^, |, & operators. #endif /* 13.3: Result of ||, && operators is either of 1 or 0. */ #if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 Bad arithmetic of ||, && operators. #endif /* 13.4: ?, : operator. */ #if (0 ? 1 : 2) != 2 Bad arithmetic of ?: operator. #endif /* n_13_5.t: Arithmetic conversion in #if expressions. */ /* 13.5: The usual arithmetic conversion is not performed on bit shift. */ #if -1 << 3U > 0 Bad conversion of bit shift operands. #endif /* 13.6: Usual arithmetic conversions. */ #if -1 <= 0U /* -1 is converted to unsigned long. */ Bad arithmetic conversion. #endif #if -1 * 1U <= 0 Bad arithmetic conversion. #endif /* Second and third operands of conditional operator are converted to the same type, thus -1 is converted to unsigned long. */ #if (1 ? -1 : 0U) <= 0 Bad arithmetic conversion. #endif /* n_13_7.t: Short-circuit evaluation of #if expression. */ /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error cannot occur. */ /* Valid block */ #if 0 && 10 / 0 Block to be skipped #endif #if not_defined && 10 / not_defined Block to be skipped #endif #if MACRO_0 && 10 / MACRO_0 > 1 Block to be skipped #endif #if MACRO_0 ? 10 / MACRO_0 : 0 Block to be skipped #endif #if MACRO_0 == 0 || 10 / MACRO_0 > 1 Valid block #else Block to be skipped #endif /* n_13_8.t: Grouping of sub-expressions in #if expression. */ /* 13.8: Unary operators are grouped from right to left. */ #if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) Bad grouping of -, +, !, ~ in #if expression. #endif /* 13.9: ?: operators are grouped from right to left. */ #if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 Bad grouping of ? : in #if expression. #endif /* 13.10: Other operators are grouped from left to right. */ #if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) Bad grouping of >>, << in #if expression. #endif /* 13.11: Test of precedence. */ #if 3*10/2 >> !0*2 >> !+!-9 != 1 Bad grouping of -, +, !, *, /, >> in #if expression. #endif /* 13.12: Overall test. Grouped as: ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) ? 7 : 0) != 7 evaluated to FALSE. */ #if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 Bad arithmetic of #if expression. #endif /* n_13_13.t: #if expression with macros. */ #define and && #define or || #define not_eq != #define bitor | /* 13.13: With macros expanding to operators. */ /* Valid block */ #if (1 bitor 2) == 3 and 4 not_eq 5 or 0 /* #if (1 | 2) == 3 && 4 != 5 || 0 */ Valid block #else Block to be skipped #endif /* 13.14: With macros expanding to 0 token, nonsence but legal expression.*/ /* Valid block */ #if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN /* #if 1 > 0 */ Valid block #else Block to be skipped #endif /* n_15.t: #ifdef, #ifndef directives. */ /* 15.1: #ifdef directive. */ /* Valid block */ #ifdef MACRO_1 Valid block #else Block to be skipped #endif /* 15.2: #ifndef directive. */ /* Valid block */ #ifndef MACRO_1 Block to be skipped #else Valid block #endif /* n_18.t: #define directive. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* 18.1: Definition of an object-like macro. */ /* ( 1 - 1 ) ; */ OBJ_LIKE; /* 18.2: Definition of a function-like macro. */ /* ( c ) ; */ FTN_LIKE( c); /* 18.3: Spelling in string identical to parameter is not a parameter. */ /* "n1:n2" ; */ #define STR( n1, n2) "n1:n2" STR( 1, 2); /* n_19.t: Valid re-definitions of macros. */ /* 19.1: */ #define OBJ_LIKE /* white space */ (1-1) /* other */ /* 19.2: */ #define FTN_LIKE( a )( /* note the white space */ \ a /* other stuff on this line */ ) /* 19.4: */ #define OBJ_LIKE (1 - 1) /* different white space */ /* 19.6: */ #define FTN_LIKE(b) ( b ) /* different parameter spelling */ /* ( c ) ; */ FTN_LIKE( c); /* n_20.t: Definition of macro lexically identical to keyword. */ /* 20.1: */ /* double fl ; */ #define float double float fl; /* n_21.t: Tokenization (No preprocessing tokens are merged implicitly). */ /* 21.1: */ /* - - - a ; */ #define MINUS - -MINUS-a; /* n_22.t: Tokenization of preprocessing number. */ #define EXP 1 /* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */ /* 12E+EXP ; */ 12E+EXP; /* 22.2: .2e-EXP is also a preprocessing number. */ /* .2e-EXP ; */ .2e-EXP; /* 22.3: + or - is allowed only following E or e, 12+EXP is not a preprocessing number. */ /* Three tokens: 12 + 1 ; */ 12+EXP; /* n_23.t: ## operator in macro definition. */ /* 23.1: */ /* xy ; */ glue( x, y); /* 23.2: Generate a preprocessing number. */ /* .12e+2 ; */ #undef EXP #define EXP 2 xglue( .12e+, EXP); /* n_24.t: # operator in macro definition. */ /* 24.1: */ /* "a + b" ; */ str( a+b); /* 24.2: White spaces between tokens of operand are converted to one space. */ /* "ab + cd" ; */ str( ab /* comment */ + cd ); /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ /* "'\"' + \"' \\\"\"" ; */ str( '"' + "' \""); /* 24.4: Line splicing by is done prior to token parsing. */ /* "\"abc\"" ; */ str( "ab\ c"); /* n_25.t: Macro arguments are pre-expanded (unless the argument is an operand of # or ## operator) separately, that is, macro-replaced completely prior to rescanning. */ /* 25.1: "TWO_ARGS" is read as one argument to "sub", then expanded to "a , b", then "x" is substituted by "a , b". */ /* ( a , b - 1 ) ; */ sub( TWO_ARGS, 1); /* 25.2: An argument pre-expanded to 0-token. */ /* ( - 1 ) ; */ sub( ZERO_TOKEN, 1); /* 25.3: "glue( a, b)" is pre-expanded. */ /* abc ; */ xglue( glue( a, b), c); /* 25.4: Operands of ## operator are not pre-expanded. */ /* MACRO_0MACRO_1 ; */ glue( MACRO_0, MACRO_1); /* 25.5: Operand of # operator is not pre-expanded. */ /* "ZERO_TOKEN" ; */ str( ZERO_TOKEN); /* n_26.t: The name once replaced is not furthur replaced. */ /* 26.1: Directly recursive object-like macro definition. */ /* Z [ 0 ] ; */ #define Z Z[0] Z; /* 26.2: Intermediately recursive object-like macro definition. */ /* AB ; */ #define AB BA #define BA AB AB; /* 26.3: Directly recursive function-like macro definition. */ /* x + f ( x ) ; */ #define f(a) a + f(a) f( x); /* 26.4: Intermediately recursive function-like macro definition. */ /* x + x + g ( x ) ; */ #define g(a) a + h( a) #define h(a) a + g( a) g( x); /* 26.5: Rescanning encounters the non-replaced macro name. */ /* Z [ 0 ] + f ( Z [ 0 ] ) ; */ f( Z); /* n_27.t: Rescanning of a macro expand any macro call in the replacement text after substitution of parameters by pre-expanded-arguments. This re-examination does not involve the succeding sequences from the source file. */ /* 27.1: Cascaded use of object-like macros. */ /* 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 ; */ #define NEST8 NEST7 + 8 #define NEST7 NEST6 + 7 #define NEST6 NEST5 + 6 #define NEST5 NEST4 + 5 #define NEST4 NEST3 + 4 #define NEST3 NEST2 + 3 #define NEST2 NEST1 + 2 #define NEST1 1 NEST8; /* 27.2: Cascaded use of function-like macros. */ /* ( 1 ) + ( 1 + 2 ) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4 ; */ #define FUNC4( a, b) FUNC3( a, b) + NEST4 #define FUNC3( a, b) FUNC2( a, b) + NEST3 #define FUNC2( a, b) FUNC1( a, b) + NEST2 #define FUNC1( a, b) (a) + (b) FUNC4( NEST1, NEST2); /* 27.3: An identifier generated by ## operator is subject to expansion. */ /* 1 ; */ glue( MACRO_, 1); #define head sub( #define math( op, a, b) op( (a), (b)) #define SUB sub /* 27.4: "sub" as an argument of math() is not pre-expanded, since '(' is missing. */ /* ( ( a ) - ( b ) ) ; */ math( sub, a, b); /* 27.5: Object-like macro expanded to name of a function-like macro. */ /* sub ( a , b ) ; */ SUB( a, b); /* n_28.t: __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and __STDC_VERSION__ are predefined. */ /* 28.1: */ /* "n_post.t" ; */ __FILE__; /* 28.2: */ /* 629 ; */ __LINE__; /* 28.3: */ /* "Aug 1 2001"; */ __DATE__; /* 28.4: */ /* "21:42:22" ; */ __TIME__; /* 28.5: */ /* 1 ; */ __STDC__; /* 28.6: */ /* 199409L ; */ /* In C99, the value of this macro is 199901L */ __STDC_VERSION__; /* 28.7: __LINE__, __FILE__ in an included file. */ /* 3 ; "line.h" ; */ #include "line.h" /* n_29.t: #undef directive. */ /* 29.1: Undefined macro is not a macro. */ /* DEFINED ; */ #define DEFINED #undef DEFINED DEFINED; /* 29.2: Undefining undefined name is not an error. */ #undef UNDEFINED /* n_30.t: Macro call. */ /* Note: Comma separate the arguments of function-like macro call, but comma between matching inner parenthesis doesn't. This feature is tested on so many places in this suite especially on *.c samples which use assert() macro, that no separete item to test this feature is provided. */ /* 30.1: A macro call may cross the lines. */ #define FUNC( a, b, c) a + b + c /* a + b + c ; */ FUNC ( a, b, c ) ; /* n_37.t: Translation limits. */ /* 37.1: Number of parameters in macro: at least 31. */ #define glue31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E /* 37.2: Number of arguments of macro call: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcde ; */ glue31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R , S, T, U, V, W, X, Y, Z, a, b, c, d, e); /* 37.3: Significant initial characters in an internal identifier or a macro name: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ ; */ ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; /* 37.4: Nested conditional inclusion: at least 8 levels. */ /* nest = 8 ; */ #ifdef A #else # ifdef B # else # ifdef C # else # ifdef D # else # ifdef E # else # ifdef F # else # ifdef G # else # ifdef H # else nest = 8; # endif # endif # endif # endif # endif # endif # endif #endif /* 37.5: Nested source file inclusion: at least 8 levels. */ /* nest = 1 ; nest = 2 ; nest = 3 ; nest = 4 ; nest = 5 ; nest = 6 ; nest = 7 ; nest = 8 ; */ #define X8 #include "nest1.h" /* 37.6: Parenthesized expression: at least 32 levels. */ /* nest = 32 ; */ #if 0 + (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 + 0)))))))))) \ )))))))))))))))))))))) == 0 nest = 32; #endif /* 37.7: Characters in a string (after concatenation): at least 509. */ "123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 012345678901234567" ; /* 37.8: Characters in a logical source line: at least 509. */ int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int A123456789012345678901234567890 = 123456; \ int B123456789012345678901234567890 = 123457; \ int C123456789012345678901234567890 = 123458; \ int D1234567890123456789012 = 123459; /* 37.9: Macro definitions: at least 1024. */ #define X0400 #include "m4095.h" /* 0x0400; */ BNJ; mcpp-2.7.2/test-t/nest13.h0000644000175000017500000000004310216765467012123 00000000000000/* nest13.h */ #include "nest14.h" mcpp-2.7.2/test-t/n_nularg.t0000644000175000017500000000135010216765467012631 00000000000000/* n_nularg.t: Empty argument of macro call. */ #define ARG( a) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( CON, )", "CON"); */ SHOWS( APPEND( CON, )); /* printf( "%s : %s\n", "APPEND( , )", ""); */ SHOWS( APPEND( , )); mcpp-2.7.2/test-t/e_operat.cc0000644000175000017500000000036210216765467012746 00000000000000/* e_operat.t */ /* * In C++98 the 11 identifier-like tokens are operators, not identifiers. * Note: in C95 these are defined as macros by . */ /* Cannot define operator as a macro. */ #define and && #define xor_eq ^= mcpp-2.7.2/test-t/n_13_13.t0000644000175000017500000000130510216765467012067 00000000000000/* n_13_13.t: #if expression with macros. */ #define ZERO_TOKEN #define MACRO_0 0 #define MACRO_1 1 #if ! __cplusplus #define and && #define or || #define not_eq != #define bitor | #endif /* 13.13: With macros expanding to operators. */ /* Valid block */ #if (1 bitor 2) == 3 and 4 not_eq 5 or 0 /* #if (1 | 2) == 3 && 4 != 5 || 0 */ Valid block #else Block to be skipped #endif /* 13.14: With macros expanding to 0 token, nonsence but legal expression.*/ /* Valid block */ #if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN /* #if 1 > 0 */ Valid block #else Block to be skipped #endif mcpp-2.7.2/test-t/e_intmax.t0000644000175000017500000000061210441602103012601 00000000000000/* e_intmax.t: Overflow of constant expression in #if directive. */ #include #include #if INTMAX_MAX - INTMAX_MIN #endif #if INTMAX_MAX + 1 > SHRT_MAX #endif #if INTMAX_MIN - 1 #endif #if INTMAX_MAX * 2 #endif #if LLONG_MAX - LLONG_MIN #endif #if LLONG_MAX + 1 > SHRT_MAX #endif #if LLONG_MIN - 1 #endif #if LLONG_MAX * 2 #endif mcpp-2.7.2/test-t/n_24.t0000644000175000017500000000155610216765467011576 00000000000000/* n_24.t: # operator in macro definition. */ #define str( a) # a /* 24.1: White spaces should not be inserted (silly specification). */ /* "a+b"; */ str( a+b); /* 24.2: White spaces between tokens of operand are converted to one space. */ /* "ab + cd"; */ str( ab /* comment */ + cd ); /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ /* "'\"' + \"' \\\"\""; */ str( '"' + "' \""); /* 24.4: Line splicing by is done prior to token parsing. */ /* "\"abc\""; */ str( "ab\ c"); /* 24.5: Token separator inserted by macro expansion should be removed. (Meanwhile, tokens should not be merged. See 21.2.) */ #define xstr( a) str( a) #define f(a) a /* "x-y"; */ xstr( x-f(y)); mcpp-2.7.2/test-t/e_35_2.t0000644000175000017500000000020610216765467011777 00000000000000/* e_35_2.t: Out of range of character constant. */ /* 35.2: */ #if 'abcdefghi' /* Perhaps out of range. */ #endif mcpp-2.7.2/test-t/m_36_sjis.t0000644000175000017500000000120510216765467012617 00000000000000/* m_36_sjis.t: Handling of 0x5c in shift-JIS multi-byte character. */ #define str( a) # a /* 36.1: 0x5c in multi-byte character is not an escape character */ #pragma __setlocale( "sjis") /* For MCPP */ #pragma setlocale( "japanese") /* For Visual C */ #if '' == '\x8e\x9a' && '\' != '\x95\x5c' Bad handling of '\\' in multi-byte character. #endif /* 36.ext and 36.2 are expanded to: "\"; "\"\\""; or "\\"; "\"\\\""; */ /* 36.ext: */ "\"; /* 36.2: # operater should not insert '\\' before 0x5c in multi-byte character. */ str( "\"); mcpp-2.7.2/test-t/unbal4.h0000644000175000017500000000003310216765467012172 00000000000000/* unbal4.h */ int unbal4\ mcpp-2.7.2/test-t/nest12.h0000644000175000017500000000004310216765467012122 00000000000000/* nest12.h */ #include "nest13.h" mcpp-2.7.2/test-t/warns.t0000644000175000017500000001313510216765467012162 00000000000000/* * warns.t: * 1998/08 made public kmatsui * 2002/12 slightly modified kmatsui * 2003/11 added a few samples kmatsui */ /* * The following texts are legal but suspicious ones. Good preprocessor * will warn at these texts. */ /* w.1.1: "/*" in comment. */ /* comment /* nested comment and no closing */ /* w.1.2: Rescanning of replacement text involves succeding text. */ #define sub( x, y) (x - y) #define head sub( int a = 1, b = 2, c; c = head a,b ); #define OBJECT_LIKE FUNCTION_LIKE #define FUNCTION_LIKE( x, y) (x + y) c = OBJECT_LIKE( a, b); /* (a + b) */ /* w.2.1: Negative number converted to positive in #if expression. */ #if -1 < 0U #endif /* w.2.2: Out of range of unsigned type (wraps around and never overflow) in #if expression. */ #if 0U - 1 #endif /* * The following texts are legal but non-portable ones, since these requires * translation limits greater than the minima quaranteed by C90. Good * preprocessor will warn at these texts (at least when user wants), unless * it diagnose these as errors. */ /* w.3.1: Number of parameters in macro: more than 31. */ #define glue63( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ o0 ## o1 ## o2 ## o3 ## p0 ## p1 ## p2 /* w.3.2: Number of arguments in macro call: more than 31. */ /* A0B0C0D0E0F0G0H0O0O1O2O3P0P1P2; */ glue63( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3); /* w.3.3: Initial significant characters in an identifier: more than 31. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; /* w.3.4: Nested conditional inclusion: more than 8 levels. */ #define X0F /* nest = 0x0f; */ #include "ifdef15.h" /* w.3.5: Nested source file inclusion: more than 8 levels. */ #define X0F /* nest = 0x0f; */ #include "nest1.h" /* w.3.6: Parenthesized expression: more than 32 levels. */ /* nest = 63; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif /* w.3.7: Characters in a string (after concatenation): more than 509. */ char *string1023 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" ; /* w.3.8: Characters in a logical source line: more than 509. */ int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int g123456789012345678901234567890 = 123456; \ int h123456789012345678901234567890 = 123457; \ int i123456789012345678901234567890 = 123458; \ int j123456789012345678901234567890 = 123459; \ int k123456789012345678901234567890 = 123460; \ int l123456789012345678901234567890 = 123461; \ int m123456789012345678901234567890 = 123462; \ int n123456789012345678901234567890 = 123463; \ int o123456789012345678901234567890 = 123464; \ int p123456789012345678901234567890 = 123465; \ int q123456789012345678901234567890 = 123466; \ int r123456789012345678901234567890 = 123467; \ int s123456789012345678901234567890 = 123468; \ int t1234567890123456 = 123469; /* w.3.9: Macro definitions: more than 1024 (including predefined ones). */ #define X0400 #include "m4095.h" /* 0x0400; */ BNJ; mcpp-2.7.2/test-t/nest15.h0000644000175000017500000000006310216765467012127 00000000000000/* nest15.h */ #ifdef X0F nest = 0x0f; #endif mcpp-2.7.2/test-t/m_34_jis.t0000644000175000017500000000065610216765467012443 00000000000000/* m_34_jis.t: Multi-byte character constant encoded in ISO-2022-JP. */ /* 34.1: */ #pragma __setlocale( "jis") /* For MCPP */ #pragma setlocale( "jis") /* For MCPP on VC */ #if '$B;z(B' == '\x3b\x7a' /* This line doesn't work unless "shift states" are processed. */ Multi-byte character is encoded in ISO-2022-JP. #else I cannot understand ISO-2022-JP. #endif mcpp-2.7.2/test-t/u_1_5.t0000644000175000017500000000061410216765467011736 00000000000000/* u_1_5.t: Undefined behaviors on illegal characters. */ /* u.1.5: Illegal characters (in other than string literal, character constant, header-name or comment). */ #if 1 ||2 /* 0x1e ^ ^ 0x1f */ #endif /* Maybe the second error. */ /* u.1.6: [VT], [FF] in directive line. */ #if 1 || 2 /* [VT] ^ ^ [FF] */ #endif /* Maybe the second error. */ mcpp-2.7.2/test-t/u_1_17.t0000644000175000017500000000144410216765467012023 00000000000000/* u_1_17.t: Undefined behaviors on out-of-range #line number. */ /* u.1.17: Line number argument of #line directive should be in range of [1,32767]. */ /* In C99, range of line number is [1,2147483647] */ #if __STDC_VERSION__ < 199901L #line 32767 /* valid here */ /* line 32767 */ /* line 32768 ? : out of range */ __LINE__; /* 32769 ? or -32767 ?, maybe warned as an out-of-range */ #line 0 #line 32768 #else #line 2147483647 /* valid here */ /* line 2147483647 */ /* line 2147483648 ? : out of range */ __LINE__; /* 2147483649 ? or -2147483647 ?, maybe warned as an out-of-range */ #line 0 #line 2147483648 #endif /* u.1.18: Line number argument of #line directive should be written in decimal digits. */ #line 0x1000 mcpp-2.7.2/test-t/u_1_7_sjis.t0000644000175000017500000000050310216765467012765 00000000000000/* u_1_7_sjis.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "japanese") /* For Visual C */ #pragma __setlocale( "sjis") /* For MCPP */ str( "8"); /* 0x9138 */ mcpp-2.7.2/test-t/n_bool.cc0000644000175000017500000000055210216765467012421 00000000000000/* bool.t */ /* * On C++: 'true' and 'false' are evaluated 1 and 0 respectively. * and logical AND, logical OR are evaluated boolean. */ /* Valid block; */ #define MACRO 1 #define MACRO3 3 #if MACRO == true Valid block; #else non-Valid block; #endif #if (MACRO && MACRO3) == true Valid block; #else non-Valid block; #endif mcpp-2.7.2/test-t/u_1_7_ksc.t0000644000175000017500000000047710216765467012607 00000000000000/* u_1_7_ksc.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "korean") /* For Visual C */ #pragma __setlocale( "ksc5601") /* For MCPP */ str( ""); /* 0xb1a0 */ mcpp-2.7.2/test-t/n_22.t0000644000175000017500000000064310216765467011570 00000000000000/* n_22.t: Tokenization of preprocessing number. */ #define EXP 1 /* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */ /* 12E+EXP; */ 12E+EXP; /* 22.2: .2e-EXP is also a preprocessing number. */ /* .2e-EXP; */ .2e-EXP; /* 22.3: + or - is allowed only following E or e, 12+EXP is not a preprocessing number. */ /* Three tokens: 12 + 1; */ 12+EXP; mcpp-2.7.2/test-t/pragmas.h0000644000175000017500000000117610216765467012450 00000000000000/* pragmas.h based on the proposal to C99 by Bill Homer */ #if defined(Machine_A) /* Request fastest calling sequence for machine A */ # define Fast_call \ _Pragma("fast_call") #elif defined(Machine_B) /* Request fastest calling sequence for machine B */ # define Fast_call \ _Pragma("vfunction") #else # define Fast_call #endif #if defined(Machine_B) /* Vectorization hint (ignore vector dependencies) */ # define Independent _Pragma("ivdep") #elif defined(Machine_C) /* Parallelization hint (iterations are independent) */ # define Independent _Pragma("independent") #else # define Independent #endif mcpp-2.7.2/test-t/u_1_27.t0000644000175000017500000000026410216765467012023 00000000000000/* u_1_27.t: Pseudo-directive-line. */ /* u.1.27: Unknown preprocessing directive (other than #pragma). */ #ifdefined MACRO #endif /* The second error. */ mcpp-2.7.2/test-t/e_pragma.t0000644000175000017500000000024210216765467012576 00000000000000/* e_pragma.t: Erroneous use of _Pragma() operator */ /* Operand of _Pragma() should be a string literal */ _Pragma( This is not a string literal) mcpp-2.7.2/test-t/n_ppnum.t0000644000175000017500000000030010216765467012472 00000000000000/* n_ppnum.t: Preprocessing number token *p+* */ /* Undefined on C90, because '+A' is not a valid pp-token. */ #define A 3 #define glue( a, b) a ## b /* 12p+A; */ glue( 12p+, A); mcpp-2.7.2/test-t/e_14_10.t0000644000175000017500000000052010441601440012026 00000000000000/* e_14_10.t: Overflow of constant expression in #if directive. */ /* 14.10: */ /* In C99, #if expression is evaluated in intmax_t */ #if __STDC_VERSION__ < 199901L #include #if LONG_MAX - LONG_MIN #endif #if LONG_MAX + 1 > SHRT_MAX #endif #if LONG_MIN - 1 #endif #if LONG_MAX * 2 #endif #endif mcpp-2.7.2/test-t/nest5.h0000644000175000017500000000006510216765467012050 00000000000000/* nest5.h */ nest = 5; #include "nest6.h" mcpp-2.7.2/test-t/nest4.h0000644000175000017500000000006510216765467012047 00000000000000/* nest4.h */ nest = 4; #include "nest5.h" mcpp-2.7.2/test-t/n_18.t0000644000175000017500000000103710216765467011573 00000000000000/* n_18.t: #define directive. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) #define ZERO_TOKEN /* 18.1: Definition of an object-like macro. */ /* (1-1); */ OBJ_LIKE; /* Macro defined to no token. */ /* ; */ ZERO_TOKEN; /* 18.2: Definition of a function-like macro. */ /* ( c ); */ FTN_LIKE( c); /* 18.3: Spelling in string identical to parameter is not a parameter. */ /* "n1:n2"; */ #define STR( n1, n2) "n1:n2" STR( 1, 2); mcpp-2.7.2/test-t/u_1_7_utf8.t0000644000175000017500000000063610760723604012701 00000000000000/* u_1_7_utf8.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma __setlocale( "utf8") /* For MCPP */ str( "字"); /* 0xe5ad97 : legal */ str( ""); /* 0xc0af : overlong */ str( ""); /* 0xe09fbf : overlong */ str( ""); /* 0xeda080 : UTF-16 surrogate */ mcpp-2.7.2/test-t/n_37.t0000644000175000017500000000622310216765467011576 00000000000000/* n_37.t: Translation limits. */ /* 37.1: Number of parameters in macro: at least 31. */ #define glue31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E /* 37.2: Number of arguments of macro call: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcde; */ glue31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R , S, T, U, V, W, X, Y, Z, a, b, c, d, e); /* 37.3: Significant initial characters in an internal identifier or a macro name: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; */ ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; /* 37.4: Nested conditional inclusion: at least 8 levels. */ /* nest = 8; */ #ifdef A #else # ifdef B # else # ifdef C # else # ifdef D # else # ifdef E # else # ifdef F # else # ifdef G # else # ifdef H # else nest = 8; # endif # endif # endif # endif # endif # endif # endif #endif /* 37.5: Nested source file inclusion: at least 8 levels. */ #define X8 /* nest = 1; nest = 2; nest = 3; nest = 4; nest = 5; nest = 6; nest = 7; nest = 8; */ #include "nest1.h" /* 37.6: Parenthesized expression: at least 32 levels. */ /* nest = 32; */ #if 0 + (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 + 0)))))))))) \ )))))))))))))))))))))) == 0 nest = 32; #endif /* 37.7: Characters in a string (after concatenation): at least 509. */ "123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 012345678901234567" ; /* 37.8: Characters in a logical source line: at least 509. */ int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int A123456789012345678901234567890 = 123456; \ int B123456789012345678901234567890 = 123457; \ int C123456789012345678901234567890 = 123458; \ int D1234567890123456789012 = 123459; /* 37.9: Macro definitions: at least 1024. */ #define X0400 #include "m4095.h" /* 0x0400; */ BNJ; mcpp-2.7.2/test-t/e_post.t0000644000175000017500000001532010216765467012317 00000000000000/* * e_post.t * * 1998/08 made public kmatsui * 2002/08 revised not to conflict with C99 Standard kmatsui * 2003/11 added a few samples kmatsui * * Samples to test "POST_STANDARD" mode of C preprocessing. * POST_STANDARD cpp must diagnose all of these samples appropriately. */ /* e_4_3.t: Illegal pp-token. */ /* 4.3: Empty character constant is an error. */ #if '' == 0 /* This line is invalid, maybe skipped. */ #endif /* This line maybe the second error. */ /* e_7_4.t: #line error. */ /* 7.4: string literal in #line directive shall be a character string literal. */ #line 123 L"wide" /* 27 ; "e_post.t" ; */ __LINE__; __FILE__; /* e_12_7.t: Out of range of integer pp-token in #if expression. */ /* 12.7: Preprocessing number perhaps out of range of unsigned long. */ #if 123456789012345678901 #endif /* e_14.t: Illegal #if expressions. */ #define A 1 #define B 1 /* 14.1: String literal is not allowed in #if expression. */ #if "string" #endif /* The second error ? */ /* 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. */ #if A = B #endif #if A++ B #endif #if A --B #endif #if A.B #endif /* 14.3: Unterminated #if expression. */ #if ( (A == B) #endif /* 14.4: Unbalanced parenthesis in #if defined operator. */ #if defined ( MACRO #endif /* 14.5: No argument. */ #if #endif /* 14.6: Macro expanding to 0 token in #if expression. */ #define ZERO_TOKEN #if ZERO_TOKEN #endif /* e_14_7.t: There is no keyword in #if expression. */ /* 14.7: sizeof operator is disallowed. */ /* Evaluated as: 0 (0) Constant expression syntax error. */ #if sizeof (int) #endif /* 14.8: type cast is disallowed. */ /* Evaluated as: (0)0x8000 Also a constant expression error. */ #if (int)0x8000 < 0 #endif /* e_14_9.t: Out of range in #if expression (division by 0). */ /* 14.9: Divided by 0. */ #if 1 / 0 #endif /* e_14_10.t: Overflow of constant expression in #if directive. */ /* 14.10: */ /* In C99, #if expression is evaluated in intmax_t */ #if __STDC_VERSION__ < 199901L #include #if LONG_MAX - LONG_MIN #endif #if LONG_MAX + 1 #endif #if LONG_MIN - 1 #endif #if LONG_MAX * 2 #endif #endif /* e_15_3.t: #ifdef, #ifndef syntax errors. */ /* 15.3: Not an identifier. */ #ifdef "string" #endif #ifdef 123 #endif /* 15.4: Excessive token sequence. */ #ifdef ZERO_TOKEN Junk #endif /* 15.5: No argument. */ #ifndef #endif /* e_16.t: Trailing junk of #else, #endif. */ /* 16.1: Trailing junk of #else. */ #define MACRO_0 0 #if MACRO_0 #else MACRO_0 /* 16.2: Trailing junk of #endif. */ #endif MACRO_0 /* e_17.t: Ill-formed group in a source file. */ #define MACRO_1 1 /* 17.1: Error of #endif without #if. */ #endif /* 17.2: Error of #else without #if. */ #else /* 17.3: Error of #else after #else. */ #if MACRO_1 #else /* line 154 */ #if 1 #else #endif #else #endif /* 17.4: Error of #elif after #else. */ #if MACRO_1 == 1 #else /* line 163 */ #elif MACRO_1 == 0 #endif /* 17.5: Error of #endif without #if in an included file. */ #if 1 #include "unbal1.h" /* 17.6: Error of unterminated #if section in an included file. */ #include "unbal2.h" #endif /* 17.7: Error of unterminated #if section. */ /* This error would be diagnosed at end of file. */ #if MACRO_1 == 0 /* line 177 */ #else /* e_18_4.t: #define syntax errors. */ /* 18.4: Not an identifier. */ #define "string" #define 123 /* 18.5: No argument. */ #define /* 18.6: Empty parameter list. */ #define math( op, a, ) op( (a), (b)) /* 18.7: Duplicate parameter names. */ #define math( op, a, a) op( (a), (b)) /* 18.8: Argument is not an identifier. */ #define NUMARGS( 1, +, 2) (1 + 2) /* e_19_3.t: Redefinitions of macros. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* The following redefinitions should be diagnosed. */ /* 19.3: */ #define OBJ_LIKE (0) /* different token sequence */ /* ( 1 - 1 ) ; or ( 0 ) ; */ OBJ_LIKE; /* 19.5: */ #define FTN_LIKE(b) ( a ) /* different parameter usage */ /* ( x ) ; or ( a ) ; */ FTN_LIKE(x); /* 19.7: Not in ISO C "Examples" */ #define FTN_LIKE OBJ_LIKE /* e_23_3.t: ## operator shall not occur at the beginning or at the end of replacement list for either form of macro definition. */ /* 23.3: In object-like macro. */ #define con ## name #define cat 12 ## /* 23.4: In function-like macro. */ #define CON( a, b) ## a ## b #define CAT( b, c) b ## c ## /* e_24_6.t: Operand of # operator in function-like macro definition shall be a parameter name. */ /* 24.6: */ #define FUNC( a) # b /* e_25_6.t: Macro arguments are pre-expanded separately. */ /* 25.6: */ #define sub( x, y) (x - y) #define head sub( #define body(x,y) x,y #define tail ) #define head_body_tail( a, b, c) a b c /* "head" is once replaced to "sub(", then rescanning of "sub(" causes an uncompleted macro call. Expansion of an argument should complete within the argument. */ head_body_tail( head, body(a,b), tail); /* e_27_7.t: Error of rescanning. */ /* 27.7: Rescanning of macro should complete in the macro call. */ /* 'add(' causes "unterminated macro call" error. */ head a,b ); /* 27.8: */ #define TWO_TOKENS a,b #define SUB( x, y) sub( x, y) /* Too many arguments error while rescanning after once replaced to: sub( a,b, 1); */ SUB( TWO_TOKENS, 1); /* e_29_3.t: #undef errors. */ /* 29.3: Not an identifier. */ #undef "string" #undef 123 /* 29.4: Excessive token sequence. */ #undef MACRO_0 Junk /* 29.5: No argument. */ #undef /* e_31.t: Illegal macro calls. */ /* 31.1: Too many arguments error. */ sub( x, y, z); /* 31.2: Too few arguments error. */ sub( x); /* e_31_3.t: Macro call in control line should complete in the line. */ #define glue( a, b) a ## b #define str( s) # s #define xstr( s) str( s) /* 31.3: Unterminated macro call. */ #include xstr( glue( header, .h)) /* e_32_5.t: Character constant is forbidden in #if expression. */ /* 32.5: */ #if '\x12' == 0x12 #endif /* Error of "unterminated #if section started at line 177" will be reported at end of file. */ mcpp-2.7.2/test-t/e_operat.t0000644000175000017500000000036210216765467012624 00000000000000/* e_operat.t */ /* * In C++98 the 11 identifier-like tokens are operators, not identifiers. * Note: in C95 these are defined as macros by . */ /* Cannot define operator as a macro. */ #define and && #define xor_eq ^= mcpp-2.7.2/test-t/m_34_sjis.t0000644000175000017500000000052510216765467012621 00000000000000/* m_34_sjis.t: Multi-byte character constant encoded in shift-JIS. */ /* 34.1: */ #pragma __setlocale( "sjis") /* For MCPP */ #pragma setlocale( "japanese") /* For Visual C */ #if '' == '\x8e\x9a' Multi-byte character is encoded in shift-JIS. #else I cannot understand shift-JIS. #endif mcpp-2.7.2/test-t/unbal6.h0000644000175000017500000000013510216765467012177 00000000000000/* unbal6.h */ #define UNBAL6( a, b) ((a) + (b)) UNBAL6 ( x , mcpp-2.7.2/test-t/e_15_3.t0000644000175000017500000000037210216765467012002 00000000000000/* e_15_3.t: #ifdef, #ifndef syntax errors. */ /* 15.3: Not an identifier. */ #ifdef "string" #endif #ifdef 123 #endif /* 15.4: Excessive token sequence. */ #ifdef MACRO Junk #endif /* 15.5: No argument. */ #ifndef #endif mcpp-2.7.2/test-t/e_14_7.t0000644000175000017500000000053510216765467012006 00000000000000/* e_14_7.t: There is no keyword in #if expression. */ /* 14.7: sizeof operator is disallowed. */ /* Evaluated as: 0 (0) Constant expression syntax error. */ #if sizeof (int) #endif /* 14.8: type cast is disallowed. */ /* Evaluated as: (0)0x8000 Also a constant expression error. */ #if (int)0x8000 < 0 #endif mcpp-2.7.2/test-t/n_token.t0000644000175000017500000000066410216765467012470 00000000000000/* n_token.t: special pp-token in C++ */ #define str( a) xstr( a) #define xstr( a) # a #define paste( a, b) a ## b /* token.1: '::' is a token in C++, although illegal token sequence in C */ /* "::"; */ str( paste( :, :)); /* token.2: 'and', 'or', 'not', etc. are tokens in C++, although in C these are macros defined by */ /* "xor"; */ #if 1 and 2 or not 3 str( xor); #endif mcpp-2.7.2/test-t/e_12_8.t0000644000175000017500000000027110216765467012002 00000000000000/* e_12_8.t: Out of range of integer pp-token in #if expression. */ /* 12.8: Preprocessing number perhaps out of range of unsigned long. */ #if 123456789012345678901 #endif mcpp-2.7.2/test-t/n_7.t0000644000175000017500000000061710216765467011514 00000000000000/* n_7.t: #line directive. */ /* 7.1: Line number and filename. */ /* 1234; "cpp"; */ #line 1234 "cpp" __LINE__; __FILE__; /* 7.2: Filename argument is optional. */ /* 2345; "cpp"; */ #line 2345 __LINE__; __FILE__; /* 7.3: Argument with macro. */ /* 3456; "n_7.t"; */ #define LINE_AND_FILENAME 3456 "n_7.t" #line LINE_AND_FILENAME __LINE__; __FILE__; mcpp-2.7.2/test-t/e_17.t0000644000175000017500000000135310216765467011562 00000000000000/* e_17.t: Ill-formed group in a source file. */ #define MACRO_1 1 /* 17.1: Error of #endif without #if. */ #endif /* 17.2: Error of #else without #if. */ #else /* 17.3: Error of #else after #else. */ #if MACRO_1 #else /* line 13 */ #if 1 #else #endif #else #endif /* 17.4: Error of #elif after #else. */ #if MACRO_1 == 1 #else /* line 22 */ #elif MACRO_1 == 0 #endif /* 17.5: Error of #endif without #if in an included file. */ #if 1 #include "unbal1.h" /* 17.6: Error of unterminated #if section in an included file. */ #include "unbal2.h" #endif /* 17.7: Error of unterminated #if section. */ #if MACRO_1 == 0 /* line 35 */ #else mcpp-2.7.2/test-t/n_ucn1.cc0000644000175000017500000000067210216765467012337 00000000000000/* n_ucn1.t: Universal-character-name */ /* UCN in character constant */ #if '\u5B57' UCN-16bits is implemented. #endif #if '\U00006F22' UCN-32bits is implemented. #endif /* UCN in string literal */ "abc\u6F22\u5B57xyz"; /* i.e. "abcxyx"; */ /* UCN in identifier */ #define macro\u5B57 9 #define macro\U00006F22 99 macro\u5B57 /* 9 */ macro\U00006F22 /* 99 */ mcpp-2.7.2/test-t/m_36_jis.t0000644000175000017500000000202110216765467012431 00000000000000/* * m_36_jis.t: Handling of 0x5c ('\\'), 0x22 ('"'), 0x27 ('\'') * in ISO-2022-JP multi-byte character. */ #define str( a) # a /* 36.1: 0x5c in multi-byte character is not an escape character. */ #pragma __setlocale( "jis") /* For MCPP */ #pragma setlocale( "jis") /* For MCPP on VC */ #if '$B;z(B' == '\x3b\x7a' && '$B0\(B' != '\x30\x5c' Bad handling of '\\' in multi-byte character. #endif /* 36.2: # operater should not insert '\\' before 0x5c in multi-byte character. */ str( "$B0\F0(B"); /* \x22\x5c\x22\x30\x5c\x46\x30\x5c\x22\x22 with shift-sequence */ /* 36.3: # operater should not insert '\\' before 0x22 in multi-byte character. */ str( "$B1"M[(B"); /* \x22\x5c\x22\x31\x22\x4d\x5b\x5c\x22\x22 with shift-sequence */ /* 36.4: # operater should not insert '\\' before 0x27 in multi-byte character. */ str( "$B1'Ch(B"); /* \x22\x5c\x22\x31\x27\x43\x68\x5c\x22\x22 with shift-sequence */ mcpp-2.7.2/test-t/n_21.t0000644000175000017500000000045410216765467011567 00000000000000/* n_21.t: Tokenization (No preprocessing tokens are merged implicitly). */ /* 21.1: */ /* - - -a; */ #define MINUS - -MINUS-a; /* 21.2: */ #define sub( a, b) a-b /* '(a)-(b)' is better */ #define Y -y /* '(-y)' is better */ /* x- -y; */ sub( x, Y); mcpp-2.7.2/test-t/n_post99.t0000644000175000017500000002457410216765467012525 00000000000000/* * n_post99.t * Samples to test "Post-C99" preprocessing. * * 2002/08 made public kmatsui * 2003/03 slightly revised kmatsui */ /* n_dslcom: // is a comment of C99. */ /* a ; */ a; // is a comment of C99 /* n_ppnum.t: Preprocessing number token *p+* */ /* Undefined on C90, because '+A' is not a valid pp-token. */ #define A 3 #define glue( a, b) a ## b /* 12p+A ; */ glue( 12p+, A); /* n_line.t: line number argument of #line */ /* C99: Range of line number in #line directive is [1..2147483647] */ #line 2147483647 __LINE__; /* 2147483647 ; */ #line 30 /* Resume the real line number */ __LINE__; /* n_llong.t: long long in #if expression */ #if 12345678901234567890 < 13345678901234567890 "long long #if expression is implemented." #else "long long #if expression is not implemented." #endif /* n_vargs.t: Macro of variable arguments */ /* from C99 Standard 6.10.3 Examples */ #define debug( ...) fprintf( stderr, __VA_ARGS__) #define showlist( ...) puts( #__VA_ARGS__) #define report( test, ...) ((test) ? puts( #test) \ : printf( __VA_ARGS__)) { /* fprintf ( stderr , "Flag" ) ; */ debug( "Flag"); /* fprintf ( stderr , "X = %d\n" , x ) ; */ debug( "X = %d\n", x); /* puts ( "The first , second , and third items ." ) ; */ showlist( The first, second, and third items.); /* ( ( x > y ) ? puts ( "x > y" ) : printf ( "x is %d but y is %d", x , y ) ) ; */ report( x>y, "x is %d but y is %d", x, y); } /* n_pragma.t: _Pragma() operator */ /* based on the proposal to C99 by Bill Homer */ #define Machine_B #include "pragmas.h" /* #pragma vfunction */ Fast_call void f(int n, double * a, double * b) { /* #pragma ivdep */ Independent while(n-- > 0) { *a++ += *b++; } } #define f(N, A, B) \ { int n = (N), double * a = (A), double * b = (B); \ Independent while(n-- > 0) { *a++ += *b++; } \ } #define EXPRAG(x) _Pragma(#x) #define PRAGMA(x) EXPRAG(x) #define LIBFUNC xyz int libfunc() { ... } /* Direct the linker to define alternate entry points for libfunc. */ /* #pragma duplicate libfunc as ( lib_func , xyz ) */ PRAGMA( duplicate libfunc as (lib_func,LIBFUNC) ) /* n_nularg.t: Empty argument of macro call. */ #define ARG( a) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf ( "%s : %d\n" , "math ( sub , , y )" , ( - y ) ) ; */ SHOWN( math( sub, , y)); /* printf ( "%s : %s\n" , "EMPTY" , "" ) ; */ SHOWS( EMPTY); /* printf ( "%s : %s\n" , "APPEND ( CON , 1 )" , "CON1" ) ; */ SHOWS( APPEND( CON, 1)); /* printf ( "%s : %s\n" , "APPEND ( CON , )" , "CON" ) ; */ SHOWS( APPEND( CON, )); /* printf ( "%s : %s\n" , "APPEND( , )" , "" ) ; */ SHOWS( APPEND( , )); /* n_stdmac.t: C99 Standard pre-defined macros. */ /* 199901L ; */ __STDC_VERSION__; /* 1 ; or 0 ; */ __STDC_HOSTED__; /* n_tlimit.t: Tests of translation limits. */ /* 37.1L: Number of parameters of macro definition: at least 127. */ #define glue127( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## o7 /* 37.2L: Number of arguments of macro call: at least 127. */ /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6O7 ; */ glue127( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7); /* 37.3L: Significant initial characters in an internal identifier or a macro name: at least 63 bytes. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; /* 37.4L: Nested conditional inclusion: at least 63 level. */ /* ifdef_nest = 0x3f ; */ #define X3F #include "ifdef15.h" /* 37.5L: Nested source file inclusion: at least 15 level. */ /* nest = 0x0f ; */ #define X0F #include "nest1.h" /* 37.6L: Parenthesized expression: at least 63 level. */ /* nest = 63 ; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif /* 37.7L: Characters in a string (after concatenation) : at least 4095 bytes. */ /* 4095 bytes long. */ char *string4093 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; /* 37.8L: Length of logical source line: at least 4095 bytes. */ #include "long4095.h" /* 37.9L: Number of macro definitions: at least 4095. */ #undef ARG #include "m4095.h" /* 0x0fff ; */ GBM; mcpp-2.7.2/test-t/u_1_28.t0000644000175000017500000000077210216765467012030 00000000000000/* u_1_28.t: Macro expanding to name identical to directive. */ #define D define /* u.1.28: There are following two ways of preprocessing. 1: "D" isn't expanded, because # is the first token of the line. Preprocessor reports that "D" is an unknown directive. 2: "D" is expanded, because that is not a directive. Compiler-phase will diagnose the output of preprocess. Anyway, preprocessor should not interprete this line as a preprocessing directive. */ #D A B mcpp-2.7.2/test-t/m_34_big5.t0000644000175000017500000000052310216765467012475 00000000000000/* m_34_big5.t: Multi-byte character constant encoded in Big-Five. */ /* 34.1: */ #pragma __setlocale( "big5") /* For MCPP */ #pragma setlocale( "chinese-traditional") /* For Visual C */ #if 'r' == '\xa6\x72' Multi-byte character is encoded in Big-Five. #else I cannot understand Big-Five. #endif mcpp-2.7.2/test-t/n_ucn2.t0000644000175000017500000000024210216765467012207 00000000000000/* n_ucn2.t: Universal-character-name */ /* UCN in pp-number */ #define mkint( a) a ## 1\u5B57 int mkint( abc) = 0; /* int abc1\u5B57 = 0; */ mcpp-2.7.2/test-t/n_2.t0000644000175000017500000000133410216765467011504 00000000000000/* n_2.t: Line splicing by sequence. */ /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ /* ab + cd + ef; */ #define FUNC( a, b, c) \ a + b + c FUNC( ab, cd, ef); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ /* ab + cd + ef; */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c FUNC( ab, cd, ef); /* 2.3: In a string literal. */ /* "abcde" */ "abc\ de" /* 2.4: in midst of an identifier. */ /* abcde */ abc\ de /* 2.5: by trigraph. */ /* abcde */ abc??/ de mcpp-2.7.2/test-t/n_dslcom.t0000644000175000017500000000014710216765467012625 00000000000000/* n_dslcom: // is a comment of C++ and C99. */ /* a; */ a; // is a comment of C++ and C99 mcpp-2.7.2/test-t/e_29_3.t0000644000175000017500000000032110216765467012001 00000000000000/* e_29_3.t: #undef errors. */ /* 29.3: Not an identifier. */ #undef "string" #undef 123 /* 29.4: Excessive token sequence. */ #undef MACRO_0 Junk /* 29.5: No argument. */ #undef mcpp-2.7.2/test-t/m4095.h0000644000175000017500000014010310216765467011566 00000000000000/* m4095.h */ #define AAA #define AAB #define AAC #define AAD #define AAE #define AAF #define AAG #define AAH #define AAI #define AAJ #define AAK #define AAL #define AAM #define AAN #define AAO #define AAP #define AAQ #define AAR #define AAS #define AAT #define AAU #define AAV #define AAW #define AAX #define AAY #define AAZ #define ABA #define ABB #define ABC #define ABD #define ABE #define ABF #define ABG #define ABH #define ABI #define ABJ #define ABK #define ABL #define ABM #define ABN #define ABO #define ABP #define ABQ #define ABR #define ABS #define ABT #define ABU #define ABV #define ABW #define ABX #define ABY #define ABZ #define ACA #define ACB #define ACC #define ACD #define ACE #define ACF #define ACG #define ACH #define ACI #define ACJ #define ACK #define ACL #define ACM #define ACN #define ACO #define ACP #define ACQ #define ACR #define ACS #define ACT #define ACU #define ACV #define ACW #define ACX #define ACY #define ACZ #define ADA #define ADB #define ADC #define ADD #define ADE #define ADF #define ADG #define ADH #define ADI #define ADJ #define ADK #define ADL #define ADM #define ADN #define ADO #define ADP #define ADQ #define ADR #define ADS #define ADT #define ADU #define ADV #define ADW #define ADX #define ADY #define ADZ #define AEA #define AEB #define AEC #define AED #define AEE #define AEF #define AEG #define AEH #define AEI #define AEJ #define AEK #define AEL #define AEM #define AEN #define AEO #define AEP #define AEQ #define AER #define AES #define AET #define AEU #define AEV #define AEW #define AEX #define AEY #define AEZ #define AFA #define AFB #define AFC #define AFD #define AFE #define AFF #define AFG #define AFH #define AFI #define AFJ #define AFK #define AFL #define AFM #define AFN #define AFO #define AFP #define AFQ #define AFR #define AFS #define AFT #define AFU #define AFV #define AFW #define AFX #define AFY #define AFZ #define AGA #define AGB #define AGC #define AGD #define AGE #define AGF #define AGG #define AGH #define AGI #define AGJ #define AGK #define AGL #define AGM #define AGN #define AGO #define AGP #define AGQ #define AGR #define AGS #define AGT #define AGU #define AGV #define AGW #define AGX #define AGY #define AGZ #define AHA #define AHB #define AHC #define AHD #define AHE #define AHF #define AHG #define AHH #define AHI #define AHJ #define AHK #define AHL #define AHM #define AHN #define AHO #define AHP #define AHQ #define AHR #define AHS #define AHT #define AHU #define AHV #define AHW #define AHX #define AHY #define AHZ #define AIA #define AIB #define AIC #define AID #define AIE #define AIF #define AIG #define AIH #define AII #define AIJ #define AIK #define AIL #define AIM #define AIN #define AIO #define AIP #define AIQ #define AIR #define AIS #define AIT #define AIU #define AIV #define AIW #define AIX #define AIY #define AIZ #define AJA #define AJB #define AJC #define AJD #define AJE #define AJF #define AJG #define AJH #define AJI #define AJJ #define AJK #define AJL #define AJM #define AJN #define AJO #define AJP #define AJQ #define AJR #define AJS #define AJT #define AJU #define AJV #define AJW #define AJX #define AJY #define AJZ #define AKA #define AKB #define AKC #define AKD #define AKE #define AKF #define AKG #define AKH #define AKI #define AKJ #define AKK #define AKL #define AKM #define AKN #define AKO #define AKP #define AKQ #define AKR #define AKS #define AKT #define AKU #define AKV #define AKW #define AKX #define AKY #define AKZ #define ALA #define ALB #define ALC #define ALD #define ALE #define ALF #define ALG #define ALH #define ALI #define ALJ #define ALK #define ALL #define ALM #define ALN #define ALO #define ALP #define ALQ #define ALR #define ALS #define ALT #define ALU #define ALV #define ALW #define ALX #define ALY #define ALZ #define AMA #define AMB #define AMC #define AMD #define AME #define AMF #define AMG #define AMH #define AMI #define AMJ #define AMK #define AML #define AMM #define AMN #define AMO #define AMP #define AMQ #define AMR #define AMS #define AMT #define AMU #define AMV #define AMW #define AMX #define AMY #define AMZ #define ANA #define ANB #define ANC #define AND #define ANE #define ANF #define ANG #define ANH #define ANI #define ANJ #define ANK #define ANL #define ANM #define ANN #define ANO #define ANP #define ANQ #define ANR #define ANS #define ANT #define ANU #define ANV #define ANW #define ANX #define ANY #define ANZ #define AOA #define AOB #define AOC #define AOD #define AOE #define AOF #define AOG #define AOH #define AOI #define AOJ #define AOK #define AOL #define AOM #define AON #define AOO #define AOP #define AOQ #define AOR #define AOS #define AOT #define AOU #define AOV #define AOW #define AOX #define AOY #define AOZ #define APA #define APB #define APC #define APD #define APE #define APF #define APG #define APH #define API #define APJ #define APK #define APL #define APM #define APN #define APO #define APP #define APQ #define APR #define APS #define APT #define APU #define APV #define APW #define APX #define APY #define APZ #define AQA #define AQB #define AQC #define AQD #define AQE #define AQF #define AQG #define AQH #define AQI #define AQJ #define AQK #define AQL #define AQM #define AQN #define AQO #define AQP #define AQQ #define AQR #define AQS #define AQT #define AQU #define AQV #define AQW #define AQX #define AQY #define AQZ #define ARA #define ARB #define ARC #define ARD #define ARE #define ARF #define ARG #define ARH #define ARI #define ARJ #define ARK #define ARL #define ARM #define ARN #define ARO #define ARP #define ARQ #define ARR #define ARS #define ART #define ARU #define ARV #define ARW #define ARX #define ARY #define ARZ #define ASA #define ASB #define ASC #define ASD #define ASE #define ASF #define ASG #define ASH #define ASI #define ASJ #define ASK #define ASL #define ASM #define ASN #define ASO #define ASP #define ASQ #define ASR #define ASS #define AST #define ASU #define ASV #define ASW #define ASX #define ASY #define ASZ #define ATA #define ATB #define ATC #define ATD #define ATE #define ATF #define ATG #define ATH #define ATI #define ATJ #define ATK #define ATL #define ATM #define ATN #define ATO #define ATP #define ATQ #define ATR #define ATS #define ATT #define ATU #define ATV #define ATW #define ATX #define ATY #define ATZ #define AUA #define AUB #define AUC #define AUD #define AUE #define AUF #define AUG #define AUH #define AUI #define AUJ #define AUK #define AUL #define AUM #define AUN #define AUO #define AUP #define AUQ #define AUR #define AUS #define AUT #define AUU #define AUV #define AUW #define AUX #define AUY #define AUZ #define AVA #define AVB #define AVC #define AVD #define AVE #define AVF #define AVG #define AVH #define AVI #define AVJ #define AVK #define AVL #define AVM #define AVN #define AVO #define AVP #define AVQ #define AVR #define AVS #define AVT #define AVU #define AVV #define AVW #define AVX #define AVY #define AVZ #define AWA #define AWB #define AWC #define AWD #define AWE #define AWF #define AWG #define AWH #define AWI #define AWJ #define AWK #define AWL #define AWM #define AWN #define AWO #define AWP #define AWQ #define AWR #define AWS #define AWT #define AWU #define AWV #define AWW #define AWX #define AWY #define AWZ #define AXA #define AXB #define AXC #define AXD #define AXE #define AXF #define AXG #define AXH #define AXI #define AXJ #define AXK #define AXL #define AXM #define AXN #define AXO #define AXP #define AXQ #define AXR #define AXS #define AXT #define AXU #define AXV #define AXW #define AXX #define AXY #define AXZ #define AYA #define AYB #define AYC #define AYD #define AYE #define AYF #define AYG #define AYH #define AYI #define AYJ #define AYK #define AYL #define AYM #define AYN #define AYO #define AYP #define AYQ #define AYR #define AYS #define AYT #define AYU #define AYV #define AYW #define AYX #define AYY #define AYZ #define AZA #define AZB #define AZC #define AZD #define AZE #define AZF #define AZG #define AZH #define AZI #define AZJ #define AZK #define AZL #define AZM #define AZN #define AZO #define AZP #define AZQ #define AZR #define AZS #define AZT #define AZU #define AZV #define AZW #define AZX #define AZY #define AZZ #define BAA #define BAB #define BAC #define BAD #define BAE #define BAF #define BAG #define BAH #define BAI #define BAJ #define BAK #define BAL #define BAM #define BAN #define BAO #define BAP #define BAQ #define BAR #define BAS #define BAT #define BAU #define BAV #define BAW #define BAX #define BAY #define BAZ #define BBA #define BBB #define BBC #define BBD #define BBE #define BBF #define BBG #define BBH #define BBI #define BBJ #define BBK #define BBL #define BBM #define BBN #define BBO #define BBP #define BBQ #define BBR #define BBS #define BBT #define BBU #define BBV #define BBW #define BBX #define BBY #define BBZ #define BCA #define BCB #define BCC #define BCD #define BCE #define BCF #define BCG #define BCH #define BCI #define BCJ #define BCK #define BCL #define BCM #define BCN #define BCO #define BCP #define BCQ #define BCR #define BCS #define BCT #define BCU #define BCV #define BCW #define BCX #define BCY #define BCZ #define BDA #define BDB #define BDC #define BDD #define BDE #define BDF #define BDG #define BDH #define BDI #define BDJ #define BDK #define BDL #define BDM #define BDN #define BDO #define BDP #define BDQ #define BDR #define BDS #define BDT #define BDU #define BDV #define BDW #define BDX #define BDY #define BDZ #define BEA #define BEB #define BEC #define BED #define BEE #define BEF #define BEG #define BEH #define BEI #define BEJ #define BEK #define BEL #define BEM #define BEN #define BEO #define BEP #define BEQ #define BER #define BES #define BET #define BEU #define BEV #define BEW #define BEX #define BEY #define BEZ #define BFA #define BFB #define BFC #define BFD #define BFE #define BFF #define BFG #define BFH #define BFI #define BFJ #define BFK #define BFL #define BFM #define BFN #define BFO #define BFP #define BFQ #define BFR #define BFS #define BFT #define BFU #define BFV #define BFW #define BFX #define BFY #define BFZ #define BGA #define BGB #define BGC #define BGD #define BGE #define BGF #define BGG #define BGH #define BGI #define BGJ #define BGK #define BGL #define BGM #define BGN #define BGO #define BGP #define BGQ #define BGR #define BGS #define BGT #define BGU #define BGV #define BGW #define BGX #define BGY #define BGZ #define BHA #define BHB #define BHC #define BHD #define BHE #define BHF #define BHG #define BHH #define BHI #define BHJ #define BHK #define BHL #define BHM #define BHN #define BHO #define BHP #define BHQ #define BHR #define BHS #define BHT #define BHU #define BHV #define BHW #define BHX #define BHY #define BHZ #define BIA #define BIB #define BIC #define BID #define BIE #define BIF #define BIG #define BIH #define BII #define BIJ #define BIK #define BIL #define BIM #define BIN #define BIO #define BIP #define BIQ #define BIR #define BIS #define BIT #define BIU #define BIV #define BIW #define BIX #define BIY #define BIZ #define BJA #define BJB #define BJC #define BJD #define BJE #define BJF #define BJG #define BJH #define BJI #define BJJ #define BJK #define BJL #define BJM #define BJN #define BJO #define BJP #define BJQ #define BJR #define BJS #define BJT #define BJU #define BJV #define BJW #define BJX #define BJY #define BJZ #define BKA #define BKB #define BKC #define BKD #define BKE #define BKF #define BKG #define BKH #define BKI #define BKJ #define BKK #define BKL #define BKM #define BKN #define BKO #define BKP #define BKQ #define BKR #define BKS #define BKT #define BKU #define BKV #define BKW #define BKX #define BKY #define BKZ #define BLA #define BLB #define BLC #define BLD #define BLE #define BLF #define BLG #define BLH #define BLI #define BLJ #define BLK #define BLL #define BLM #define BLN #define BLO #define BLP #define BLQ #define BLR #define BLS #define BLT #define BLU #define BLV #define BLW #define BLX #define BLY #define BLZ #define BMA #define BMB #define BMC #define BMD #define BME #define BMF #define BMG #define BMH #define BMI #define BMJ #define BMK #define BML #define BMM #define BMN #define BMO #define BMP #define BMQ #define BMR #define BMS #define BMT #define BMU #define BMV #define BMW #define BMX #define BMY #define BMZ #define BNA #define BNB #define BNC #define BND #define BNE #define BNF #define BNG #define BNH #define BNI #define BNJ 0x0400 #ifndef X0400 #define BNK #define BNL #define BNM #define BNN #define BNO #define BNP #define BNQ #define BNR #define BNS #define BNT #define BNU #define BNV #define BNW #define BNX #define BNY #define BNZ #define BOA #define BOB #define BOC #define BOD #define BOE #define BOF #define BOG #define BOH #define BOI #define BOJ #define BOK #define BOL #define BOM #define BON #define BOO #define BOP #define BOQ #define BOR #define BOS #define BOT #define BOU #define BOV #define BOW #define BOX #define BOY #define BOZ #define BPA #define BPB #define BPC #define BPD #define BPE #define BPF #define BPG #define BPH #define BPI #define BPJ #define BPK #define BPL #define BPM #define BPN #define BPO #define BPP #define BPQ #define BPR #define BPS #define BPT #define BPU #define BPV #define BPW #define BPX #define BPY #define BPZ #define BQA #define BQB #define BQC #define BQD #define BQE #define BQF #define BQG #define BQH #define BQI #define BQJ #define BQK #define BQL #define BQM #define BQN #define BQO #define BQP #define BQQ #define BQR #define BQS #define BQT #define BQU #define BQV #define BQW #define BQX #define BQY #define BQZ #define BRA #define BRB #define BRC #define BRD #define BRE #define BRF #define BRG #define BRH #define BRI #define BRJ #define BRK #define BRL #define BRM #define BRN #define BRO #define BRP #define BRQ #define BRR #define BRS #define BRT #define BRU #define BRV #define BRW #define BRX #define BRY #define BRZ #define BSA #define BSB #define BSC #define BSD #define BSE #define BSF #define BSG #define BSH #define BSI #define BSJ #define BSK #define BSL #define BSM #define BSN #define BSO #define BSP #define BSQ #define BSR #define BSS #define BST #define BSU #define BSV #define BSW #define BSX #define BSY #define BSZ #define BTA #define BTB #define BTC #define BTD #define BTE #define BTF #define BTG #define BTH #define BTI #define BTJ #define BTK #define BTL #define BTM #define BTN #define BTO #define BTP #define BTQ #define BTR #define BTS #define BTT #define BTU #define BTV #define BTW #define BTX #define BTY #define BTZ #define BUA #define BUB #define BUC #define BUD #define BUE #define BUF #define BUG #define BUH #define BUI #define BUJ #define BUK #define BUL #define BUM #define BUN #define BUO #define BUP #define BUQ #define BUR #define BUS #define BUT #define BUU #define BUV #define BUW #define BUX #define BUY #define BUZ #define BVA #define BVB #define BVC #define BVD #define BVE #define BVF #define BVG #define BVH #define BVI #define BVJ #define BVK #define BVL #define BVM #define BVN #define BVO #define BVP #define BVQ #define BVR #define BVS #define BVT #define BVU #define BVV #define BVW #define BVX #define BVY #define BVZ #define BWA #define BWB #define BWC #define BWD #define BWE #define BWF #define BWG #define BWH #define BWI #define BWJ #define BWK #define BWL #define BWM #define BWN #define BWO #define BWP #define BWQ #define BWR #define BWS #define BWT #define BWU #define BWV #define BWW #define BWX #define BWY #define BWZ #define BXA #define BXB #define BXC #define BXD #define BXE #define BXF #define BXG #define BXH #define BXI #define BXJ #define BXK #define BXL #define BXM #define BXN #define BXO #define BXP #define BXQ #define BXR #define BXS #define BXT #define BXU #define BXV #define BXW #define BXX #define BXY #define BXZ #define BYA #define BYB #define BYC #define BYD #define BYE #define BYF #define BYG #define BYH #define BYI #define BYJ #define BYK #define BYL #define BYM #define BYN #define BYO #define BYP #define BYQ #define BYR #define BYS #define BYT #define BYU #define BYV #define BYW #define BYX #define BYY #define BYZ #define BZA #define BZB #define BZC #define BZD #define BZE #define BZF #define BZG #define BZH #define BZI #define BZJ #define BZK #define BZL #define BZM #define BZN #define BZO #define BZP #define BZQ #define BZR #define BZS #define BZT #define BZU #define BZV #define BZW #define BZX #define BZY #define BZZ #define CAA #define CAB #define CAC #define CAD #define CAE #define CAF #define CAG #define CAH #define CAI #define CAJ #define CAK #define CAL #define CAM #define CAN #define CAO #define CAP #define CAQ #define CAR #define CAS #define CAT #define CAU #define CAV #define CAW #define CAX #define CAY #define CAZ #define CBA #define CBB #define CBC #define CBD #define CBE #define CBF #define CBG #define CBH #define CBI #define CBJ #define CBK #define CBL #define CBM #define CBN #define CBO #define CBP #define CBQ #define CBR #define CBS #define CBT #define CBU #define CBV #define CBW #define CBX #define CBY #define CBZ #define CCA #define CCB #define CCC #define CCD #define CCE #define CCF #define CCG #define CCH #define CCI #define CCJ #define CCK #define CCL #define CCM #define CCN #define CCO #define CCP #define CCQ #define CCR #define CCS #define CCT #define CCU #define CCV #define CCW #define CCX #define CCY #define CCZ #define CDA #define CDB #define CDC #define CDD #define CDE #define CDF #define CDG #define CDH #define CDI #define CDJ #define CDK #define CDL #define CDM #define CDN #define CDO #define CDP #define CDQ #define CDR #define CDS #define CDT #define CDU #define CDV #define CDW #define CDX #define CDY #define CDZ #define CEA #define CEB #define CEC #define CED #define CEE #define CEF #define CEG #define CEH #define CEI #define CEJ #define CEK #define CEL #define CEM #define CEN #define CEO #define CEP #define CEQ #define CER #define CES #define CET #define CEU #define CEV #define CEW #define CEX #define CEY #define CEZ #define CFA #define CFB #define CFC #define CFD #define CFE #define CFF #define CFG #define CFH #define CFI #define CFJ #define CFK #define CFL #define CFM #define CFN #define CFO #define CFP #define CFQ #define CFR #define CFS #define CFT #define CFU #define CFV #define CFW #define CFX #define CFY #define CFZ #define CGA #define CGB #define CGC #define CGD #define CGE #define CGF #define CGG #define CGH #define CGI #define CGJ #define CGK #define CGL #define CGM #define CGN #define CGO #define CGP #define CGQ #define CGR #define CGS #define CGT #define CGU #define CGV #define CGW #define CGX #define CGY #define CGZ #define CHA #define CHB #define CHC #define CHD #define CHE #define CHF #define CHG #define CHH #define CHI #define CHJ #define CHK #define CHL #define CHM #define CHN #define CHO #define CHP #define CHQ #define CHR #define CHS #define CHT #define CHU #define CHV #define CHW #define CHX #define CHY #define CHZ #define CIA #define CIB #define CIC #define CID #define CIE #define CIF #define CIG #define CIH #define CII #define CIJ #define CIK #define CIL #define CIM #define CIN #define CIO #define CIP #define CIQ #define CIR #define CIS #define CIT #define CIU #define CIV #define CIW #define CIX #define CIY #define CIZ #define CJA #define CJB #define CJC #define CJD #define CJE #define CJF #define CJG #define CJH #define CJI #define CJJ #define CJK #define CJL #define CJM #define CJN #define CJO #define CJP #define CJQ #define CJR #define CJS #define CJT #define CJU #define CJV #define CJW #define CJX #define CJY #define CJZ #define CKA #define CKB #define CKC #define CKD #define CKE #define CKF #define CKG #define CKH #define CKI #define CKJ #define CKK #define CKL #define CKM #define CKN #define CKO #define CKP #define CKQ #define CKR #define CKS #define CKT #define CKU #define CKV #define CKW #define CKX #define CKY #define CKZ #define CLA #define CLB #define CLC #define CLD #define CLE #define CLF #define CLG #define CLH #define CLI #define CLJ #define CLK #define CLL #define CLM #define CLN #define CLO #define CLP #define CLQ #define CLR #define CLS #define CLT #define CLU #define CLV #define CLW #define CLX #define CLY #define CLZ #define CMA #define CMB #define CMC #define CMD #define CME #define CMF #define CMG #define CMH #define CMI #define CMJ #define CMK #define CML #define CMM #define CMN #define CMO #define CMP #define CMQ #define CMR #define CMS #define CMT #define CMU #define CMV #define CMW #define CMX #define CMY #define CMZ #define CNA #define CNB #define CNC #define CND #define CNE #define CNF #define CNG #define CNH #define CNI #define CNJ #define CNK #define CNL #define CNM #define CNN #define CNO #define CNP #define CNQ #define CNR #define CNS #define CNT #define CNU #define CNV #define CNW #define CNX #define CNY #define CNZ #define COA #define COB #define COC #define COD #define COE #define COF #define COG #define COH #define COI #define COJ #define COK #define COL #define COM #define CON #define COO #define COP #define COQ #define COR #define COS #define COT #define COU #define COV #define COW #define COX #define COY #define COZ #define CPA #define CPB #define CPC #define CPD #define CPE #define CPF #define CPG #define CPH #define CPI #define CPJ #define CPK #define CPL #define CPM #define CPN #define CPO #define CPP #define CPQ #define CPR #define CPS #define CPT #define CPU #define CPV #define CPW #define CPX #define CPY #define CPZ #define CQA #define CQB #define CQC #define CQD #define CQE #define CQF #define CQG #define CQH #define CQI #define CQJ #define CQK #define CQL #define CQM #define CQN #define CQO #define CQP #define CQQ #define CQR #define CQS #define CQT #define CQU #define CQV #define CQW #define CQX #define CQY #define CQZ #define CRA #define CRB #define CRC #define CRD #define CRE #define CRF #define CRG #define CRH #define CRI #define CRJ #define CRK #define CRL #define CRM #define CRN #define CRO #define CRP #define CRQ #define CRR #define CRS #define CRT #define CRU #define CRV #define CRW #define CRX #define CRY #define CRZ #define CSA #define CSB #define CSC #define CSD #define CSE #define CSF #define CSG #define CSH #define CSI #define CSJ #define CSK #define CSL #define CSM #define CSN #define CSO #define CSP #define CSQ #define CSR #define CSS #define CST #define CSU #define CSV #define CSW #define CSX #define CSY #define CSZ #define CTA #define CTB #define CTC #define CTD #define CTE #define CTF #define CTG #define CTH #define CTI #define CTJ #define CTK #define CTL #define CTM #define CTN #define CTO #define CTP #define CTQ #define CTR #define CTS #define CTT #define CTU #define CTV #define CTW #define CTX #define CTY #define CTZ #define CUA #define CUB #define CUC #define CUD #define CUE #define CUF #define CUG #define CUH #define CUI #define CUJ #define CUK #define CUL #define CUM #define CUN #define CUO #define CUP #define CUQ #define CUR #define CUS #define CUT #define CUU #define CUV #define CUW #define CUX #define CUY #define CUZ #define CVA #define CVB #define CVC #define CVD #define CVE #define CVF #define CVG #define CVH #define CVI #define CVJ #define CVK #define CVL #define CVM #define CVN #define CVO #define CVP #define CVQ #define CVR #define CVS #define CVT #define CVU #define CVV #define CVW #define CVX #define CVY #define CVZ #define CWA #define CWB #define CWC #define CWD #define CWE #define CWF #define CWG #define CWH #define CWI #define CWJ #define CWK #define CWL #define CWM #define CWN #define CWO #define CWP #define CWQ #define CWR #define CWS #define CWT #define CWU #define CWV #define CWW #define CWX #define CWY #define CWZ #define CXA #define CXB #define CXC #define CXD #define CXE #define CXF #define CXG #define CXH #define CXI #define CXJ #define CXK #define CXL #define CXM #define CXN #define CXO #define CXP #define CXQ #define CXR #define CXS #define CXT #define CXU #define CXV #define CXW #define CXX #define CXY #define CXZ #define CYA #define CYB #define CYC #define CYD #define CYE #define CYF #define CYG #define CYH #define CYI #define CYJ #define CYK #define CYL #define CYM #define CYN #define CYO #define CYP #define CYQ #define CYR #define CYS #define CYT #define CYU #define CYV #define CYW #define CYX #define CYY #define CYZ #define CZA #define CZB #define CZC #define CZD #define CZE #define CZF #define CZG #define CZH #define CZI #define CZJ #define CZK #define CZL #define CZM #define CZN #define CZO #define CZP #define CZQ #define CZR #define CZS #define CZT #define CZU #define CZV #define CZW #define CZX #define CZY #define CZZ #define DAA #define DAB #define DAC #define DAD #define DAE #define DAF #define DAG #define DAH #define DAI #define DAJ #define DAK #define DAL #define DAM #define DAN #define DAO #define DAP #define DAQ #define DAR #define DAS 0x07ff #ifndef X07FF #define DAT #define DAU #define DAV #define DAW #define DAX #define DAY #define DAZ #define DBA #define DBB #define DBC #define DBD #define DBE #define DBF #define DBG #define DBH #define DBI #define DBJ #define DBK #define DBL #define DBM #define DBN #define DBO #define DBP #define DBQ #define DBR #define DBS #define DBT #define DBU #define DBV #define DBW #define DBX #define DBY #define DBZ #define DCA #define DCB #define DCC #define DCD #define DCE #define DCF #define DCG #define DCH #define DCI #define DCJ #define DCK #define DCL #define DCM #define DCN #define DCO #define DCP #define DCQ #define DCR #define DCS #define DCT #define DCU #define DCV #define DCW #define DCX #define DCY #define DCZ #define DDA #define DDB #define DDC #define DDD #define DDE #define DDF #define DDG #define DDH #define DDI #define DDJ #define DDK #define DDL #define DDM #define DDN #define DDO #define DDP #define DDQ #define DDR #define DDS #define DDT #define DDU #define DDV #define DDW #define DDX #define DDY #define DDZ #define DEA #define DEB #define DEC #define DED #define DEE #define DEF #define DEG #define DEH #define DEI #define DEJ #define DEK #define DEL #define DEM #define DEN #define DEO #define DEP #define DEQ #define DER #define DES #define DET #define DEU #define DEV #define DEW #define DEX #define DEY #define DEZ #define DFA #define DFB #define DFC #define DFD #define DFE #define DFF #define DFG #define DFH #define DFI #define DFJ #define DFK #define DFL #define DFM #define DFN #define DFO #define DFP #define DFQ #define DFR #define DFS #define DFT #define DFU #define DFV #define DFW #define DFX #define DFY #define DFZ #define DGA #define DGB #define DGC #define DGD #define DGE #define DGF #define DGG #define DGH #define DGI #define DGJ #define DGK #define DGL #define DGM #define DGN #define DGO #define DGP #define DGQ #define DGR #define DGS #define DGT #define DGU #define DGV #define DGW #define DGX #define DGY #define DGZ #define DHA #define DHB #define DHC #define DHD #define DHE #define DHF #define DHG #define DHH #define DHI #define DHJ #define DHK #define DHL #define DHM #define DHN #define DHO #define DHP #define DHQ #define DHR #define DHS #define DHT #define DHU #define DHV #define DHW #define DHX #define DHY #define DHZ #define DIA #define DIB #define DIC #define DID #define DIE #define DIF #define DIG #define DIH #define DII #define DIJ #define DIK #define DIL #define DIM #define DIN #define DIO #define DIP #define DIQ #define DIR #define DIS #define DIT #define DIU #define DIV #define DIW #define DIX #define DIY #define DIZ #define DJA #define DJB #define DJC #define DJD #define DJE #define DJF #define DJG #define DJH #define DJI #define DJJ #define DJK #define DJL #define DJM #define DJN #define DJO #define DJP #define DJQ #define DJR #define DJS #define DJT #define DJU #define DJV #define DJW #define DJX #define DJY #define DJZ #define DKA #define DKB #define DKC #define DKD #define DKE #define DKF #define DKG #define DKH #define DKI #define DKJ #define DKK #define DKL #define DKM #define DKN #define DKO #define DKP #define DKQ #define DKR #define DKS #define DKT #define DKU #define DKV #define DKW #define DKX #define DKY #define DKZ #define DLA #define DLB #define DLC #define DLD #define DLE #define DLF #define DLG #define DLH #define DLI #define DLJ #define DLK #define DLL #define DLM #define DLN #define DLO #define DLP #define DLQ #define DLR #define DLS #define DLT #define DLU #define DLV #define DLW #define DLX #define DLY #define DLZ #define DMA #define DMB #define DMC #define DMD #define DME #define DMF #define DMG #define DMH #define DMI #define DMJ #define DMK #define DML #define DMM #define DMN #define DMO #define DMP #define DMQ #define DMR #define DMS #define DMT #define DMU #define DMV #define DMW #define DMX #define DMY #define DMZ #define DNA #define DNB #define DNC #define DND #define DNE #define DNF #define DNG #define DNH #define DNI #define DNJ #define DNK #define DNL #define DNM #define DNN #define DNO #define DNP #define DNQ #define DNR #define DNS #define DNT #define DNU #define DNV #define DNW #define DNX #define DNY #define DNZ #define DOA #define DOB #define DOC #define DOD #define DOE #define DOF #define DOG #define DOH #define DOI #define DOJ #define DOK #define DOL #define DOM #define DON #define DOO #define DOP #define DOQ #define DOR #define DOS #define DOT #define DOU #define DOV #define DOW #define DOX #define DOY #define DOZ #define DPA #define DPB #define DPC #define DPD #define DPE #define DPF #define DPG #define DPH #define DPI #define DPJ #define DPK #define DPL #define DPM #define DPN #define DPO #define DPP #define DPQ #define DPR #define DPS #define DPT #define DPU #define DPV #define DPW #define DPX #define DPY #define DPZ #define DQA #define DQB #define DQC #define DQD #define DQE #define DQF #define DQG #define DQH #define DQI #define DQJ #define DQK #define DQL #define DQM #define DQN #define DQO #define DQP #define DQQ #define DQR #define DQS #define DQT #define DQU #define DQV #define DQW #define DQX #define DQY #define DQZ #define DRA #define DRB #define DRC #define DRD #define DRE #define DRF #define DRG #define DRH #define DRI #define DRJ #define DRK #define DRL #define DRM #define DRN #define DRO #define DRP #define DRQ #define DRR #define DRS #define DRT #define DRU #define DRV #define DRW #define DRX #define DRY #define DRZ #define DSA #define DSB #define DSC #define DSD #define DSE #define DSF #define DSG #define DSH #define DSI #define DSJ #define DSK #define DSL #define DSM #define DSN #define DSO #define DSP #define DSQ #define DSR #define DSS #define DST #define DSU #define DSV #define DSW #define DSX #define DSY #define DSZ #define DTA #define DTB #define DTC #define DTD #define DTE #define DTF #define DTG #define DTH #define DTI #define DTJ #define DTK #define DTL #define DTM #define DTN #define DTO #define DTP #define DTQ #define DTR #define DTS #define DTT #define DTU #define DTV #define DTW #define DTX #define DTY #define DTZ #define DUA #define DUB #define DUC #define DUD #define DUE #define DUF #define DUG #define DUH #define DUI #define DUJ #define DUK #define DUL #define DUM #define DUN #define DUO #define DUP #define DUQ #define DUR #define DUS #define DUT #define DUU #define DUV #define DUW #define DUX #define DUY #define DUZ #define DVA #define DVB #define DVC #define DVD #define DVE #define DVF #define DVG #define DVH #define DVI #define DVJ #define DVK #define DVL #define DVM #define DVN #define DVO #define DVP #define DVQ #define DVR #define DVS #define DVT #define DVU #define DVV #define DVW #define DVX #define DVY #define DVZ #define DWA #define DWB #define DWC #define DWD #define DWE #define DWF #define DWG #define DWH #define DWI #define DWJ #define DWK #define DWL #define DWM #define DWN #define DWO #define DWP #define DWQ #define DWR #define DWS #define DWT #define DWU #define DWV #define DWW #define DWX #define DWY #define DWZ #define DXA #define DXB #define DXC #define DXD #define DXE #define DXF #define DXG #define DXH #define DXI #define DXJ #define DXK #define DXL #define DXM #define DXN #define DXO #define DXP #define DXQ #define DXR #define DXS #define DXT #define DXU #define DXV #define DXW #define DXX #define DXY #define DXZ #define DYA #define DYB #define DYC #define DYD #define DYE #define DYF #define DYG #define DYH #define DYI #define DYJ #define DYK #define DYL #define DYM #define DYN #define DYO #define DYP #define DYQ #define DYR #define DYS #define DYT #define DYU #define DYV #define DYW #define DYX #define DYY #define DYZ #define DZA #define DZB #define DZC #define DZD #define DZE #define DZF #define DZG #define DZH #define DZI #define DZJ #define DZK #define DZL #define DZM #define DZN #define DZO #define DZP #define DZQ #define DZR #define DZS #define DZT #define DZU #define DZV #define DZW #define DZX #define DZY #define DZZ #define EAA #define EAB #define EAC #define EAD #define EAE #define EAF #define EAG #define EAH #define EAI #define EAJ #define EAK #define EAL #define EAM #define EAN #define EAO #define EAP #define EAQ #define EAR #define EAS #define EAT #define EAU #define EAV #define EAW #define EAX #define EAY #define EAZ #define EBA #define EBB #define EBC #define EBD #define EBE #define EBF #define EBG #define EBH #define EBI #define EBJ #define EBK #define EBL #define EBM #define EBN #define EBO #define EBP #define EBQ #define EBR #define EBS #define EBT #define EBU #define EBV #define EBW #define EBX #define EBY #define EBZ #define ECA #define ECB #define ECC #define ECD #define ECE #define ECF #define ECG #define ECH #define ECI #define ECJ #define ECK #define ECL #define ECM #define ECN #define ECO #define ECP #define ECQ #define ECR #define ECS #define ECT #define ECU #define ECV #define ECW #define ECX #define ECY #define ECZ #define EDA #define EDB #define EDC #define EDD #define EDE #define EDF #define EDG #define EDH #define EDI #define EDJ #define EDK #define EDL #define EDM #define EDN #define EDO #define EDP #define EDQ #define EDR #define EDS #define EDT #define EDU #define EDV #define EDW #define EDX #define EDY #define EDZ #define EEA #define EEB #define EEC #define EED #define EEE #define EEF #define EEG #define EEH #define EEI #define EEJ #define EEK #define EEL #define EEM #define EEN #define EEO #define EEP #define EEQ #define EER #define EES #define EET #define EEU #define EEV #define EEW #define EEX #define EEY #define EEZ #define EFA #define EFB #define EFC #define EFD #define EFE #define EFF #define EFG #define EFH #define EFI #define EFJ #define EFK #define EFL #define EFM #define EFN #define EFO #define EFP #define EFQ #define EFR #define EFS #define EFT #define EFU #define EFV #define EFW #define EFX #define EFY #define EFZ #define EGA #define EGB #define EGC #define EGD #define EGE #define EGF #define EGG #define EGH #define EGI #define EGJ #define EGK #define EGL #define EGM #define EGN #define EGO #define EGP #define EGQ #define EGR #define EGS #define EGT #define EGU #define EGV #define EGW #define EGX #define EGY #define EGZ #define EHA #define EHB #define EHC #define EHD #define EHE #define EHF #define EHG #define EHH #define EHI #define EHJ #define EHK #define EHL #define EHM #define EHN #define EHO #define EHP #define EHQ #define EHR #define EHS #define EHT #define EHU #define EHV #define EHW #define EHX #define EHY #define EHZ #define EIA #define EIB #define EIC #define EID #define EIE #define EIF #define EIG #define EIH #define EII #define EIJ #define EIK #define EIL #define EIM #define EIN #define EIO #define EIP #define EIQ #define EIR #define EIS #define EIT #define EIU #define EIV #define EIW #define EIX #define EIY #define EIZ #define EJA #define EJB #define EJC #define EJD #define EJE #define EJF #define EJG #define EJH #define EJI #define EJJ #define EJK #define EJL #define EJM #define EJN #define EJO #define EJP #define EJQ #define EJR #define EJS #define EJT #define EJU #define EJV #define EJW #define EJX #define EJY #define EJZ #define EKA #define EKB #define EKC #define EKD #define EKE #define EKF #define EKG #define EKH #define EKI #define EKJ #define EKK #define EKL #define EKM #define EKN #define EKO #define EKP #define EKQ #define EKR #define EKS #define EKT #define EKU #define EKV #define EKW #define EKX #define EKY #define EKZ #define ELA #define ELB #define ELC #define ELD #define ELE #define ELF #define ELG #define ELH #define ELI #define ELJ #define ELK #define ELL #define ELM #define ELN #define ELO #define ELP #define ELQ #define ELR #define ELS #define ELT #define ELU #define ELV #define ELW #define ELX #define ELY #define ELZ #define EMA #define EMB #define EMC #define EMD #define EME #define EMF #define EMG #define EMH #define EMI #define EMJ #define EMK #define EML #define EMM #define EMN #define EMO #define EMP #define EMQ #define EMR #define EMS #define EMT #define EMU #define EMV #define EMW #define EMX #define EMY #define EMZ #define ENA #define ENB #define ENC #define END #define ENE #define ENF #define ENG #define ENH #define ENI #define ENJ #define ENK #define ENL #define ENM #define ENN #define ENO #define ENP #define ENQ #define ENR #define ENS #define ENT #define ENU #define ENV #define ENW #define ENX #define ENY #define ENZ #define EOA #define EOB #define EOC #define EOD #define EOE #define EOF #define EOG #define EOH #define EOI #define EOJ #define EOK #define EOL #define EOM #define EON #define EOO #define EOP #define EOQ #define EOR #define EOS #define EOT #define EOU #define EOV #define EOW #define EOX #define EOY #define EOZ #define EPA #define EPB #define EPC #define EPD #define EPE #define EPF #define EPG #define EPH #define EPI #define EPJ #define EPK #define EPL #define EPM #define EPN #define EPO #define EPP #define EPQ #define EPR #define EPS #define EPT #define EPU #define EPV #define EPW #define EPX #define EPY #define EPZ #define EQA #define EQB #define EQC #define EQD #define EQE #define EQF #define EQG #define EQH #define EQI #define EQJ #define EQK #define EQL #define EQM #define EQN #define EQO #define EQP #define EQQ #define EQR #define EQS #define EQT #define EQU #define EQV #define EQW #define EQX #define EQY #define EQZ #define ERA #define ERB #define ERC #define ERD #define ERE #define ERF #define ERG #define ERH #define ERI #define ERJ #define ERK #define ERL #define ERM #define ERN #define ERO #define ERP #define ERQ #define ERR #define ERS #define ERT #define ERU #define ERV #define ERW #define ERX #define ERY #define ERZ #define ESA #define ESB #define ESC #define ESD #define ESE #define ESF #define ESG #define ESH #define ESI #define ESJ #define ESK #define ESL #define ESM #define ESN #define ESO #define ESP #define ESQ #define ESR #define ESS #define EST #define ESU #define ESV #define ESW #define ESX #define ESY #define ESZ #define ETA #define ETB #define ETC #define ETD #define ETE #define ETF #define ETG #define ETH #define ETI #define ETJ #define ETK #define ETL #define ETM #define ETN #define ETO #define ETP #define ETQ #define ETR #define ETS #define ETT #define ETU #define ETV #define ETW #define ETX #define ETY #define ETZ #define EUA #define EUB #define EUC #define EUD #define EUE #define EUF #define EUG #define EUH #define EUI #define EUJ #define EUK #define EUL #define EUM #define EUN #define EUO #define EUP #define EUQ #define EUR #define EUS #define EUT #define EUU #define EUV #define EUW #define EUX #define EUY #define EUZ #define EVA #define EVB #define EVC #define EVD #define EVE #define EVF #define EVG #define EVH #define EVI #define EVJ #define EVK #define EVL #define EVM #define EVN #define EVO #define EVP #define EVQ #define EVR #define EVS #define EVT #define EVU #define EVV #define EVW #define EVX #define EVY #define EVZ #define EWA #define EWB #define EWC #define EWD #define EWE #define EWF #define EWG #define EWH #define EWI #define EWJ #define EWK #define EWL #define EWM #define EWN #define EWO #define EWP #define EWQ #define EWR #define EWS #define EWT #define EWU #define EWV #define EWW #define EWX #define EWY #define EWZ #define EXA #define EXB #define EXC #define EXD #define EXE #define EXF #define EXG #define EXH #define EXI #define EXJ #define EXK #define EXL #define EXM #define EXN #define EXO #define EXP #define EXQ #define EXR #define EXS #define EXT #define EXU #define EXV #define EXW #define EXX #define EXY #define EXZ #define EYA #define EYB #define EYC #define EYD #define EYE #define EYF #define EYG #define EYH #define EYI #define EYJ #define EYK #define EYL #define EYM #define EYN #define EYO #define EYP #define EYQ #define EYR #define EYS #define EYT #define EYU #define EYV #define EYW #define EYX #define EYY #define EYZ #define EZA #define EZB #define EZC #define EZD #define EZE #define EZF #define EZG #define EZH #define EZI #define EZJ #define EZK #define EZL #define EZM #define EZN #define EZO #define EZP #define EZQ #define EZR #define EZS #define EZT #define EZU #define EZV #define EZW #define EZX #define EZY #define EZZ #define FAA #define FAB #define FAC #define FAD #define FAE #define FAF #define FAG #define FAH #define FAI #define FAJ #define FAK #define FAL #define FAM #define FAN #define FAO #define FAP #define FAQ #define FAR #define FAS #define FAT #define FAU #define FAV #define FAW #define FAX #define FAY #define FAZ #define FBA #define FBB #define FBC #define FBD #define FBE #define FBF #define FBG #define FBH #define FBI #define FBJ #define FBK #define FBL #define FBM #define FBN #define FBO #define FBP #define FBQ #define FBR #define FBS #define FBT #define FBU #define FBV #define FBW #define FBX #define FBY #define FBZ #define FCA #define FCB #define FCC #define FCD #define FCE #define FCF #define FCG #define FCH #define FCI #define FCJ #define FCK #define FCL #define FCM #define FCN #define FCO #define FCP #define FCQ #define FCR #define FCS #define FCT #define FCU #define FCV #define FCW #define FCX #define FCY #define FCZ #define FDA #define FDB #define FDC #define FDD #define FDE #define FDF #define FDG #define FDH #define FDI #define FDJ #define FDK #define FDL #define FDM #define FDN #define FDO #define FDP #define FDQ #define FDR #define FDS #define FDT #define FDU #define FDV #define FDW #define FDX #define FDY #define FDZ #define FEA #define FEB #define FEC #define FED #define FEE #define FEF #define FEG #define FEH #define FEI #define FEJ #define FEK #define FEL #define FEM #define FEN #define FEO #define FEP #define FEQ #define FER #define FES #define FET #define FEU #define FEV #define FEW #define FEX #define FEY #define FEZ #define FFA #define FFB #define FFC #define FFD #define FFE #define FFF #define FFG #define FFH #define FFI #define FFJ #define FFK #define FFL #define FFM #define FFN #define FFO #define FFP #define FFQ #define FFR #define FFS #define FFT #define FFU #define FFV #define FFW #define FFX #define FFY #define FFZ #define FGA #define FGB #define FGC #define FGD #define FGE #define FGF #define FGG #define FGH #define FGI #define FGJ #define FGK #define FGL #define FGM #define FGN #define FGO #define FGP #define FGQ #define FGR #define FGS #define FGT #define FGU #define FGV #define FGW #define FGX #define FGY #define FGZ #define FHA #define FHB #define FHC #define FHD #define FHE #define FHF #define FHG #define FHH #define FHI #define FHJ #define FHK #define FHL #define FHM #define FHN #define FHO #define FHP #define FHQ #define FHR #define FHS #define FHT #define FHU #define FHV #define FHW #define FHX #define FHY #define FHZ #define FIA #define FIB #define FIC #define FID #define FIE #define FIF #define FIG #define FIH #define FII #define FIJ #define FIK #define FIL #define FIM #define FIN #define FIO #define FIP #define FIQ #define FIR #define FIS #define FIT #define FIU #define FIV #define FIW #define FIX #define FIY #define FIZ #define FJA #define FJB #define FJC #define FJD #define FJE #define FJF #define FJG #define FJH #define FJI #define FJJ #define FJK #define FJL #define FJM #define FJN #define FJO #define FJP #define FJQ #define FJR #define FJS #define FJT #define FJU #define FJV #define FJW #define FJX #define FJY #define FJZ #define FKA #define FKB #define FKC #define FKD #define FKE #define FKF #define FKG #define FKH #define FKI #define FKJ #define FKK #define FKL #define FKM #define FKN #define FKO #define FKP #define FKQ #define FKR #define FKS #define FKT #define FKU #define FKV #define FKW #define FKX #define FKY #define FKZ #define FLA #define FLB #define FLC #define FLD #define FLE #define FLF #define FLG #define FLH #define FLI #define FLJ #define FLK #define FLL #define FLM #define FLN #define FLO #define FLP #define FLQ #define FLR #define FLS #define FLT #define FLU #define FLV #define FLW #define FLX #define FLY #define FLZ #define FMA #define FMB #define FMC #define FMD #define FME #define FMF #define FMG #define FMH #define FMI #define FMJ #define FMK #define FML #define FMM #define FMN #define FMO #define FMP #define FMQ #define FMR #define FMS #define FMT #define FMU #define FMV #define FMW #define FMX #define FMY #define FMZ #define FNA #define FNB #define FNC #define FND #define FNE #define FNF #define FNG #define FNH #define FNI #define FNJ #define FNK #define FNL #define FNM #define FNN #define FNO #define FNP #define FNQ #define FNR #define FNS #define FNT #define FNU #define FNV #define FNW #define FNX #define FNY #define FNZ #define FOA #define FOB #define FOC #define FOD #define FOE #define FOF #define FOG #define FOH #define FOI #define FOJ #define FOK #define FOL #define FOM #define FON #define FOO #define FOP #define FOQ #define FOR #define FOS #define FOT #define FOU #define FOV #define FOW #define FOX #define FOY #define FOZ #define FPA #define FPB #define FPC #define FPD #define FPE #define FPF #define FPG #define FPH #define FPI #define FPJ #define FPK #define FPL #define FPM #define FPN #define FPO #define FPP #define FPQ #define FPR #define FPS #define FPT #define FPU #define FPV #define FPW #define FPX #define FPY #define FPZ #define FQA #define FQB #define FQC #define FQD #define FQE #define FQF #define FQG #define FQH #define FQI #define FQJ #define FQK #define FQL #define FQM #define FQN #define FQO #define FQP #define FQQ #define FQR #define FQS #define FQT #define FQU #define FQV #define FQW #define FQX #define FQY #define FQZ #define FRA #define FRB #define FRC #define FRD #define FRE #define FRF #define FRG #define FRH #define FRI #define FRJ #define FRK #define FRL #define FRM #define FRN #define FRO #define FRP #define FRQ #define FRR #define FRS #define FRT #define FRU #define FRV #define FRW #define FRX #define FRY #define FRZ #define FSA #define FSB #define FSC #define FSD #define FSE #define FSF #define FSG #define FSH #define FSI #define FSJ #define FSK #define FSL #define FSM #define FSN #define FSO #define FSP #define FSQ #define FSR #define FSS #define FST #define FSU #define FSV #define FSW #define FSX #define FSY #define FSZ #define FTA #define FTB #define FTC #define FTD #define FTE #define FTF #define FTG #define FTH #define FTI #define FTJ #define FTK #define FTL #define FTM #define FTN #define FTO #define FTP #define FTQ #define FTR #define FTS #define FTT #define FTU #define FTV #define FTW #define FTX #define FTY #define FTZ #define FUA #define FUB #define FUC #define FUD #define FUE #define FUF #define FUG #define FUH #define FUI #define FUJ #define FUK #define FUL #define FUM #define FUN #define FUO #define FUP #define FUQ #define FUR #define FUS #define FUT #define FUU #define FUV #define FUW #define FUX #define FUY #define FUZ #define FVA #define FVB #define FVC #define FVD #define FVE #define FVF #define FVG #define FVH #define FVI #define FVJ #define FVK #define FVL #define FVM #define FVN #define FVO #define FVP #define FVQ #define FVR #define FVS #define FVT #define FVU #define FVV #define FVW #define FVX #define FVY #define FVZ #define FWA #define FWB #define FWC #define FWD #define FWE #define FWF #define FWG #define FWH #define FWI #define FWJ #define FWK #define FWL #define FWM #define FWN #define FWO #define FWP #define FWQ #define FWR #define FWS #define FWT #define FWU #define FWV #define FWW #define FWX #define FWY #define FWZ #define FXA #define FXB #define FXC #define FXD #define FXE #define FXF #define FXG #define FXH #define FXI #define FXJ #define FXK #define FXL #define FXM #define FXN #define FXO #define FXP #define FXQ #define FXR #define FXS #define FXT #define FXU #define FXV #define FXW #define FXX #define FXY #define FXZ #define FYA #define FYB #define FYC #define FYD #define FYE #define FYF #define FYG #define FYH #define FYI #define FYJ #define FYK #define FYL #define FYM #define FYN #define FYO #define FYP #define FYQ #define FYR #define FYS #define FYT #define FYU #define FYV #define FYW #define FYX #define FYY #define FYZ #define FZA #define FZB #define FZC #define FZD #define FZE #define FZF #define FZG #define FZH #define FZI #define FZJ #define FZK #define FZL #define FZM #define FZN #define FZO #define FZP #define FZQ #define FZR #define FZS #define FZT #define FZU #define FZV #define FZW #define FZX #define FZY #define FZZ #define GAA #define GAB #define GAC #define GAD #define GAE #define GAF #define GAG #define GAH #define GAI #define GAJ #define GAK #define GAL #define GAM #define GAN #define GAO #define GAP #define GAQ #define GAR #define GAS #define GAT #define GAU #define GAV #define GAW #define GAX #define GAY #define GAZ #define GBA #define GBB #define GBC #define GBD #define GBE #define GBF #define GBG #define GBH #define GBI #define GBJ #define GBK #define GBL #define GBM 0x0fff #endif #endif mcpp-2.7.2/test-t/n_tlim_7.t0000644000175000017500000001042610216765467012540 00000000000000/* n_tlim_7.t: Characters in a string (after concatenation) : at least 4095 bytes. */ /* 4095 bytes long. */ char *string4093 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; mcpp-2.7.2/test-t/misc.t0000644000175000017500000002110410451745276011753 00000000000000/* * M I S C . T * 1998/08 Made public. kmatsui * 2003/11 Slightly revised. kmatsui * 2004/11 Split samples for "Reiser cpp" as "trad.t". * Removed duplicate samples with other testcases. * kmatsui * * Miscellaneous texts for test of preprocessor. * * PART 1, 2 are excerpts from * ISO C 6.8.3 "Examples" * Some other examples are excerpted from : * P.J.Plauger "The Standard C Library", * GCC "cpp.info" */ /* * PART 1 * Weird tests of macro rescan. */ #define x 3 #define f(a) f(x * (a)) #undef x #define x 2 #define g f #define z z[0] #define h g(~ #define m(a) a(w) #define w 0,1 #define t(a) a rescan() { /* f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); * * should expand to: * * f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); */ f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); /* g(x+(3,4)-w) | h 5) & m * (f)^m(m); * * should result in: * * f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); */ g(x+(3,4)-w) | h 5) & m (f)^m(m); } /* * PART 2 * Tests of creating string literal and concatenation of tokens. */ #define str(s) # s #define xstr(s) str(s) #define debug(s,t) printf("x" # s "= %d, x" # t "= %s", \ x ## s, x ## t) #define INCFILE(n) vers ## n /* comment */ #define glue(a, b) a ## b #define xglue(a, b) glue(a, b) #define HIGHLOW "hello" #define LOW LOW ", world" stringize() { /* debug(1, 2); * * should result in: * * printf("x" "1" "= %d, x" "2" "= %s", x1, x2); * * after concatenation of the character string literals: * * printf("x1= %d, x2= %s", x1, x2); */ debug(1, 2); /* fputs(str(strncmp("abc\0d", "abc", '\4') * == 0) str(: @\n), s); * * should result in: * * fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s); * * after concatenation of the character string literals (exactly, the each * escape sequences are converted to a corresponding character prior to the * concatenation): * * fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0: @\n", s); */ fputs(str(strncmp("abc\0d", "abc", '\4') /* this goes away */ == 0) str(: @\n), s); /* glue(HIGH, LOW); * * should result in: * * "hello"; */ glue(HIGH, LOW); /* xglue(HIGH, LOW) * * should result in: * * "hello" ", world" * * after concatenation of the character string literals: * * "hello, world" */ xglue(HIGH, LOW) } #undef f #undef g #undef h #undef m #undef t #undef w #undef x #undef z /* #include xstr(INCFILE(2).h) * * should expand to (after macro replacement, before file access): * * #include "vers2.h" * * "vers2.h" includes and for the later tests. */ #include xstr(INCFILE(2).h) /* * PART 3 * More tests of token concatenation, taken from * Kernighan & Ritchie "The C Programming Language", 2nd. Ed., A12.3. */ concat() { /* This is expanded to: * abc; */ xglue( xglue( a, b), c); /* This is also expanded to: * abc; */ xglue( glue( a, b), c); /* Results of these macro calls are undefined, once expanded to: * glue( a, b)c; * xglue( a, b)c; * ')c' is not a valid preprocessing token. */ glue( glue( a, b), c); glue( xglue( a, b), c); } /* * PART 4 * More samples of token concatenation. */ #define COMMAND( name) { # name, name ## _command } struct command commands[] = { /* { "quit", quit_command }, */ COMMAND (quit), /* { "help", help_command }, */ COMMAND (help), }; #define maxof( type) maxof ## type #define DefMax( type) \ type maxof( type)( type a, type b) \ { \ return (( a > b) ? a : b); \ } /* int maxofint( int a, int b) { return (( a > b) ? a : b); } */ DefMax( int) /* double maxofdouble( double a, double b) * { return (( a > b) ? a : b); } */ DefMax( double) /* * PART 5 * Test of stringization. */ line() { /* 211; "211"; "__LINE__"; */ __LINE__; xstr( __LINE__); str( __LINE__); } /* * PART 6 * Tests of handling escape sequences. * Tests of concatenation of string literals. */ escape() { #undef NDEBUG #include /* In ASCII character set */ assert( '\a' == 7); /* After string concatenation : * results somehow as this: * ((strcmp( "132", "132") == 0) ? (void) 0 : * _assert( "strcmp( \"\\x31\" \"32\", \"132\") == 0", * "misc.t",270)); * ((strcmp( "132", "132") == 0) ? (void) 0 : * _assert( "strcmp( \"\\61\" \"32\", \"132\") == 0", * "misc.t",271)); */ assert( strcmp( "\x31" "32", "132") == 0); assert( strcmp( "\61" "32", "132") == 0); /* * In the messy encoding of KANJI called shift-JIS, "ɽ" is encoded as * "\x95\x5C", the latter byte is not a beginning of an escape sequence. */ assert( strcmp( "ɽ" "", "ɽ") == 0); } /* * PART 7 * Tests of evaluating constant expression in long, unsigned long. * Tests of , . */ #include #if INT_MAX < INT_MIN || UINT_MAX <= INT_MAX # error bad int properties #endif #if LONG_MAX < 2147483647 || -2147483647 < LONG_MIN || LONG_MAX < INT_MAX # error bad long properties #endif #define NDEBUG #include assert_long() { /* This macro is ineffective now that NDEBUG is defined. */ assert( LONG_MAX >= 2147483647 && -2147483647 >= LONG_MIN && LONG_MAX >= INT_MAX); } ulong() { /* For the compiler which has unsigned long data type */ #if defined ULONG_MAX && (ULONG_MAX < 4294967295 \ || ULONG_MAX / 2 < LONG_MAX || ULONG_MAX < UINT_MAX) # error bad unsigned long properties #endif } internal() { /* The following 2 samlpes overflow on two's complement representation. */ #if -LONG_MIN == LONG_MAX This is not a "two's complement" representation. #endif #if LONG_MIN * -1 == LONG_MAX This is not a "two's complement" representation. #endif /* On two's complement representation this expression evaluate to false. */ #if defined (ULONG_MAX) && ULONG_MAX / 2 > LONG_MIN This is not "two's complement" representation or mis-implementation. #endif /* Right bit-shift of negative number is implementation-defined. */ #if -2 >> 1 == -1 Arithmetic right shift of negative number. #elif -2 >> 1 == LONG_MAX Logical shift of negative number of "two's complement" representation. #else Maybe logical shift of other than "two's complement" representation. #endif /* Dividing or modulo containing negative operand is not portable. */ #if -7 / 3 != -2 Not algebraic dividing of negative number. #endif #if -7 % 3 != -1 What ? #endif } /* * PART 8 * Extended or obsolete facilities. */ non_standard() { #if defined __cplusplus || __STDC_VERSION__ == 199901L // Comment in C++ style, terminating with '\x95\x5C' encoded in shift-JIS ɽ "__cplusplus" is defined or "__STDC_VERSION__" equals 199901L. #endif /* sizeof in #if expression is disallowed in Standard C */ #if sizeof (long) < sizeof (int) # error bad long properties #endif #if sizeof (char *) == 2 && sizeof (int (*)()) == 2 puts( "This is a small memory model."); #endif #if __MCPP > 1 /* Trace the process of macro expansion */ #ifdef __STDC__ #pragma MCPP debug memory /* list heap memory */ #pragma MCPP debug token /* trace token */ #else #debug memory #debug token #endif /* glue ( a, b)c; */ glue( glue( a, b), c); #ifdef __STDC__ #pragma MCPP end_debug token /* no debug */ #else #end_debug token #endif #endif /* __MCPP */ #define TRUE 1 #define FALSE 0 #ifndef __STDC__ #ifdef __MCPP #assert TRUE != 0 && FALSE == 0 #endif #endif } put_long() { char * line = "line"; #ifndef __STDC__ #ifdef __MWC09__ /* Assemly source for Microware-C/09 */ /* fputs( line, stdout); */ #asm leax _iob+13,y /* stdout */ pshs x ldd 2,s /* line */ pshs d lbsr fputs leas 4,s #endasm #endif #endif } /* * PART 9 * Ambiguous macros and others. */ wide_and_nonwide() { /* Wide-character string literal following string literal and vice versa. */ "string" L""; L"" "string"; } ambiguous() { /* Result of "f(2)(9)" is left intentionally ambiguous by Standard (ANSI C "Rationale", 3.8.3.4). */ /* 2*f(9); or 2*9*g; */ #define f(a) a*g #define g(a) f(a) f(2)(9); } mcpp-2.7.2/test-t/u_1_14.t0000644000175000017500000000067310216765467012023 00000000000000/* u_1_14.t: Undefined behaviors on undefined #line syntax. */ /* u.1.14: #line directive without an argument of line number. */ #line "filename" /* u.1.15: #line directive with the second argument of other than string literal. */ #line 1234 filename /* u.1.16: Excessive argument in #line directive. */ #line 2345 "filename" Junk /* 14; "u_1_14.t"; or other undefined results. */ __LINE__; __FILE__; mcpp-2.7.2/test-t/n_4.t0000644000175000017500000000037510216765467011512 00000000000000/* n_4.t: Special tokens. */ /* 4.1: Digraph spellings in directive line. */ /* "abc"; */ %: define stringize( a) %: a stringize( abc); /* 4.2: Digraph spellings are retained in stringization. */ /* "<:"; */ stringize( <:); mcpp-2.7.2/test-t/n_9.t0000644000175000017500000000026210216765467011512 00000000000000/* n_9.t: #pragma directive. */ /* 9.1: Any #pragma directive should be processed or ignored, should not be diagnosed as an error. */ #pragma once #pragma who knows ? mcpp-2.7.2/test-t/n_std99.t0000644000175000017500000002601710633151133012302 00000000000000/* * n_std99.t * * 2002/08 kmatsui * * Samples to test Standard C99 preprocessing. */ /* n_ucn1: Universal-character-name */ /* UCN in character constant */ #if '\u5B57' UCN-16bits is implemented. #endif #if '\U00006F22' UCN-32bits is implemented. #endif /* UCN in string literal */ "abc\u6F22\u5B57xyz"; /* i.e. "abcxyx"; */ /* UCN in identifier */ #define macro\u5B57 9 #define macro\U00006F22 99 macro\u5B57 /* 9 */ macro\U00006F22 /* 99 */ macro\U00006f22 /* 99 */ /* n_ucn2.t: Universal-character-name */ /* UCN in pp-number */ #define mkint( a) a ## 1\u5B57 int mkint( abc) = 0; /* int abc1\u5B57 = 0; */ /* n_dslcom.t: // is a comment of C99. */ /* a; */ a; // is a comment of C99 /* n_ppnum.t: Preprocessing number token *p+* */ /* Undefined on C90, because '+A' is not a valid pp-token. */ #define A 3 #define glue( a, b) a ## b /* 12p+A; */ glue( 12p+, A); /* n_line.t: line number argument of #line */ /* C99: Range of line number in #line directive is [1..2147483647] */ /* 2147483647; */ #line 2147483647 __LINE__; #line 62 /* Resume the real line number */ __LINE__; /* n_llong.t: long long in #if expression */ #if 12345678901234567890 < 13345678901234567890 "long long #if expression is implemented." #else "long long #if expression is not implemented." #endif #if 12345678901234567890ULL < 13345678901234567890ULL Valid block #else Block to be skipped #endif #if (0x7FFFFFFFFFFFFFFFLL - 0x6FFFFFFFFFFFFFFFLL) >> 60 == 1 Valid block #else Block to be skipped #endif /* n_vargs.t: Macro of variable arguments */ /* from C99 Standard 6.10.3 Examples */ #define debug( ...) fprintf( stderr, __VA_ARGS__) #define showlist( ...) puts( #__VA_ARGS__) #define report( test, ...) ((test) ? puts( #test) \ : printf( __VA_ARGS__)) { /* fprintf( stderr, "Flag"); */ debug( "Flag"); /* fprintf( stderr, "X = %d\n", x); */ debug( "X = %d\n", x); /* puts( "The first, second, and third items."); */ showlist( The first, second, and third items.); /* ((x>y) ? puts( "x>y") : printf( "x is %d but y is %d", x, y)); */ report( x>y, "x is %d but y is %d", x, y); } /* n_pragma.t: _Pragma() operator */ /* based on the proposal to C99 by Bill Homer */ #define Machine_B #include "pragmas.h" /* #pragma vfunction */ Fast_call void f(int n, double * a, double * b) { /* #pragma ivdep */ Independent while(n-- > 0) { *a++ += *b++; } } #define f(N, A, B) \ { int n = (N), double * a = (A), double * b = (B); \ Independent while(n-- > 0) { *a++ += *b++; } \ } #define EXPRAG(x) _Pragma(#x) #define PRAGMA(x) EXPRAG(x) #define LIBFUNC xyz int libfunc() { ... } /* Direct the linker to define alternate entry points for libfunc. */ /* #pragma duplicate libfunc as (lib_func,xyz) */ PRAGMA( duplicate libfunc as (lib_func,LIBFUNC) ) /* n_nularg.t: Empty argument of macro call. */ #define ARG( a) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( CON, )", "CON"); */ SHOWS( APPEND( CON, )); /* printf( "%s : %s\n", "APPEND( , )", ""); */ SHOWS( APPEND( , )); /* n_stdmac.t: C99 Standard pre-defined macros. */ /* 199901L; */ __STDC_VERSION__; /* 1; or 0; */ __STDC_HOSTED__; /* n_tlimit.t: Tests of translation limits. */ /* 37.1L: Number of parameters of macro definition: at least 127. */ #define glue127( \ a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \ a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \ a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \ a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \ a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \ a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \ a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7) \ a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \ p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## o7 /* 37.2L: Number of arguments of macro call: at least 127. */ /* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6O7; */ glue127( A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1, A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2, A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4, A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5, A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6, A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7); /* 37.3L: Significant initial characters in an internal identifier or a macro name: at least 63 bytes. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; /* 37.4L: Nested conditional inclusion: at least 63 level. */ /* ifdef_nest = 0x3f; */ #define X3F #include "ifdef15.h" /* 37.5L: Nested source file inclusion: at least 15 level. */ /* nest = 0x0f; */ #define X0F #include "nest1.h" /* 37.6L: Parenthesized expression: at least 63 level. */ /* nest = 63; */ #if \ (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \ (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \ (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \ (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \ (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \ (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \ (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \ (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E) \ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ == -1 nest = 63; #endif /* 37.7L: Characters in a string (after concatenation) : at least 4095 bytes. */ /* 4095 bytes long. */ char *string4093 = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ 9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\ f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" ; /* 37.8L: Length of logical source line: at least 4095 bytes. */ #include "long4095.h" /* 37.9L: Number of macro definitions: at least 4095. */ #undef ARG #include "m4095.h" /* 0x0fff; */ GBM; mcpp-2.7.2/test-t/n_6.t0000644000175000017500000000106010216765467011504 00000000000000/* n_6.t: #include directive. */ /* 6.1: Header-name quoted by " and " as well as by < and > can include standard headers. */ /* Note: Standard headers can be included any times. */ #include "ctype.h" #include /* 6.2: Macro is allowed in #include line. */ #define HEADER "header.h" /* Before file inclusion: #include "header.h" */ #include HEADER /* abc */ MACRO_abc /* 6.3: With macro nonsence but legal. */ #undef MACRO_abc #define ZERO_TOKEN #include ZERO_TOKEN HEADER ZERO_TOKEN /* abc */ MACRO_abc mcpp-2.7.2/test-t/u_1_7_eucjp.t0000644000175000017500000000040410216765467013123 00000000000000/* u_1_7_eucjp.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma __setlocale( "eucjp") /* For MCPP */ str( ""); /* 0xb1a0 */ mcpp-2.7.2/test-t/u_1_13.t0000644000175000017500000000027110216765467012014 00000000000000/* u_1_13.t: Undefined behaviors on undefined #include syntax or header- name. */ /* u.1.13: Excessive argument in #include directive. */ #include Junk mcpp-2.7.2/test-t/e_32_5.t0000644000175000017500000000035010216765467011777 00000000000000/* e_32_5.t: Range error of character constant. */ /* 32.5: Value of a numerical escape sequence in character constant should be in the range of char. */ #if '\x123' == 0x123 /* Out of range */ #endif mcpp-2.7.2/test-t/vers2.h0000644000175000017500000000031210216765467012046 00000000000000/* vers2.h */ /* comment */ # /**/ pragma /**/ once /**/ #include #include /* * , might have the line * #pragma once * near the beginning. */ mcpp-2.7.2/test-t/m_33_eucjp.t0000644000175000017500000000112510216765467012753 00000000000000/* m_33_eucjp.t: Wide character constant encoded in EUC-JP. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "eucjp") /* For MCPP */ #pragma setlocale( "eucjp") /* For MCPP on VC */ #if L'' == '\xbb' * BYTES_VAL + '\xfa' Wide character is encoded in EUC-JP. #elif L'' == '\xfa' * BYTES_VAL + '\xbb' Wide character is encoded in EUC-JP. Inverted order of evaluation. #else I cannot understand EUC-JP. #endif #if L'' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/n_bool.t0000644000175000017500000000055210216765467012277 00000000000000/* bool.t */ /* * On C++: 'true' and 'false' are evaluated 1 and 0 respectively. * and logical AND, logical OR are evaluated boolean. */ /* Valid block; */ #define MACRO 1 #define MACRO3 3 #if MACRO == true Valid block; #else non-Valid block; #endif #if (MACRO && MACRO3) == true Valid block; #else non-Valid block; #endif mcpp-2.7.2/test-t/ifdef15.h0000644000175000017500000000115710216765467012240 00000000000000/* ifdef15.h */ #ifdef X01 #else #ifdef X02 #else #ifdef X03 #else #ifdef X04 #else #ifdef X05 #else #ifdef X06 #else #ifdef X07 #else #ifdef X08 #else #ifdef X09 #else #ifdef X0A #else #ifdef X0B #else #ifdef X0C #else #ifdef X0D #else #ifdef X0E #else #ifdef X0F ifdef_nest = 0x0f; #else #include "ifdef31.h" #endif /* X0F */ #endif /* X0E */ #endif /* X0D */ #endif /* X0C */ #endif /* X0B */ #endif /* X0A */ #endif /* X09 */ #endif /* X08 */ #endif /* X07 */ #endif /* X06 */ #endif /* X05 */ #endif /* X04 */ #endif /* X03 */ #endif /* X02 */ #endif /* X01 */ mcpp-2.7.2/test-t/m_34_utf8.t0000644000175000017500000000052210216765467012534 00000000000000/* m_34_utf8.t: Multi-byte character constant encoded in UTF-8. */ /* 34.1: */ #pragma __setlocale( "utf8") /* For MCPP */ #pragma setlocale( "utf8") /* For MCPP on VC */ #if '字' == '\xe5\xad\x97' Multi-byte character is encoded in UTF-8. #else I cannot understand UTF-8. #endif mcpp-2.7.2/test-t/e_std.t0000644000175000017500000001764710216765467012142 00000000000000/* * e_std.t * * 1998/08 made public kmatsui * 2002/08 revised not to conflict with C99 Standard kmatsui * 2003/11 added a few samples kmatsui * * Samples to test Standard C preprocessing. * Preprocessor must diagnose all of these samples appropriately. */ /* e_4_3.t: Illegal pp-token. */ /* 4.3: Empty character constant is an error. */ #if '' == 0 /* This line is invalid, maybe skipped. */ #endif /* This line maybe the second error. */ /* e_7_4.t: #line error. */ /* 7.4: string literal in #line directive shall be a character string literal. */ #line 123 L"wide" /* 27; "e_std.t"; */ __LINE__; __FILE__; /* Restore to correct line number. */ #line 31 /* e_12_8.t: Out of range of integer pp-token in #if expression. */ /* Note: Tests of character constant overflow are in 32.5, 33.2, 35.2. */ /* 12.8: Preprocessing number perhaps out of range of unsigned long. */ #if 123456789012345678901 #endif /* e_14.t: Illegal #if expressions. */ #define A 1 #define B 1 /* 14.1: String literal is not allowed in #if expression. */ #if "string" #endif /* The second error ? */ /* 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. */ #if A = B #endif #if A++ B #endif #if A --B #endif #if A.B #endif /* 14.3: Unterminated #if expression. */ #if 0 < #endif #if ( (A == B) #endif /* 14.4: Unbalanced parenthesis in #if defined operator. */ #if defined ( MACRO #endif /* 14.5: No argument. */ #if #endif /* 14.6: Macro expanding to 0 token in #if expression. */ #define ZERO_TOKEN #if ZERO_TOKEN #endif /* e_14_7.t: There is no keyword in #if expression. */ /* 14.7: sizeof operator is disallowed. */ /* Evaluated as: 0 (0) Constant expression syntax error. */ #if sizeof (int) #endif /* 14.8: type cast is disallowed. */ /* Evaluated as: (0)0x8000 Also a constant expression error. */ #if (int)0x8000 < 0 #endif /* e_14_9.t: Out of range in #if expression (division by 0). */ /* 14.9: Divided by 0. */ #if 1 / 0 #endif /* e_14_10.t: Overflow of constant expression in #if directive. */ /* 14.10: */ /* In C99, #if expression is evaluated in intmax_t */ #if __STDC_VERSION__ < 199901L #include #if LONG_MAX - LONG_MIN #endif #if LONG_MAX + 1 #endif #if LONG_MIN - 1 #endif #if LONG_MAX * 2 #endif #endif /* e_15_3.t: #ifdef, #ifndef syntax errors. */ /* 15.3: Not an identifier. */ #ifdef "string" #endif #ifdef 123 #endif /* 15.4: Excessive token sequence. */ #ifdef ZERO_TOKEN Junk #endif /* 15.5: No argument. */ #ifndef #endif /* e_16.t: Trailing junk of #else, #endif. */ /* 16.1: Trailing junk of #else. */ #define MACRO_0 0 #if MACRO_0 #else MACRO_0 /* 16.2: Trailing junk of #endif. */ #endif MACRO_0 /* e_17.t: Ill-formed group in a source file. */ #define MACRO_1 1 /* 17.1: Error of #endif without #if. */ #endif /* 17.2: Error of #else without #if. */ #else /* 17.3: Error of #else after #else. */ #if MACRO_1 #else /* line 159 */ #if 1 #else #endif #else #endif /* 17.4: Error of #elif after #else. */ #if MACRO_1 == 1 #else /* line 168 */ #elif MACRO_1 == 0 #endif /* 17.5: Error of #endif without #if in an included file. */ #if 1 #include "unbal1.h" /* 17.6: Error of unterminated #if section in an included file. */ #include "unbal2.h" #endif /* 17.7: Error of unterminated #if section. */ /* This error would be diagnosed at end of file. */ #if MACRO_1 == 0 /* line 182 */ #else /* e_18_4.t: #define syntax errors. */ /* 18.4: Not an identifier. */ #define "string" #define 123 /* 18.5: No argument. */ #define /* 18.6: Empty parameter list. */ #define math( op, a, ) op( (a), (b)) /* 18.7: Duplicate parameter names. */ #define math( op, a, a) op( (a), (b)) /* 18.8: Argument is not an identifier. */ #define NUMARGS( 1, +, 2) (1 + 2) /* 18.9: No space between macro name and replacement text. */ /* C90 (Corrigendum 1) forbids this if and only the replacement text begins with a non-basic-character. C99 forbids this even when the replacement text begins with basic- character. */ /* From ISO 9899:1990 / Corrigendum 1. */ #define THIS$AND$THAT(a, b) ((a) + (b)) /* Note: the following definition is legal (object-like macro). #define THIS $AND$THAT(a, b) ((a) + (b)) */ /* e_19_3.t: Redefinitions of macros. */ /* Excerpts from ISO C90 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* The following redefinitions should be diagnosed. */ /* 19.3: */ #define OBJ_LIKE (0) /* different token sequence */ /* (1-1); or (0); */ OBJ_LIKE; /* 19.4: */ #undef OBJ_LIKE #define OBJ_LIKE (1-1) #define OBJ_LIKE (1 - 1) /* different white space */ /* 19.5: */ #define FTN_LIKE(b) ( a ) /* different parameter usage */ /* ( x ); or ( a); */ FTN_LIKE(x); /* 19.6: */ #undef FTN_LIKE #define FTN_LIKE(a) ( a ) #define FTN_LIKE(b) ( b ) /* different parameter spelling */ /* 19.7: Not in ISO C "Examples" */ #define FTN_LIKE OBJ_LIKE /* e_23_3.t: ## operator shall not occur at the beginning or at the end of replacement list for either form of macro definition. */ /* 23.3: In object-like macro. */ #define con ## name #define cat 12 ## /* 23.4: In function-like macro. */ #define CON( a, b) ## a ## b #define CAT( b, c) b ## c ## /* e_24_6.t: Operand of # operator in function-like macro definition shall be a parameter name. */ /* 24.6: */ #define FUNC( a) # b /* e_25_6.t: Macro arguments are pre-expanded separately. */ /* 25.6: */ #define sub( x, y) (x - y) #define head sub( #define body(x,y) x,y #define tail ) #define head_body_tail( a, b, c) a b c /* "head" is once replaced to "sub(", then rescanning of "sub(" causes an uncompleted macro call. Expansion of an argument should complete within the argument. */ head_body_tail( head, body(a,b), tail); /* e_27_7.t: Error of rescanning. */ /* 27.7: */ #define TWO_ARGS a,b #define SUB( x, y) sub( x, y) /* Too many arguments error while rescanning after once replaced to: sub( a,b, 1); */ SUB( TWO_ARGS, 1); /* e_29_3.t: #undef errors. */ /* 29.3: Not an identifier. */ #undef "string" #undef 123 /* 29.4: Excessive token sequence. */ #undef MACRO_0 Junk /* 29.5: No argument. */ #undef /* e_31.t: Illegal macro calls. */ /* 31.1: Too many arguments error. */ sub( x, y, z); /* 31.2: Too few arguments error. */ sub( x); /* e_31_3.t: Macro call in control line should complete in the line. */ #define glue( a, b) a ## b #define str( s) # s #define xstr( s) str( s) /* 31.3: Unterminated macro call. */ #include xstr( glue( header, .h)) /* e_32_5.t: Range error of character constant. */ /* 32.5: Value of a numerical escape sequence in character constant should be in the range of char. */ #if '\x123' == 0x123 /* Out of range */ #endif /* e_33_2.t: Out of range of numerical escape sequence in wide-char. */ /* 33.2: Value of a numerical escape sequence in wide-character constant should be in the range of wchar_t. */ #if L'\xabcdef012' == 0xbcdef012 /* Perhaps out of range. */ #endif /* e_35_2.t: Out of range of character constant. */ /* 35.2: */ #if 'abcdefghi' /* Perhaps out of range. */ #endif /* Error of "unterminated #if section started at line 182" will be reported at end of file. */ mcpp-2.7.2/test-t/n_line.t0000644000175000017500000000026010216765467012267 00000000000000/* n_line.t: line number argument of #line */ /* C99: Range of line number in #line directive is [1..2147483647] */ /* 2147483647; */ #line 2147483647 __LINE__; mcpp-2.7.2/test-t/u_1_22.t0000644000175000017500000000163510216765467012021 00000000000000/* u_1_22.t: Undefined behaviors on generating invalid pp-token by # and ## operators. */ /* u.1.22: Result of ## operator is not a valid pp-token. */ #define NUM( dig, exp) dig ## E+ ## exp /* * "E+" is a sequence of two pp-tokens "E" and "+", not a single pp-token. * The first ## concatenates the last pp-token of first argument with "E", * and the second ## concatenates "+" with the first pp-token of the second * argument. * While "12E" (one of the sequence generated by the token concatenation) * is a valid pp-token, "+34" (the another sequence) is not a valid pp-token * and causes an undefined behavior. */ NUM( 12, 34); /* u.1.23: Result of # operator is not a valid string literal. */ /* "\\"\""; This sequence is parsed to three tokens "\\" \ "", and will be diagnosed by compiler-proper unless diagnosed by preprocessor. */ #define str( a) #a str( \""); mcpp-2.7.2/test-t/m_33_utf8.t0000644000175000017500000000122310216765467012532 00000000000000/* m_33_utf8.t: Wide character constant encoded in UTF-8. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "utf8") /* For MCPP */ #pragma setlocale( "utf8") /* For MCPP on VC */ #if L'字' == '\xe5' * BYTES_VAL * BYTES_VAL + '\xad' * BYTES_VAL + '\x97' Wide character is encoded in UTF-8. #elif L'字' == '\x97' * BYTES_VAL * BYTES_VAL + '\xad' * BYTES_VAL + '\xe5' Wide character is encoded in UTF-8. Inverted order of evaluation. #else I cannot understand UTF-8. #endif #if L'字' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/u_line.t0000644000175000017500000000061610216765467012303 00000000000000/* u_line.t: Undefined behaviors on out-of-range #line number. */ /* C99: Line number argument of #line directive should be in range of [1..2147483647] */ #line 2147483647 /* valid here */ /* line 2147483647 */ /* line 2147483648 ? : out of range */ __LINE__; /* 2147483649 ? or -2147483647 ?, maybe warned as an out-of-range */ #line 0 #line 2147483648 mcpp-2.7.2/test-t/undefs.t0000644000175000017500000001634510216765467012322 00000000000000/* * undefs.t: * 1998/08 made public kmatsui * 2002/12 slightly revised kmatsui * 2003/11 slightly revised kmatsui * * Each of the following texts causes undefined behavior. Good pre- * processor will diagnose or warn at these texts, or at least document the * behavior on these cases. */ #define str( a) # a /* u.1.1: End of a source file without . */ #include "unbal3.h" int e_1; /* u.1.2: End of a source file with . */ #include "unbal4.h" ; /* u.1.3: End of a source file with an unterminated comment. */ #include "unbal5.h" */ /* u.1.4: End of a source file with an uncompleted macro call. */ #include "unbal6.h" y); /* u.1.5: Illegal characters (in other than string literal, character constant, header-name or comment). */ #if 1 ||2 /* 0x1e ^ ^ 0x1f */ #endif /* Maybe the second error. */ /* u.1.6: [VT], [FF] in directive line. */ #if 1 || 2 /* [VT] ^ ^ [FF] */ #endif /* Maybe the second error. */ /* u.1.7: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #if '== 0x8e /* ^ 0x8e */ #endif /* Maybe the second error. */ /* u.1.8: Unterminated character constant. */ /* The following "comment" may not interpreted as a comment but swallowed by the unterminated character constant. */ #error I can't understand. /* Token error prior to execution of #error. */ /* u.1.9: Unterminated string literal. */ "String literal across the lines. " /* u.1.10: Unterminated header-name. */ #include Junk /* u.1.14: #line directive without an argument of line number. */ #line "filename" /* u.1.15: #line directive with the second argument of other than string literal. */ #line 1234 filename /* u.1.16: Excessive argument in #line directive. */ #line 2345 "filename" Junk /* 83; "undefs.t"; or other undefined results. */ __LINE__; __FILE__; /* u.1.17: Line number argument of #line directive should be in range of [1,32767]. */ /* In C99, range of line number is [1,2147483647] */ #if __STDC_VERSION__ < 199901L #line 32767 /* valid here */ /* line 32767 */ /* line 32768 ? : out of range */ __LINE__; /* 32769 ? or -32767 ?, maybe warned as an out-of-range */ #line 0 #line 32768 #else #line 2147483647 /* valid here */ /* line 2147483647 */ /* line 2147483648 ? : out of range */ __LINE__; /* 2147483649 ? or -2147483647 ?, maybe warned as an out-of-range */ #line 0 #line 2147483648 #endif /* u.1.18: Line number argument of #line directive should be written in decimal digits. */ #line 0x1000 #line 110 /* Restore to correct line number. */ /* u.1.19: A macro expanded to "defined" in #if expression. */ #define DEFINED defined #if DEFINED DEFINED #endif #undef __linux__ #undef __arm__ #define __linux__ 1 #define HAVE_MREMAP defined(__linux__) && !defined(__arm__) /* Wrong macro definition. * This macro should be defined as follows. * #if defined(__linux__) && !defined(__arm__) * #define HAVE_MREMAP 1 * #endif */ #if HAVE_MREMAP mremap(); #endif /* u.1.20: Undefining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ or "defined" in #undef directive. */ #undef __LINE__ /* 134; or other undefined result. */ __LINE__; /* u.1.21: Defining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ or "defined" in #define directive. */ #define __LINE__ 1234 /* 140; or other undefined result. */ __LINE__; #define defined defined #if defined defined # error I am not a good preprocessor. #endif /* u.1.22: Result of ## operator is not a valid pp-token. */ #define NUM( dig, exp) dig ## E+ ## exp /* * "E+" is a sequence of two pp-tokens "E" and "+", not a single pp-token. * The first ## concatenates the last pp-token of first argument with "E", * and the second ## concatenates "+" with the first pp-token of the second * argument. * While "12E" (one of the sequence generated by the token concatenation) * is a valid pp-token, "+34" (the another sequence) is not a valid pp-token * and causes an undefined behavior. */ NUM( 12, 34); /* u.1.23: Result of # operator is not a valid string literal. */ /* "\\"\""; This sequence is parsed to three tokens "\\" \ "", and will be diagnosed by compiler-proper unless diagnosed by preprocessor. */ str( \""); /* u.1.24: Empty argument of macro call. */ /* * Empty argument is permitted in C99. * Note: Since no argument and one empty argument cannot be distinguished * syntactically, additional dummy argument may be necessary for an * intermediate macro to process one empty argument (if possible). */ #if __STDC_VERSION__ < 199910L #define ARG( a, dummy) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s, dummy)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); or other undefined behavior. */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); or other undefined behavior. */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( CON, )", "CON"); or other undefined behavior. */ SHOWS( APPEND( CON, )); /* printf( "%s : %s\n", "APPEND( , )", ""); or other undefined behavior. */ SHOWS( APPEND( , )); #endif /* u.1.25: Macro argument otherwise parsed as a directive. */ /* "#define NAME"; or other undefined behaviour. */ str( #define NAME ); #if 0 /* Added by C90: Corrigendum 1 (1994) and deleted by C99 */ /* u.1.26: Expanded macro replacement list end with name of function-like macro. */ #define SUB sub SUB( a, b); #endif /* u.1.27: Unknown preprocessing directive (other than #pragma). */ #ifdefined MACRO #endif /* The second error. */ #define D define /* u.1.28: There are following two ways of preprocessing. 1: "D" isn't expanded, because # is the first token of the line. Preprocessor reports that "D" is an unknown directive. 2: "D" is expanded, because that is not a directive. Compiler-phase will diagnose the output of preprocess. Anyway, preprocessor should not interprete this line as a preprocessing directive. */ #D A B /* u.2.1: Undefined escape sequence. */ #if '\x' #endif /* u.2.2: Illegal bit shift count. */ #if 1 << -1 #endif #if 1 << 64 #endif mcpp-2.7.2/test-t/n_8_2.t0000644000175000017500000000014310216765467011730 00000000000000/* n_8_2.t: Argument of #error is optional. */ /* 8.2: #error should be executed. */ #error mcpp-2.7.2/test-t/nest2.h0000644000175000017500000000006510216765467012045 00000000000000/* nest2.h */ nest = 2; #include "nest3.h" mcpp-2.7.2/test-t/u_2.t0000644000175000017500000000034210216765467011511 00000000000000/* u_2.t: Undefined behaviors on undefined constant expression. */ /* u.2.1: Undefined escape sequence. */ #if '\x' #endif /* u.2.2: Illegal bit shift count. */ #if 1 << -1 #endif #if 1 << 64 #endif mcpp-2.7.2/test-t/n_10.t0000644000175000017500000000120710216765467011562 00000000000000/* n_10.t: #if, #elif, #else and #endif pp-directive. */ #define MACRO_0 0 #define MACRO_1 1 /* 10.1: */ /* Note: an undefined identifier in #if expression is replaced to 0. */ /* 1; */ #if a a; #elif MACRO_0 MACRO_0; #elif MACRO_1 /* Valid block */ MACRO_1; #else 0; #endif /* 10.2: Comments must be processed even if in skipped #if block. */ /* At least tokenization of string literal and character constant is necessary to process comments, e.g. /* is not a comment mark in string literal. */ #ifdef UNDEFINED /* Comment */ "in literal /* is not a comment" #endif mcpp-2.7.2/test-t/i_mbident.t0000644000175000017500000000067710216765467012771 00000000000000/* i_mbident.t: Multi-byte characters in identifier and pp-number. */ /* Multi-byte characters in identifier. */ #define ޥ #define ؿͥޥ(1, 2) 1 ## 2 /* ; */ ޥ; /* ̾; */ ؿͥޥ(, ̾); /* Multi-byte character in pp-number. */ #define mkname( a) a ## 1 #define mkstr( a) xmkstr( a) #define xmkstr( a) # a /* "abc1" */ char * mkstr( mkname( abc)); mcpp-2.7.2/test-t/n_1.t0000644000175000017500000000063410216765467011505 00000000000000/* n_1.t: Conversion of trigraph sequences. */ /* 1.1: The following 9 sequences are valid trigraph sequences. */ /* [ ] \ ^ { } | ~ #; */ ??( ??) ??/ ??' ??< ??> ??! ??- ??=; /* 1.2: In directive line. */ /* ab | cd; */ ??= define OR( a, b) a ??! b OR( ab, cd); /* 1.3: Any sequence other than above 9 is not a trigraph sequence. */ /* ?? ??? ??% ??^ ?#; */ ?? ??? ??% ??^ ???=; mcpp-2.7.2/test-t/n_llong.t0000644000175000017500000000065710216765467012465 00000000000000/* n_llong.t: long long in #if expression */ #if 12345678901234567890 < 13345678901234567890 "long long #if expression is implemented." #else "long long #if expression is not implemented." #endif #if 12345678901234567890LL < 13345678901234567890LL Valid block #else Block to be skipped #endif #if (0x7FFFFFFFFFFFFFFFULL - 0x6FFFFFFFFFFFFFFFULL) >> 60 == 1 Valid block #else Block to be skipped #endif mcpp-2.7.2/test-t/n_cnvucn.cc0000644000175000017500000000114010216765467012754 00000000000000/* n_cnvucn.t: C++ Conversion from multi-byte character to UCN. */ /* This conversion takes place in the translation phase 1. */ #define str( a) # a /* "\"\u6F22\u5B57\"" or "\"\\u6F22\\u5B57\"" */ str( "") /* Multi-byte characters in identifier. */ #define ޥ #define ؿͥޥ(1, 2) 1 ## 2 /* ; */ ޥ; /* ̾; */ ؿͥޥ(, ̾); /* Multi-byte character in pp-number. */ #define mkname( a) a ## 1 #define mkstr( a) xmkstr( a) #define xmkstr( a) # a /* "abc1" */ char * mkstr( mkname( abc)); mcpp-2.7.2/test-t/LICENSE0000644000175000017500000000266410764236547011655 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/test-t/header.h0000644000175000017500000000005010216765467012234 00000000000000/* header.h */ #define MACRO_abc abc mcpp-2.7.2/test-t/ifdef31.h0000644000175000017500000000122310216765467012230 00000000000000/* ifdef31.h */ #ifdef X10 #else #ifdef X11 #else #ifdef X12 #else #ifdef X13 #else #ifdef X14 #else #ifdef X15 #else #ifdef X16 #else #ifdef X17 #else #ifdef X18 #else #ifdef X19 #else #ifdef X1A #else #ifdef X1B #else #ifdef X1C #else #ifdef X1D #else #ifdef X1E #else #ifdef X1F ifdef_nest = 0x1f; #else #include "ifdef63.h" #endif /* X1F */ #endif /* X1E */ #endif /* X1D */ #endif /* X1C */ #endif /* X1B */ #endif /* X1A */ #endif /* X19 */ #endif /* X18 */ #endif /* X17 */ #endif /* X16 */ #endif /* X15 */ #endif /* X14 */ #endif /* X13 */ #endif /* X12 */ #endif /* X11 */ #endif /* X10 */ mcpp-2.7.2/test-t/e_16.t0000644000175000017500000000031210216765467011553 00000000000000/* e_16.t: Trailing junk of #else, #endif. */ /* 16.1: Trailing junk of #else. */ #define MACRO_0 0 #if MACRO_0 #else MACRO_0 /* 16.2: Trailing junk of #endif. */ #endif MACRO_0 mcpp-2.7.2/test-t/m_33_jis.t0000644000175000017500000000137410216765467012440 00000000000000/* m_33_jis.t: Wide character constant encoded in ISO-2022-JP. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "jis") /* For MCPP */ #pragma setlocale( "jis") /* For MCPP on VC */ #if L'$B;z(B' == 0x3b * BYTES_VAL + 0x7a /* This line doesn't work unless "shift states" are processed. */ Wide character is encoded in ISO-2022-JP. #elif L'$B;z(B' == 0x7a * BYTES_VAL + 0x3b /* This line doesn't work unless "shift states" are processed. */ Wide character is encoded in ISO-2022-JP. Inverted order of evaluation. #else I cannot understand ISO-2022-JP. #endif #if L'$B;z(B' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/n_20.t0000644000175000017500000000021610216765467011562 00000000000000/* n_20.t: Definition of macro lexically identical to keyword. */ /* 20.1: */ /* double fl; */ #define float double float fl; mcpp-2.7.2/test-t/u_cplus.cc0000644000175000017500000000016110216765467012617 00000000000000/* u_cplus.t: C++: #undef or #define __cplusplus causes undefined behavior. */ #undef __cplusplus mcpp-2.7.2/test-t/recurs.t0000644000175000017500000000122310451745316012316 00000000000000/* recurs.t: recursive macro */ /* The sample posted to comp.std.c by B. Stroustrap. */ #define NIL(xxx) xxx #define G_0(arg) NIL(G_1)(arg) #define G_1(arg) NIL(arg) G_0(42) /* * Note by kmatsui: * There are two interpretations on the Standard's specification. * (1) This macro should be expanded to 'NIL(42)'. * (2) This macro should be expanded to '42'. * The Standard's wording seems to justify the (1). * GCC, Visual C++ and other major implementations, however, expand * this macro as (2). * MCPP V.2.4.1 or later of Standard mode expands this as (1) by default, * and expands as (2) when invoked with -@compat option. */ mcpp-2.7.2/test-t/n_cplus.t0000644000175000017500000000014110216765467012464 00000000000000/* cplus.t: C++98 pre-defined macro __cplusplus. */ /* 199711L; */ __cplusplus; mcpp-2.7.2/test-t/trad.t0000644000175000017500000000241710216765467011763 00000000000000/* trad.t * Samples for a very old "Reiser" model preprocessor. */ #define glue(a, b) a/**/b #define xglue(a, b) glue(a,b) #define ctrl( c) 'c' & 0x1f #define debug(n1,n2) printf("n1= %d, n2= %s", x/**/n1, x/**/n2) /* ISO C preprocessor expands to :a b c; * very old preprocessor does to :abc; */ glue( glue( a,b),c); /* ISO C :a b c; * very old :abc; */ xglue( xglue( a,b),c); #define abc ABC /* ISO C preprocessor expands to :a b c; * very old preprocessor does to :ABC; */ glue( glue( a,b),c); /* ISO C :'c' & 0x1f; * very old :'A' & 0x1f; */ ctrl( A); /* ISO C :printf("n1= %d, n2= %s", x 1, x 2); * very old :printf("1= %d, 2= %s", x1, x2); */ debug(1,2); /* ISO C :text other than comment after #else, #endif line is error * very old :the text is skipped quietly */ #define OLD_PREPROCESSOR 1 #if OLD_PREPROCESSOR #else OLD_PREPROCESSOR #endif OLD_PREPROCESSOR /* ISO C :Token error * very old :Implicit closing quote at end of line */ asm(" .text _probeintr: ss incl _npx_intrs_while_probing pushl %eax movb $0x20,%al #ifdef PC98 outb %al,$0x08 outb %al,$0x0 #else outb %al,$0xa0 outb %al,$0x20 #endif "); mcpp-2.7.2/test-t/u_1_19.t0000644000175000017500000000175610216765467012033 00000000000000/* u_1_19.t: Undefined behaviors on undefined #define and #undef syntax. */ /* u.1.19: A macro expanded to "defined" in #if expression. */ #define DEFINED defined #if DEFINED DEFINED #endif #undef __linux__ #undef __arm__ #define __linux__ 1 #define HAVE_MREMAP defined(__linux__) && !defined(__arm__) /* Wrong macro definition. * This macro should be defined as follows. * #if defined(__linux__) && !defined(__arm__) * #define HAVE_MREMAP 1 * #endif */ #if HAVE_MREMAP mremap(); #endif /* u.1.20: Undefining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or "defined" in #undef directive. */ #undef __LINE__ /* 16; or other undefined result. */ __LINE__; /* u.1.21: Defining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or "defined" in #define directive. */ #define __LINE__ 1234 /* 18; or other undefined result. */ __LINE__; #define defined defined #if defined defined # error I am not a good preprocessor. #endif mcpp-2.7.2/test-t/u_1_7_jis.t0000644000175000017500000000040610216765467012604 00000000000000/* u_1_7_jis.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma __setlocale( "jis") /* For MCPP */ str( "$B1 (B"); /* 0x3120 */ mcpp-2.7.2/test-t/e_vargs.t0000644000175000017500000000075210216765467012457 00000000000000/* e_vargs1.t: Erroneous usage of __VA_ARGS__ */ /* __VA_ARGS__ should not be defined. */ #define __VA_ARGS__ (x, y, z) /* * __VA_ARGS__ should be the parameter name in replacement list * corresponding to '...'. */ #define wrong_macro( a, b, __VA_ARGS__) (a + b - __VA_ARGS__) /* e_vargs2.t: Erroneous macro invocation of variable arguments */ #define debug( ...) fprintf( stderr, __VA_ARGS__) /* No argument to correspond __VA_ARGS__ */ debug(); mcpp-2.7.2/test-t/n_13_7.t0000644000175000017500000000105610216765467012015 00000000000000/* n_13_7.t: Short-circuit evaluation of #if expression. */ /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error cannot occur. */ #define MACRO_0 0 /* Valid block */ #if 0 && 10 / 0 Block to be skipped #endif #if not_defined && 10 / not_defined Block to be skipped #endif #if MACRO_0 && 10 / MACRO_0 > 1 Block to be skipped #endif #if MACRO_0 ? 10 / MACRO_0 : 0 Block to be skipped #endif #if MACRO_0 == 0 || 10 / MACRO_0 > 1 Valid block #else Block to be skipped #endif mcpp-2.7.2/test-t/e_25_6.t0000644000175000017500000000072510216765467012010 00000000000000/* e_25_6.t: Macro arguments are pre-expanded separately. */ #define sub( x, y) (x - y) /* 25.6: */ #define head sub( #define body(x,y) x,y #define tail ) #define head_body_tail( a, b, c) a b c /* "head" is once replaced to "sub(", then rescanning of "sub(" causes an uncompleted macro call. Expansion of an argument should complete within the argument. */ head_body_tail( head, body(a,b), tail); mcpp-2.7.2/test-t/n_token.cc0000644000175000017500000000066410216765467012612 00000000000000/* n_token.t: special pp-token in C++ */ #define str( a) xstr( a) #define xstr( a) # a #define paste( a, b) a ## b /* token.1: '::' is a token in C++, although illegal token sequence in C */ /* "::"; */ str( paste( :, :)); /* token.2: 'and', 'or', 'not', etc. are tokens in C++, although in C these are macros defined by */ /* "xor"; */ #if 1 and 2 or not 3 str( xor); #endif mcpp-2.7.2/test-t/e_18_4.t0000644000175000017500000000155410216765467012011 00000000000000/* e_18_4.t: #define syntax errors. */ /* 18.4: Not an identifier. */ #define "string" #define 123 /* 18.5: No argument. */ #define /* 18.6: Empty parameter list. */ #define math( op, a, ) op( (a), (b)) /* 18.7: Duplicate parameter names. */ #define math( op, a, a) op( (a), (b)) /* 18.8: Argument is not an identifier. */ #define NUMARGS( 1, +, 2) (1 + 2) /* 18.9: No space between macro name and replacement text. */ /* C90 (Corrigendum 1) forbids this if and only the replacement text begins with a non-basic-character. C99 forbids this even when the replacement text begins with basic- character. */ /* From ISO 9899:1990 / Corrigendum 1. */ #define THIS$AND$THAT(a, b) ((a) + (b)) /* Note: the following definition is legal (object-like macro). #define THIS $AND$THAT(a, b) ((a) + (b)) */ mcpp-2.7.2/test-t/n_27.t0000644000175000017500000000276710216765467011606 00000000000000/* n_27.t: Rescanning of a macro replace any macro call in the replacement text after substitution of parameters by pre-expanded-arguments. This re-examination may involve the succeding sequences from the source file (what a queer thing!). */ /* 27.1: Cascaded use of object-like macros. */ /* 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8; */ #define NEST8 NEST7 + 8 #define NEST7 NEST6 + 7 #define NEST6 NEST5 + 6 #define NEST5 NEST4 + 5 #define NEST4 NEST3 + 4 #define NEST3 NEST2 + 3 #define NEST2 NEST1 + 2 #define NEST1 1 NEST8; /* 27.2: Cascaded use of function-like macros. */ /* (1) + (1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4; */ #define FUNC4( a, b) FUNC3( a, b) + NEST4 #define FUNC3( a, b) FUNC2( a, b) + NEST3 #define FUNC2( a, b) FUNC1( a, b) + NEST2 #define FUNC1( a, b) (a) + (b) FUNC4( NEST1, NEST2); /* 27.3: An identifier generated by ## operator is subject to expansion. */ /* 1; */ #define glue( a, b) a ## b #define MACRO_1 1 glue( MACRO_, 1); #define sub( x, y) (x - y) #define head sub( #define math( op, a, b) op( (a), (b)) /* 27.4: 'sub' as an argument of math() is not pre-expanded, since '(' is missing. */ /* ((a) - (b)); */ math( sub, a, b); /* 27.5: Queer thing. */ /* (a - b); */ head a,b ); /* 27.6: Recursive macro (the 2nd 'm' is expanded to 'n' since it is in source file). */ /* n; */ #define m n #define n( a) a m( m); mcpp-2.7.2/test-t/e_4_3.t0000644000175000017500000000033610216765467011720 00000000000000/* e_4_3.t: Illegal pp-token. */ /* 4.3: Empty character constant is an error. */ #if '' == 0 /* This line is invalid, maybe skipped. */ #endif /* This line maybe the second error. */ mcpp-2.7.2/test-t/n_32.t0000644000175000017500000000052410216765467011567 00000000000000/* n_32.t: Escape sequence in character constant in #if expression. */ /* 32.1: Character octal escape sequence. */ #if '\123' != 83 Bad evaluation of octal escape sequence. #endif /* 32.2: Character hexadecimal escape sequence. */ #if '\x1b' != '\033' Bad evaluation of hexadecimal escape sequence. #endif mcpp-2.7.2/test-t/n_tlim_3.t0000644000175000017500000000031010216765467012523 00000000000000/* n_tlim_3.t: Significant initial characters in an internal identifier or a macro name: at least 63 bytes. */ int A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63; mcpp-2.7.2/test-t/n_std.t0000644000175000017500000005032410632454763012134 00000000000000/* * n_std.t * * 1998/08 made public kmatsui * 2002/08 revised not to conflict with C99 Standard kmatsui * 2004/10 added a few testcases for macro expansion kmatsui * * Samples to test C++ Standard preprocessing. * Preprocessor must process these samples as shown in each comments. * Preprocessor must process also #error directive properly, which is not * included here because the directive might cause translator to terminate. */ #define ZERO_TOKEN #define TWO_ARGS a,b #define MACRO_0 0 #define MACRO_1 1 #define sub( x, y) (x - y) #define str( a) # a #define glue( a, b) a ## b #define xglue( a, b) glue( a, b) /* n_1.t: Conversion of trigraph sequences. */ /* 1.1: The following 9 sequences are valid trigraph sequences. */ /* [ ] \ ^ { } | ~ #; */ ??( ??) ??/ ??' ??< ??> ??! ??- ??=; /* 1.2: In directive line. */ /* ab | cd; */ ??= define OR( a, b) a ??! b OR( ab, cd); /* 1.3: Any sequence other than above 9 is not a trigraph sequence. */ /* ?? ??? ??% ??^ ?#; */ ?? ??? ??% ??^ ???=; /* n_2.t: Line splicing by sequence. */ /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ /* ab + cd + ef; */ #define FUNC( a, b, c) \ a + b + c FUNC( ab, cd, ef); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ /* ab + cd + ef; */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c FUNC( ab, cd, ef); /* 2.3: In a string literal. */ /* "abcde" */ "abc\ de" /* 2.4: in midst of an identifier. */ /* abcde */ abc\ de /* 2.5: by trigraph. */ /* abcde */ abc??/ de /* n_3.t: Handling of comment. */ /* 3.1: A comment is converted to one space. */ /* abc de */ abc/* comment */de /* 3.2: // is not a comment of C. */ #if 0 /* This feature is obsolete now. */ /* / / is not a comment of C */ // is not a comment of C #endif /* 3.3: Comment is parsed prior to the parsing of preprocessing directive. */ /* abcd */ #if 0 "nonsence"; /* #else still in comment */ #else #define MACRO_abcd /* in comment */ abcd #endif MACRO_abcd /* n_4.t: Special tokens. */ /* 4.1: Digraph spellings in directive line. */ /* "abc"; */ %: define stringize( a) %: a stringize( abc); /* 4.2: Digraph spellings are retained in stringization. */ /* "<:"; */ stringize( <:); /* n_5.t: Spaces or tabs are allowed at any place in pp-directive line, including between the top of a pp-directive line and '#', and between the '#' and the directive. */ /* 5.1: */ /* |**|[TAB]# |**|[TAB]define |**| MACRO_abcde[TAB]|**| abcde |**| */ /**/ # /**/ define /**/ MACRO_abcde /**/ abcde /**/ /* abcde */ MACRO_abcde /* n_6.t: #include directive. */ /* 6.1: Header-name quoted by " and " as well as by < and > can include standard headers. */ /* Note: Standard headers can be included any times. */ #include "ctype.h" #include /* 6.2: Macro is allowed in #include line. */ #define HEADER "header.h" /* Before file inclusion: #include "header.h" */ #include HEADER /* abc */ MACRO_abc /* 6.3: With macro nonsence but legal. */ #undef MACRO_abc #include ZERO_TOKEN HEADER ZERO_TOKEN /* abc */ MACRO_abc /* n_7.t: #line directive. */ /* 7.1: Line number and filename. */ /* 1234; "cpp"; */ #line 1234 "cpp" __LINE__; __FILE__; /* 7.2: Filename argument is optional. */ /* 2345; "cpp"; */ #line 2345 __LINE__; __FILE__; /* 7.3: Argument with macro. */ /* 3456; "n_7.t"; */ #define LINE_AND_FILENAME 3456 "n_7.t" #line LINE_AND_FILENAME __LINE__; __FILE__; /* Restore to correct line number and filename. */ #line 169 "n_std.t" /* n_9.t: #pragma directive. */ /* 9.1: Any #pragma directive should be processed or ignored, should not be diagnosed as an error. */ #pragma once #pragma who knows ? /* n_10.t: #if, #elif, #else and #endif pp-directive. */ /* 10.1: */ /* Note: an undefined identifier in #if expression is replaced to 0. */ /* 1; */ #if a a; #elif MACRO_0 MACRO_0; #elif MACRO_1 /* Valid block */ MACRO_1; #else 0; #endif /* 10.2: Comments must be processed even if in skipped #if block. */ /* At least tokenization of string literal and character constant is necessary to process comments, e.g. /* is not a comment mark in string literal. */ #ifdef UNDEFINED /* Comment */ "in literal /* is not a comment" #endif /* n_11.t: Operator "defined" in #if or #elif directive. */ /* 11.1: */ #undef MACRO_abc #define MACRO_abc abc /* abc; */ /* abc; */ #if defined a a; #else MACRO_abc; #endif #if defined (MACRO_abc) MACRO_abc; #else 0; #endif /* 11.2: "defined" is an unary operator whose result is 1 or 0. */ #if defined MACRO_0 * 3 != 3 Bad handling of "defined" operator. #endif #if (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1) Bad grouping of "defined", !, - operator. #endif /* n_12.t: Integer preprocessing number token and type of #if expression. */ #include /* 12.1: Type long. */ #if LONG_MAX <= LONG_MIN Bad evaluation of long. #endif #if LONG_MAX <= 1073741823 /* 0x3FFFFFFF */ Bad evaluation of long. #endif /* 12.2: Type unsigned long. */ #if ULONG_MAX / 2 < LONG_MAX Bad evaluation of unsigned long. #endif /* 12.3: Octal number. */ #if 0177777 != 65535 Bad evaluation of octal number. #endif /* 12.4: Hexadecimal number. */ #if 0Xffff != 65535 || 0xFfFf != 65535 Bad evaluation of hexadecimal number. #endif /* 12.5: Suffix 'L' or 'l'. */ #if 0L != 0 || 0l != 0 Bad evaluation of 'L' suffix. #endif /* 12.6: Suffix 'U' or 'u'. */ #if 1U != 1 || 1u != 1 Bad evaluation of 'U' suffix. #endif /* 12.7: Negative integer. */ #if 0 <= -1 Bad evaluation of negative number. #endif /* n_13.t: Valid operators in #if expression. */ /* Valid operators are (precedence in this order) : defined, (unary)+, (unary)-, ~, !, *, /, %, +, -, <<, >>, <, >, <=, >=, ==, !=, &, ^, |, &&, ||, ? : */ /* 13.1: Bit shift. */ #if 1 << 2 != 4 || 8 >> 1 != 4 Bad arithmetic of <<, >> operators. #endif /* 13.2: Bitwise operators. */ #if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 Bad arithmetic of ^, |, & operators. #endif /* 13.3: Result of ||, && operators is either of 1 or 0. */ #if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 Bad arithmetic of ||, && operators. #endif /* 13.4: ?, : operator. */ #if (0 ? 1 : 2) != 2 Bad arithmetic of ?: operator. #endif /* n_13_5.t: Arithmetic conversion in #if expressions. */ /* 13.5: The usual arithmetic conversion is not performed on bit shift. */ #if -1 << 3U > 0 Bad conversion of bit shift operands. #endif /* 13.6: Usual arithmetic conversions. */ #if -1 <= 0U /* -1 is converted to unsigned long. */ Bad arithmetic conversion. #endif #if -1 * 1U <= 0 Bad arithmetic conversion. #endif /* Second and third operands of conditional operator are converted to the same type, thus -1 is converted to unsigned long. */ #if (1 ? -1 : 0U) <= 0 Bad arithmetic conversion. #endif /* n_13_7.t: Short-circuit evaluation of #if expression. */ /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error cannot occur. */ /* Valid block */ #if 0 && 10 / 0 Block to be skipped #endif #if not_defined && 10 / not_defined Block to be skipped #endif #if MACRO_0 && 10 / MACRO_0 > 1 Block to be skipped #endif #if MACRO_0 ? 10 / MACRO_0 : 0 Block to be skipped #endif #if MACRO_0 == 0 || 10 / MACRO_0 > 1 Valid block #else Block to be skipped #endif /* n_13_8.t: Grouping of sub-expressions in #if expression. */ /* 13.8: Unary operators are grouped from right to left. */ #if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) Bad grouping of -, +, !, ~ in #if expression. #endif /* 13.9: ?: operators are grouped from right to left. */ #if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 Bad grouping of ? : in #if expression. #endif /* 13.10: Other operators are grouped from left to right. */ #if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) Bad grouping of >>, << in #if expression. #endif /* 13.11: Test of precedence. */ #if 3*10/2 >> !0*2 >> !+!-9 != 1 Bad grouping of -, +, !, *, /, >> in #if expression. #endif /* 13.12: Overall test. Grouped as: ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) ? 7 : 0) != 7 evaluated to FALSE. */ #if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 Bad arithmetic of #if expression. #endif /* n_13_13.t: #if expression with macros. */ #define and && #define or || #define not_eq != #define bitor | /* 13.13: With macros expanding to operators. */ /* Valid block */ #if (1 bitor 2) == 3 and 4 not_eq 5 or 0 /* #if (1 | 2) == 3 && 4 != 5 || 0 */ Valid block #else Block to be skipped #endif /* 13.14: With macros expanding to 0 token, nonsence but legal expression.*/ /* Valid block */ #if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN /* #if 1 > 0 */ Valid block #else Block to be skipped #endif /* n_15.t: #ifdef, #ifndef directives. */ /* 15.1: #ifdef directive. */ /* Valid block */ #ifdef MACRO_1 Valid block #else Block to be skipped #endif /* 15.2: #ifndef directive. */ /* Valid block */ #ifndef MACRO_1 Block to be skipped #else Valid block #endif /* n_18.t: #define directive. */ /* Excerpts from ISO C 6.8.3 "Examples". */ #define OBJ_LIKE (1-1) #define FTN_LIKE(a) ( a ) /* 18.1: Definition of an object-like macro. */ /* (1-1); */ OBJ_LIKE; /* Macro defined to no token. */ /* ; */ ZERO_TOKEN; /* 18.2: Definition of a function-like macro. */ /* ( c ); */ FTN_LIKE( c); /* 18.3: Spelling in string identical to parameter is not a parameter. */ /* "n1:n2"; */ #define STR( n1, n2) "n1:n2" STR( 1, 2); /* n_19.t: Valid re-definitions of macros. */ /* 19.1: */ #define OBJ_LIKE /* white space */ (1-1) /* other */ /* 19.2: */ #define FTN_LIKE( a )( /* note the white space */ \ a /* other stuff on this line */ ) /* ( c ); */ FTN_LIKE( c); /* n_20.t: Definition of macro lexically identical to keyword. */ /* 20.1: */ /* double fl; */ #define float double float fl; /* n_21.t: Tokenization (No preprocessing tokens are merged implicitly). */ /* 21.1: */ /* - - -a; */ #define MINUS - -MINUS-a; /* 21.2: */ #undef sub #define sub( a, b) a-b /* '(a)-(b)' is better */ #define Y -y /* '(-y)' is better */ /* x- -y; */ sub( x, Y); /* n_22.t: Tokenization of preprocessing number. */ #define EXP 1 /* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */ /* 12E+EXP; */ 12E+EXP; /* 22.2: .2e-EXP is also a preprocessing number. */ /* .2e-EXP; */ .2e-EXP; /* 22.3: + or - is allowed only following E or e, 12+EXP is not a preprocessing number. */ /* Three tokens: 12 + 1; */ 12+EXP; /* n_23.t: ## operator in macro definition. */ /* 23.1: */ /* xy; */ glue( x, y); /* 23.2: Generate a preprocessing number. */ /* .12e+2; */ #undef EXP #define EXP 2 xglue( .12e+, EXP); /* n_24.t: # operator in macro definition. */ /* 24.1: */ /* "a+b"; */ str( a+b); /* 24.2: White spaces between tokens of operand are converted to one space. */ /* "ab + cd"; */ str( ab /* comment */ + cd ); /* 24.3: \ is inserted before \ and " in or surrounding literals and no other character is inserted to anywhere. */ /* "'\"' + \"' \\\"\""; */ str( '"' + "' \""); /* 24.4: Line splicing by is done prior to token parsing. */ /* "\"abc\""; */ str( "ab\ c"); /* 24.5: Token separator inserted by macro expansion should be removed. (Meanwhile, tokens should not be merged. See 21.2.) */ #define xstr( a) str( a) #define f(a) a /* "x-y"; */ xstr( x-f(y)); /* n_25.t: Macro arguments are pre-expanded (unless the argument is an operand of # or ## operator) separately, that is, are macro-replaced completely prior to rescanning. */ #undef sub #define sub( x, y) (x - y) /* 25.1: "TWO_ARGS" is read as one argument to "sub", then expanded to "a,b", then "x" is substituted by "a,b". */ /* (a,b - 1); */ sub( TWO_ARGS, 1); /* 25.2: An argument pre-expanded to 0-token. */ /* ( - 1); */ sub( ZERO_TOKEN, 1); /* 25.3: "glue( a, b)" is pre-expanded. */ /* abc; */ xglue( glue( a, b), c); /* 25.4: Operands of ## operator are not pre-expanded. */ /* MACRO_0MACRO_1; */ glue( MACRO_0, MACRO_1); /* 25.5: Operand of # operator is not pre-expanded. */ /* "ZERO_TOKEN"; */ str( ZERO_TOKEN); /* n_26.t: The name once replaced is not furthur replaced. */ /* 26.1: Directly recursive macro definition. */ /* Z[0]; */ #define Z Z[0] Z; /* 26.2: Intermediately recursive macro definition. */ /* AB; */ #define AB BA #define BA AB AB; /* 26.3: Directly recursive function-like macro definition. */ /* x + f(x); */ #undef f #define f(a) a + f(a) f( x); /* 26.4: Intermediately recursive function-like macro definition. */ /* x + x + g( x); */ #define g(a) a + h( a) #define h(a) a + g( a) g( x); /* 26.5: Rescanning encounters the non-replaced macro name. */ /* Z[0] + f( Z[0]); */ f( Z); /* n_27.t: Rescanning of a macro expand any macro call in the replacement text after substitution of parameters by pre-expanded-arguments. This re-examination may involve the succeding sequences from the source file (what a queer thing!). */ /* 27.1: Cascaded use of object-like macros. */ /* 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8; */ #define NEST8 NEST7 + 8 #define NEST7 NEST6 + 7 #define NEST6 NEST5 + 6 #define NEST5 NEST4 + 5 #define NEST4 NEST3 + 4 #define NEST3 NEST2 + 3 #define NEST2 NEST1 + 2 #define NEST1 1 NEST8; /* 27.2: Cascaded use of function-like macros. */ /* (1) + (1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4; */ #define FUNC4( a, b) FUNC3( a, b) + NEST4 #define FUNC3( a, b) FUNC2( a, b) + NEST3 #define FUNC2( a, b) FUNC1( a, b) + NEST2 #define FUNC1( a, b) (a) + (b) FUNC4( NEST1, NEST2); /* 27.3: An identifier generated by ## operator is subject to expansion. */ /* 1; */ glue( MACRO_, 1); #define head sub( #define math( op, a, b) op( (a), (b)) /* 27.4: 'sub' as an argument of math() is not pre-expanded, since '(' is missing. */ /* ((a) - (b)); */ math( sub, a, b); /* 27.5: Queer thing. */ /* (a - b); */ head a,b ); /* 27.6: Recursive macro (the 2nd 'm' is expanded to 'n' since it is in source file). */ /* n; */ #define m n #define n( a) a m( m); /* n_28.t: __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and __STDC_VERSION__ are predefined. */ /* 28.1: */ /* "n_std.t"; */ __FILE__; /* 28.2: */ /* 674; */ __LINE__; /* 28.3: */ /* "Aug 1 2001"; */ __DATE__; /* 28.4: */ /* "21:42:22"; */ __TIME__; /* 28.5: */ /* 1; */ __STDC__; /* 28.6: */ /* 199409L; */ /* In C99, the value of this macro is 199901L */ __STDC_VERSION__; /* 28.7: __LINE__, __FILE__ in an included file. */ /* 3; "line.h"; */ #include "line.h" /* n_29.t: #undef directive. */ /* 29.1: Undefined macro is not a macro. */ /* DEFINED; */ #define DEFINED #undef DEFINED DEFINED; /* 29.2: Undefining undefined name is not an error. */ #undef UNDEFINED /* n_30.t: Macro call. */ /* Note: Comma separate the arguments of function-like macro call, but comma between matching inner parenthesis doesn't. This feature is tested on so many places in this suite especially on *.c samples which use assert() macro, that no separete item to test this feature is provided. */ /* 30.1: A macro call may cross the lines. */ #undef FUNC #define FUNC( a, b, c) a + b + c /* a + b + c; */ FUNC ( a, b, c ) ; /* n_32.t: Escape sequence in character constant in #if expression. */ /* 32.1: Character octal escape sequence. */ #if '\123' != 83 Bad evaluation of octal escape sequence. #endif /* 32.2: Character hexadecimal escape sequence. */ #if '\x1b' != '\033' Bad evaluation of hexadecimal escape sequence. #endif /* n_37.t: Translation limits. */ /* 37.1: Number of parameters in macro: at least 31. */ #define glue31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E /* 37.2: Number of arguments of macro call: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcde; */ glue31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R , S, T, U, V, W, X, Y, Z, a, b, c, d, e); /* 37.3: Significant initial characters in an internal identifier or a macro name: at least 31. */ /* ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; */ ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_; /* 37.4: Nested conditional inclusion: at least 8 levels. */ /* nest = 8; */ #ifdef A #else # ifdef B # else # ifdef C # else # ifdef D # else # ifdef E # else # ifdef F # else # ifdef G # else # ifdef H # else nest = 8; # endif # endif # endif # endif # endif # endif # endif #endif /* 37.5: Nested source file inclusion: at least 8 levels. */ /* nest = 1; nest = 2; nest = 3; nest = 4; nest = 5; nest = 6; nest = 7; nest = 8; */ #define X8 #include "nest1.h" /* 37.6: Parenthesized expression: at least 32 levels. */ /* nest = 32; */ #if 0 + (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 + 0)))))))))) \ )))))))))))))))))))))) == 0 nest = 32; #endif /* 37.7: Characters in a string (after concatenation): at least 509. */ "123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789012345678901234567890123456789\ 012345678901234567" ; /* 37.8: Characters in a logical source line: at least 509. */ int a123456789012345678901234567890 = 123450; \ int b123456789012345678901234567890 = 123451; \ int c123456789012345678901234567890 = 123452; \ int d123456789012345678901234567890 = 123453; \ int e123456789012345678901234567890 = 123454; \ int f123456789012345678901234567890 = 123455; \ int A123456789012345678901234567890 = 123456; \ int B123456789012345678901234567890 = 123457; \ int C123456789012345678901234567890 = 123458; \ int D1234567890123456789012 = 123459; /* 37.9: Macro definitions: at least 1024. */ #define X0400 #include "m4095.h" /* 0x0400; */ BNJ; mcpp-2.7.2/test-t/u_1_7_gb.t0000644000175000017500000000047710216765467012417 00000000000000/* u_1_7_gb.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "chinese-simplified") /* For Visual C */ #pragma __setlocale( "gb2312") /* For MCPP */ str( ""); /* 0xb1a0 */ mcpp-2.7.2/test-t/u_1_1.t0000644000175000017500000000070610216765467011734 00000000000000/* u_1_1.t: Undefined behaviors on unterminated line, comment or macro. */ /* u.1.1: End of a source file without . */ #include "unbal3.h" int e_1; /* u.1.2: End of a source file with . */ #include "unbal4.h" ; /* u.1.3: End of a source file with an unterminated comment. */ #include "unbal5.h" */ /* u.1.4: End of a source file with an uncompleted macro call. */ #include "unbal6.h" y); mcpp-2.7.2/test-t/u_1_24.t0000644000175000017500000000225710216765467012024 00000000000000/* u_1_24.t: Undefined behaviors on empty argument of macro call. */ /* u.1.24: Empty argument of macro call. */ /* * Note: Since no argument and one empty argument cannot be distinguished * syntactically, additional dummy argument may be necessary for an * intermediate macro to process one empty argument (if possible). */ #define ARG( a, dummy) # a #define EMPTY #define SHOWN( n) printf( "%s : %d\n", # n, n) #define SHOWS( s) printf( "%s : %s\n", # s, ARG( s, dummy)) #define add( a, b) (a + b) #define sub( a, b) (a - b) #define math( op, a, b) op( a, b) #define APPEND( a, b) a ## b /* printf( "%s : %d\n", "math( sub, , y)", ( - y)); or other undefined behavior. */ SHOWN( math( sub, , y)); /* printf( "%s : %s\n", "EMPTY", ""); or other undefined behavior. */ SHOWS( EMPTY); /* printf( "%s : %s\n", "APPEND( CON, 1)", "CON1"); */ SHOWS( APPEND( CON, 1)); /* printf( "%s : %s\n", "APPEND( CON, )", "CON"); or other undefined behavior. */ SHOWS( APPEND( CON, )); /* printf( "%s : %s\n", "APPEND( , )", ""); or other undefined behavior. */ SHOWS( APPEND( , )); mcpp-2.7.2/test-t/line.h0000644000175000017500000000005010216765467011733 00000000000000/* line.h */ __LINE__; __FILE__; mcpp-2.7.2/test-t/n_15.t0000644000175000017500000000047310216765467011573 00000000000000/* n_15.t: #ifdef, #ifndef directives. */ #define MACRO_1 1 /* 15.1: #ifdef directive. */ /* Valid block */ #ifdef MACRO_1 Valid block #else Block to be skipped #endif /* 15.2: #ifndef directive. */ /* Valid block */ #ifndef MACRO_1 Block to be skipped #else Valid block #endif mcpp-2.7.2/test-t/m_33_big5.t0000644000175000017500000000112710216765467012475 00000000000000/* m_33_big5.t: Wide character constant encoded in Big-Five. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "big5") /* For MCPP */ #pragma setlocale( "chinese-traditional") /* For Visual C */ #if L'r' == '\xa6' * BYTES_VAL + '\x72' Wide character is encoded in Big-Five. #elif L'r' == '\x72' * BYTES_VAL + '\xa6' Wide character is encoded in Big-Five. Inverted order of evaluation. #else I cannot understand Big-Five. #endif #if L'r' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/u_1_12.t0000644000175000017500000000026510216765467012016 00000000000000/* u_1_12.t: Undefined behaviors on undefined #include syntax or header- name. */ /* u.1.12: Argument of #include other than header-name. */ #include filename mcpp-2.7.2/test-t/n_11.t0000644000175000017500000000106310216765467011563 00000000000000/* n_11.t: Operator "defined" in #if or #elif directive. */ #define MACRO_abc abc #define MACRO_0 0 #define ZERO_TOKEN /* 11.1: */ /* abc; */ /* abc; */ #if defined a a; #else MACRO_abc; #endif #if defined (MACRO_abc) MACRO_abc; #else 0; #endif /* 11.2: "defined" is an unary operator whose result is 1 or 0. */ #if defined MACRO_0 * 3 != 3 Bad handling of "defined" operator. #endif #if (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1) Bad grouping of "defined", !, - operator. #endif mcpp-2.7.2/test-t/i_35.t0000644000175000017500000000032610216765467011565 00000000000000/* i_35.t: Multi-character character constant. */ /* In ASCII character set. */ /* 35.1: */ #if ('ab' != '\x61\x62') || ('\aa' != '\7\x61') Bad handling of multi-character character constant. #endif mcpp-2.7.2/test-t/u_1_9.t0000644000175000017500000000034610216765467011744 00000000000000/* u_1_8.t: Undefined behaviors on unterminated quotations (2). */ /* u.1.9: Unterminated string literal. */ "String literal across the lines. " /* u.1.10: Unterminated header-name. */ #include #define BYTES_VAL (1 << CHAR_BIT) /* 33.1: L'ch'. */ #pragma __setlocale( "ksc5601") /* For MCPP */ #pragma setlocale( "korean") /* For Visual C */ #if L'' == '\xed' * BYTES_VAL + '\xae' Wide character is encoded in KSC-5601. #elif L'' == '\xae' * BYTES_VAL + '\xed' Wide character is encoded in KSC-5601. Inverted order of evaluation. #else I cannot understand KSC-5601. #endif #if L'' < 0 Evaluated in negative value. #endif mcpp-2.7.2/test-t/nest10.h0000644000175000017500000000004310216765467012120 00000000000000/* nest10.h */ #include "nest11.h" mcpp-2.7.2/test-t/n_stdmac.t0000644000175000017500000000021310216765467012611 00000000000000/* n_stdmac.t: C99 Standard pre-defined macros. */ /* 199901L; */ __STDC_VERSION__; /* 1; or 0; */ __STDC_HOSTED__; mcpp-2.7.2/test-t/u_1_11.t0000644000175000017500000000051210216765467012010 00000000000000/* u_1_11.t: Undefined behaviors on undefined #include syntax or header- name. */ /* u.1.11: Header-name containing ', ", \ or "/*". */ /* Probably illegal filename and fails to open. */ #include "../*line.h" /* \ is a legal path-delimiter in MS-DOS or some other OS's. */ #include "..\test-t\line.h" mcpp-2.7.2/test-t/e_7_4.t0000644000175000017500000000031610216765467011722 00000000000000/* e_7_4.t: #line error. */ /* 7.4: string literal in #line directive shall be a character string literal. */ #line 123 L"wide" /* 8; "e_7_4.t"; */ __LINE__; __FILE__; mcpp-2.7.2/test-t/u_1_7_big5.t0000644000175000017500000000050310216765467012643 00000000000000/* u_1_7_big5.t: Invalid multi-byte character sequence (in string literal, character constant, header-name or comment). */ #define str( a) # a #pragma setlocale( "chinese-traditional") /* For Visual C */ #pragma __setlocale( "big5") /* For MCPP */ str( ""); /* 0xa181 */ mcpp-2.7.2/test-t/long4095.h0000644000175000017500000001057410216765467012301 00000000000000/* long4095.c: logical source line of 4095 bytes long. */ typedef int wchar_t; \ typedef struct { \ rune_t min; \ rune_t max; \ rune_t map; \ unsigned long *types; \ } _RuneEntry; \ \ typedef struct { \ int nranges; \ _RuneEntry *ranges; \ } _RuneRange; \ \ typedef struct { \ char magic[8]; \ char encoding[32]; \ \ rune_t (*sgetrune) \ (const char *, unsigned int, char const **) ; \ int (*sputrune) \ (rune_t, char *, unsigned int, char **) ; \ rune_t invalid_rune; \ \ unsigned long runetype[ (1 <<8 ) ]; \ rune_t maplower[ (1 <<8 ) ]; \ rune_t mapupper[ (1 <<8 ) ]; \ _RuneRange runetype_ext; \ _RuneRange maplower_ext; \ _RuneRange mapupper_ext; \ \ void *variable; \ int variable_len; \ } _RuneLocale; \ \ \ \ extern _RuneLocale _DefaultRuneLocale; \ extern _RuneLocale *_CurrentRuneLocale; \ \ unsigned long ___runetype ( int ) ; \ int ___tolower ( int ) ; \ int ___toupper ( int ) ; \ \ \ int __istype ( int , unsigned long) ; \ int __isctype ( int , unsigned long) ; \ int toupper ( int ) ; \ int tolower ( int ) ; \ \ extern int errno; \ \ void *memchr (const void *, int, size_t) ; \ int memcmp (const void *, const void *, size_t) ; \ void *memcpy (void *, const void *, size_t) ; \ void *memmove (void *, const void *, size_t) ; \ void *memset (void *, int, size_t) ; \ char *strcat (char *, const char *) ; \ char *strchr (const char *, int) ; \ int strcmp (const char *, const char *) ; \ int strcoll (const char *, const char *) ; \ char *strcpy (char *, const char *) ; \ size_t strcspn (const char *, const char *) ; \ char *strerror (int) ; \ size_t strlen (const char *) ; \ char *strncat (char *, const char *, size_t) ; \ int strncmp (const char *, const char *, size_t) ; \ char *strncpy (char *, const char *, size_t) ; \ char *strpbrk (const char *, const char *) ; \ char *strrchr (const char *, int) ; \ size_t strspn (const char *, const char *) ; \ char *strstr (const char *, const char *) ; \ char *strtok (char *, const char *) ; \ size_t strxfrm (char *, const char *, size_t) ; \ \ \ \ int bcmp (const void *, const void *, size_t) ; \ void bcopy (const void *, void *, size_t) ; \ void bzero (void *, size_t) ; \ int ffs (int) ; \ char *index (const char *, int) ; \ void *memccpy (void *, const void *, int, size_t) ; \ char *rindex (const char *, int) ; \ int strcasecmp (const char *, const char *) ; \ char *strdup (const char *) ; \ void strmode (int, char *) ; \ int strncasecmp (const char *, const char *, size_t) ; \ char *strsep (char **, const char *) ; \ void swab (const void *, void *, size_t) ; \ \ \ typedef struct { \ int quot; \ int rem; \ } div_t; \ \ typedef struct { \ long quot; \ long rem; \ } ldiv_t; \ extern int __mb_cur_max; \ \ \ void \ abort (void) ; \ int \ abs (int) ; \ int atexit (void (*)(void)) ; \ double atof (const char *) ; \ int atoi (const char *) ; \ long atol (const char *) ; \ void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *)) ; \ void *calloc (size_t, size_t) ; \ div_t \ div (int, int) ; \ void \ exit (int) ; \ void free (void *) ; \ char *getenv (const char *) ; \ long \ labs (long) ; \ ldiv_t \ ldiv (long, long) ; \ void *malloc (size_t) ; \ void qsort (void *, size_t, size_t, int (*)(const void *, const void *)) ; \ int rand (void) ; \ void *realloc (void *, size_t) ; \ void srand (unsigned) ; \ double strtod (const char *, char **) ; \ long strtol (const char *, char **, int) ; \ unsigned long \ strtoul (const char *, char **, int) ; \ int system (const char *) ; \ \ \ int mblen (const char *, size_t) ; \ size_t mbstowcs (wchar_t *, const char *, size_t) ; \ int wctomb (char *, wchar_t) ; \ int mbtowc (wchar_t *, const char *, size_t) ; \ size_t wcstombs (char *, const wchar_t *, size_t) ; \ \ \ int putenv (const char *) ; \ int setenv (const char *, const char *, int) ; \ \ \ \ double drand48 (void) ; \ double erand48 (unsigned short[3]) ; \ long lrand48 (void) ; \ long nrand48 (unsigned short[3]) ; \ long mrand48 (void) ; \ long jrand48 (unsigned short[3]) ; \ void srand48 (long) ; \ unsigned short *seed48 (unsigned short[3]) ; \ void lcong48 (unsigned short[7]) ; \ \ void *alloca (size_t) ; \ \ char *getbsize (int *, long *) ; \ char *cgetcap (char *, char *, int) ; \ int cgetclose (void) ; \ \ mcpp-2.7.2/test-t/e_23_3.t0000644000175000017500000000051410216765467011777 00000000000000/* e_23_3.t: ## operator shall not occur at the beginning or at the end of replacement list for either form of macro definition. */ /* 23.3: In object-like macro. */ #define con ## name #define cat 12 ## /* 23.4: In function-like macro. */ #define CON( a, b) ## a ## b #define CAT( b, c) b ## c ## mcpp-2.7.2/test-t/n_cplus.cc0000644000175000017500000000014110216765467012606 00000000000000/* cplus.t: C++98 pre-defined macro __cplusplus. */ /* 199711L; */ __cplusplus; mcpp-2.7.2/test-t/n_8.t0000644000175000017500000000052210216765467011510 00000000000000/* n_8.t: #error directive. */ /* 8.1: Argument of #error directive is not a subject of macro expansion. Output to stderr as an example: Preprocessing error directive: MACRO is not a positive number. from line 10 of file "n_8.t" */ #define MACRO 0 #if MACRO <= 0 #error MACRO is not a positive number. #endif mcpp-2.7.2/test-t/n_13_8.t0000644000175000017500000000172510216765467012021 00000000000000/* n_13_8.t: Grouping of sub-expressions in #if expression. */ /* 13.8: Unary operators are grouped from right to left. */ #if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) Bad grouping of -, +, !, ~ in #if expression. #endif /* 13.9: ?: operators are grouped from right to left. */ #if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 Bad grouping of ? : in #if expression. #endif /* 13.10: Other operators are grouped from left to right. */ #if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) Bad grouping of >>, << in #if expression. #endif /* 13.11: Test of precedence. */ #if 3*10/2 >> !0*2 >> !+!-9 != 1 Bad grouping of -, +, !, *, /, >> in #if expression. #endif /* 13.12: Overall test. Grouped as: ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) ? 7 : 0) != 7 evaluated to FALSE. */ #if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 Bad arithmetic of #if expression. #endif mcpp-2.7.2/test-t/n_13_5.t0000644000175000017500000000116710216765467012016 00000000000000/* n_13_5.t: Arithmetic conversion in #if expressions. */ /* 13.5: The usual arithmetic conversion is not performed on bit shift. */ #if -1 << 3U > 0 Bad conversion of bit shift operands. #endif /* 13.6: Usual arithmetic conversions. */ #if -1 <= 0U /* -1 is converted to unsigned long. */ Bad arithmetic conversion. #endif #if -1 * 1U <= 0 Bad arithmetic conversion. #endif /* Second and third operands of conditional operator are converted to the same type, thus -1 is converted to unsigned long. */ #if (1 ? -1 : 0U) <= 0 Bad arithmetic conversion. #endif mcpp-2.7.2/test-t/n_dslcom.cc0000644000175000017500000000014710216765467012747 00000000000000/* n_dslcom: // is a comment of C++ and C99. */ /* a; */ a; // is a comment of C++ and C99 mcpp-2.7.2/test-t/n_ucn1.t0000644000175000017500000000073510216765467012215 00000000000000/* n_ucn1.t: Universal-character-name */ /* UCN in character constant */ #if '\u5B57' UCN-16bits is implemented. #endif #if '\U00006F22' UCN-32bits is implemented. #endif /* UCN in string literal */ "abc\u6F22\u5B57xyz"; /* i.e. "abcxyx"; */ /* UCN in identifier */ #define macro\u5B57 9 #define macro\U00006F22 99 macro\u5B57 /* 9 */ macro\U00006F22 /* 99 */ macro\U00006f22 /* 99 */ mcpp-2.7.2/test-t/n_tlim_9.t0000644000175000017500000000017310216765467012540 00000000000000/* n_tlim_9.t: Number of macro definitions: at least 4095. */ #undef ARG #include "m4095.h" /* 0x0fff; */ GBM; mcpp-2.7.2/test-t/n_28.t0000644000175000017500000000105610216765467011575 00000000000000/* n_28.t: __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and __STDC_VERSION__ are predefined. */ /* 28.1: */ /* "n_28.t"; */ __FILE__; /* 28.2: */ /* 10; */ __LINE__; /* 28.3: */ /* "Aug 1 2001"; */ __DATE__; /* 28.4: */ /* "21:42:22"; */ __TIME__; /* 28.5: */ /* 1; */ __STDC__; /* 28.6: */ /* 199409L; */ /* In C99, the value of this macro is 199901L */ __STDC_VERSION__; /* 28.7: __LINE__, __FILE__ in an included file. */ /* 3; "line.h"; */ #include "line.h" mcpp-2.7.2/test-t/e_33_2.t0000644000175000017500000000043210216765467011776 00000000000000/* e_33_2.t: Out of range of numerical escape sequence in wide-char. */ /* 33.2: Value of a numerical escape sequence in wide-character constant should be in the range of wchar_t. */ #if L'\xabcdef012' == 0xbcdef012 /* Perhaps out of range. */ #endif mcpp-2.7.2/test-t/e_27_7.t0000644000175000017500000000042110216765467012004 00000000000000/* e_27_7.t: Error of rescanning. */ #define sub( x, y) (x - y) /* 27.7: */ #define TWO_TOKENS a,b #define SUB( x, y) sub( x, y) /* Too many arguments error while rescanning after once replaced to: sub( a,b, 1); */ SUB( TWO_TOKENS, 1); mcpp-2.7.2/test-t/n_26.t0000644000175000017500000000125310216765467011572 00000000000000/* n_26.t: The name once replaced is not furthur replaced. */ /* 26.1: Directly recursive object-like macro definition. */ /* Z[0]; */ #define Z Z[0] Z; /* 26.2: Intermediately recursive object-like macro definition. */ /* AB; */ #define AB BA #define BA AB AB; /* 26.3: Directly recursive function-like macro definition. */ /* x + f(x); */ #define f(a) a + f(a) f( x); /* 26.4: Intermediately recursive function-like macro definition. */ /* x + x + g( x); */ #define g(a) a + h( a) #define h(a) a + g( a) g( x); /* 26.5: Rescanning encounters the non-replaced macro name. */ /* Z[0] + f( Z[0]); */ f( Z); mcpp-2.7.2/test-t/unbal2.h0000644000175000017500000000011410216765467012170 00000000000000/* unbal2.h */ #define UNBAL2 1 #if UNBAL2 /* line 5 */ #else mcpp-2.7.2/test-t/n_30.t0000644000175000017500000000101210216765467011556 00000000000000/* n_30.t: Macro call. */ /* Note: Comma separate the arguments of function-like macro call, but comma between matching inner parenthesis doesn't. This feature is tested on so many places in this suite especially on *.c samples which use assert() macro, that no separete item to test this feature is provided. */ /* 30.1: A macro call may cross the lines. */ #define FUNC( a, b, c) a + b + c /* a + b + c; */ FUNC ( a, b, c ) ; mcpp-2.7.2/test-t/unspcs.t0000644000175000017500000000231110216765467012335 00000000000000/* * unspcs.t: * 1998/08 made public kmatsui * * These texts are unportable ones, because the order of the evaluation is * unspecified. Good preprocessor will warn at these texts even if the * results are valid. Good preprocessor will also document the order of * evaluation and the behavior on invalid results. * Note: Order of evaluation of sub-expressions (other than operands of &&, * ||, ? :) of #if expression is also unspecified. The order, however, never * affects the result, because #if expression never cause side effect, so no * warning is necessary. Precedence and grouping rules of operators are other * things than order of evaluation, and shall be obeyed by preprocessor. */ #define str( a) # a #define xstr( a) str( a) /* s.1.1: Order of evaluation of #, ## operators. */ #define MAKWIDESTR( s) L ## # s /* Either of L"name"; or L# name; ("L#" is not a valid pp-token). */ MAKWIDESTR( name); /* s.1.2: Order of evaluation of ## operators. */ #define glue3( a, b, c) a ## b ## c /* "1.a" or undefined, since .a is not a valid pp-token, while 1. and 1.a are valid pp-tokens. */ xstr( glue3( 1, ., a)); mcpp-2.7.2/test-t/nest11.h0000644000175000017500000000004310216765467012121 00000000000000/* nest11.h */ #include "nest12.h" mcpp-2.7.2/tests/0000777000175000017500000000000011114177233010630 500000000000000mcpp-2.7.2/tests/set_test.sh0000755000175000017500000000204610735410035012735 00000000000000#! /bin/sh # script to set mcpp testsuite corresponding to the version of GCC 2 or 3, 4 # ./set_test.sh $CC $gcc_path $gcc_testsuite_dir $gcc_maj_ver $LN_S $cpp_call # $target_cc CC=$1 gcc_path=`expr $2 : "\(.*\)/$CC"` target_cc=$7 if test x$target_cc != x; then CC=$target_cc fi gcc_testsuite_dir=$3 gcc_maj_ver=$4 if test $gcc_maj_ver = 4; then gcc_maj_ver=3; fi LN_S=$5 cpp_name=`echo $6 | sed 's,.*/,,'` cpp_path=`echo $6 | sed "s,/$cpp_name,,"` echo " cd $gcc_testsuite_dir/gcc.dg/cpp-test/test-t" cd "$gcc_testsuite_dir/gcc.dg/cpp-test/test-t" for i in *_run.c do rm -f $i echo " $LN_S $i.gcc$gcc_maj_ver $i" $LN_S $i.gcc$gcc_maj_ver $i done echo " cd $cpp_path" cd "$cpp_path" echo " appending '-23j' options to mcpp invocation" for i in mcpp*.sh do cat $i | sed 's/mcpp/mcpp -23j/' > tmp mv -f tmp $i chmod a+x $i done if test $CC = gcc; then exit 0 fi echo " cd $gcc_path" cd "$gcc_path" if test -f "gcc"; then echo " mv gcc gcc.save" mv gcc gcc.save fi echo " $LN_S $CC gcc" $LN_S $CC gcc mcpp-2.7.2/tests/Makefile.am0000644000175000017500000000257310733223514012607 00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = dejagnu foreign if REPLACE_CPP Makefile: check-DEJAGNU: EXPECT=$(EXPECT); export EXPECT @if test x"$(gcc_testsuite_dir)" = x""; then \ echo "ERROR: testsuite directory is not specified. Do './configure --with-gcc-testsuite-dir=directory' prior to 'make check'"; \ exit 1; \ fi @if test `$(cpp_call) -v /dev/null 2>&1 | grep 'MCPP' > /dev/null; echo $$?` != 0; \ then \ echo "ERROR: Do 'make install' prior to 'make check'"; \ exit 1; \ fi @if test -f "$(gcc_testsuite_dir)/gcc.dg/cpp-test/test-t/cpp-test.exp"; \ then :; \ else \ echo ' cp -Rp $(top_srcdir)/cpp-test $(gcc_testsuite_dir)/gcc.dg'; \ cp -Rp $(top_srcdir)/cpp-test "$(gcc_testsuite_dir)/gcc.dg"; \ fi @$(top_srcdir)/tests/set_test.sh '$(CC)' '$(gcc_path)' '$(gcc_testsuite_dir)' $(gcc_maj_ver) '$(LN_S)' '$(cpp_call)' '$(target_cc)' -$(RUNTEST) --tool gcc --srcdir $(gcc_testsuite_dir) cpp-test.exp @$(top_srcdir)/tests/after_test.sh '$(CC)' '$(gcc_path)' '$(cpp_call)' '$(target_cc)' uninstall: @if test x"$(gcc_testsuite_dir)" != x""; then \ cd "$(gcc_testsuite_dir)"; \ if test -f "gcc.dg/cpp-test/test-t/cpp-test.exp"; then \ echo " rm -rf gcc.dg/cpp-test"; \ rm -rf gcc.dg/cpp-test; \ fi \ fi endif mcpp-2.7.2/tests/Makefile.in0000644000175000017500000003111211113211444012577 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir EXPECT = expect RUNTEST = runtest DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ Target_Cpu = @Target_Cpu@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cpp_call = @cpp_call@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gcc_maj_ver = @gcc_maj_ver@ gcc_min_ver = @gcc_min_ver@ gcc_path = @gcc_path@ gcc_testsuite_dir = @gcc_testsuite_dir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_system = @host_system@ host_vendor = @host_vendor@ htmldir = @htmldir@ inc_dir = @inc_dir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cc = @target_cc@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = dejagnu foreign all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps tests/Makefile .PRECIOUS: Makefile @REPLACE_CPP_FALSE@Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @REPLACE_CPP_FALSE@ @case '$?' in \ @REPLACE_CPP_FALSE@ *config.status*) \ @REPLACE_CPP_FALSE@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ @REPLACE_CPP_FALSE@ *) \ @REPLACE_CPP_FALSE@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ @REPLACE_CPP_FALSE@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ @REPLACE_CPP_FALSE@ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: @REPLACE_CPP_FALSE@check-DEJAGNU: site.exp @REPLACE_CPP_FALSE@ srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ @REPLACE_CPP_FALSE@ EXPECT=$(EXPECT); export EXPECT; \ @REPLACE_CPP_FALSE@ runtest=$(RUNTEST); \ @REPLACE_CPP_FALSE@ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ @REPLACE_CPP_FALSE@ exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ @REPLACE_CPP_FALSE@ if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ @REPLACE_CPP_FALSE@ then :; else exit_status=1; fi; \ @REPLACE_CPP_FALSE@ done; \ @REPLACE_CPP_FALSE@ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ @REPLACE_CPP_FALSE@ fi; \ @REPLACE_CPP_FALSE@ exit $$exit_status site.exp: Makefile @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp @echo 'set srcdir $(srcdir)' >>site.tmp @echo "set objdir `pwd`" >>site.tmp @echo 'set build_alias "$(build_alias)"' >>site.tmp @echo 'set build_triplet $(build_triplet)' >>site.tmp @echo 'set host_alias "$(host_alias)"' >>site.tmp @echo 'set host_triplet $(host_triplet)' >>site.tmp @echo 'set target_alias "$(target_alias)"' >>site.tmp @echo 'set target_triplet $(target_triplet)' >>site.tmp @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp distclean-DEJAGNU: -rm -f site.exp site.bak -l='$(DEJATOOL)'; for tool in $$l; do \ rm -f $$tool.sum $$tool.log; \ done distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am @REPLACE_CPP_FALSE@uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-DEJAGNU distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \ clean-libtool distclean distclean-DEJAGNU distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am @REPLACE_CPP_TRUE@Makefile: @REPLACE_CPP_TRUE@check-DEJAGNU: @REPLACE_CPP_TRUE@ EXPECT=$(EXPECT); export EXPECT @REPLACE_CPP_TRUE@ @if test x"$(gcc_testsuite_dir)" = x""; then \ @REPLACE_CPP_TRUE@ echo "ERROR: testsuite directory is not specified. Do './configure --with-gcc-testsuite-dir=directory' prior to 'make check'"; \ @REPLACE_CPP_TRUE@ exit 1; \ @REPLACE_CPP_TRUE@ fi @REPLACE_CPP_TRUE@ @if test `$(cpp_call) -v /dev/null 2>&1 | grep 'MCPP' > /dev/null; echo $$?` != 0; \ @REPLACE_CPP_TRUE@ then \ @REPLACE_CPP_TRUE@ echo "ERROR: Do 'make install' prior to 'make check'"; \ @REPLACE_CPP_TRUE@ exit 1; \ @REPLACE_CPP_TRUE@ fi @REPLACE_CPP_TRUE@ @if test -f "$(gcc_testsuite_dir)/gcc.dg/cpp-test/test-t/cpp-test.exp"; \ @REPLACE_CPP_TRUE@ then :; \ @REPLACE_CPP_TRUE@ else \ @REPLACE_CPP_TRUE@ echo ' cp -Rp $(top_srcdir)/cpp-test $(gcc_testsuite_dir)/gcc.dg'; \ @REPLACE_CPP_TRUE@ cp -Rp $(top_srcdir)/cpp-test "$(gcc_testsuite_dir)/gcc.dg"; \ @REPLACE_CPP_TRUE@ fi @REPLACE_CPP_TRUE@ @$(top_srcdir)/tests/set_test.sh '$(CC)' '$(gcc_path)' '$(gcc_testsuite_dir)' $(gcc_maj_ver) '$(LN_S)' '$(cpp_call)' '$(target_cc)' @REPLACE_CPP_TRUE@ -$(RUNTEST) --tool gcc --srcdir $(gcc_testsuite_dir) cpp-test.exp @REPLACE_CPP_TRUE@ @$(top_srcdir)/tests/after_test.sh '$(CC)' '$(gcc_path)' '$(cpp_call)' '$(target_cc)' @REPLACE_CPP_TRUE@uninstall: @REPLACE_CPP_TRUE@ @if test x"$(gcc_testsuite_dir)" != x""; then \ @REPLACE_CPP_TRUE@ cd "$(gcc_testsuite_dir)"; \ @REPLACE_CPP_TRUE@ if test -f "gcc.dg/cpp-test/test-t/cpp-test.exp"; then \ @REPLACE_CPP_TRUE@ echo " rm -rf gcc.dg/cpp-test"; \ @REPLACE_CPP_TRUE@ rm -rf gcc.dg/cpp-test; \ @REPLACE_CPP_TRUE@ fi \ @REPLACE_CPP_TRUE@ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mcpp-2.7.2/tests/after_test.sh0000755000175000017500000000116210735413741013250 00000000000000#!/bin/sh ## ./after_test.sh $CC $gcc_path $cpp_call $target_cc CC=$1 gcc_path=`expr $2 : "\(.*\)/${CC}\$"` target_cc=$4 if test x$target_cc != x; then CC=$target_cc fi cpp_name=`echo $3 | sed 's,.*/,,'` cpp_path=`echo $3 | sed "s,/$cpp_name,,"` echo " cd $cpp_path" cd "$cpp_path" echo " removing '-23j' options from mcpp invocation" for i in mcpp*.sh do cat $i | sed 's/mcpp -23j/mcpp/' > tmp mv -f tmp $i chmod a+x $i done if test $CC = gcc; then exit 0 fi echo " cd $gcc_path" cd "$gcc_path" echo " rm gcc" rm gcc if test -f "gcc.save"; then echo " mv gcc.save gcc" mv gcc.save gcc fi mcpp-2.7.2/mcpp.10000644000175000017500000000775210763015061010435 00000000000000.TH MCPP "1" "Mar 2008" "alternative CPP" "User Commands" .SH NAME mcpp \- Matsui CPP, an alternative C preprocessor .SH SYNOPSIS mcpp [\fIoptions\fP] [\fI\fP [\fI\fP]] .SH DESCRIPTION \fBmcpp\fR is a C/C++ preprocessor with the highest conformance which implements C90, C99 and C++98. \fBmcpp\fR has plentiful diagnostics and many #pragmas. It is useful to check portability of your program, and also useful to debug complicated macro. This is a man-page for \fBmcpp\fR of compiler-independent-build. .SH OPTIONS \fBmcpp\fR expects two file names as arguments, \fI\fR and \&\fI\fR. If not specified, \fI\fR defaults to standard input and \fI\fR defaults to standard output. .PP It takes the following options. .PP Commonly used options: .IP \fB-@MODE Specify preprocessing mode. MODE should be one of these 4: .IP " \fB-@std" Standard conforming mode. (default) .IP " \fB-@poststd, -@post" special 'post-Standard' mode. .IP " \fB-@kr" K&R 1st mode. .IP " \fB-@oldprep, -@old" "old_preprocessor" mode (i.e. "Reiser model" cpp). .IP \fB-C Output also comments. .IP "\fB-D [=]" Define as (default:1). .IP "\fB-D [=]" Define as . .IP "\fB-e " Change the default multi-byte character encoding to one of: euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8. .IP "\fB-I " Add to the #include search list. .IP \fB-I- Unset system or site specific include directories. .IP \fB-j Do not output the source line in diagnostics. .IP "\fB-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file" Output source file dependency line for makefile. .IP \fB-N Don't predefine any non-standard macros. .IP "\fB-o " Output to . .IP \fB-P Don't output #line lines. .IP \fB-Q Output diagnostics to "mcpp.err" (default:stderr). .IP "\fB-U " Undefine . .IP \fB-v Show version of \fBmcpp\fR. .IP "\fB-W " Set warning level to (OR of {0,1,2,4,8,16}, default:1). .IP \fB-z Don't output the included file, only defining macros. .PP Options available with -@std (default) or -@poststd options: .IP \fB-+ Process C++ source. .IP \fB-2 Enable digraphs. .IP "\fB-h " Re-define the pre-defined macro __STDC_HOSTED__ as . .IP "\fB-S " Redefine __STDC__ to , undefine old style macros. .IP "\fB-V " Redefine __STDC_VERSION__ or __cplusplus to . .br C with -V199901L specifies C99 mode. .br C++ with -V199901L specifies C99 compatible mode. .PP Options available with only -@std (default) option: .IP \fB-@compat Expand recursive macro more than Standard. .IP \fB-3 Enable trigraphs. .IP \fB-K Embed macro annotations into comments. .PP Options available with -@std (default), -@kr or -@oldprep options: .IP \fB-a Process "assembler" source. .SH PRAGMA \fBmcpp\fR has the following #pragma directives. .IP "#pragma once" Read the header file only once even if multiply #included. .IP "#pragma __setlocale( ""encoding"")" Specify the multibyte character encoding to "encoding". See -e option for the encodings. .IP "#pragma MCPP put_defines" Putout all the macro definitions currently valid. .IP "#pragma MCPP debug " Start to putout debugging informations. should be one or more of: token expand macro_call path if expression memory getc .IP "#pragma MCPP end_debug " Stop to putout debugging informations. are the same with 'debug'. No argument specifies all arguments. .IP "#pragma MCPP push_macro( ""MACRO"")" Save the macro definition to the stack. .IP "#pragma MCPP pop_macro( ""MACRO"")" Retrieve the macro definition from the stack. .IP "#pragma MCPP preprocess" "Pre-preprocess" the following header files for \fBmcpp\fR. .IP "#pragma MCPP warning any message" Putout warning "any message". .SH "VERSION" MCPP V.2.7 (2008/03) compiler-independent-build .SH "SEE ALSO" Do 'man mcpp-gcc' for \fBmcpp\fR of GCC-specific-build. The full documentation for \fBmcpp\fR are maintained as html files. Please see mcpp-manual.html. mcpp-2.7.2/doc-jp/0000777000175000017500000000000011114177017010642 500000000000000mcpp-2.7.2/doc-jp/mcpp-porting.html0000644000175000017500000034533011113257006014067 00000000000000

MCPP-PORTING

== How to Port MCPP ==

for V.2.7.2 (2008/11)
(kmatsui@t3.rim.or.jp)

== ܼ ==

1.
1.1. ϣӤϤФʤ portable ʥ
1.2. Τ Standard C ⡼ɤ˲äƤ¾γƼ⡼ɤ
1.3. ΥɥȤɽˡ

2.

3. ƽϤ˰ܿˡ
3.1. ܿߤν: compiler-specific-build Υѥ
3.1.1. ɤνϤǤɬפ
3.1.2. FreeBSD / GCC V.2.*, V.3.*, V.4.*
3.1.3. Linux / GCC V.2.*, V.3.*, V.4.*
3.1.4. Mac OS X / Apple-GCC V.4.*
3.1.5. CygWIN / GCC V.2.*, V.3.*
3.1.6. MinGW / GCC V.3.*
3.1.7. LCC-WIN32 2003-08, 2006-03
3.1.8. Visual C++ V.6.0, 2002, 2003, 2005, 2008
3.1.9. Borland C V.5.*
3.2. DECUS cpp бƤ
3.3. noconfig.H, configed.H, system.H
3.4. system.c
3.5. 饤֥ؿ
3.6. ɸإå
3.7. makefile mcpp Ȥäꥳѥ
3.8. mcpp 򥳥ѥǤ
3.9. ѥ뤹ϤȥåȤν
3.10. MS-DOS νϡDJGPP
3.11. Compiler-independent-build Υѥ
3.12. Subroutine-build Υѥ
3.12.1. configure
3.12.2. noconfig/*.mak Ȥ
3.12.3. static library shared library DLL

4. ƽϤ˰ܿˡܺ
4.1. noconfig.H, configed.H, system.H
4.1.1. PART 1 åȥƥ: compiler-specific-build
4.1.1.1. ޥ
4.1.1.2. Include ǥ쥯ȥ
4.1.1.3. ֹνϷ¾
4.1.1.4. Ϥθͤ˱
4.1.1.5. Multi-byte character
4.1.1.6. åȤȥۥȤ˶̤
4.1.2. PART 2 ۥȥƥ
4.1.3. PART 3 mcpp ưͤ
4.1.3.1. Ƽư⡼
4.1.3.2. ư⡼ɤκλ
4.1.3.3. Translation limits λ
4.2. system.c
4.extra. malloc()

5. ХȰܿ
5.1. Хɤ
5.2. malloc() ϢΥХå
5.3. Х
5.4. ܿ
5.5. GCC ʳνϤǤ configure ξ
5.6. ǡäƤаܿƤߤޤ
5.7. ڥåȤˤ¾νϤΥƥ
5.8. Τո

6. mcpp ĹƻΤ
6.1. ۣǯ
6.2. V.2.3
6.3. ̤Ƨեȥ¤ȡפ˺

1.

mcpp Martin Minow DECUS cpp 򸵤 kmatsuiʾ ˤŪ˽ľåץץåǤmcpp Ȥ̾ Matsui cpp Ȥ̣Ǥϥ󶡤ΤǡƽϤǻȤˤϡνϤ˹碌ƥ˼㴳ѹäǥѥ뤷ơmcpp μ¹ԥץɬפޤ*1

ΥɥȤϥƽϤ˰ܿˡƤޤǤä¹ԥץưͤˤĤƤϡmcpp-manual.html Ȥޥ˥奢򻲾ȤƤ
ΥɥȤϤ٤ƥץ󥽡եȥȤ󶡤ޤ
mcpp ϼΤ褦ħäƤޤ

:

*1 mcpp V.2.6.3 ϥѥ뤺ߤβफΥХʥꡦѥå⼡ΥȤ󶡤褦ˤΥɥȤǤϤˤϿʤХʥꡦѥåˤĤƤϤ web page 򻲾ȤΤȡ

http://mcpp.sourceforge.net/


1.1. ϣӤϤФʤ portable ʥ

Linux, FreeBSD, Windows ¿ΣϣӤ򥵥ݡȤƤ portable ʥץץåǤꡢΥ Standard C (ANSI/ISO/JIS C) νϤǤХѥǤ빭 portability äƤޤ饤֥ؿϸŵŪʤΤȤäƤޤ
ƽϤ˰ܿ뤿ˤϡ¿ξ硢إåեΤĤΥޥؤƥѥ뤹ǤߤޤǰξǤ⥽ե˿Խ­٤Ǥ

Multi-byte characterʴˤνܤ EUC-JP, shift-JIS, ISO2022-JP GB-2312Ѥ Big-5ڹ KSC-5601 (KSX 1001) бƤꡢUTF-8 ȤޤShift-JIS, ISO2022-JP, Big-5 ξ硢ѥΤǧʤϤǤϡmcpp 䤤ޤ


1.2. Τ Standard C ⡼ɤ˲äƤ¾γƼ⡼ɤ

Standard C ư⡼ɤΤۤˡK&R 1st. Υ⡼ɤ "Reiser" model cpp Υ⡼ɤ⤢ꡢˤϼ post-Standard ͤΥ⡼ɤޤǤޤC++ ΥץץåȤư¹Իץ⤢ޤ
Standard C ⡼ɤϴ¸¿ΥץץåȰäơʤ˼ƤĤǤC90, C95, C99, C++98 Τ٤ƤбƤޤStandard C ץץ reference model ȤʤΤܻؤƺäƤޤεʤΥСϼ¹Իץǻꤹ뤳ȤǤޤ*1

ۤˤĤͭѤʳĥǽäƤޤޥŸ #if ɾȥ졼 #pragma MCPP debug ⤢ޤإåե "pre-preprocess" ƤȤǤޤ
ĤͭѤʼ¹ԻץƤޤ˥󥰤Υ٥ꤹ륪ץ䡢include directory ꤹ륪ץǤ
ˤɤʴְ㤤äƤ mcpp ˽긫ʥåФꤻΤǤ狼䤹ǥåФŬڤʽ򤷤ޤܿȤʤˤĤƤٹȯޤ
ʼǤʤ顢ɥŪŪʤƤߤޤ
ܺ٤ʥɥȤ°Ƥޤ

mcpp η򶯤Ƶ󤲤С®٤٤ȤǤGCC 3.*, 4.* / cc1 ٤ȣܤ飳ܤλ֤ޤBorland C 5.5 / cpp Ʊ餤®٤ǡإåե pre-preprocess εǽȤȤ⤦®ʤΤǡä٤ۤǤϤޤΤǤ뤳ȡportable ʥǤ뤳ȡʤǤư뤳Τˤϡ٤ν֤Ϥ򤨤ʤȹͤƤޤ

ʤץץå Standard C ٤ƥȤ뤿θڥåȤǤ "Validation Suite for Standard C Preprocessing"β⤪ӤȤäƥƥȤƼץץåκ cpp-test.html mcpp ȤȤ˸Ƥޤ򸫤ȡStandard C פȾΤ¸Υץץåˤ¿꤬뤫狼ޤ*2

:

*1 øεʤȤƤ ISO/IEC 9899:1990 (JIS X 3010-1993) ĹȤƤ1999 ǯˤ ISO/IEC 9899:1999 򤵤줿ǤԤ C90Ԥ C99 ȸƤ֡Ԥ ANSI X3.159-1989 ܹԤΤʤΤǡ̤ˤ ANSI C ޤ C89 ȸƤФ뤳Ȥ⤢롣ޤISO/IEC 9899:1990 + Amendment 1995 C95 ȸƤ֤Ȥ롣C++ εʤ ISO/IEC 14882:1998 ӤǤǤ ISO/IEC 14882:2003 ǡξԤ򤳤Ǥ C++98 ȸƤ֡

*2 cpp V.2.2 ޤǤñ cpp ȸƤǤ̤ cpp ʶ路ΤǡV.2.3 mcpp ȸƤ֤ȤˤΥɥȤǤ V.2.2 ޤǤΥС mcpp ȸƤ֡ޤΥɥȤ̾ V.2.2 ޤǤ cpp.doc ȤƤV.2.3 porting.txt ѹV.2.5 mcpp-porting.txt ѹ V.2.6.2 mcpp-porting.html ѹ伫Ȥ̾⡢V.2.2 ޤǤ Psycho ȤƤV.2.3 kmatsui ѹ


1.3. ΥɥȤɽˡ

ΥɥȤϤĤƤϥƥȥեǤV.2.6.2 html եѤޤ
ΥɥȤǤϼΤ褦˥եȤȤʬƤޤ

  • source:
    եȤϡ ɤҤӥޥɥ饤Ϥ򼨤Τ˻Ȥޤ
  • __STDC__:
    եȤϡɸޥӲ餫Υޥ򼨤Τ˻Ȥޤ
  • STD:
    Italic եȤ mcpp system.H ȤեޥɽޤΥɥȤǤϤ̾ mcpp μɽ뤿ˤȤޤΥޥ mcpp 򥳥ѥ뤹˻Ȥǡmcpp μ¹ԥץˤ¸ߤƤʤȤդƤ

2.

  1. DECUS cpp Martin Minow ˤäƺ졢1984/05 usenet / net.sources ǸޤDECUS ȤΤϡDEC Users' Society Ȥ DEC ҤΥԥ塼Υ桼롼פǤDECUS cpp DEC PDP-11 / RT11, PDP-11 / RSX, VAX / VMS, VAX / ULTRIX ΥƥΣøϤΤ˽񤫤줿åץץåǤܿɤƤΤǡ¾Υƥ˰ܿ뤳ȤŪưפǡꥸʥǤǤ⤹Ǥ DEC ʳΤĤ UNIX ƥбƤ褦Ǥ

  2. mcpp νȯȤΤϡC Users' Group եǥ #243 ǤΥˤ뽤򸫤ȡԤˤǽ 85/06 ȤʤäƤޤθ塢ԤС󥢥åפ򤷤ƤȤäʹޤ

  3. θ 88/12 ޤǤ˲ͤˤä MS-DOS ΤĤνϤˤܿޤCUG ΥǥäƤΤϤΥСǤ

  4. ftp.oreilly.com/pub/examples/imake/DECUS-cpp.tar.gz ˤ⥽ꡢ time-stamp 93/02 ȤʤäƤޤºݤƤ CUG ΤΤŤ85/01 ΤΤǤʤ˴ޤޤƤ Martin Minow README ˤȡΥץ public domain ȤʤäƤޤʤ README Τ 84 ޤ 85 ǯΤΤȻפˡ

  5. 89/04 Gigo ˤä OS-9/6x09 Microware C ˰ܿ줿Τ NIFTY-SERVE / FOS9 / lib 2 ϿƤޤ

  6. mcpp V.2 ϡ䤬򸵤Ū˽ľΤǤܿ򤵤˸夵Standard C ˴б뤿ᡢեʬλѤ¿Υޥɲäؿѿɲáʬ䡦񤭴̾˹ԤäƤޤ̤⥪ꥸʥǤΣܤˤʤäƤޤɥȤȸڥåȤϤ٤ơ䤬ޤä񤤤ΤǤ
    Ϥ򥪡ץ󥽡եȥȤƸޤ伫Ȥ DECUS Ȥϲδط⤢ޤ
    ʤꥸʥǤˤǿդƤޤ󤬡mcpp 椹ˤϡ DECUS cpp ȸƤ֤Ȥˤޤ

  7. Standard C ΥޥŸμˡˤĤƤϡE. Ream MS-DOS PDS Ǥ CPP V.5.3 (1989/08, CUG #319) Υ⻲ͤˤޤΤۤGCC / cpp ư䡢J. Roskind JRCPP ΥɥȤ⤤ĤμƤޤ

  8. mcpp V.2.0 ϸڥå V.1.0 ȤȤ 1998/08 NIFTY SERVE / FC / LIB 2 Ǹ졢٥ҤΥȤˤžܤޤ

  9. mcpp V.2.1 ϡV.2.0 C99 1998/08 draft б뤿νäΤǤڥå V.1.1 ȤȤ 1998/09 NIFTY SERVE / FC / LIB 2 ӥ٥ҤΥȤƱ˥ץɤޤ

  10. mcpp V.2.2 V.2.1 1998/07 ˷ޤä C++ Standard (ISO/IEC 14882:1998) б update ΤǤڥå V.1.2 ȤȤ 1998/11 NIFTY SERVE / FC / LIB 2 ӥ٥ҤΥȤƱ˥ץɤޤ

  11. mcpp V.2.3 V.2.2 C99 б update Linux / GCC 2.95, GCC 3.2 ؤΰܿɲäơGCC / cpp Ȥθߴ夵ΤǤޤ¹ԻץɲäѹޤV.2.3 ǤϥɥȤαѸǤޤmcpp °븡ڥåȤˤϡGCC / testsuite ΰȤƼưŪ˥ƥȤ¹Ԥ뤳ȤΤǤ edition ɲäޤ

  12. mcpp V.2.3 γȯǡڥå V.1.3 ȤȤˡʵ(IPA) ʿǯ١̤Ƨեȥ¤ȡפ˿ ͵ץȥޥ͡ˤäƺ򤵤졢2002/07 - 2003/02 δ֤ IPA λȿУͤνΤȤ˳ȯʤޤѸǥɥȤ⤳ΥץȤǡͭ²ҡϥˤ˻䤬ȥƥäƤǤäΤǤΥץȤ cvs repository ftp site Ѱդ졢V.2.3 Ϥ 2002/08 pre-release 1 2002/12 pre-release 2 2003/02 ˥꡼Ǥȯޤθ塢2003/03 V.2.3 patch 1 ФƤޤ*1

  13. mcpp Ϥʿǯ٤ˤ̤Ƨեȥ¤ȡפ˰ PM ˤäƷ³ƺ򤵤졢2003/06 - 2004/02 δ֤ IPA λȰϣУͤνΤȤ V.2.4 ؤ update Ȥʤޤơ2003/11 ˤ V.2.4 prerelease ȯޤΥСǤ Visual C++ 2003 ؤΰܿɲä졢ޤmcpp make ư configure ץȤޤʤmcpp ϤޤΤʥ饤ɽ򤷤ƤޤǤλ BSD Υ饤ɽ򤹤褦ˤʤޤˡ2004/02 ˤϥ꡼ǤȯޤΥСǤ multi-byte character νĥޤޤѸǥɥȤϥܸǤ˹碌 update ޤ
    2004/03 ˤ mcpp V.2.4.1 ꡼ޤϺƵŪޥŸˡΤǤ

  14. 2005/03 ˤ mcpp V.2.5 ꡼ޤΥСǤϡPOST_STANDARD ȤѥΥ⡼ɤ STANDARD ⡼ɤˤμ¹ԻץΰĤȤƵۼ졢OLD_PREPROCESSOR Ȥѥ PRE_STANDARD ⡼ɤμ¹ԻץȤƵۼޤƵŪޥŸˡϺƽƴʤΤȤʤޤޤGCC V.3.3, 3.4 бǡ16 ӥåȥƥǤνϤ˴ؤɥȤ¿ޤ

  15. 2006/07 ˤ mcpp V.2.6 ꡼ޤΥСǤϡSTANDARD ⡼ɤ PRE_STANDARD ⡼ɤĤμ¹ԥץˤޤȤޤcompiler-independent-build λͤϽϤ˰¸ʤΤ˲ޤĤνϤοСؤбɲä줿ǡpre-C90 λͤνϤ˰ܿ뤿ϺޤMS-DOS Υѥؤΰܿޤν񤭴ʤΤˤʤޤϥɲäνϤäƤ⡢ʽ񤭴ȯʤߤǤ
    2006/08 ˤ mcpp V.2.6.1 ꡼ޤΥСǤϡMinGW ؤΰܿɲäޤΤۤХȤĤŪɤޤ
    2006/11 ˤ mcpp V.2.6.2 ꡼ޤΥСǤϡĤΥХȤȤˡƥȥեΥɥȤ html ѹޤޤJuergen Mueller contribution ˤ subroutine-build ޤ
    2007/04 ˤ mcpp V.2.6.3 ꡼ޤΥСǤϡGCC-specific-build GCC ȤθߴޤSubroutine-build Ǥ Greg Kress contribution ˤäƥΥХåեؤνϤޤޤΥС󤫤餤ĤΥƥѤΥХʥꡦѥå󶡤褦ˤʤޤ
    2007/05 ˤ mcpp V.2.6.4 ꡼ޤ V.2.6.3 ΥХեåǤǤ

  16. 2008/03 ˤ mcpp V.2.7 ꡼ޤ ޥ˴ؤ򥳥Ȥ˽񤭹ǽϤ֥ޥ⡼ɡ(macro notification mode) ȤΤ졢ɤʤޤΥ⡼ɤǤϡץץνϤ鸵ΥΥޥΰ֤Τ뤳ȤǤޤΥ⡼ɤ C/C++ refactoring tool Τ˼줿ΤǤ ޤMac OS X / Apple-GCC ؤΰܿɲäޤ Visual C++ 2008 ؤΰܿ⤵ޤ GCC-specific-build Ϥ GCC ˶ᤤΤˤʤޤ СΤĤΥХ⽤ޤ
    2008/05 ˤ mcpp V.2.7.1 ꡼ޤ V.2.7 ΥХեåǤǡСΤĤΥХޤ ޤUNIX ϥƥΥХʥꡦѥåϤ٤ shared library ޤ DLL ȡ󥯤¹ԥץ󶡤褦ˤʤޤ
    2008/11 ˤ mcpp V.2.7.2 ꡼ޤ СΥХեåǤǤ

:

*1 ̤Ƨեȥ¤ȡ(Exploratory Software Project) γפϼΤȤΤ뤳ȤǤ롣

http://www.ipa.go.jp/jinzai/esp/

mcpp V.2.3 V.2.5 ޤǤϼΤȤ֤Ƥ

http://www.m17n.org/mcpp/

2006/04 ˼ΤȤ˰ܤä

http://mcpp.sourceforge.net/

cpp V.2.2 ϥ٥ҤΥȤμΤȤˤ롣dos/prog/c Ȥǥ쥯ȥƤ뤬MS-DOS ѤǤϤʤ UNIX, WIN32/MS-DOS бƤ롣

http://www.vector.co.jp/soft/dos/prog/se081188.html
http://www.vector.co.jp/soft/dos/prog/se081189.html
http://www.vector.co.jp/soft/dos/prog/se081186.html

Υ֥եΥƥȥեϡVector ΤΤ DOS/Windows Ϥ˹碌ơԥɤ [CR]+[LF] shift-JIS encode Ƥ롣SourceForge ΤΤ V.2.5 ޤǤ UNIX Ϥ˹碌Ʋԥɤ [LF] EUC-JP Ǥ롣V.2.6 [CR]+[LF] / shift-JIS zip Ǥ [LF] / EUC-JP tar.gz ǤΣΥ֥ե֤褦ˤ


3. ƽϤ˰ܿˡ

mcpp ΥϣܤΥإåեȣܤ *.c ե뤫ʤäƤޤϣӤϤ˰¸ʬ configed.H, noconfig.H, system.H, system.c ΣܤΥˤޤȤƤޤconfiged.H noconfig.H ȤƱ˻Ȥ뤳ȤϤʤɬɤ餫Ȥޤޤ饤֥ؿΰΣäˤ륽 system.c ˤޤäơmcpp 򲿤餫νϤǻȤˤϡ˹碌ƤΥեѹäɬפޤ

mcpp μ¹ԥץ build ˡ˱Ʋफޤ Build ˡˤϼΣĤμޤ

  1. stand-alone-build vs subroutine-build
  2. compiler-independent-build vs compiler-specific-build
  • stand-alone-build: ĤΥޥɤȤñΤưץץåǤ ϤΥѥ顦ɥ饤ФƤӽФΤ⤢ޤ
  • subroutine-build: ¾Υᥤץ椫饵֥롼Ȥ ɬפʤ鷫֤˸ƤӽФΤǤ ˤĤƤ 3.12 ǽҤ٤ޤ

  • compiler-independent-build: ϤΩưץץåǤ ¹ԻץʤɤλͤϽϤΤˤ餺Ǥ ץץ뤳ȤǤޤϤΰȤư뤳ȤϤǤޤ*1
    ¿ξ硢ѥ뤵̤ФΤǤñǤˤĤƤ 3.11 ǽҤ٤ޤ*2
  • compiler-specific-build: νϤΥץץåʤ⤷ǽʤؤ뤿ΤΤǤ νϤѤλͤνϤѤΥǥ쥯ȥ˥󥹥ȡ뤵ޤ

ʲ 3.1 - 3.9 ǤϤ stand-alone compiler-specific-build ޤGCC ǡסVisual C ѡɽƤΤϤ٤ơ줾 GCC-specific-build, Visual C-specific-build ΤȤǤ

mcpp 򥳥ѥ뤹ˤϣĤˡޤĤ configure ץȤ¹Ԥơconfig.h Ȥإåե Makefile ưˡǤȤñ make; make install ȤǤߤޤconfiged.H ȤإåեϤξ˻Ȥޤconfigure UNIX ϤΥƥ CygWIN, MinGW ǤȤޤ
⤦ĤϳƽѤκʬեȤäƥإåեѹäɬפʤ餵˥إåեԽǡνѤ makefile Ȥä make ˡǤnoconfig.H ȤإåեϤξ˻Ȥޤʬե makefile noconfig Ȥǥ쥯ȥˤޤConfigure λȤ륷ƥǤ⡢إåեľܡԽ뤳ȤǺ٤򤹤뤳ȤǤޤʬեϤǤ˰ܿߤνѤΤΤޤ
ξϤǤϺʬեȤˡˤĤޤConfigure ˤĤƤ INSTALL 򸫤Ƥ

:

*1 V.2.6, V.2.6.1 Ǥ stand-alone-build ȸƤǤ V.2.6.2 subroutine-build ǤΤȼäơƾΤѹ

*2 mcpp V.2.6.3 mcpp.sourceforge.net DzफΥХʥꡦѥå󶡤褦ˤʤäϤ٤ stand-alone compiler-independent-build Ǥ롣


3.1. ܿߤν: compiler-specific-build Υѥ

伫ȤưȤΤǤýϤϼΤΤǡΤˤ mcpp ܿƤޤʤΥ򥳥ѥǤ줿ץץå줾νϤξư뤳ȤǧƤޤ CPU x86 ϤȤäƤޤUbuntu 64 ӥåǤǡ¾ 32 ӥåǤǤ

FreeBSD 6.3 GCC V.3.4.6
Vine Linux 4.2 GCC V.2.95.3, V.3.2, V.3.3.6, V.3.4.3, V.4.1.1
Fedora Linux 9 GCC V.4.3.0
Debian LInux 4.0 GCC V.4.1.2
Ubuntu Linux 8.04 / x86_64 GCC V.4.2.3
Mac OS 10.5 GCC V.4.0.1
CygWIN 1.3.10 GCC V.2.95.3
CygWIN 1.5.18 GCC V.3.4.4
MinGW (MSYS 1.0.11)GCC V.3.4.5
WIN32 Visual C++ 2003, 2005, 2008
WIN32 Borland C++ V.5.5J
WIN32 LCC-Win32 2003-08, 2006-03

ޤ¾Υ桼󶡤줿 Visual C++ V.6.0, Visual C++ 2002, C++Builder 2007 (aka BCC V.5.9) ξ⤢ꡢνϤǥѥ뤹뤳ȤǤޤ

νϤ mcpp 򥳥ѥ뤹뤿νϴñǡnoconfig.H οĤΥޥѹǤ

noconfig ǥ쥯ȥ *.dif Ȥե FreeBSD 6.* / GCC 3.4 Ѥ noconfig.H ƽѤ˽뺹ʬեǤVisual C++ 2005 ˤȤȡsrc ǥ쥯ȥ

patch -c < ..\noconfig\vc2005.dif

Ȥȡޤpatch UNIX ɸŪʥޥɤǡWindows ˤܿƤޤpatch ȤʤƤ⡢ʬե򸫤ƥǥǽƤ⤫ޤޤ

Include ǥ쥯ȥλʤɤϡʬեˤ뽤Ȥ̤ˡ桼ʬΥƥ˹碌ƽʤФʤޤ

ƽ򥳥ѥ뤹뤿γƽѤ makefile źդƤޤ3.7 ȡˡ

copy ..\noconfig\visualc.mak Makefile

Ȥ src ǥ쥯ȥ˥ԡޤ

ʲκȤ src ǥ쥯ȥǹԤޤȤäǤʤ¤ꡢnoconfig.H νǤ

3.1.1. ɤνϤǤɬפ

ʲΤɤνϤǤ⡢compiler-specific-build 뤿ˤϡ

#define COMPILER        INDEPENDENT

ȤʤäƤԤ

#define COMPILER        MSC

ȡνϤɽޥѹޤơ

#define VERSION_MSG     "GCC 3.4"

ȤԤ򼡤Τ褦Ŭ񤭴ޤ

#define VERSION_MSG     "Visual C 2005"

COMPILER make ΥץǾ񤭤뤳ȤǤޤ 㤨С

nmake COMPILER=MSC
nmake COMPILER=MSC install

Ȥޤʬե noconfig.H 񤭴ϡcompiler-specific-build Τ⤽νѤ˽񤭴ΤǡCOMPILER Ͻ񤭴ɬפϤޤmake COMPILER ꤹ compiler-specific-build 졢ꤷʤ compiler-independent-build ޤ

ޤǥեȤ include directory ꤬ noconfig.H ΤΤȰۤʤϡ C_INCLUDE_DIR1, C_INCLUDE_DIR2 Ȥޥ˽񤤤ƤޤC Ȱۤʤ C++ ͭ include directory ϡ CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2, CPLUS_INCLUDE_DIR3 ˽񤭤ޤʤΥǥ쥯ȥϼ¹Ի˴Ķѿ -I ץǻꤹ뤳ȤǤˡnoconfig.H ꤹΤϽϸͭ include directory Ǥ
Include directory ϤΤۤsystem.c ǤꤵƤޤUNIX Ǹ system.c ꤵΤϤ OS-specific ʤΡ̾ /usr/includeˤȤ site-specific ʤΡ̾ /usr/local/includeˤǤWindows Ǥ system.c Ǥ include directory ϲꤵޤWindows Ǥ noconfig.H ǤǥեȤǤ include directory ꤵʤΤǡʬǽ񤯤ޤϴĶѿ INCLUDE, CPLUS_INCLUDE ǻꤹɬפޤ

ޤɬפʤ COMPILER_STD1, COMPILER_STD2 Ȥ߹ߥޥ̾ѹޤ

Multi-byte character encoding ϥǥեȤǤϡUNIX ϤǤ EUC-JPWindows Ǥ shift-JIS ȤƤޤɬפʤ MBCHAR Ȥޥ񤭴¾ encoding ѹޤMulti-byte character encoding ϼ¹Ի˴Ķѿץ#pragma ѹ뤳ȤǤˡ
ϤˤäƤ shift-JIS Big5 encoding бƤʤᡢmulti-byte character '\\' Ʊ 0x5c ͤΥХȤ tokenization ǥ顼ˤʤ뤳ȤޤϤǤ mcpp üʽ򤷤ƥѥη٤䤤ޤˤĤƤ 4.1.1.5 򸫤Ƥ

źդ makefile ˤĤƤϡBINDIR ȤѿǽϤΥХʥ֤Ƥǥ쥯ȥ񤭤ޤ

GCC V.3, V.4 Ǥϥץץѥ (cc1, cc1plus) ˵ۼƤޤäΤǡGCC-specific-build mcpp Ȥˤϡgcc, g++ θƤӽФ shell-script ֤ơmcpp => cc1, mcpp => cc1plus νǼ¹Ԥ褦ˤʤФʤޤźդ makefile Ǥϡ

make COMPILER=GNUC
make COMPILER=GNUC install

Ȥȡ줬ưŪꤵޤܺ٤ mcpp-manual.html#3.9.7 򸫤Ƥ

桼 BINDIR ؤν񤭹߸¤äƤʤϡUNIX ϤǤ sudo make COMPILER=GNUC install ȤޤWindows ǤϤ餫 administrator ȤǡΥǥ쥯ȥ permission ѹƤޤ

3.1.2. FreeBSD / GCC V.2.*, V.3.*, V.4.*

FreeBSD 6.* GCC (GNU C) V.3.4.* ǥѥ뤷 compiler-independent-build mcpp ֤ˤʤäƤޤFreeBSD 6.* / GCC V.3.4.* Ѥ compiler-specific-build ˤϡ

#define COMPILER        INDEPENDENT

ȤʤäƤԤ

#define COMPILER        GNUC

Ȥơѥ뤹ФǤǤ COMPLIER make COMPILER=GNUC Ǿ񤭤뤳ȤǤޤ

GCC ¾ΥСǤСVERSION_MSG Ȥޥ

#define COMPILER_EXT_VAL    "3"
#define COMPILER_EXT2_VAL   "4"
#define COMPILER_CPLUS_VAL  "3"
#define GCC_MAJOR_VERSION   3

ȤʤäƤȤΥСֹѹޤ COMPILER_EXT_VAL GCC major version number COMPILER_EXT2_VAL minor version number 򤤤ʸƥǽ񤭤ޤCOMPILER_CPLUS_VAL __GNUG__ ޥͤǡCOMPILER_EXT_VAL Ʊˤʤޤ ޤGCC_MAJOR_VERSION COMPILER_EXT_VAL Ʊͤͤǽ񤭤ޤ

FreeBSD ΥС 6.* ǤʤС

#define SYSTEM_EXT_VAL      "6"     /* V.5.*: 5, V.6.*:6    */

ͤѹޤ

include directory FreeBSD 6.* ɸȰäƤϡ

#define CPLUS_INCLUDE_DIR1  "/usr/include/c++/3.4"
#define CPLUS_INCLUDE_DIR2  "/usr/include/c++/3.4/backward"

ȤʤäƤǥ쥯ȥѹޤCPLUS_INCLUDE_DIR3, C_INCLUDE_DIR1 ɬפ⤷ޤ

GCC V.2.7-2.95 ǤмΥޥ 199409L ѹޤ

#define STDC_VERSION        0L

¾ UNIX OS Ǥ⥳ѥ餬 GCC ǤСΥСɽ䡢include ǥ쥯ȥꡢϣӸͭȤ߹ߥޥꡢѤǤफ⤷ޤ4.1.1 ȡˡ

3.1.3. Linux / GCC V.2.*, V.3.*, V.4.*

Linux / GCC ǤϤޤ

#define SYSTEM      SYS_FREEBSD

#define SYSTEM      SYS_LINUX

ѹޤ ơFreeBSD ξƱ褦ˡCOMPILER, VERSION_MSG, COMPILER_EXT_VAL, COMPILER_EXT2_VAL, COMPILER_CPLUS_VAL, GCC_MAJOR_VERSION CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2, C_INCLUDE_DIR1 Υޥͤѹޤ

GCC 2.* Ǥ STDC_VERSION ͤѹˡ

#define COMPILER_SP3_VAL    "int"

#define COMPILER_SP3_VAL    "long int"

ѹޤ

include directory

gcc -xc -E -v /dev/null
g++ -xc++ -E -v /dev/null

ȤƳΤƤꤷƤ

noconfig ǥ쥯ȥ linux_gcc2953.dif, linux_gcc32.dif, linux_gcc336.dif, linux_gcc343.dif FreeBSD 6.* / GCC V.3.4 ѤΥ VineLinux 4.0 / GCC V.2.95.3, V.3.2, V.3.3.6, V.3.4.3 Ѥ˽뺹ʬեǤ ޤlinux_gcc412.dif Debian 4.0 / GCC V.4.1.2 Ѥ˽ΤǤ 줾 compiler-specific-build ǤϤ COMPILER ѹޤDistribution ɸ GCC ɲå󥹥ȡ뤷 GCC Ȥ include directory ʤۤʤդƤ

ʤglibc getopt() POSIX ɸΤΤȤϻͤۤʤΤǡȤ鷺ˡsystem.c mcpp_getopt() ȤäƤ

3.1.4. Mac OS X / Apple-GCC V.4.*

Mac OS X Ǥ Xcode Ȥѥå򥤥󥹥ȡ뤹 GCC ⥤󥹥ȡ뤵ޤ /usr/bin ¿ gcc, cc, g++, c++ ޤIntel-Mac Mac OS X 10.5 (Leopard) ξϡi686-apple-darwin9-gcc-4.0.1, i686-apple-darwin9-g++-4.0.1 ȤΤΥޥѤ native code 륳ѥǤ Ʊ˥ѥ⥤󥹥ȡ뤵ޤ Intel-Mac ξϡpowerpc-apple-darwin9-gcc-4.0.1, powerpc-apple-darwin9-g++-4.0.1 ȤΤ powerpc ѤΥХʥ륯ѥǤ ñʤ gcc (g++) gcc-4.0 (g++-4.0) ؤΥ󥯤ǡϥǥեȤǤ native compiler Ȥưޤ-arch ppc ȤץդƵư powerpc ѤΥѥΤƤӽФޤ ޤ/Developer/usr/bin ˤ /usr/bin Ʊѥ켰󥹥ȡ뤵ޤ

Ϥ Apple ˤä¿γĥܤ줿 Mac OS X Ѥ GCC Ǥ ¾Υƥ GCC ȰۤʤΤϡĤ framework ȸƤФäʥǥ쥯ȥ system header directory ȤƤ뤳ȤǤ ⤦Ĥ Intel-Mac PowerPC-Mac ΥХʥΡʣΡ˥ޥǤ褦ˤʤäƤ뤳ȤǤ ΥХʥ򣱤Ĥ˥Хɥ뤷ƤɤΥޥǤư褦ˤ universal binary ȤΤ뤷ߤ⤢ޤ ¤ gcc-4.0, i686-apple-darwin9-gcc-4.0.1, powerpc-apple-darwin9-gcc-4.0.1 䡢ƤӽФ륳ѥΤǤ /usr/libexec/gcc/SYSTEM/4.0.1 cc1, cc1plus ⤹٤ i386 Ѥ ppc ѤȤ universal binary ʤΤǤSYSTEM i686-apple-darwin9 ޤ powerpc-apple-darwin9ˡ 򤽤Τޤ x86 ޥ󤫤 powerpc ޥ˻äƤСnative cross δطž֤ư褦ˤʤäƤΤȻפޤ ξ塢Intel-Mac ppc ѤΥХʥ x86 ΥɤѴʤ鼫ưŪư褦ˤʤäƤޤ

Ȥǡ/usr/bin /Developer/usr/bin ¿ gcc, g++ ꡢؤΥ󥯤ꡢx86 Ѥ ppc Ѥ libexec ǥ쥯ȥ꤬ꡢĤμ¹ԥץˣĤΥХʥ꤬Хɥ뤵Ƥꡢppc ѤΥХʥ꤬ x86 ưĥǽꡢʶ路ΤդƤ Ǥ Intel-Mac Mac OS X 10.5 (Leopard) ˤȤޤppc-Mac Ǥ i686 powerpc (ppc) ؤɤǤ ޤMac OS X 10.4 (Tiger) Ǥ darwin9 darwin8 ɤؤƤ

3.1.4.1. ͥƥ֥ѥȥѥ

ͥƥ֥ѥѤ mcpp Υ󥹥ȡϴñǤ noconfig.H mac_gcc401_i686.dif ѹäȡIntel-Mac Mac OS X 10.5 / GCC 4.0.1 Ѥˤʤޤ Makefile ȤƤ mac_osx.mak Ȥޤ make; sudo make install Ȥ compiler-independent-build make COMPILER=GNUC; sudo make COMPILER=GNUC install Ȥ GCC-specific-build Ǥޤ /Developer/usr/bin ˤ̾ PATH ̤äƤʤΤǡѥ /usr/bin ΤΤȤޤ

Intel-Mac powerpc ѤΥѥ˥󥹥ȡ뤹ˤϡޤ noconfig.H mac_gcc401_powerpc.dif ѹäޤ Makefile ޤ

compiler-independent-build Ǥ NAME, CC, CXX Ȥѿ򡢤 mac_osx.mak ΥȤˤ褦 powerpc ޤʸѹޤ make; sudo make install Ȥޤ ϡ֥ѥǡץѥ뤵줿Τǡppc-Mac ưϤǤ

GCC-specific-build Ǥ NAME, INCDIR, BINDIR, target_cc, arch 򡢤Ϥ powerpc (ppc) ޤ̾ѹޤCC, CXX ѹʤˡ ơmake COMPILER=GNUC; sudo make COMPILER=GNUC install Ȥޤ Intel-Mac ư֥ѥΤΡפΤʤΤǡIntel-Mac ưޤ

ppcMac ǤϡIntel-Mac Ȥϵդˡmac_gcc401_powerpc.dif ǥͥƥ֥ѥѤˤʤꡢmac_gcc401_i686.dif ǥѥѤˤʤϤǤ ѥѤǤϡ嵭 Intel-Mac Makefile ѿ powerpc ޤ̾ȤäȤ򡢤٤ i686 ѹޤ

3.1.4.2. Universal binary

Universal binary ˤϡmac_osx.mak UFLAGS Ȥѿ򥳥ȥȤƤ # 򳰤ơͭˤǤ ȤΤޤޤǤ

3.1.5. CygWIN / GCC V.2.*, 3.*

CygWIN V.1.3.10 / GCC V.2.95.3 Ǥ noconfig.H cyg1310.dif ˤ褦ѹäޤ
CygWIN V.1.5.18 / GCC V.3.4.4 Ǥ cyg1518.dif Ȥޤ

CYGWIN_ROOT_DIRECTORY ȤޥʬδĶ˹碌ƽޤ CygWIN ¸ߤ Windows Υǥ쥯ȥ򼡤ηΤǤ

#define CYGWIN_ROOT_DIRECTORY   "c:/pub/compilers/cygwin"

path-list ʸʸϴطޤ

¾ version Ǥ⡢VERSION_MSG, CYGWIN_ROOT_DIRECTORY include directory Υޥѹ뤳ȤбǤǤ礦

CygWIN Windows ΥƥǤUNIX Υե륷ƥबߥ졼ȤƤΤǡmcpp Ǥ UNIX ϥƥ GCC ȤۤƱͤ˰ޤInclude directories UNIX ϤƱͤȤ߹ޤޤ

3.1.6. MinGW / GCC V.3.*

MinGW / GCC V.3.4.5 Ǥ noconfig.H mingw345.dif Τ褦ѹäޤ
MSYS_ROOT_DIRECTORY, MINGW_DIRECTORY ȤĤΥޥʬδĶ˹碌ƽޤϼΤ褦ˡ줾 /, /mingw ǥ쥯ȥ Windows ΰ֤ΤǤ

#define MSYS_ROOT_DIRECTORY "C:/Program Files/MSYS/1.0"
#define MINGW_DIRECTORY     "C:/Program Files/MinGW"

path-list ʸʸϴطޤ

¾ version Ǥ⡢Υޥ VERSION_MSG include directory Υޥѹ뤳ȤбǤǤ礦Include directory Υޥ "C:/dir/mingw/include" ȤХѥǤ⡢"/mingw/include" Ȥ MinGW Υǥ쥯ȥǤ⤫ޤޤ

MinGW Ǥ symbolic link ݡȤƤʤΤǡgcc GCC-specific-build mcpp ưΤ symbolic link Ȥޤ󡣤ξ塢MinGW / gcc ϤȤ cc1 Ȥ̾Ǥ shell-script εưϵݤޤǡmcpp ΥѥǤ cc1.exe Ȥ¹ԥץơ椫 mcpp.exe ޤ GCC cc1.exe, cc1plus.exe ƤӽФޤ

MinGW GCC-specific-build Ǥ include directories mcpp ꤷޤcompiler-independent-build ǤꤵʤΤǡĶѿ INCLUDE, CPLUS_INCLUDE ǻꤹɬפޤ

3.1.7. LCC-WIN32 2003-08, 2006-03

LCC-WIN32 2003-08-*, 2006-03-* ǤϤ줾 lcc0308.dif, lcc0603.dif Τ褦ѹäޤ
¾ version Ǥ VERSION_MSG ޥѹޤ

3.1.8. Visual C++ V.6.0, 2002, 2003, 2005, 2008

Visual C++ 2008, 2005, 2003, 2002, 6.0 ǤϤ줾 vc2008.dif, vc2005.dif, vc2003.dif, vc2002.dif, vc6.dif Τ褦ѹäޤcompiler-specific-build Ǥ COMPILER ޥ񤭴뤫nmake -DCOMPILER=MSC ץǾ񤭤ޤ

Visual C ¾ΥСǤϡVERSION_MSG ޥѹۤ_MSC_VER _MSC_FULL_VER ȤȤ߹ߥޥͤ򤽤줾 COMPILER_EXT_VAL, COMPILER_EXT2_VAL ȤޥѤ뤳Ȥбޤ

3.1.9. Borland C++ V.5.*

Borland C V.5.5, V.5.9 (C++Builder 2007) / bcc32 ǤϤ줾 bc55.dif, bc59.dif Τ褦ѹäޤ

Borland C/C++ ̤ΥСǤ VERSION_MSG Τۤ__TURBOC__, __BORLANDC__, __BCPLUSPLUS__ ȤȤ߹ߥޥͤ򤽤줾 noconfig.H COMPILER_STD2_VAL, COMPILER_EXT_VAL, COMPILER_CPLUS_VAL ȤޥѤ뤳Ȥǡбޤ4.1.1.1 ȡˡDigraphs μƤСǤСHAVE_DIGRAPHS ѹޤ__STDC_VERSION__ μƤСǤСSTDC_VERSION ѹޤ


3.2. DECUS cpp бƤ

PDP-11 RT-11 / DECUS C, RSX / DECUS CVAX VMS / VAX-11 CPDP-11 / UNIX, VAX / ULTRIX βΣäˤ DECUS cpp бƤ褦ǤMS-DOS Microsoft C, Lattice C ΤʤŤǤˤбƤ褦ǤϤˤ⤦פȻפ졢ޤ伫Ȥƥʥ󥹤ǤʤΤǡޤ


3.3. noconfig.H, configed.H, system.H

system.H HAVE_CONFIG_H Ȥޥ non-0 Ƥ configed.H include Ǥʤ noconfig.H include ޤconfiged.H, noconfig.H ˤ mcpp PART 1 PART 2 Ȥʬꡢsystem.H ˤ PART 3 ޤ

ΥեˤϡƽϤ˰ܿɬפʤĤΥޥƤޤޤܿƤʤϤ˰ܿˤϡPART 1 ˿ԤʤԤ­ޤ
PART 1 ϣϣӤ target Ϥ˰¸ǡPART 2 host Ϥ˰¸ PART 3 mcpp ưͤǤ
configed.H, noconfig.H ǤϥåȽϤȥۥȽϤȤƱǤȲꤷƤޤۤʤ PART 2 Խɬפޤ

ǥեȤȰ㤦ǰܿϡΥեΤɬܤ̤Ƥ


3.4. system.c

configed.H (noconfig.H), system.H ΥޥǤϵۼǤʤϣӤϤκۤϡsystem.c ǵۼƤޤ̤νϤ˰ܿˤϡ˿ԤΥ­ȤɬפˤʤǤ礦

Υե˵ҤƤΤϡmcpp ưΥץusage ʸinclude ǥ쥯ȥꡢإåե䥽ե򥪡ץ󤹤ΣϣӸͭΥǥ쥯ȥѥΰ#pragma νϸͭγĥǥ쥯ƥ֤νǤۤȤɤ target OS target ϤǤ


3.5. 饤֥ؿ

饤֥ؿΤStandard C ˤʤ getopt(), stpcpy() Σäˤ륽 system.c ˽񤤤Ƥޤmcpp getcwd(), stat() ȤUNIX ϤǤ readlink() ȤޤΣĤ OS ˰¸ؿǤ portable ˽񤯤ȤǤʤΤǡˤϴޤƤޤ󡣤ΣĤ Standard C ˤϤޤ󤬡POSIX ǤϵꤵƤޤmcpp λȤؿϤΣĤǤʤϤϤʤǤ礦 ΤۤMSC Ǥ stricmp() Mac OS X, CygWIN, MinGW Ǥ strcasecmp() Ȥޤ*1, *2
饤֥ؿϤ⡢Ϥˤä̯˰㤦Τͤ˰¸ȤϤƤʤΤǡɤνϤΤΤǤХʤפǤ

:

*1 MinGW Ǥ˸¤ä spawnv() Ȥ롣

*2 mcpp V.2.6.4 ޤǤ lib.c ȤեΩƤƤ getopt(), stpcpy() ΣĤˤʤäΤǡV.2.7 system.c ˵ۼ ơgetopt() mcpp_getopt() ̾Ѥơ󥯤Υȥ֥ä


3.6. ɸإå

mcpp ΥǤ stdio.h, ctype.h, errno.h, stdlib.h, string.h, stddef.h, limits.h, time.h, sys/types.h, sys/stat.h ̵ include ƤޤUNIX ϤΥƥǤ unistd.h include ޤʤϤϤޤʤǤ礦


3.7. makefile mcpp Ȥäꥳѥ

noconfig ǥ쥯ȥˤ *.mak ϸ̤νѤ makefile Ǥܺ٤꤬Ǥޤmake ΤΤϳƽϤ°ΤΡޤϤΥƥɸŪʤΤꤷƤޤVisual C Ǥ make ǤϤʤ nmake Ȥޤ

ޤϤ xyz ȤȡFreeBSD / GCC ʳǤ

patch -c < ../noconfig/xyz.dif

Ȥ noconfig.H ޤˡnoconfig.H COMPILER VERSION_MSG Ȥޥ񤭴ޤ˼ʬΥƥ˹碌 noconfig.H C_INCLUDE_DIR? ΥޥޤơѤ noconfig/xyz.mak Makefile ˥ԡǥ쥯ȥʬΥƥ˹碌ƽǡ

make
make install
make clean

ȤƤ

¾νϤǤϡ򻲹ͤɬפ makefile 񤤤Ƥΰ¸طñǡ

  1. main.c, directive.c, eval.c, expand.c, support.c, system.c, mbchar.c system.H, internal.H ˰¸
  2. system.H configed.H (noconfig.H) ˰¸

ȤطˤʤäƤޤ system.H internal.H include ɬפޤ internal.H Ϥ mcpp_lib.h include ޤ

mcpp ȤȤä mcpp ꥳѥ뤹ˤϡϤΥץץåΤˤμ¹ԥץ򤪤ޤ㤨 GCC V.2.95 ǤС° cpp0 cpp0_gnuc ȤǤ rename Ƥλ˻ȤΤ cpp0 ˥󥯤ΤɤǤ礦ʤȤץץå mcpp Ȥȡ

ln -sf mcpp cpp0

ȤޤWindows ǤϻȤΤ cpp32.exe ˥ԡޤ*1

mcpp ¹ԥץ̾

make NAME=mcpp

Ȥƻꤹ뤳ȤǤޤƱȤ BC make Ǥ make -DNAME=mcpp Ȥ롣UCB make Ǥ -D դƤդʤƤɤGNU make Ǥ -D դƤϤʤˡ

źդ makefile Ǥ GCC ѡfreebsd.mak, linux.mak, mac_osx.mak, cygwin.mak, mingw.mak˰ʳ make install ǤϤޤϤʤΤǡäƤ°Υץץåϡmake install ǾäƤޤȤΤʤ褦ˡ餫̾Υե˥ԡƤƤ

Visual C, Borland C Τ褦ʣѥѥ mcpp Ȥäƥꥳѥ뤹ϡmcpp νϥե򥳥ѥͿ륽եȤޤ㤨 main.c ȤץץΤ main.i Ȥä̾ǽϤơ cl bcc32 ˥ѥ뤵ˡ

mcpp Ȥäƥꥳѥ뤹ϡإåե "pre-preprocess" εǽȤȡץץ֤ṳ̂ޤźդ makefile ȤϡUCB make, GNU make, MS nmake Ǥϡ

make PREPROCESSED=1

BC make Ǥ

make -DPREPROCESSED=1

ȤȡưŪ˥إåե pre-preprocess ǥץץ줫饳ѥ뤷ޤLCC-Win32 make Ǥ if ʸˤʬǤʤΤǡmakefile ƥꥳѥ뤹ɬפޤƤ makefile ΤΤ˥ȤȤƽ񤤤Ƥޤ

UCB make, GNU make, MS nmake ǤϡMALLOC=KMMALLOC Ȥץդ make ȡ䤬񤤤 malloc() 󥯤ޤˤĤƤ 4.extra 򸫤ƤBC make ǤƱȤ -DKMMALLOC ȤץǻꤷޤLCC-Win32 make ǻ malloc() 󥯤뤿ˤϡmakefile ɬפޤ

:

*1 FreeBSD Ǥ cpp0, cc1 ֤ɸΥǥ쥯ȥ /usr/libexec Ǥ롣Linux Ǥ /usr/lib/gcc-lib/i686-redhat-linux/3.3.2 ȤäҤɤǥ쥯ȥˤʤäƤ롣Linux / GCC Ǥ distribution 䤽 version ˱ makefile ΤΥǥ쥯ȥλ񤭴ɬפ롣Include directory ⤤ΤǡΤʤФʤʤ

ޤLinux FreeBSD Ǥ /usr/bin/cpp ȤΤ뤬ϼºݤˤ cpp0 ޤ cc1 ƤӽФgcc cpp0 ޤ cc1 ƤӽФ
ʤmcpp-manual.html#3.9.5, mcpp-manual.html#3.9.7 ⻲ȤΤȡGCC 3.*, 4.* Ǥϥץץѥ (cc1, cc1plus) ˵ۼƤޤäΤǡmcpp Ȥˤ gcc, g++ θƤӽФ shell-script ֤ɬפ롣


3.8. mcpp 򥳥ѥǤ

ƽϤ˰ܿ뤿ˤϤĤ꤬ɬפǤmcpp Υ򥳥ѥ뤹뤳ȼΤϡC90 (ANSI C) λͤƤϤǤнʬǤޤץץåƱͤǤ*1, *2

char դǤʤǤ⤫ޤޤ
ư黻פǤ

ΥϽϤ̯ʺ˱ƶʤ褦˽񤤤Ƥޤ äȤ⡢ºݤ˳ƽϤǥѥ뤹뤿ˤϡˤνϤΥХ򤹤ɬפޤϤäƤߤʤȲФƤ뤫狼ޤ󡣻䤬ܿĤνϤǤ⡢ХǤ뤳ȤΤ᤽βˡ򸫤ĤޤǤˤʤλ֤äƤޤäȤ󤫤ޤ

mcpp бƤʤΤϡpre-C90 νϤΤۤüʸåȤĽϤü CPU Ǥ
EBCDIC ˤбƤޤ
ޤ黻Ǥʤ CPU ˤ⡢бƤޤ󡣣Ǥʤϡ#if ǥСեȯˡʤ뤫⤷ޤ

:

*1 mcpp V.2.5 ޤǤ K&R 1st. νϤǤ⥳ѥǤ褦ˤƤǤˤɬפϤʤʤäƤȻפΤǡV.2.6 C90 Ȥ褦˲᤿ȼäƥΥɥȤ

*2 V.2.6.2 ޤǤ C++ Ǥ⥳ѥǤ褦ˤƤV.2.6.3 C Ȥ


3.9. ѥ뤹ϤȥåȤν

mcpp Υ򥳥ѥ뤹ϡʥۥȡˤȡˤä줿 mcpp μ¹ԥץȤϡʥåȡˤȤϡɬƱǤɬפϤޤ󡣤줬äƤϡnoconfig.H (configed.H) SYSTEM, COMPILER ǥåȤꤷHOST_SYSTEM, HOST_COMPILER ϥۥȤꤷޤޤPART 1 ˤϥåѤΤΤǡPART 2 ˤΤϥۥѤǤsystem.c ϼȤƥåѤΤΤǤ

ۥȤȥåȤδطˤϡΤ褦¤ޤ

  1. ۥȽϤϥåȽϤƱϣӾΤΤǤ뤫ޤϥѥǤ뤳ȤɬפǤ ۥȽϤȥåȽϤʸåȤȤϤȤ ASCII Ǥ뤳ȤɬפǤ
  2. ۥȽϤ long (unsigned long) ϥåȽϤΤϰϤƤϤޤ󡣤 Standard C ǵꤵƤǤ⤢ޤC99 Ǥ long long (unsigned long long) ˤĤƱȤޤ

ʤǸۥȤȥåȤȤΤϡѥΤȤϴطޤ󡣥ѥ뤹ΤϥѥΤλŻǡץץåϸ§ȤƤˤϴΤޤmcpp ֥ѥˡװܿϡΥѥ餬ǸåȽϤǤۥȽϤȤƤϥѥǤʤΤȤȤˤʤϤǤmcpp ֥ѥǡץѥ뤹ϡΥѥ餬ۥȽϤǡѥΥåȤåȽϤȤʤޤ


3.10. MS-DOS νϡDJGPP

mcpp βΥСǥݡȤƤΤΤθ塢ݡȤ᤿ϤˤĤƽҤ٤Ƥޤ

mcpp V.2.2 ޤǤϼνϤ򥵥ݡȤƤޤV.2.4 Ǻޤ

MS-DOS Turbo C V.2.0
OS-9/6x09 Microware C

V.2.5 ǤϼνϤ˴ؤɥȤޤ

DJGPP V.1.12 GCC V.2.7.1
MS-DOS LSI C-86 V.3.3 

V.2.6 ǤϾΣĤνϤ򥽡˼νϤ˴ؤɥȤȥޤ

MS-DOS Borland C 4.0
Plan 9 pcc

V.2.6 ǤϤޤMS-DOS νϤξƥΤ򤹤٤ƺpre-C90 νϤΤޤ

V.2.7.2 ǤϼνϤΥݡȤޤ

Win32 Borland C 4.0

ŤϤǡ桼ϾʤʤäƤȻפΤǤ
⤷νϤǥѥ뤹ϡcompiler-specific-build Ǥ¿꤬ɬפǴñǤϤޤ󤬡compiler-independent-build ʤ顢νϤ C90 λܼͤۤƤСΤ褦ˤƴñˤǤޤ

DJGPP ˤĤƤϡnoconfig.H SYSTEM, HOST_SYSTEM SYS_WIN32 ȤHAVE_INTMAX_T, HAVE_INTTYPES_H FALSE Ȥsystem.H NBUFF ǥեȤ 1/4 餤˲ޤ*1

MS-DOS νϤˤĤƤϡnoconfig.H SYSTEM, HOST_SYSTEM SYS_WIN32 ȤHAVE_LONG_LONG FALSE Ȥsystem.H NBUFF ǥեȤ 1/16 餤ˡIDMAX ǥեȤ 1/4 餤˲ޤ directive.c SBSIZE ǥեȤ 1/8 餤ˤޤơlarge memory model ǥѥ뤷ޤ
MS-DOS Ǥϥ󤬸Τǡǥѥ뤷ƤƤ⡢Ĺʥޥ¿ʤɤ out of memory Ȥʤ뤳Ȥޤ

:

*1 DJGPP / GCC 4.1.0 ǤϤ mcpp V.2.6.1 򥳥ѥǤȤ𤬤롣


3.11. Compiler-independent-build Υѥ

mcpp ϤΩñΤư compiler-independent ǤȤƥѥ뤹뤳ȤǤޤ¿ξϥѥ뤵̤ФΤǴñǤCompiler-independent Ǥϼ¹Իץʤɤλͤϰǡϰ¸ʬϤޤOS ˤ㤬Ǥinclude directory UNIX Ϥ /usr/include, /usr/local/include ꤵʤΤǡȤϴĶѿ -I ץǻꤹɬפޤ*1, *2

configure Ȥ륷ƥ GCC ǥѥ뤹ñ mcpp Υ롼ȥǥ쥯ȥ

./configure; make; make install

ȤФߤޤξ noconfig.H ǤϤʤ configed.H Ȥإåե뤬Ȥޤconfigure ξܺ٤ˤĤƤ INSTALL-jp 򻲾ȤƤ

configure λȤʤƥǤ mcpp Ǥ˰ܿƤϤǤϡnoconfig ǥ쥯ȥˤκʬեȤä noconfig.H 񤭴Фߤޤʳѹɬפޤmakefile noconfig ǥ쥯ȥˤΤ򥳥ԡƻȤޤ󥹥ȡ뤹ǥ쥯ȥ makefile BINDIR Ȥѿ˽񤭤ޤơsrc ǥ쥯ȥ make make install ޤ
mcpp Ǥ˰ܿƤϤȥС󤬾㤦ξϡޤᤤСκʬեŬѤơԽޤ

mcpp ޤܿƤʤϤǤϡnoconfig.H ԽƿĤΥޥ񤭴񤭲äꤷƤޤHOST_COMPILER ŬޤơCOMPILER INDEPENDENT SYSTEM 򤽤 OS VERSION_MSG ŬޤåȽϤ¸ߤʤΤǡPART 1 ˤꤹ뤳ȤϤޤ

PART 2 mcpp 򥳥ѥ뤹ۥȽϤ Standard C λͤɤƤ뤫ɬפʴؿäƤ뤫ˤäơ꤬äƤޤǤ㤦Τ long long ȤμǤVisual C 2002, 2003, 2005 Borland C 5.5 Ǥ __int64 ȤˤʤäƤơͤ printf() ɽҤ VC 2005 ʳǤ j ll ǤϤʤ I64 ʤΤǡLL_FORM Ȥޥ "I64" ޤMinGW Ǥ long long ޤprintf() λҤ I64 Ǥ Visual C 2008 Ǥ long long Ȥ̾Ȥ褦ˤʤޤ

stpcpy() ȤؿΤʤϤǤϡHOST_HAVE_STPCPY FALSE ޤ

makefile noconfig ǥ쥯ȥˤΤ򻲹ͤˤƽ񤤤Ƥ3.7 ⻲ȤΤȡˡ

Mac OS X ˤ x86 powerpc ΥХʥΥޥǺ褦ˡͥƥ֥ѥȥѥȤѰդƤޤ ޤȤä universal binary ȤΤ褦ˤʤäƤޤ x86 powerpc ѤΥХʥܤΥե«ͤΤǤ λȤߤϾʣʤΤǡ3.1.4 compiler-specific-build compiler-independent-build ˤĤƤޤȤƤޤ

ʤmcpp V.2.6.3 sourceforge ΥȤ compiler-independent-build βफΥХʥꡦѥå󶡤褦ˤʤޤϤ줾Υѥå˸ͭˡǥѥå󥰤줿ΤǤΥѥå󥰻ͤϤ줾б륽ѥåˤե˽񤫤ƤޤFreeBSD, Linux, Mac OS X ѤΤΤϤ٤ƥѥˤ configure ץȤȤäƤޤ

:

*1 mcpp V.2.4, V.2.5 Ǥ compiler-independent ǤλͤȾüǡ Ϥλͤб̤ΥޥɤȤƤΥץץåǤäV.2.6 ϽϤΩλͤȤ

*2 ѥ뤵̤ФȸäƤ⡢MS-DOS νϤǤϥ󤬸ΤǡѥϤǤƤ¹Ԥ out of memory ˤʤ뤳Ȥ롣MS-DOS Ǥ translation limits ˲ƥѥ뤷ʤФʤʤ3.10 򻲾ȡ


3.12. Subroutine-build Υѥ

mcpp ¾β餫Υᥤץफ饵֥롼ȤƸƤӽФ褦˥ѥ뤹뤳ȤǤޤΩץץåƱ褦ˡƤӽФ¹Իץꡢꤵ줿ϥեץץƽϥե˽ϤơƤӽФΤǤɬפʤʣΥեˤĤƷ֤ƤӽФȤǤޤƤӽФȥȡñ̤ΤȤ򤹤ΤǤϤޤ

֥롼ǤǤϡȤƥեǤϤʤΥХåեȤȤǤޤ

mcpp ΥϡMCPP_LIB Ȥޥ non-0 ƥѥ뤹ȡ֥롼ǤȤƥѥ뤵褦ˤʤäƤޤ֥롼 stand-alone Ǥ main() Τ褦 mcpp_lib_main() Ȥ̾ѤǤ

    int mcpp_lib_main( int argc, char ** argv);

GCC Ǥ COMPILER ޥ GNUC ǤϤʤ INDEPENDENT Τޤޤǥѥ뤷ޤGNUC ȤȡGCC libexec ǥ쥯ȥ˥󥹥ȡ뤵 GCC ƤӽФΤǤƤޤǤ
¾ǡVisual C, Borland C, LCC-Win32 Ǥ COMPILER INDEPENDENT Ǥ MSC, BORLANDC, LCC ΤɤǤ⤫ޤޤ󡣤νϤǤϥץץåΩƤʤΤǡcompiler-specific-build ǤϤƤӽФ뤳ȤϤʤǤcompiler-specific-build ǤϽϸͭλޥ䥪ץ䤤ĤνϸͭλͤΤǡ줬ĤɤǥѥλӤޤ

ºݤ˥ѥ뤹μ configure script Ȥ noconfig/*.mak եȤȤʬޤ

3.12.1. configure

GCC ǥѥ뤹 configure Ȥޤ

./configure --enable-mcpplib
make
sudo make install

ȤȡLinux FreeBSD Ǥ compiler-independent Ǥ libmcpp.a, libmcpp.so.$(SHLIB_VER) ơǥեȤǤ /usr/local/lib ˥󥹥ȡ뤵ޤ ơlibmcpp.so libmcpp.so.0 libmcpp.so.$(SHLIB_VER) ؤΥ󥯤ĥޤ *.a static 饤֥ꡢ*.so shared 饤֥Ǥ libmcpp.la Ȥեޤ libtool Ȥġ뤬ȤΤΤǤ $(SHLIB_VER) mcpp V.2.6.3 Ǥ 0.0.0V.2.6.4 Ǥ 0.0.1V.2.7 Ǥ 0.1.0V.2.7.1 Ǥ 0.2.0V.2.7.2 Ǥ 0.3.0 ȤƤޤ mcpp_lib.h, mcpp_out.h Ȥإåե /usr/local/include ˥󥹥ȡ뤵ޤ libmcpp ȤץɬפʤΤǤ

Mac OS X Ǥ *.so ǤϤʤ *.dylib Ȥ̾ˤʤޤ ޤmake CFLAGS+='-arch i386 -arch ppc' ȡ-arch ץǤĤ CPU ꤹȡб universal binary Υ饤֥꤬Ǥޤ -isysroot -mmacosx-version-min= ȤץȤäơȤ Mac OS X ΥСϰϤ򹭤뤳ȤǤޤ ϡLeopard Tiger ȸߴ i386 ppc Ѥ universal binary shared 饤֥륳ޥɤǤ

make CFLAGS+='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc'

CygWIN, MinGW Ǥ *.so ǤϤʤ *.dll Ȥ̾ DLL Ȥʤޤ CygWIN Ǥ libmcpp.a, libmcpp.dll.a, libmcpp.la /usr/local/lib ˡcygmcpp-0.dll /usr/local/bin ˥󥹥ȡ뤵ޤ MinGW ۤȤƱǤcygmcpp-0.dll libmcpp-0.dll Ȥ̾ˤʤޤ DLL ȤȤ libmcpp.dll.a 󥯤ޤ import library ȤΤǤ

줿 libmcpp.so 󥯤 main_libmcpp.c Ȥñʥ⥳ѥ뤵ơmcpp Ȥ̾ /use/local/bin ˥󥹥ȡ뤵ޤ ΥǤ狼褦ˡlibmcpp Ȥˤ mcpp_lib.h Ȥإåե include ޤ*1

Ǿ¤ΥɥȤ⥤󥹥ȡ뤵ޤ

testmain.c 򥳥ѥ뤷ƥ饤֥ȥ󥯤ȡ⤦ʣʥƥȤǤޤ configure ǤϤʤΤǡˡǹԤޤ

:

*1 libmcpp Ȥʤ stand-alone Ǥ compiler-independent-build mcpp Ʊ̾Ʊǥ쥯ȥ˥󥹥ȡ뤵Τǡߤ˾񤭤礦Ȥˤʤ롣 ɥȤƱΤƱǥ쥯ȥ˥󥹥ȡ뤵Τǡ񤭤롣

3.12.2. noconfig/*.mak Ȥ

noconfig.H noconfig ǥ쥯ȥ makefile Ȥϡnoconfig.H ˤνϤΥСѤ patch Ƥơmakefile γƥǥ쥯ȥʬΥƥ˹碌ƽǡˡΤ褦ˤޤ

make MCPP_LIB=1 mcpplib
make MCPP_LIB=1 mcpplib_install
compiler-independent ǤΥѥǤGCC ʳǤ COMPILER=MSC Ȥ compiler-specific Ǥǥѥ뤷Ƥ⤫ޤޤ
Visual C Ǥ make ǤϤʤ nmake Ȥޤ
LCC-Win32 make 㵡ǽ if ʸˤʬǤʤΤǡmakefile Խʤ make ɬפޤ

Linux, FreeBSD, Mac OS X, CygWIN, MinGW Ǥϡlibmcpp.la ʤΤȥɥȤ󥹥ȡ뤵ʤʳϡconfigure make Ʊͤη̤ˤʤޤ Mac OS X Ǥϡmac_osx.mak UFLAGS Ȥѿ򥳥ȥȤƤ # 򳰤ȡuniversal binary ˤʤޤ Windows νϤǤϥ饤֥̾ Linux ȤϰäơΤ褦ˤʤޤ

FreeBSD / GCCLinux / GCCMac OS X / GCCCygWIN / GCCMinGW / GCCVisual C, Borland C, LCC-Win32
static librarylibmcpp.alibmcpp.alibmcpp.alibmcpp.alibmcpp.amcpp.lib
shared library or DLLlibmcpp.so.$(SHL_VER)libmcpp.so.$(SHLIB_VER)libmcpp.$(SHLIB_VER).dylibcygmcpp-$(DLL_VER).dlllibmcpp-$(DLL_VER).dllmcpp$(DLL_VER).dll
import library of DLLlibmcpp-$(DLL_VER).dll.alibmcpp-$(DLL_VER).dll.amcpp$(DLL_VER).lib

$(SHL_VER) mcpp V.2.6.3, V.2.6.4 Ǥ 0V.2.7 Ǥ 1V.2.7.1 Ǥ 2V.2.7.2 Ǥ 3 Ǥ $(SHLIB_VER) mcpp V.2.6.3 Ǥ 0.0.0V.2.6.4 Ǥ 0.0.1V.2.7 Ǥ 0.1.0V.2.7.1 Ǥ 0.2.0V.2.7.2 Ǥ 0.3.0 Ǥ $(DLL_VER) mcpp V.2.6.3, V.2.6.4, V.2.7, V.2.7.1, V.2.7.2 Ȥ 0 Ǥ $(SHLIB_VER) Σܤޤ $(DLL_VER) Ʊϡ$(SHLIB_VER) Σܰʹߤι⤤С㤤Сξ̸ߴδطˤޤ

Windows νϤǤ import library ȤΤޤ DLL ȤΤΤǤ DLL ȤȤϤ import library 󥯤ޤ Static library import library makefile ǻꤵ줿 $(LIBDIR) ˡDLL Τ $(BINDIR) ˥󥹥ȡ뤵ޤ DLL $(BINDIR) ˥󥹥ȡ뤹ΤϡWindows Ǥ DLL ϼ¹ԥץ PATH ̤äǥ쥯ȥˤʤФʤʤǤ

mcpp_lib.h, mcpp_out.h $(INCDIR) ˥󥹥ȡ뤵ޤ

饤֥Ǥ󥯤 main_mcpplib.c ⥳ѥ뤵 mcpp Ȥ̾ $(BINDIR) ˥󥹥ȡ뤵ޤ Windows νϤǤϤ 'DLL_IMPORT=1' ȤץꤹȡDLL Ǥ mcpp 󥯤ޤ

Τ褦ˤȡtestmain.c ȤץᥤץȤƥ饤֥Ǥ mcpp 󥯤ޤ

make testmain
make testmain_install

testmain.c ˤϥΥХåե˽Ϥ񤤤Ƥޤ ˽Ϥˤϡᥤץ mcpp_lib.h Ȥإåե include ơƤؿȤޤ 嵭Υޥɤ 'OUT2MEM=1' Ȥץդäȡtestmain.c Ǥ줬ͭˤʤޤ OUT2MEM Ȥޥñ testmain.c ΤΤΤǡmcpp ΤˤϤΥޥɬפޤ

饤֥ǤȤȤϡtestmain.c 򻲹ͤ main ץ񤭡noconfig/*.mak 򻲹ͤ makefile 񤤤Ƥ

3.12.3. static library shared library DLL

饤֥ˤ static library shared libraryWindows Ǥ dynamically-linking library: DLLˤȤޤ Static library *.o (*.obj) ե򽸤᤿Τǡѥ˥󥯤ޤ ѿؿ global name ϤΤޤ޸ƤӽФ¦ global name Ȥʤꡢ̾ξͤδ⤢ޤ ΤȤϡV.2.6.1 ޤǤϥ饤֥경ͽꤻ˳ȯƤ mcpp ˤȤäƤ礭Ȥʤޤ Ф shared library (DLL) ϼ¹Ի˥󥯤Τǡ¾Υץȶͭޤ

Windows DLL Ǥϥ饤֥ global name ϳϸŪ export 줿̾ import ǽǤ mcpp ξ mcpp_lib.h ˤ̾ import Ǥޤ

UNIX shared library Ǥϡ̤ˤϥ饤֥ global name ϳݸǡ̾ξͤ˿ФȤʤФʤޤ GCC 4.0 ʹߤ mcpp V.2.7 ʹߤ򥳥ѥ뤷ϡmcpp_lib.h ˤ̾ʳϳϸޤ*1, *2

ȤǡWindows Ǥ DLL ȤUNIX Ǥ GCC 4.0 ʹߤǥѥ뤷 shared library ȤΤ̾ξͤ餺¿Ǥ

:

*1 mcpp V.2.7 ʹߤǤ GCC V.4.0 Ǽ줿 #pragma GCC visibility * Ȥǥ쥯ƥ֤Ȥ褦ˤǤ롣

*2 ʤGCC V.4.1 ʹߤˤ -fstack-protector Ȥץ󤬤뤬 #pragma GCC visibility hidden ȤξΩʤ褦Ǥ롣 äơlibmcpp ΥѥǤϻȤʤ


4. ƽϤ˰ܿˡܺ

4.1. noconfig.H, configed.H, system.H

Υإåե˵ҤƤ뤳Ȥΰ̣ϡƤɤФ狼ȻפޤȤ¿񤭹ǤޤǰΤ˰ʲ񤤤Ƥޤ
PART 1, PART 2 noconfig.H (configed.H) ˤꡢPART 3 system.H ˤޤ

ޤåȥƥmcpp ܿ륷ƥˤȥۥȥƥmcpp 򥳥ѥ뤹륷ƥˤꤷޤ

  • SYSTEM
    åȽϤưϣӤꤷޤϣӤ̾ϤľƤޤ̾ƤʤϣӤŬƤ
  • COMPILER
    åȽϤꤷޤѥ̾ϤľƤޤ̾ƤʤѥŬƤCOMPILER INDEPENDENT ȡåȽϤ¸ߤʤ compiler-independent Ǥ mcpp ޤξ PART 1 ¿̵꤬뤵ޤ
  • VERSION_MSG
    -v ץ usage() ʸɽ뤿ΥۥȽϤΥСʸƥǽ񤭤ޤ
  • HOST_SYSTEM, HOST_COMPILER
    ۥȣϣӡۥȽϤꤷޤåȤƱϡ
    #define HOST_SYSTEM     SYSTEM
    #define HOST_COMPILER   COMPILER
    
    ȤƤޤ

SYSTEM, COMPILER ̿̾ˤϰε§ޤ򸫤ۤ狼䤹Ǥ礦ġˤʤäƤޤSYSTEM ϥ󥯥롼ɥեΥѥꥹȤηϣɸΥ󥯥롼ɥǥ쥯ȥΤ뤿ˤȤƤʤΤǡޤͤɬפϤޤ

4.1.1. PART 1 åȥƥ: compiler-specific-build

4.1.1.1. ޥ

  • SYSTEM_OLD, SYSTEM_STD1, SYSTEM_STD2, SYSTEM_EXT, SYSTEM_EXT2, COMPILER_OLD, COMPILER_STD1, COMPILER_STD2, COMPILER_EXT, COMPILER_EXT2
    mcpp predefine ϸͭΥޥ̾ʸƥǻꤷޤפʤΤʤǤޤ0 ĤΥȡƤϤʤˡ*_OLD Τ '_' (underline) ǻϤޤʤŤήΥޥǡ mcpp ¹Ի -S <n> ץ <n> 1 ʾꤹ predefine ޤʤGCC-specific-build STD ⡼ɤǤϡ-ansi ޤ -std=iso* ץ󤬻ꤵʤ¤ꡢΥޥˡ *_STD?, *_EXT, *_EXT2 Ǥɬ _ ǻϤޤޥ̾ꤷޤ*_STD1 __ ǻϤޤΤǡ*_STD2 __ ǻϤޤä __ ǽΤǤSYSTEM_EXT, SYSTEM_EXT2, COMPILER_STD1, COMPILER_STD2, COMPILER_EXT, COMPILER_EXT2 ǤϤΥޥͤ SYSTEM_EXT_VAL, SYSTEM_EXT2_VAL, COMPILER_STD1_VAL, COMPILER_STD2_VAL, COMPILER_EXT_VAL, COMPILER_EXT2_VAL ǻꤷޤ "" ǰϤʸƥǻꤷޤ0 ĤΥȡŸޥ "" ޤꤵʤСΥޥͤ 1 ˤʤޤ¾ predefined ޥSYSTEM_OLD, SYSTEM_STD1, SYSTEM_STD2, COMPILER_OLD ǻꤵΡˤϤ٤ 1 ͤޤ
  • SYSTEM_SP_OLD, SYSTEM_SP_STD
    ϸͭüʻޥ̾ʸƥǽ񤭡ͤ SYSTEM_SP_OLD_VAL, SYSTEM_SP_STD_VAL ޤ
  • COMPILER_SP1, COMPILER_SP2, COMPILER_SP3
    ϸͭüʻޥ̾ʸƥǽ񤭡ͤ COMPILER_SP1_VAL, COMPILER_SP2_VAL, COMPILER_SP3_VAL ޤ
  • COMPILER_CPLUS, COMPILER_CPLUS_VAL
    -+ ץC++ ץץˤꤷϸͭλޥ̾Ȥͤ嵭Ʊ褦ʸƥǻꤷޤCOMPILER_CPLUS_VAL ꤷʤȡΥޥͤ 1 ˤʤޤ̾ '_' ǻϤޤΤǤʤФʤޤɬפʤ COMPILER_CPLUS ΤΤʤǤޤ

Τۤ¹Իץ˱ system.c ޥ⤢ޤCPU-dependent ʥޥʤɤǤGCC V.3.3 ʹߤǤ̤λޥΤǡȤ̤ mcpp_g*.h Ȥ̾ΣܤѤΥإåե뤬 mcpp Υ󥹥ȡ˼ưŪޤ

ʾǻ줿ޥϤ٤Ƽ¹Իˤ -N ץ̵Ȥʤޤ

4.1.1.2. Include ǥ쥯ȥ

  • C_INCLUDE_DIR1, C_INCLUDE_DIR2, CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2, CPLUS_INCLUDE_DIR3
    mcpp ǥɸإåե include directory ꤷޤCPLUS_INCLUDE_DIR? C++ include directory äΤΤȰäƤˡꤷޤmcpp ư -+ ץꤹ뤳ȤͭȤʤˡUNIX /usr/include, /usr/local/include system.c ꤵΤǡC_INCLUDE_DIR? ˤϤʳνϸͭΤΤꤷޤ
  • ENV_C_INCLUDE_DIR, ENV_CPLUS_INCLUDE_DIR
    mcpp ǥɸإåե include directory ¹Ի˴ĶѿǻꤹΤˡδĶѿ̾ޤENV_CPLUS_INCLUDE_DIR C++ include directory ꤹĶѿ̾ǤǥեȤǤϤ줾 "INCLUDE", "CPLUS_INCLUDE" ޤGCC-specific-build Ǥ "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH" ǥեȤǤ
    ѥϤγsystem.c ꤵΡ-I ץꤵΤޤʤ̤ͥˤĤƤ mcpp-manual.html#4.2 򻲾ȡˡ
  • ENV_SEP
    δĶѿʣΥѥ񤯻 separator ʸǽ񤭤ޤ
    /usr/local/abc/include:/usr/local/xyz/include Ƚ񤯻 ':'
    C:/BC55/INCLUDE;C:/BC55/LOCAL/INCLUDE Ƚ񤯻 ';' Ǥ
  • SEARCH_INIT
    åȽϤ include ե򥵡Υ롼񤭤ޤ#include "../dir/header.h" Ȥäǥ쥯ƥ֤ˡinclude ǥ쥯ȥ򥵡ˤɤΥǥ쥯ȥ򥵡ΤȤ롼Ǥȥǥ쥯ȥ꤫Хѥ򥵡ϤǤ CURRENT Ȥեinclude ˤΤǥ쥯ȥ꤫Хѥ򥵡ϤǤ SOURCE ȤޤξԤȹ碌Ǥ (CURRENT & SOURCE) Ȥޤ

4.1.1.3. ֹνϷ¾

  • LINE_PREFIX
    mcpp compiler-proper ˥ե̾ȹֹꤷޤ
    #line 123 "fname"
    
    ȤäΥηǥեȤȤʤäƤޤ¾ηȤϤǤϡ "#line " ʬ֤ sequence ʸƥǽ񤤤Ƥޤ
    # 123 "fname"
    
    Ȥʤ "# " ɤǤʤȼηʤ餽˹碌ޤʾˤäƤ main.c sharp() ˽­ʤФʤʤ⤷ʤˡ
    Visual C++ .net Borland C Τ褦ʣѥѥʤ mcpp ȤϡȤ߹ߥץץå˽ϤϤȤˤʤΤǡmcpp νϤϣäΥˤʤäƤʤФʤޤ󡣤äơֹμϤϣܤηǤʤФʤޤ

  • EMFILE
    <errno.h> too many open files (for the process) ̣ errno ͤɽޥ EMFILE ǤʤϡEMFILE 򤽤Υޥ̾ޤʤ<errno.h> Τ˽񤭲äƤ⤫ޤʤˡ
  • ONE_PASS
    åȽϤץץåʬΥƤʤ֥ѥѥפǤФ TRUE ˡǤʤ FALSE ޤ TRUE Ȥȡ#pragma MCPP put_defines (#put_defines) ǤϡϤλޥϤ٤ƥȤǰϤǽϤޤѥѥǤ mcpp νϤ򤳤ͿȺ٥ץץ뤳ȤˤʤΤǡ򤱤뤿Ǥ
    GCC V.3, V.4 ϥѥѥȤޤΩץץåȤȤǤΤǡΥޥ FALSE ȤƤޤ
  • FNAME_FOLD
    Windows Τ褦˥ե̾ʸȾʸ̤ʤϣӤǤϤ TRUE Ǥʤ FALSE Ȥޤ

4.1.1.4. Ϥθͤ˱

  • EXPAND_PRAGMA
    #pragma Ԥΰ STDC ʳǤХޥŸоݤȤʤϤǤϡ TRUE ޤǥեȤǤ FALSE ȤƤޤVisual C, Borland C Ǥ #pragma ԤΰϾ˥ޥŸоݤȤʤΤǡ TRUE ȤޤC99 Ǥ #pragma ΰޥŸоݤȤʤ뤫ɤ implementation-defined ǡC90 ǤϥޥŸʤΤʤΤǤmcpp Visual C, Borland C Ѥ˸¤äƤ C99 ǤʤƤޥŸоݤȤޤʰ STDC ޤ MCPP ǻϤޤʤ¤ˡ

  • HAVE_DIGRAPHS
    Digraphs Ƥ TRUEǤʤ FALSE Ȥޤ
  • STDC
    åȽϤλޥ __STDC__ Υǥեͤޤ__STDC__ Ƥʤ 0 Ȥޤ
  • STDC_VERSION
    åȽϤλޥ __STDC_VERSION__ Υǥեͤޤ__STDC_VERSION__ Ƥʤ 0L Ȥޤ

  • CHARBIT, UCHARMAX, LONGMAX, ULONGMAX
    åȽϤ <limits.h> CHAR_BIT, UCHAR_MAX, LONG_MAX, ULONG_MAX ͤ񤭤ޤ
    limits.h UCHAR_MAX ϴְäƤ礬ΤǡդɬפǤ255U, 0xffU unsigned ˤƤϤޤ255, 0xff signed int ͤޤcpp-test.html#5.1.3 ȡˡ

4.1.1.5. Multi-byte character

MBCHAR Ȥޥ multi-byte character encoding ꤹΤǤmcpp Ǥϲο encoding ٤Ʊ˼ޤMBCHAR ϥǥեȤ encoding ꤹǡ¹Ի encoding Ķѿץ#pragma ѹ뤳ȤǤޤʻȤˤĤƤ mcpp-manual.html#2.3, mcpp-manual#2.8, mcpp-manual.#3.4 򻲾ȡˡ

  • MBCHAR
    åȤ multi-byte characterܸǤϴˤ encoding μޤ
    EUC_JP ܤ extended UNIX code (UJIS)
    SJIS ܤ shift-JIS (MS-Kanji)
    GB2312 EUC-like GB-2312ʴλ
    BIGFIVE Ѥ Big5λ
    KSC5601 ڹ EUC-like KSC-5601 (KSX 1001)
    ISO2022_JPISO-2022-JP1 Ȥݵʤܸ
    UTF8 unicode encoding ΣǤ UTF-8
    ΣĤϤ shift-states ʤʸХȤ encoding Ǥʤmulti-byte character, wide character encoding ХȤǤˤ⤫餺wchar_t ХȤηˤʤäƤϤ⤢ޤץץå wchar_t ηˤϴΤޤ󡣥Ǥ multi-byte character wide character ХȤƤΤǡ˽äƽ򤷤ޤ
    ISO-2022-* shift-states encoding ǤUTF-8 ϣХȤ unicode 򣱥ХȤʤХȤ encode ΤǤϣХȤˤʤޤ
    MBCHAR 0 硢multi-byte character ν򤷤ʤΤǥեȤλͤˤʤǡĶѿץ#pragma Ǽ¹Իѹޤ

  • SJIS_IS_ESCAPE_FREE
    ѥΤ shift-JIS ν򤹤 TRUE Ȥʤ FALSE Ȥޤ
    Shift-JIS ǤϴΣХܤ '\\' Ʊ 0x5c ͤˤʤ뤳ȤޤѥΤ shift-JIS ǧʤϡ escape sequence ȲᤷƤޤtokenization ǥ顼ˤʤޤ
    SJIS_IS_ESCAPE_FREE FALSE Ȥȡmcpp 䤤ޤʤǽϤλˡʸƥޤʸ shift-JIS 裲ХȤ 0x5c Ǥäϡ 0x5c ΥХȤ⤦ղäޤˤäơѸǤΥѥ shift-JIS б뤳ȤǤޤ
  • BIGFIVE_IS_ESCAPE_FREE
    ƱͤˡѥΤ Big 5 ν򤹤Ϥ TRUE Ȥʤ FALSE Ȥޤ
  • IS02022_JP_IS_ESCAPE_FREE
    ƱͤˡѥΤ ISO-2022-JP ν򤹤Ϥ TRUE Ȥʤ FALSE ȤޤIS0-2022-* Ǥ '\\' ФǤʤ'\'' '"' ȰפХȤиޤISO2022_JP_IS_ESCAPE_FREE FALSE ξ mcpp ϡ'\\', '\'', '"' ȰפХȤľˤ٤ 0x5c ΥХȤ򣱤ޤ

ʤmulti-byte character ˴ؤ륳ѥưϼ¹ԤδĶˤäѤ礬ޤʬλȤĶ˹碌ꤷƤˤĤƤϡmcpp-manual.html#2.8 ⻲ȤƤ

4.1.1.6. åȤȥۥȤ˶̤

ΣĤص塢PART 2 ˽񤤤Ƥޤ åȽϤȥۥȽϤηľ TRUE ȤǤʤ FALSE Ȥޤ

  • HAVE_LONG_LONG
    long long ȤǡĽϤǤϤ TRUE Ȥޤ
    Visual C 2005 ޤǤ Borland C 5.* Τ褦ˡlong long Ϥʤ __int64 ȤƱη printf() ɽ뤿 length modifier ѰդƤϡ TRUE Ȥޤ Visual C 2008 Ǥ long long Ȥޤ
  • HAVE_INTMAX_T
    intmax_t ȤǡƤФ TRUE Ȥޤ

  • LL_FORM
    νϤ long long äƤϡۥȽϤκͤ printf() ɽ뤿 length modifier ʸƥޤC99 Ǥ "j" ǤޤC99 Ǥ long long length modifier "ll" (ell-ell) ǤVisual C 2003 ޤǤ Borland C 5.* Ǥ __int64 ͤɽ "I64" ȤޤMinGW Ǥ "I64" Ǥ

4.1.2. PART 2 ۥȥƥ

noconfig.H, configed.H ǤϥåȽϤȥۥȽϤȤƱǤȲꤷƤޤۤʤ PART 2 ľɬפޤ

  • HOST_HAVE_STPCPY
    ۥȽϤΥ饤֥ stpcpy() TRUE ˡʤ FALSE ޤFALSE Ǥ stpcpy() ˤ system.c ΤΤȤޤ
  • PATHMAX
    ۥȽϤ <limits.h> PATH_MAX ͤǤ POSIX ǵꤵƤޥǤ줬ʤϤǤ <stdio.h> FILENAME_MAX ͤȤޤ

PART 1 ˤۥȤȥåȤƱȲꤷƤʬΤǡɬפʤ餽񤭴ޤ㤨мΤ褦˥ۥȽϤλޥȤäƤԤǤ

#if _MSC_VER >= 1200

4.1.3. PART 3 mcpp ưͤ

4.1.3.1. Ƽư⡼

system.H Ǥ mcpp ưͤꤹޥƤޤ

mcpp ˤ mcpp_mode Ȥѿꡢ줬ޥŸˡȤǥ쥯ƥ֡Ȥ predefined ޥץץåκȤʤưλͤƤޤmcpp_mode ͤˤ OLD_PREP, KR, STD, POST_STD Σ郎ޤ
mcpp ư⡼ɤϼ¹Իץǻꤵޤmcpp 򥳥ѥ뤹ˤϡΣĤΥޥˤĤƤϲꤹ뤳ȤϤޤ󡣤ƼԤˤϣĤưͤΰ㤤򤹤뤳ȤɬפǤ
Τۤ COMPAT ⡼ɤ⤢ޤ STD ѼǤ

  • OLD_PREP
    "Reiser" model cpp ưͤǤ
  • KR
    C90 K&R 1st. ΥץץͤǤ
  • STD
    (C90, C99, C++98) ΥץץͤǤ
  • POST_STD
    ɮԤ˺äץץͤǡʤμӤʤñ㲽ΤǤ

Ǥ KR OLD_PREP 碌 pre-Standard ⡼ɡSTD POST_STD 碌 Standard ⡼ɤȸƤ֤Ȥˤޤƥ⡼ɤλͤξܺ٤ˤĤƤ mcpp-manual.html#2.1 򻲾ȤƤ

4.1.3.2. ư⡼ɤκλ

  • CPLUS
    -+ ץ C++ ΥץץåȤưˡɸȤ߹ߥޥ __cplusplus ͤ˻ޤC++98 Ǥ 199711L Ǥ-V ץˤäƼ¹ԻѹǤޤ
  • TRIGRAPHS_INIT
    STD ⡼ɤǤ trigraph ν֤ꤷޤ-3 ץϤξ֤ȿžޤ TRUE ˤȡdefault trigraph ǧ졢-3 ץǵưǧޤFALSE ξϵդ default ǧ-3 ץǧ褦ˤʤޤ
  • DIGRAPHS_INIT
    Standard ⡼ɤǤ digraph ν֤ꤷޤ-2 ץϤξ֤ȿžޤ TRUE ˤȡdefault digraph ǧ졢-2 ץǵưǧޤFALSE ξϵդ default ǧ-2 ץǧ褦ˤʤޤ
    HAVE_DIGRAPHS == FALSE νϤξ硢digraphs mcpp ̾ΥȡѴޤ
  • OK_UCN
    STD ⡼ -V199901L ޤ -+ ץꤷ UCN (universal-character-name) ͭˤˤϡ TRUE ޤǥեȤǤ TRUE ȤƤޤ*1
  • OK_MBIDENT
    STD ⡼ -V199901L ץꤷȤ identifier multi-byte character Ȥ褦ˤˤϡ TRUE ޤǥեȤǤ FALSE ȤƤޤ

  • expr_t, uexpr_t
    Ǥ礭η typedef ޤintmax_t, uintmax_t ȤФˡǤʤ long long, unsigned long long ĽϤǤϤˡǤʤ __int64, unsigned __int64 ĽϤǤϤˡǤʤ long, unsigned long ޤ
  • EXPR_MAX
    uexpr_t κͤޤ

:

*1 UCN C++, C99 λͤǡUnicode ʸͤ \u ޤ \U ǻϤޤ룱 escape sequence ɽΤǤmcpp-manual.html#3.7, cpp-test.html#2.8, cpp-test.html#4.6 ȡˡ

4.1.3.3. Translation limits λ

  • RESCAN_LIMIT
    Standard ⡼ɤǤΥޥŸκθ٤ޤ Standard ⡼ ǤϺϾʤΤǡޤ礭ͤꤹɬפϤޤ
  • PRESTD_RESCAN_LIMIT
    pre-Standard ⡼ɤǤΥޥŸκθ٤ޤpre-Standard ⡼ ǤϺƵŪʥޥŸˤä̵¥롼פȯޤ줬ΥߥåȤˤҤäޤ
  • NBUFF
    ԡʥʪԤι \ ä³ԡˤκĹ +1 ޤȤ a space ѴιԡʥȤˤäʣԤˤޤ뤳Ȥ⤢ꤦˤ⤳ĹˤޤäƤʤФʤޤ
  • NMACWORK
    ޥŸŪʥХåեΥޤʤĤΥޥŸ̡ʥޥƤӽФʣԤˤޤϡŸ̡ˤϤΥˤޤäƤʤФʤޤ󡣤ϤޤĤΥޥִꥹȤŪ˵ݤκĹȤƤȤޤ NBUFF*2 ʾ NWORK*2 ʾǤʤФʤޤ
  • NWORK
    mcpp νϤĹޤ compiler-proper μĹ+1 ۤƤϤޤ󡣤ޤNBUFF ͤۤƤ⤤ޤ󡣥ޥŸιĹۤϡmcpp ʲιĹʬ䤷ƽϤޤʸƥĹ NWORK-2 ϰϤ˼ޤäƤʤФʤޤʸƥĹȤΤϡchar ǿΤȤǤϤʤǤʸƥȤȡĹǤ롣ξü " ޤߡ\n ϣХȤȿ롣磻ʸƥǤƬ L ޤˡ
    GCC Ǥ Visual C ǤǤϽϤκĹȤƤ NWORK ǤϤʤ NMACWORK Ȥޤ νϤǤϥѥ餬ʤĹԤ뤳ȤǤΤǡʬ䤷ƽϤɬפʤǤ
  • IDMAX
    ̻ҤκĹޤĹ̾⥨顼ˤϤʤޤ󤬡Ĺڤͤޤ
  • NMACPARS
    ؿͥޥΰκޤ UCHARMAX 礭ϤǤޤ
  • NEXP
    #if ԤμΥåǤͥȥ٥θ٤ޤϥͥȥ٥뤬ľܷޤ櫓ǤϤʤΤˤϡȡοΣܡ黻ҥȡοΣܤޤǻȤ롣äϰФǣĤȿˡ
  • BLK_NEST
    #if (#ifdef, #ifndef) section Υͥȥ٥θ١#if, etc. ʳ˥ͥȤǤ뤫ˤޤ
  • INCLUDE_NEST
    #include Υͥȥ٥θ٤ޤ#include ̵ºƵå뤿ΤΤǤƱ˥ץǤեο˴ؤ OS ¤ĶƤƤ⤫ޤޤ
  • SBSIZE
    ޥŪ hash ʬषƵݤ hash table ǿޤɬΥ٥ǤʤФʤޤ󡣥ޥο꾮Ƥưˤޤ礭ۤϤ®ʤޤ

줾礭ͤˤۤɻͤϾˤʤޤNWORK, NBUFF, NMACWORK, SBSIZE 礭Ȥ礭ʥ򿩤ޤºݤΥϥޥ̤ˤäƤƤ椭ޤʤ줾ΥޥĹˤäɬץ꤬ޤ롣ޥŪʷ internal.H struct defbuf ˽񤤤Ƥˡ

NMACWORK, NEXP, RESCAN_LIMIT ϥå񤷤ޤ
¾ΤΤϥϤۤɬפȤޤ󤬡system.H ΥǥեȤͰʾˤƤѾΰ̣ϤۤȤɤʤǤ礦

C90, C99 ׵᤹ translation limits κ٤ system.H κǸΤۤ˽񤤤ƤޤC++98 translation limits 񤤤ƤޤϣäȰۤʤꡢ׵ͤǤϤޤ


4.2. system.c

ȤƥåȽϤ˴ؤ뤤ĤƤޤ

  • PATH_DELIM
    ϣӤ path-delimiter ƤޤPATH_DELIM \ ȤƤϤޤʥץΤĤǡˡWindows Ǥ / ȤƤޤ桼ץǤϤ \ ȤޤŪˤ / Ѵޤ
  • OBJEXT
    Ϥ뤤륪֥ȥեҤʸƥޤUNIX νϤ "o"Windows νϤ "obj" Ǥ -M* ץꤷ makefile Ѱ¸طԤνϤ˻ȤΤǤ

  • do_options()
    mcpp ưΥץƤޤޤܿƤʤϤ˰ܿˤϡν°Υѥɥ饤Ф˹碌ơ˲Ԥ­ȤɬפǤ礦do_options() ɲäϡбƼ set_opt_list(), usage() ˤ­ޤ
    do_options() mcpp_getopt() ƤӽФޤmcpp_getopt() POSIX getopt() ƱͤǤ ΤᡢĤΥץʸϰʤΤɤ餫˷ʤФʤޤ-P -P- ȤäץλȤϸ§ȤƤǤޤʤ°ΥץץåȤθߴΤɬפʾϡ̵Ǥʤʤ-M ץμ򻲾ȡˡޤ-trigraphs ȤäĹץ t 򥪥ץʸȤ rigraphs Ȥ뤳ȤǼ뤷ޤ
  • set_opt_list()
    do_options() ǻȤץʸꤷޤ
  • usage()
    Usage ʸ񤫤Ƥޤ ⡼ɤȤΥץ󤬥ե٥åȽ¤٤Ƥޤ
  • set_sys_dirs()
    Include directory ꤷƤޤnoconfig.H (configed.H) Υޥ C_INCLUDE_DIR?, CPLUS_INCLUDE_DIR? ǻꤵ줿ϸͭΥǥ쥯ȥΤۤUNIX ϣϣӤǤ /usr/include, /usr/local/include ⤳ꤷƤޤnoconfig.H, configed.H Υޥ ENV_C_INCLUDE_DIR, ENV_CPLUS_INCLUDE_DIR 줿̾δĶѿˤ include directory set_env_dirs() ꤵˡ

  • do_pragma()
    #pragma νƤޤmcpp Ȥʤ #pragma sub-directive ϤΤޤ޽Ϥ compiler-proper Ϥޤmcpp Ȥ #pragma MCPP debug ϤƤӽФؿǽޤmcpp Ȥ #pragma sub-directive ϸ§Ȥ MCPP Ȥ̾ǻϤޤ褦ˤƤޤMCPP ǻϤޤ #pragma ԤΤΤϽϤޤ󡣤ޤ #pragma once Ϥޤ󡣤#pragma __setlocale ԤϽϤޤʤǤϽϸͭγĥ directive #pragma sub-directive ȤƼ뤳ȤˤʤäƤޤ
  • do_old()
    ʤ˹פʤ preprocessing directive #pragma sub-directive Ǥʤ #assert, #asm, #endasm, #include_next, #warning, #put_defines, #debug ˤɬפʾϡν򤹤ؿ­ǡ餽ƤӽФ褦ˤޤʤGCC ѤǤ #include_next, #warning STD ⡼ ǤȤ褦ˤƤˡ

Standard C ˤϤʤ饤֥ؿΤgetopt() stpcpy() Υ˽񤤤Ƥޤ getopt() ϥ󥯤Υȥ֥ɤᡢmcpp_getopt() ̾ѤƤޤ stpcpy() HOST_HAVE_STPCPY FALSE λ˻Ȥޤ


4.extra. malloc()

kmmalloc -- ǥХåǽ malloc()פȤΤϡ䤬äǽ񤤤 malloc(), free(), realloc(), calloc() portable ʥǤϥΨȤȤˡǥХåΤĤͤƽ񤤤ƤޤǥХåѤΥ롼źդƤޤ󥯤Ƥȡפ̥ХҤääƤ뤳Ȥޤ*1, *2

noconfig/*.mak -DKMMALLOC -D_MEM_DEBUG -DXMALLOC ȤץͿƤΤϡλ malloc() ȥǥХå롼󥯤뤿ΤΤǤ󥯤 mcpp EFREEP, EFREEBLK, EALLOCBLK, EFREEWRT, ETRAILWRT Ȥ顼ֹ exit 뤳ȤС mcpp ΥХ̣ޤ

BSD_MALLOC, DB_MALLOC, MALLOC_DBG ȤޥΤɤ줫 1 mcpp 򥳥ѥ뤹ȡ malloc() Ȥ̤Τ줾ǥХåǽä malloc() ȤޤˤƤ⡢°ΤΤǤϤʤ malloc() Ȥˤϡѥ뤹˥饤֥äƤʤФʤޤ󡣤ˤĤƤ kmmalloc ΥɥȤ򸫤Ƥ

:

*1 kmmalloc ϼΤȤˤ롣

http://download.vector.co.jp/pack/dos/prog/se026997.html

*2 CygWIN Ǥϥ饤֥ȤΩƤ¾ malloc() Ȥʤ褦ˤʤäƤΤǡ malloc() ϻȤäƤʤ Visual C 2005, 2008 ǤƱͤǤ롣


5. ХȰܿ

5.1. Хɤ

ץץ Standard C Ŭ򸡾ڤ뤿 Validation Suite mcpp Ȥä˸ƤޤStandard C ΥץץΤ٤Ƥε򸡾ڤǤΤˤĤǤmcpp ϤȤäƥåƤޤ⡢嵭Τ٤ƤνϤǥѥ뤷ƥåƤޤäơХͤϤۤȤɤʤȻפޤޤĤĤäƤ붲⤢ޤޤܿƤʤϤ˿ܿϡϤΥХˤҤäǽ⤢ޤ

⤷ԲIJưȯ줿顢Ҥ𤯤κݤˤϡΥå򤪴ꤤޤ

  1. STD ⡼ɤξ硢ʬ Standard C Τ뤿ᡢޤ Validation Suite ȤäƤߤ롣GCC / testsuite λȤ륷ƥǤϡץդ configure make check ǼưƥȤǤ롣
  2. ʬ mcpp ΰܿ˴ְ㤤ϤʤɤɥȤΤ롣
  3. ХƸ륵ץ륽Ф롣
  4. ХФʬ #pragma MCPP debug <args> #pragma MCPP end_debug ǤϤ mcpp ưȥ졼Ƥߤ롣 <args> 򤵤䤷Ƥܺ٤˥ȥ졼Ƥߤ롣

⤷"Bug: ..." ȤǥåФ顢ϴְ㤤ʤ mcpp ޤϽϤΡʤ֤ mcpp Ρ˥ХǤޤȤ㤯ʡ֥פǤ⡢򿩤碌뤳Ȥ mcpp ˽ʤ顢ХǤ
Standard C ⡼ɰʳΥ⡼ɤ mcpp Validation Suite Ǥϡְִ㤤פ餱ư򤷤ޤϻͤǤʤǤ˽ϤʤϤˡɤͤ 4.1.3 򸫤Ƥ


5.2. malloc() ϢΥХå

䤬񤤤 kmmalloc Ȥ malloc() Υ饤֥꤬ޤ4.extra ȡˡ
⤷Τ malloc() 󥯤 mcpp 120 124ʽϤˤäƤ 2120 2124ˤΥ顼ֹ exit 뤳ȤСϴְ㤤ʤ mcpp ޤϽϤΡʤ֤饤֥ؿΡ˥ХǤ

ޤƥȤ˻Ȥץ륽Τɤ

#pragma MCPP debug memory

Ƚ񤤤ƤȡθĽꤪӽλ˥ҡץ˴ؤ󤬽Ϥޤ Heap error: ... ȤåФ뤳ȤСְ㤤ʤ mcpp ޤϽϤΥХǤ

ΥХȯ줿顢ץ륽γʬ #if 0 #endif ǤϤǥƥȤ򷫤֤ХȯʬʤǤߤƤ


5.3. Х

ХˤϼΤ褦ʥǡդƤ褦ꤤޤ

  1. mcpp ܿϡ
  2. ܿˡnoconfig.H ˡ
  3. ХȻפΤƸǤ륵ץ륽
  4. ν̡

5.4. ܿ

mcpp ϤۤȤɤνϤŪñ˰ܿǤ褦˽񤤤ƤĤǤ 䤬äƤϤϾǤ¾νϤؤΰܿǤϥν­ɬפʤϤǤνϤؤΰܿԤƤޤ򥽡˥եɥХåƤȻפޤ
ܿϼΤ褦ʷǤꤤޤ

  1. ϡ
  2. noconfig.H (configed.H), system.H, system.c ꡣ ʤ٤ꥸʥȤκʬե뤬ɤñʤΤʤǤġ

ܿǤɤΤˤϡcompiler-specific-build Ǥϡޤץץåؤơإåե "pre-preprocess" εǽȤäƼʬȤꥳѥ뤷ƤߤΤüᤤǤ礦

Validation Suite STD ⡼ɤΥå򤷤ޤϥեο¿ΤǡǥХå򷫤֤ˤϼ֤ꤹޤǥХåϤޤn_std.c 򥳥ѥ뤷ơ˥ѥ롦¹Ԥ뤫ɤ򸫤ޤ°Υѥɥ饤ФǤ mcpp ϤˡΤʤץ⤢ޤˤĤƤ mcpp-manual.html#2.2 򸫤Ƥ mcpp ̤Ƥ饳ѥ뤹⤢ޤ

⤷줬ޤʤϡ n_std.t ȤץȤäơɤΤܤǥåޤ줬ޤä顢e_std.t, m_*.t, unspcs.t, warns.t, misc.t åޤ"post-Standard" ⡼ɤǤ n_post.t, e_post.t Ȥޤ

mcpp -QCz23 Ȥץդƽޤpost-Standard ⡼ɤǤ -3 ԲġˡSTDC == 0 ǥѥ뤷Ƥ -S1 -V199409L ץդޤ-C ץǥȤϤΤǡ̤̤꤫ɤ狼ޤ
-Q ץǿǥå mcpp.err Ȥե˽ϤΤǡڡ㡼ɤߤޤ
-z ץǡإåեνϤϾάޤ
-2 -3 digraph trigraph ͭˤʤޤ-S1 -V199409L __STDC__ 1 __STDC_VERSION__ 199409L ˤʤޤ
C99 бΥƥȤ򤹤뤿ˤϡ-V199901L ץդ n_std99.t, e_std99.t Υå򤷤ޤ

Validation Suite cpp_test.c ȤץȤȡn_*.c, i_*.c ΥץΥƥȤưŪ˹ԤȤǤޤʤϡߤĤǡܺ٤Ϥ狼ʤޤe_*.?, u_*.?, unspcs.?, warns.? ΥƥȤϴޤޤʤmcpp ȤΥƥȤ򤹤뤿ˤϡn_std.c 򥳥ѥ뤹ۤᤤˡ

ʤValidation Suite GCC testsuite бƤޤäơmcpp GCC Τɤ줫ΥС˰ܿϡGCC / testsuite 󥹥ȡ뤵ƤСGCC Υץץå mcpp ֤ȡmcpp μưƥȤǤޤˤĤƤ cpp-test.html#3.2.3, mcpp-manual.html#3.9.7 򸫤Ƥ


5.5. GCC ʳνϤǤ configure ξ

mcpp UNIX ϥƥǤ configure ץȤȤޤ UNIX ϥƥǤ GCC ʳνϤˤĤƤϻϤޤäΤʤΤǡcompiler-specific-build configure ǤϤĤΥץꤷƤʤФʤޤ

ΥץǻꤹƤˤĤƤϡνϤȤäƤͤΤäƤ뤫ޤĴ٤뤳ȤǤϤǤ狼ϤҶƤConfigure ˼Ǥ椭Ȼפޤ
Configure ˤĤƤ INSTALL


5.6. ǡäƤаܿƤߤޤ

ܿޤʤϡΤ褦Τ餻
ΥǡդƤС֤ܿǤ뤫⤷ޤConfigure λȤĶǤϡΥǡΤΤʤʬ configure ˤäΤ뤳ȤǤޤ
ʤC90 (ANSI C) бƤʤϤϡmcpp V.2.6 ϰܿоݤ鳰ޤ

  1. ϣӤȤΥѥꥹȤηʻ UNIX , DOS/Windows , OS-9 Τʤˡ
  2. Ϥ̾ȥС
  3. ʸåȤ ASCII ǤʤФɤʸåȤMulti-byte characterʴˤ encoding ϥե JIS EUC-JP ȤⲿShift-JIS Τ褦 <backslash> Ʊɤ multi-byte character ˴ޤޤ encoding ξ硢ѥΤϤǧ뤫
  4. ShellʥޥɥץåˤʸȾʸ̤뤫
  5. ե̾ʸȾʸ϶̤뤫
  6. ¹Իץ󡣥ѥɥ饤ФϤ륪ץ ץץåñΤưΥץgetopt() ǼǤʤΤԲġˡ
  7. ץץåʬΥƤϤȤ⤤ѥѥ餫
  8. νϤλޥȤ͡C++ λϤɤʤ뤫ʥѥɥ饤Ф -D ץǥץץåϤޥȡץץåȤޥȤ̤뤳ȡˡ
  9. long long Ϥ뤫long long 硢printf() Ǥ long long length modifier ϲlong long ʤƤƱη뤫
  10. #pragma ԤΰϥޥŸоݤȤʤ뤫
  11. Include directory ꤹĶѿˤϤɤ̾ȤĶѿʣΥѥ򵭽Ҥ separator ˤϲȤ
  12. ̾Ȥ include directory#include ǥإåե򥵡ε§
  13. ɬפʴؿǡ饤̵֥Τ뤫
  14. ѥΤ digraph ǧ뤫
  15. ̻Ҥ $ Ȥ
  16. #asm, #endasm Ϥ뤫 ǤϤޤ줿֥åΥѥΤؤμϤϤɤ¾εʳ directive ˤϤɤʤΤ뤫
  17. ץץåǽ٤ #pragma sub-directive ˤϲ뤫
  18. ѥΤĹϤɤΤ餤ޤǤValidation Suite ˤ test-l/l_37_8.c 򥳥ѥ뤹Ȥ狼ˡ
  19. ѥΤǤϡ̻ҤϲХȤޤǼ̤뤫
  20. ѥ塢Ρ֥֥ȥեפҤϲUNIX νϤ .o Windows νϤ .obj Ρˡ
  21. t_line.c Ȥץץץå̡̤ñΥץץåȤޤϥץǥץץνϤꤹˡϹֹȥե̾ξ򥳥ѥΤϤˡ򸫤뤿ΤΤǤ롣<stdio.h> ƤĹΤǡ򥫥åȤƺǽΣԤȺǸΣԤнʬǤ롣
    ˡ#line 1000 줿̤ #line 1000 "t_line.c" Ȥʤ餺 #1000 "t_line.c" Ȥ¾ηˤʤϤǤϡʬ #line 1000 "t_line.c" ȽؤƥѥΤϤơǧǤ뤫ɤ򸫤#line 1000 "t_line.c" ǥ顼ˤʤʤ error line; ιԤǥ顼åФϤǤ뤬λ˹ֹ椬ɤФ뤫ˡ
/* t_line.c */
#include    <stdio.h>

#line 1000

error line;

main( void)
{
    return  0;
}

ۥȽϤȥåȽϤ㤦ϤˤĤƾ嵭ΥǡСȤʤǤ礦

¤٤Ƥߤȡå٤Ȥ֤󤿤󤢤ޤ͡¿νϤǤϰܿߤνϤȶ̤¿Ǥ礦顢ưΰܿǤФۤɤμ֤ǤϤʤϤǤŪ֤ΤΤϼ¹Իץ #pragma˵ʳͤμǤϰư褦ˤʤäƤ顢ˤäƤ椯ȤǤޤͣݤʤΤϡϤΥХˤҤääǤ


5.7. ڥåȤˤ¾νϤΥƥ

䤬äƤϤΥץץåθڥåȤǥƥȤ̤ϡcpp-test.html#6 ˤޤȤƤޤ
¾νϤˤĤƥƥȤ̤Τ餻ܤ¿ΤǤʤμ֤Ǥ
cpp_test.c ˤƥȤǤм֤ϤʤΤǡǤ⤪ꤤޤGCC ξϡڥåȤˤ뼫ưƥȤǤޤ


5.8. Τո

ХΤۤˤ⡢mcpp λȤꡢǥåmcpp ΥValidation Suite Standard C ᡢɥȤνʤɤˤĤƤո򤪴󤻤
̣ǺäץץåǤV.2.0 ޤǤǤ⣶ǯȾ⤫ƶŤ˶ŤäϫǤŤĤǤˤǤɤΤˤȻפäƤޤåץץåˤĤƤϡλäƤʤϤؤΰܿȥƥȰʳϡäựΤ뤳ȤϤۤȤɤ٤ƤäĤǤ¿Ȥ꤬ĤäƤС줿Ȼפޤ
Martin Minow ΥϤȤƤ⤭줤ʡΤʤ狼䤹ΤǡɤǤˤȤäƤϤ֤ٶˤʤޤ
Τ˶̣ĿͤϤʤ¤ƤȻפޤ¿ΥȤȾԤƤޤ
ոȾ

http://mcpp.sourceforge.net/

"Open Discussion Forum" ޤϥ᡼Ǥꤤޤ


6. mcpp ĹƻΤ

6.1. ۣǯ

1992/01 DECUS cpp 򤤤ˤϡ ĹˤʤȤ̴ˤפޤǤ٤ߤˤ礳äȥС󥢥åפƤߤ褦ȻפääΤǤ
ϤơɤޤʤȥȤ狼ꡢ餤ɤߤޤɤߤΤ륽äǤ⤢ޤˤĤλͤ C90 б˥С󥢥åפޤޤǤṲ̄Ǥ

ǻϼʬ C90 ΥץץͤΤˤΤäƤʤȤ˵դޤP. J. Plauger & Jim Brodie "Standard C" (1989) ɤȤfunction-like ޥŸˡϡҤä֤ΤǤʤˮϤƤˡǵʽäơץץ˴ؤʸϤ򤯤֤ɤߤޤη̡C90 ΥץץŪʤΤȤ¿ǰۤʤäƤ뤳Ȥ狼ޤ#, ## 黻Ҥɲä줿ȤϡΤۤΰʬˤʤäΤǤ

Ȥ function-like ޥŸ롼ˤϤʤƬǺޤޤE. Ream cpp Υ򻲹ͤˣֹͤơC90 ѥޥŸ롼򿷤񤭤ޤ䤬ץΥ르ꥺǤʤ˰̿ͤΤϡˤˤʤȤǤ1992/04 ΤȤǤ

ơƽۤơ٤ cpp ϤޤȻפäΤǤȤ줫餵ˣǯޤꤿäƤޤޤȤäƤ⡢δ֤ˤϤۤƬǺޤϤʤäΤǤˤ⤫餺֤Ϥ֤󤫤ޤͤͤ˰Ƥơcpp ˽椷ʤʤä⤢ޤǤϤޤ󡣤δ֤ˤäΤϼΤ褦ʤȤǤ

  1. ͤ򤵤Τˤ롣Standard ⡼ɤǤϵʤ˴б롣
  2. Standard C Υ⡼ɤ濴˥ץ๽¤ǡ¤ƹ롣
  3. Portability 夲뤿ᡢΥѤ롣
  4. ǥХå򤹤롣 ϤΥХн褹롣
  5. ƥȥץहʤ Validation Suite 롣
  6. ¾νϤΥƥȤ򤹤롣
  7. ɥȤ񤯡
  8. 1997/07 ˤϿѥäᡢƻȤ WindowsNT/95,X Window System ȤΥեȤΥ󥹥ȡȽɤ줿Ƥ뤦 C99-1997/11 draft ФơؤбɬפȤʤä

Ǥ֤ΤäΤϥɥȤǤȤ˸ȾΣǯ餤ϥ򤤤ä֤ϤۤξǡɥȽ񤭤ȤȾƤޤѤʬ̤ˤʤäƤޤޤ֤äΤ̤¿ФǤϤޤ󡣥ɥȤ񤤤ƤȡͤΤʤȤȽФƤΤǤΤӤ˵ʽɤ֤򾯤Ĥޤ򤤤ä֤ϾʤƤ⡢Ͼʤޤ󡣵ʽץץǤϤʤΤ ANSI C Rationale ޤƤ褯ɤǤߤޤϥץץå뤳Ȥ̤ C90 ٶ򤷤褦ʤΤǤˤϤ̤ơC90 εΤİ뤳ȤǤޤ

ƥȥץϽϴñʥץܤ񤤤ǤȤ񤤤 cpp ƥȤ뤿Ӥ˰ճʥХĤΤǤǡC90 ץץƥȤ Validation Suite 񤯤ȤˤޤơValadation Suite 񤯤Ȥ̤ơC90 餫ˤʤäƤޤC90 Ե§ʬбΤϡʬˤȤäƤϤ鷺路ФǤޤ̣ΤʤȤǤ̣ΤʬΤۤϤ뤫¿äȤϳΤǤ
κȤ̤ƻ䤬ؤΤϡΤ褦ʤȤǤ

  1. ץλͤϡܺ٤ʥɥȤ񤭽ޤdzꤷʤ
  2. ץΥǥХåϡͤƥȤ륵ץ뤬ޤǽʤ

ιͤϴŪʤΤǤ ΤȤϴǤϤޤ椫ʤΤ¿ץ㳰ǤϤޤ󤬡ˤϴפʰ̣ʬ⤢ޤϤϤΰĤǤ礦
̣鲿ǯ⤫ŰŪˤ뤳ȤǤȤޤˤƤ⣶ǯȾĹޤʤ˻֤򤫤ƴʥץäơä줬ȤΤȤ䤬ä³Ƥޤ̣ǺץȤƤϡΤ餤Ϥθ٤ʤΤǤ礦

mcpp Ϥ⤦äƤޤäΤǡƥʥ󥹤򤷤ƤĤǤäǤ鳧󡢥ȡ𡢰ܿ򤪴ꤤޤ


6.2. V.2.3

V.2.0 塢 V.2.1, V.2.2, V.2.3 update 򷫤֤ޤC99 ˾ǧ줿 ISO / C++ бꡢбϤ䤷ꡢХȤäȤΤƤǤ

V.2.2 ޤǤϴñ update ǤƤޤV.2.2 V.2.0 飳äƤޤ󡣤ȤV.2.3 V.2.2 飴ǯޤ⤿äƤޤޤοդ¿˻ˤʤꡢ֤ȤʤʤäΤʸǤ2000/07 60 ФˤʤäơŻ򽵣˸餷Ƥ顢餫֤Ȥ褦ˤʤꡢcpp ޤ

V.2.3 ϻ֤Ǥʤ֤ŪäƤޤGCC V.2.9x ˼ƤߤȤGCC / cpp ȤθߴݤΤˤʤäʤФʤʤȤ狼äǤ¿ΥץɲäĥͤޤޤΥ顼򥦥˥󥰤˳ʲꡢȯ륦˥󥰤ǥեȤΥ˥󥰥饹Ϥꤷơʤˤ¤¤Ƥޤ

ѹ¿ϸΤΤǤꡢڤΤǤϤޤǤȤ C90 "traditional" ʻͤΰ C99 λͤξΩʤФʤʤȤΤϡϤʤϤܰդʤȤǤ줬ߤΥץ󥽡μ¾ǤСˤٹ碌ΤϤ򤨤ޤ
ʤˤ¤Ȥǡ¾νѤǤ⡢°Υץץå֤ƻȤˤϻȤ䤹ʤäȻפޤ


6.3. ̤Ƨեȥ¤ȡפ˺

V.2.3 ؤ update ǡmcpp Validation Suite Ͼȶ (IPA) ʿǯ١̤Ƨեȥ¤ȡפȤΤ˺򤵤ޤޤޤλȤΤȤΤäΤDZ礷ƤߤȤ ͵ץȥޥ͡㤬򤷤Ƥ줿ΤǤ 2002/07 2003/02 ޤǤ IPA λȿУͤνΤȤˡȯʤ뤳ȤˤʤޤɥȤα⡢ϥ뤬Ƥ뤳Ȥˤʤޤ

Ūեȥʤ⡢֤򤫤Υ饤եΤ褦ˤʤäƤޤäΤǤδ٤ˤϼޤ˽Ф뵡񤬤ʤǰʻפ򤷤Ƥޤε񤬤ĤͿ줿ΤǤϤΥץȤԤ뤿ᡢŻ򽵣˸餷ޤ
䤬ΥץȤǤ뤳ȤȤƹͤΤϡΤ褦ʤȤǤ

  1. ѸǤΥɥȤ롣Ȥäơmcpp ȸڥåȤŪɾξ˽ФƤ椯ýϤȾȤʤäƤ븽ǤϡѸǥɥȤ¸ߤɾڤΤɬܤǤ롣
  2. ܿоݤ򹭤롣ޤбƤϤοСбۤΤμפʽϤؤΰܿʤ롣

˿ PM 鼡Ƥޤ

  1. GCC 3.x ˤܿˤ testsuite ǻθڥåȤѤǤ褦ˤ롣
  2. ȯ򥪡ץʷǿʤƤ椯 ȯȤ̤ͭ䤹褦ˡɸŪʤѤ롣

伫Ȥ⤳ϤҤꤿȤǤΤǡǷײɲäޤ
ȤηײٱٱŤͤޤ ޤǥå˸ޤޤȤ򤹤뤿Ӥ˻ȤäȤΤʤեȥȤäơΤӤ˻֤ޤGCC 򥽡饳ѥ뤷ΤƤǤϤĤΥȥ֥˸ޤ̤ΥɥȤι̤αΥåȽˤ⡢ʤλ֤ޤξ塢Ȥ֤ޤȯޤץȤϻΤνϤؤбײΰǰ̤Ȥʤޤ

ϤޤǰĤη򿼤äƤ椯褦ʤȤƤʤäΤǡ򾯤褦ȤȤҤɤ֤äƤޤΤǤޥ奢ץޤ򷡤겼ˤϡ򤷤ʤФǤ뤳ȤǤϤޤ󡣤̤˽Фˤϡ򤤤餫ʤФʤʤΤǤ
򹭤ǡϿ PM νޤơĤ̤иΥեȥȯȤΤ˿뤳ȤǤޤʬʸϤʤ줿ʸäƤΤ⡢Ѥ줷ȤǤ֤ɤΤ϶줷ȤǤƤϤɤ⿷dzڤȤǤ

̤Ƨեȥ¤ȡפϤǤޤǤϤޤǤʿǯ٤ˤ⡢ ץȥޥ͡㤬 mcpp ³ץȤȤƺ򤷤Ƥ줿ΤǤơǯ٤Ѥ߻ĤβȤơˤȤäƤ̤иΰΤĤβ˼ȤळȤȤʤޤ

ΣǯΥѥ˥ȥ֥뤬ȯϡɥ OS upgrade ǤˤĤΥȥ֥˸ޤ̤иΥեȥνˤ֤פȯϤϤ٤쵤̣ǤäౡŪˤʤäƤ֤ץȤͤ˶ŤΤ¹ԤưˤưʤäƤȤ⡢ۤμǤ 2004 ǯ 2 ˻ˡϣУͤɸ̵ΤʤȤꤷƤ줿ǡƤˤäȲ˼ȤळȤǤޤ

Visual C++ ؤΰܿconfigure ץȤκ¿ͤ multi-byte character encoding ؤбβã뤳ȤǤޤޤɤȤΩʤʤԤȤƤϤΤˤȤߤޤܸǤȱѸǤΥɥȤιȤ֤ΤȤ⡢ϥζϤã뤳ȤǤޤ

̤ˤäơϰϣУͤ鲿ȡ֥ѡꥨפȤɾ뤳ȤǤޤμϤˤȤäƤϲʬɾǤĹǯˤ錄 mcpp Ѥ߽ŤͤǧƤΤȻפѴǤޤ

ǯ᤯ˤ錄̤ƧեȥפΥץȤˤäơmcpp ʼ C/C++ ץץå˻ž夬äĤǤǯΥޥ奢ץޤȤϤʤ褯äȼʬǤǼƤޤ

̤ƧեȥΥץȤäƤ⡢mcpp βɺȤ³ƤޤޤĤβ꤬ĤäƤޤβãmcpp ڤ뤿ˡ¤˼Ȥߤ³Ƥ椯ĤǤ

mcpp-2.7.2/doc-jp/mcpp-manual.html0000644000175000017500000132054511113265141013663 00000000000000

MCPP-MANUAL

== How to Use MCPP ==

for V.2.7.2 (2008/11)
(kmatsui@t3.rim.or.jp)

== ܼ ==

1.
1.1. ϣӤϤФʤ portable ʥ
1.2. Τ Standard C ⡼ɤ˲äƤ¾γƼ⡼ɤ
1.3. Υޥ˥奢ɽˡ

2. ưΥץȴĶ
2.1. mcpp ¹ԥץΣΥӥɤȣĤư⡼
2.2. ưΥץλˡ
2.3. ̤Υץ
2.4. mcpp ư⡼ɤˤ륪ץ
2.5. νϰʳνϤ˶̤Υץ
2.6. ϤȤΥץ
2.7. Ķѿ
2.8. Multi-byte character encoding
2.9. ѥѥ mcpp Ȥˤ
2.10. 糫ȯĶ mcpp Ȥˤ
2.10.1. Visual C++ IDE mcpp Ȥˡ
2.10.2. Mac OS X / Xcode.app mcpp Ȥˡ

3. ĥǽȸߴ
3.1. #pragma MCPP put_defines, #pragma MCPP preprocess
3.1.1. إåե pre-preprocess
3.2. #pragma once
3.2.1. إåե #pragma once 񤭹ġ
3.3. #pragma MCPP warning, #include_next, #warning
3.4. #pragma MCPP push_macro, #pragma __setlocale
3.5. #pragma MCPP debug, #pragma MCPP end_debug, #debug, #end_debug
3.5.1. #pragma MCPP debug path, #debug path
3.5.2. #pragma MCPP debug token, #debug token
3.5.3. #pragma MCPP debug expand, #debug expand
3.5.4. #pragma MCPP debug if, #debug if
3.5.5. #pragma MCPP debug expression, #debug expression
3.5.6. #pragma MCPP debug getc, #debug getc
3.5.7. #pragma MCPP debug memory, #debug memory
3.5.8. #pragma MCPP debug macro_call
3.6. #assert, #asm, #endasm
3.7. C99 οǽ_Pragma() 黻ҡѰޥ
3.8. ϤȤüʻ
3.8.1. GCC, Visual C βѰޥ
3.8.2. GCC 'defined' ν
3.8.3. Borland C asm ʸ¾üʹʸ
3.8.4. #import ¾
3.9. GCC GCC Ȥθߴ
3.9.1. FreeBSD 2 / kernel Υץץ
3.9.2. FreeBSD 2 / libc Υץץ
3.9.3. GCC 2 / cpp λͤ
3.9.4. Linux / glibc 2.1 Υץץ
3.9.5. GCC 2 mcpp Ȥˤ
3.9.5.1. mcpp Υ˥󥰤ˤ
3.9.6. GCC 3.2 Υץץ
3.9.7. GCC 3, 4 mcpp Ȥˤ
3.9.8. Linux / glibc 2.4 Υץץ
3.9.9. Linux stddef.h, limits.h, #include_next
3.9.10. Mac OS X / Apple-GCC ȥƥإå
3.9.11. firefox 3.0b3pre Υץץ
3.10. Visual C++ Υƥإå
3.10.1. Ȥޥ ?
3.10.2. Identifier '$'

4. λ
4.1. λ status
4.2. Include directory Υѥ
4.3. Header name ιˡ
4.4. #if ɾ
4.5. #if Ǥʸɾ
4.6. #if sizeof (type)
4.7. White-space sequence ΰ
4.8. mcpp ¹ԥץΥǥեȤλ

5. ǥå
5.1. ǥåη
5.2. Translation limits
5.3. Fatal error
5.3.1. mcpp ȤΥХ
5.3.2. ʪŪ顼
5.3.3. Translation limits ХåեΥ顼
5.3.4. #pragma MCPP preprocessed ˴ؤ륨顼
5.4. Error
5.4.1. ʸȥȡ˴ؤ륨顼
5.4.2. 뤷ʤեΥ顼
5.4.3. Preprocessing group бطΥ顼
5.4.4. ǥ쥯ƥֹԤñʹʸ顼
5.4.5. #if ιʸ顼
5.4.6. #if ɾ˴ؤ륨顼
5.4.7. #define Υ顼
5.4.8. #undef Υ顼
5.4.9. ޥŸΥ顼
5.4.10. #error, #assert
5.4.11. #include μ
5.4.12. ¾Υ顼
5.5. Warning (class 1)
5.5.1. ʸȡ󤪤ӥȤ˴ؤ륦˥
5.5.2. 뤷ʤեΥ˥
5.5.3. ǥ쥯ƥֹԤ˴ؤƼΥ˥
5.5.4. #if ˴ؤ륦˥
5.5.5. ޥŸ˴ؤ륦˥
5.5.6. ֹ˴ؤ륦˥
5.5.7. #pragma MCPP warning, #warning
5.6. Warning (class 2)
5.7. Warning (class 4)
5.8. Warning (class 8)
5.9. Warning (class 16)
5.10. ǥå

6. Х

1.

mcpp Martin Minow DECUS cpp 򸵤 kmatsuiʾ ˤŪ˽ľåץץåǤmcpp Ȥ̾ Matsui cpp Ȥ̣Ǥϥ󶡤ΤǡƽϤǻȤˤϤνϤ˹碌ƥ˼㴳ѹäǥѥ뤷 mcpp μ¹ԥץɬפޤ*1

Υޥ˥奢ǤϡǤνϤ˰ܿ줿¹ԥץλͤƤޤ˾ܺ٤Τꤿ͡鲿餫νϤ˰ܿƤߤͤϡ mcpp-porting.html ȤɥȤ򻲾ȤƤ
ΥɥȤϤ٤ƥץ󥽡եȥȤ󶡤ޤ
ޥ˥奢Ƥˡޤ mcpp ħҲ𤷤Ƥޤ

:

*1 mcpp V.2.6.3 ϡѥ뤺ߤβफΥХʥꡦѥå⼡ΥȤ󶡤褦ˤ

http://mcpp.sourceforge.net/


1.1. ϣӤϤФʤ portable ʥ

Linux, FreeBSD, Windows ¿ΣϣӤ򥵥ݡȤƤ portable ʥץץåǤꡢΥ Standard C (ANSI/ISO/JIS C) νϤޤ Standard C++ νϤǤХѥǤ빭 portability äƤޤ饤֥ؿϸŵŪʤΤȤäƤޤ
ƽϤ˰ܿ뤿ˤϡ¿ξ硢إåեΤĤΥޥؤƥѥ뤹ǤߤޤǰξǤ⥽ե˿Խ­٤Ǥ

Multi-byte characterʴˤνܤ EUC-JP, shift-JIS, ISO2022-JP GB-2312Ѥ Big-5ڹ KSC-5601 (KSX 1001) бƤꡢUTF-8 ȤޤShift-JIS, ISO2022-JP, Big-5 ξ硢ѥΤǧʤϤǤϡmcpp 䤤ޤ


1.2. Τ Standard C ⡼ɤ˲äƤ¾γƼ⡼ɤ

Standard C ư⡼ɤΤۤˡK&R 1st. Υ⡼ɤ "Reiser" model cpp Υ⡼ɤ⤢ꡢˤϼ post-Standard ͤΥ⡼ɤޤǤޤC++ ΥץץåȤư¹Իץ⤢ޤ
Standard C ⡼ɤϴ¸¿ΥץץåȰäơʤ˼ƤĤǤC90, C95, C99, C++98 Τ٤ƤбƤޤStandard C ץץ reference model ȤʤΤܻؤƺäƤޤεʤΥСϼ¹Իץǻꤹ뤳ȤǤޤ*1

ۤˤĤͭѤʳĥǽäƤޤޥŸ #if ɾȥ졼 #pragma MCPP debug ⤢ޤإåե "pre-preprocess" ƤȤǤޤ
ĤͭѤʼ¹ԻץƤޤ˥󥰤Υ٥ꤹ륪ץ䡢include directory ꤹ륪ץǤ
ˤɤʴְ㤤äƤ mcpp ˽긫ʥåФꤻΤǤ狼䤹ǥåФŬڤʽ򤷤ޤܿȤʤˤĤƤٹȯޤ
ʼǤʤ顢ɥŪŪʤƤߤޤ
ܺ٤ʥɥȤ°Ƥޤ

mcpp η򶯤Ƶ󤲤С®٤٤ȤǤGCC 3.*, 4.* / cc1 ٤ȣܤ飳ܤλ֤ޤBorland C 5.5 / cpp Ʊ餤®٤ǡإåե pre-preprocess εǽȤȤ⤦®ʤΤǡä٤ۤǤϤޤΤǤ뤳ȡportable ʥǤ뤳ȡʤǤư뤳Τˤϡ٤ν֤Ϥ򤨤ʤȹͤƤޤ

ʤץץå Standard C ٤ƥȤ뤿θڥåȤǤ "Validation Suite for Standard C Preprocessing"β⤪ӤȤäƥƥȤƼץץåκ cpp-test.html mcpp ȤȤ˸Ƥޤ򸫤ȡStandard C פȾΤ¸Υץץåˤ¿꤬뤫狼ޤ

mcpp V.2.3 γȯǡڥå V.1.3 ȤȤˡʵ(IPA) ʿǯ١̤Ƨեȥ¤ȡפ˿ ͵ץȥޥ͡ˤäƺ򤵤졢2002/07 - 2003/02 δ֤ IPA λȿУͤνΤȤ˳ȯʤޤѸǥɥȤ⤳ΥץȤǡͭ²ҡϥ˻䤬ȥƥäƤǤäΤǤ*2
mcpp Ϥʿǯ٤ˤ̤Ƨեȥ¤ȡפ˰ PM ˤäƷ³ƺ򤵤졢V.2.4 ؤ update Ȥʤޤ
θ mcpp ȸڥåȤϤ˲ɤκȤ³Ƥޤ

:

*1 øεʤȤƤ ISO/IEC 9899:1990 (JIS X 3010-1993) ĹȤƤ1999 ǯˤ ISO/IEC 9899:1999 򤵤줿ǤԤ C90Ԥ C99 ȸƤ֡Ԥ ANSI X3.159-1989 ܹԤΤʤΤǡ̤ˤ ANSI C ޤ C89 ȸƤФ뤳Ȥ⤢롣ޤISO/IEC 9899:1990 + Amendment 1995 C95 ȸƤ֤Ȥ롣C++ εʤ ISO/IEC 14882:1998 ӤǤǤ ISO/IEC 14882:2003 ǡξԤ򤳤Ǥ C++98 ȸƤ֡

*2 ̤Ƨեȥ¤ȡ(Exploratory Software Project) γפϼΤȤΤ뤳ȤǤ롣

http://www.ipa.go.jp/jinzai/esp/

mcpp V.2.3 ʹߤΥӥɥȤȸڥå V.1.3 ʹߤϼΤȤ֤Ƥ

http://www.m17n.org/mcpp/

2006/04 ˼ΤȤ˰ܤä

http://mcpp.sourceforge.net/

mcpp θŤСǤ cpp V.2.2 Ӹڥå V.1.2 ϥ٥ҤΥȤμΤȤˤ롣dos/prog/c Ȥǥ쥯ȥƤ뤬MS-DOS ѤǤϤʤ UNIX, WIN32/MS-DOS бƤ롣

http://www.vector.co.jp/soft/dos/prog/se081188.html
http://www.vector.co.jp/soft/dos/prog/se081189.html
http://www.vector.co.jp/soft/dos/prog/se081186.html

Υ֥եΥƥȥեϡVector ΤΤ Windows ˹碌ơԥɤ [CR]+[LF] shift-JIS encode Ƥ롣SourceForge ΤΤ V.2.5 ޤǤ UNIX Ϥ˹碌Ʋԥɤ [LF] EUC-JP Ǥ롣V.2.6 [CR]+[LF] / shift-JIS zip Ǥ[LF] / EUC-JP tar.gz ǤΣΥ֥ե֤褦ˤ


1.3. Υޥ˥奢ɽˡ

Υޥ˥奢ϤĤƤϥƥȥեǤV.2.6.2 html եѤޤ
Υޥ˥奢ǤϼΤ褦˥եȤȤʬƤޤ

  • source:
    եȤϡɤҤӥޥɥ饤Ϥ򼨤Τ˻Ȥޤ
  • __STDC__:
    եȤϡɸޥӲ餫Υޥ򼨤Τ˻Ȥޤ
  • STD:
    Italic եȤ mcpp system.H ȤեޥɽޤΥޥ˥奢ǤϤ̾ mcpp μɽ뤿˻ȤޤΥޥ mcpp 򥳥ѥ뤹˻Ȥǡmcpp μ¹ԥץˤ¸ߤƤʤȤդƤ

2. ưΥץȴĶ

2.1. mcpp ¹ԥץΣΥӥɤȣĤư⡼

mcpp ˤϡɤνϡʥѥˤΩñȤư compiler-independent-build ȡνϤΥץץå˼ääư build (compiler-specific-build) ȤޤԤϥץץ򤹤뤿ΤΤǡνϤ򲿤餫ΥѥͿƤѥ뤵Ȥϸ¤ޤ󡣸ԤνϤǥѥȥ󥯤ޤǹԤΤΤǡmcpp νϤϤΥѥλͤ˹碌Ƥޤ*1, *2

ԤǤϥץλͤ mcpp 򥳥ѥ뤷ϤΤˤ餺ۤܰǡOS ˤ㤬ǤԤǤ϶̤λͤȤȤˡϤȤθߴΤλͤ¿ꡢʬϽϤȤ˰ۤʤäƤޤCompiler-independent ǤΥץϽǤǤܻۤȤޤϤΥץȤξͤ򤱤뤿̤ΥץˤʤäƤΤ⤢ޤ
ʤΥɥȤǡGCC ѡסVisual C ǡɽƤΤϤ⤽줾 GCC build, Visual C build ΰ̣Ǥ

Compiler-independent ǤǤǤǤ⡢mcpp ˤϤĤư⡼ɤꡢ줾ۤʤץץͤưޤ⡼ɤˤϼΣĤޤ

  • STD
    Standard C (C90, C99, C++98) ΥץץͤǤ줬ǥեȤΥ⡼ɤǤ
  • COMPAT
    std ⡼ɤѼǡƵŪޥ򵬳ʤ⤵Ÿޤ
  • POSTSTD
    kmatsui ˺äץץͤǡStandard C μӤʤñ㲽ΤǤ
  • KR
    C90 K&R 1st. ΥץץͤǤ
  • OLDPREP
    "Reiser" model cpp ưͤǤ

Υ⡼ɤꤹ륪ץϼ̤Ǥ ⡼ɤ򲿤ꤷʤ -@std ꤷȤˤʤޤ

  • -@std
    STD
  • -@compat
    COMPAT
  • -@post, -@poststd
    POSTSTD
  • -@kr
    KR
  • -@old, -@oldprep
    OLDPREP

STD, COMPAT, POSTSTD 碌 Standard ⡼ɡKR OLDPREP 碌 pre-Standard ⡼ɤȸƤ֤ȤˤޤޤCOMPAT STD ȤۤȤƱʤΤǡäǤʤ¤ STD ˤ COMPAT ޤᡢɬפʾ COMPAT ˸ڤޤ*3

Standard pre-Standard Υ⡼ɤȤǤϡޥŸˡΰ㤤¿ޤC90 pre-C90 Ȥΰ㤤Ȼפäƴְ㤤ޤ󡣺Ǥ礭ʰ㤤ϡؿͥޥʰդޥˤŸǡ˥ޥޤޤƤ硢Standard ⡼ Ǥϰ˴ŸƤ鸵ޥִꥹΥѥ᡼֤ΤФơpre-Standard ǤŸ˥ѥ᡼ִƥŸ뤳ȤǤ
ޤStandard ⡼ ǤľܤˤܤˤޥκƵŪŸϸ§ȤƤޤpre-Standard ǤϺƵŪʥޥȡŸ̵ºƵƥ顼Ȥʤޤ

ˤ \ ΰ⡼ɤˤäưۤʤꡢStandard ⡼ Ǥ trigraph θ塢tokenization <backslash><newline> sequence ޤpre-Standard ⡼ Ǥʸƥˤ #define Ԥˤ˸¤äƤޤ

tokenizationʥȡʬ䡢ȡڤФˤ⡼ɤˤä̯˰㤤ޤ
Standard ⡼ Ǥϡtoken base ǤưפȤ¤ tokenization ԤޤŪˤϡStandard ⡼ ǤϡޥŸȤ space ơ token ȤΰտޤʤϢ뤬ȯΤɤޤpre-Standard ⡼ ŪصŪŪ tokenization ȡcharacter base ǤΥƥִפˤޥŸˡκפĤƤޤˤĤƤϡ cpp-test.html#2
Standard ⡼ Ǥ preprocessing number Ȥͥȡ̤˰ޤpre-Standard Ǥϡͥȡϣäȡ󤪤ưȡƱǤǤ 'U', 'u', 'LL', 'll'ưǤ 'F', 'f', 'L', 'l' ϥȡΰȤǧޤ
磻ʸʸƥʸ Standard ⡼ ǤñΥȡȤǧޤ

Digraph, #error, #pragma, _Pragma() operator Standard ⡼ ǤʤȻȤޤ-S <n> ץstrict-ansi ⡼ɡˤ -+ ץC++ ץץåȤưˤ Standard ⡼ ǤȤޤ󡣻ޥ __STDC__, __STDC_VERSION__ Standard ⡼ λ졢pre-Standard λޤ
#if defined, #elif pre-Standard ǤϻȤޤ#include, #line ΰ˥ޥȤȤ pre-Standard ǤϤǤޤ󡣻ޥ __FILE__, __LINE__, __DATE__, __TIME__ pre-Standard λޤ
¾ǡ#assert, #asm (#endasm), #put_defines, #debug pre-Standard ⡼ɤǤȤޤ
#if Standard ⡼ Ǥ long long / unsigned long long ɾޤpre-Standard ⡼ Ǥ (signed) long ɾޤ#if sizeof (type) ȤΤ pre-Standard Ǥ

Trigraph UCN (universal-character-name) ϡSTD ⡼ɤǤȤޤ

ǥåν⡼ɤˤäƾäƤޤ

ʾ˽Ҥ٤Ȱʳ K&R 1st. Standard C ȰۤʤΤʵΤʤȤˤĤƤϡpre-Standard ⡼ Ǥ C90 ε˽ޤ

OLDPREP ⡼ɤ KR ⡼ɤȤΰ㤤 POSTSTD, COMPAT ƥ⡼ɤ STD ⡼ɤȤΰ㤤ϼΤ褦ʤΤǤ

  • OLDPREP
    Τ褦ʻͤθŤ "Reiser model cpp" ư򤹤old preprocessor ΰաˡ

    1. Ȥ򣱸Ĥ space ǤʤĤ space Ѵ롣Ѵϸ§ȤƺǸνϻ˹Ԥ롣ޥǤľ˹Ԥ롣
    2. ޥִꥹʸƥޤʸꡢˤɤ줫Υѥ᡼̾ȰפʬϡΥޥθƤӽФκݤˤʬϡѥ᡼б֤롣פʬȤΤϡξü " ޤ ' ϤȤȡȤƸ˰פȡΤȤǤ롣
    3. #else, #endif ιԤ˲񤤤ƤäƤ⥨顼ˤ̵뤹б #if MACRO, #ifdef MACRO MACRO 񤤤ꤹˡ
    4. ƥĤ " ' ʤϡĤƤȤߤʤunterminated string literal, unterminated character constant Υ顼ȯʤˡ
    5. # 123 ȤԤ #line 123 ƱΤȤư

  • COMPAT
    ƵŪޥ򵬳ʤ⤵Ÿ롣 ʤƵŪޥŸ˺ݤơƱ̾ޥκִػߤϰϤ򵬳ʤⶹȤ롣
    ƵŪޥŸεˤĤƤ cpp-test.html#3.4.26 򻲾ȤΤȡƵŪޥζ test-t/recurs.t 򻲾ȤΤȡ*4

  • POSTSTD
    ϵʤ˼Τ褦ѹäΤǤ롣

    1. Trigraphs ǧʤDigraph translation phase 1 ǡʤץץκǽѴƤޤToken ȤƤϰʤ
    2. Tokenization token-base θ§ˤäñ㲽Ƥ롣 preprocessing token δ֤ token separator ȤƤ white space ʤϡ˼ưŪ a space ʤޥΥޥ̾ȼ '(' δ֤ˤʤˡäơ# 黻Ҥˤʸ󲽤Ǥ⤹٤Ƥ preprocessing token δ֤ˤ a space äʸ󲽤뤳Ȥˤʤ롣ޤޥκ˺ݤƤϡtoken separator ̵ͭˤʤʤ
    3. ؿͥޥκ˺ݤƤϡѥ᡼̾ΰ㤤ˤʤ
    4. #if ʸϻȤʤʥ顼ˤˡ
    5. ؿͥޥŸ˴ؤִؿ͡פǤʤԵ§ʵ򥫥åȤƤ롣 ʤƥϤΥޥִꥹȤоݤȤθ sequence ϼޤʤ
    6. #include <stdio.h> Ȥ header name ̤̾˥󥰤Фclass 2 Υ˥󥰥ץǡˡޥ <stdio.h> η header name Ȥȡüʾˤϥ顼Ȥʤ뤳Ȥ롣#include "stdio.h" η侩롣
    7. ޥǤϥޥִ̾ꥹȤȤδ֤ space ɬפȤ꤬ C99 ɲä줿εˤϽʤtokenization κݤ˼ưŪ a space Τǡˡ
    8. UCN (universal-character-name) ǧʤޤidentifier multi-byte character ǧʤ
    9. C++ Ǥϣ identifier operator operator ȤƤϰʤ

ʤΤۤ lang-asm ⡼ɤȤΤ⤢ޤ ϥ֥饽 C Υȡǥ쥯ƥ֡ޥ줿§Ūʥ⡼ɤǤ POST_STD ϤΥ⡼ɤˤʤ뤳ȤϤǤޤ󤬡ʳΥ⡼ɤϰΥץꤹ뤳ȤǤΥ⡼ɤˤʤޤ λͤˤĤƤ 2.5 򸫤Ƥ

Ȥ mcpp μ¹ԥץˤϤĤλͤΤǡޥ˥奢դɤǤξϤǤϤޤ mcpp ζ̤Υץư⡼ɤˤäưۤʤ륪ץҤ١νǤƶ̤ΥץҤ١ΤȤǽǤνϤȤ˰ۤʤ륪ץ򵭺ܤޤ

:

*1 Τۤ subroutine-build ȤΤ⤢롣餫¾Υᥤץफ mcpp ֥롼ȤƸƤӽФΤǤ롣λͤ mcpp 򥳥ѥ뤷ˤä compiler-specific-build ޤ compiler-independent-build Τɤ餫ƱˤʤΤǡΥޥ˥奢ǤäˤȤꤢʤ Subroutine-build ˤĤƤ mcpp-porting.html#3.12 򻲾ȤΤȡ

*2 SourceForge ΥȤ󶡤ХʥꡦѥåϤ٤ compiler-independent-build Ǥ롣

*3 V.2.5 ޤǤ Standard ⡼ɤ pre-Standard ⡼ɤȤǼ¹ԥץब̤ˤʤäƤV.2.6 飱Ĥ礵줿

*4 GCC, Visual C++ μפʽϤȤθߴΤΥץǤ롣'COMPAT' "compatible" ΰ̣Ǥ롣


2.2. ưΥץλˡ

ʲεܤǤϡ<arg> Ȥˡ arg 桼Ϥ٤ǤդΰǤ뤳Ȥ򼨤[arg] arg άǽʰǤ뤳Ȥ򼨤ޤɤˤƤ <, >, [, ] ʸΤΤϤƤϤޤ

mcpp ư񼰤ϼηǤmcpp Ȥ̾ mcpp Υ󥹥ȡλˤäƤ̤̾ˤʤޤ

mcpp [-<opts> [-<opts>]] [in_file] [out_file] [-<opts> [-<opts>]]

out_fileʽϥѥˤά줿ϡ-o ץ󤬻ꤵʤ¤ɸϤ˽Ϥޤin_fileϥѥˤά줿ɸϤϤޤǥåϡ-Q ץ󤬻ꤵʤ¤ɸ२顼Ϥ˽Ϥޤ
Τɤ줫Υե뤬ץǤʤϡ顼åФƽλޤ

ɬפȤ륪ץ˰ʤϥ顼Ȥʤޤ-M ץ̡ˡ
ɬפȤ륪ץǤ -I<arg>, -I <arg> ΤɤͭǤʥץʸȰδ֤ space ϤäƤʤƤɤˡ
Τʤץ -Qi, -Q -i ΤɤͭǤʣĤ '-' θˤĤʤƤ̡ '-' դƤɤ-M ϤĤʤƤϤʤˡ
ƱΥץʣꤵ줿硢-D, -U, -I, -W ץϤ줾줬ͭǤ-S, -V, -+ ϣܰʹߤ̵뤵ޤ-2, -3 ϤΤӤ˻ͤȿžޤ¾ΥץϺǸ˻ꤵ줿ΤͭǤ

ʸȾʸ϶̤ޤ
륹å饯 Windows Ǥ - Ǥꡢ/ ǤϤޤ
ʥץꤹ usage ʸɽΤǡmcpp -? Ȥ뤳ȤǡȤ륪ץΤ뤳ȤǤޤUsage ʸΤۤˤ⤤ĤΥ顼åޤƤϤ⼫ΤΤǤΤǡϾάޤ


2.3. ̤Υץ

mcpp ư⡼ɤϤˤʤ̤Υץϼ̤Ǥ

  • -C
    ΥȤϤ롣ǥХåͭѤʥץǤ롣ȤϥԤƬ˰ܤƽϤ롣ȤνϥޥŸǥ쥯ƥ֤ν˹ԤΤǤꡢȤϥޥƤӽФˤ뤫⤷ʤǤ롣

  • -D <macro>[=[<value>]]
  • -D <macro(a,b)>[=[<value>]]
    ޥ macro 롣ƤޥǤ __STDC__, __STDC_VERSION__, __FILE__, __LINE__, __DATE__, __TIME__, __cplusplus ʳǤСΥץѹǤC99 __STDC_HOSTED__ GCC V.3 Τ褦 -D ץϤ⤢Τǡ㳰Ū˵Ĥˡ=<value> ꤵƤ value άƤ 1 bcc32 ǤϾάˤϣĤΥȡΤǡȤϰ㤦Ȥաˡ= ˤ϶ƤϤʤ= θ˶򤬤ФΥޥϣĤΥȡ롣
    ΥץǤϡĤޥǤ롣
    ΥץϲǤǤ롣

  • -e <encoding>
    Multi-byte character encoding <encoding> ѹ롣 <encoding> ˤĤƤ 2.8 򻲾ȤΤȡ

  • -I <directory>
    Include directory Υѥ̤ directory ꤹʥѥˤĤƤ 4.2 򻲾ȡˡdirectory ̾ space ޤޤϡdirectory ̾Τ " " ǰϤळȡ

  • -I 1, -I 2, -I 3
    #include "header" ηΡ<header> ηǤϤʤ˥ǥ쥯ƥ֤Ǻǽ˥ǥ쥯ȥδꤹ롣-I1 Ǥϥȥǥ쥯ȥꡢ-I2 Ǥϥեʥ󥯥롼ɸˤΤǥ쥯ȥꡢ-I3 ǤϤ򥵡ʾܺ٤ 4.2 򻲾ȡˡ

  • -j
    ǥåνϤǤϥղþϽϤԤοǥåϤʥǥեȤǤϣԤοǥå³ơΥԤɽ롣ե뤬 include 줿ΤǤϡinclude ιԤ缡ɽ롣ޥ˴ؤǥåǤϡŸΥޥ缡ɽˡ
    GCC testsuite ǻθڥåȤȤϡΥץꤷơGCC Ʊǥåˤɬפ롣

-M* ץ makefile Ѥΰ¸طԤϤΤǤʣΥե뤬硢٤ƤΥˤĤƤ -M* ץդƼ¹ԤơνϤޡȡmakefile ɬפʰ¸طҹԤޤΥץ GCC ΤΤ˹碌Ƥޤ㤤ޤ*1

  • -M
    եΰ¸ط򵭽ҤԤϤ롣ϥޥɥ饤ǻꤵ줿ϥե롢줬ꤵƤʤɸϤǤ롣ԤĹޤꤿࡣ̾Υץץ̤ϽϤʤ

  • -MM
    -M ȤۤƱǤ뤬ΥإåϽ񤭽Фʤ
    1. #include <stdio.h> η include Ρ
    2. #include "/include/stdio.h" ХѥǻꤵƤΡ
    3. #include "stdio.h" ηǤ뤬ȥǥ쥯ȥʽϤ -I <n> ץˤäƤϥΤǥ쥯ȥˤȯ줺ƥ include ǥ쥯ȥȯ줿Ρ-I <directory> ץĶѿǻꤵ줿ǥ쥯ȥޤˡ
    GCC-specific-build Ǥ GCC Ʊͤˡ񤭽ФʤΤϥƥإåǤ롣

  • -MD [FILE]
    -M ȤۤƱǤ뤬̾Υץץ̤⥳ޥɥ饤ǻꤵ줿եޤɸϤ˽Ϥ뤳ȤäƤ롣ޤ¸طԤνϡ FILE ꤵ줿ϤΥեȤʤꡢꤵƤʤϥե̾ .c .d ѤեȤʤ롣

  • -MMD [FILE]
    -MD ȤۤƱǤ뤬-MM Ʊͤ˥ƥإåȤߤʤΤϽ񤭽ФʤȤäƤ롣¸طԤν -MD [FILE] Ʊ

  • -MF FILE
    FILE ˤ롣-MD FILE, -MMD FILE ͥ褹롣

  • -MP
    "Phony target" Ϥ롣Phony target ȤΤϡ󥯥롼ɤե룱ģĤˤĤơ켫Τ¸ʤåȤȤơΤ褦˵ҤΤǤ롣
    test.o: test.c test.h
    test.h:
    
  • -MT TARGET
    åȤ̾̾ foo.o ǤϤʤ TARGET ˤ롣-MT '$(objpfx)foo.o' ȤץǤϼΤ褦ʹԤϤ롣
    $(objpfx)foo.o: foo.c
    
  • -MQ TARGET
    -MT ƱͤǤ뤬make ˤȤä̤ʰ̣ʸϼΤ褦 quote 롣
    $$(objpfx)foo.o: foo.c
    
  • -N
    '_' ǻϤޤΤޤƤ٤Ƥλޥ̵ˤ롣ʤ׵ᤵƤޥ __MCPP Ͻʤ׵ᤵƤޥȤϡ__FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__, C99 __STDC_HOSTED__ C++ __cplusplus Ǥ롣__MCPP undefine -U ץȤȡˡ

  • -o <file>
    ץץΥ file ˽Ϥ롣άϥѥȤʤΤǡ̵Ƥ褤ץǤ뤬ѥɥ饤ФˤäƤϤΥץȤΤ롣

  • -P
    ѥΤ˹ֹϤά롣äΥץץåʳӤήѤ˻ȤץǤ롣

  • -Q
    ǥåʥȥǥ쥯ȥΡmcpp.err Ȥ̾Υե˽Ϥmcpp.err ϸ˥ڥɤƤ椯Τǡ뤳ȡˡ

  • -U <macro>
    Ƥޥ macro ä__FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__, C99 ⡼ɤǤ __STDC_HOSTED__ -+ ץǵư __cplusplus ϼäʤˡ

  • -v
    mcpp ΥС󤪤ӥ󥯥롼ɥǥ쥯ȥΥɸ२顼Ϥ˽Ϥ롣
    2.4 ǽҤ٤ -K ץ󤬻ꤵ줿ޤ 3.5.8 ǽҤ٤ #pragma MCPP macro_call ꤵ줿ϡΥץϤΰ̣Ѥ롣

  • -W <level>
    Warning Ϥ٥ level ˻ꤹ롣 level 0 ޤ 1, 2, 4, 8, 16 ΤǤդͤ OR ȤäΤǤ롣 1, 2, 4, 8, 16 Ϥ줾 warning class ̣롣 㤨 -W 5 Ǥ class 1, 4 warning Ϥ롣 0 ξ warning ϽϤʤ Υץʣꤵȡ٤Ƥλ OR Ȥ롣 㤨 -W 1 -W 2 -W 4 -W 7 ƱǤ롣 -W 7 -W "1|2|4" Ȥ뤳ȤǤ| ѥפȲᤵʤ褦 " " ǰϤɬפˡ -W "3|4" ȤƤ⤫ޤʤ -W 0 ꤵ줿ϡ¾ -W ץϤ٤ƥ󥻥뤵롣 Υץꤷʤ -W 1 ꤷΤƱǤwarning Ƥ 5.5 - 5.9 򻲾ȡˡ

  • -z
    #include Ǽޤ줿եΥץץ̤ϽϤʤ ޥ롣 #include ԤΤΤϤ롣 Include 줿ե #include ԤϽϤʤ ץץΥǥХå˻ȤץǤ롣

:

*1 GCC Ȱ㤦ΤϼǤ롣

  1. -MG ץϤʤץλʣ뤫Ǥʤäơɤͤάˡ -M ץǤ⡢󥯥롼ɥե뤬Ĥʤϥ顼ˤϤʤ뤬¸طԤϽϤΤǡѤǤ롣
  2. GCC-specific-build GCC ˹碌Ƥ뤬ʳǤϡ-MM, -MMD ץǽإåϰϤ

2.4. mcpp Υ⡼ɤˤ륪ץ

mcpp ˤϤĤư⡼ɤޤλͤ 2.1 򻲾ȤƤ
Υޥ˥奢ǤϳƼΥ⡼ɤλͤ¤٤ƵܤƤΤǡˤʤäƤޤޤ󤷤ƤޤʲǽФƤ DIGRAPHS_INIT, TRUE, FALSE, etc. ʸ̾__ ǻϤޤʤΡˤ italic ɽƤΤϤ٤ system.H ޥǤΥޥϤޤǤ mcpp Ȥ򥳥ѥ뤹˻ȤǡǤä mcpp ¹ԥץˤϤΥޥϻĤäƤϤޤ󡣴㤤ʤ褦ˤƤ

Standard ⡼ɤǤϼΥץ󤬻Ȥޤ

  • -+
    C++ ΥץץåȤư롣ޥ __cplusplus ʤͤ system.H Ƥ롣ǥեȤ 1ˡ// ԤιޤǤ򥳥ȤȲᤷ::, .*, ->* 򤽤줾ñΥȡȤǧ롣#if Ǥ true, false ȤȡϤ줾 1, 0 ɾ롣__STDC__, __STDC_VERSION__ ƤСʤGCC ǤǤ GCC ȤθߴΤ __STDC__ Ϻʤˡ_ ǻϤޤʤޥ롣extended characters UCN ؤѴϤʤ*1, *2

  • -2
    Digraphs νȿž롣DIGRAPHS_INIT == FALSE ξϤ digraph ǧ褦ˤʤꡢդξǧʤʤ롣

  • -h <n>
    ޥ __STDC_HOSTED__ ͤ <n> 롣
  • -S <n>
    C Ǥ __STDC__ ͤ <n> ѹ롣C++ Ǥ̵뤵롣<n> [0,9] ϰϤοͤǤʤФʤʤ<n> 1 ʾǤС_ ǻϤޤʤޥunix, linux ˤ̵ˤ롣
    S __STDC__ ΰ̣Ǥ롣Υץꤷʤȡ__STDC__ ϥǥեȤͤȤʤ̾ 1ˡ
    GCC ǤǤ -pedantic, -pedantic-errors, -lang-c89 Ǥ -S1 ꤷƱȤˤʤΤǡμ -S ̵뤵롣 ޤΥץǤ unix, linux, i386 ʰȿλޥ̵ˤʤʤ GCC ȤθߴΤǤ롣 λޥ -ansi ޤ -std=iso* ץǽ̵ˤʤ롣

  • -V <value>
    C Ǥ __STDC_VERSION__C++ Ǥ __cplusplus Ȥޥͤꤵ줿 <value> ѹ롣ξ <value> long ͤȤʤC95 ǤϤͤ 199409LC99 Ǥ 199901LC++ Standard Ǥ 199711L Ǥˡ__STDC__ 0 Ƥ __STDC_VERSION__ ɬ 0L Ȥʤꡢ-V ̵Ǥ롣
    C ǤϡΥץꤷʤȡ__STDC_VERSION__ system.H STDC_VERSION ͤȤʤGCC V.2.7 - V.2.9 Ǥ 199409LʳǤ 0Lˡ-V199901L Ȥ __STDC_VERSION__ >= 199901L ˤʤäϼΤ褦 C99 λͤȤʤ 3.7 ȡˡ

    1. // ޤǤ򥳥ȤȤư *3
    2. Preprocessing-number e+, E+, e-, E- Ʊͤ p+, P+, p-, P- Ȥ sequence ǧ롣ưΥӥåȥѥ 0x1.FFFFFEp+128 Ȥդˡʤɽ뤿ΤΤǤ롣
    3. _Pragma( "foo bar") Ƚ񤯤 #pragma foo bar Ƚ񤤤ΤƱ̤ _Pragma operator ͭˤʤ롣
    4. EXPAND_PRAGMA Ȥޥ TRUE ƥѥ뤵줿 mcpp Ǥϡ#pragma ԤΰϡSTDC ޤ mcpp ǻϤޤΤǤʤ¤ޥŸоݤȤʤʥǥեȤǤ Visual C, Borland C ǰʳǤ EXPAND_PRAGMA == FALSE ǤꡢޥŸʤˡ
    5. ̻ҡʸʸƥ롦pp-number ˤ UCN (universal-character-name) sequence ̤ʤ STD ⡼ɤ˸¤ˡ

    ʤѰޥ C99 λͤǤ뤬C90 C++ ǤȤ褦ˤƤ롣*4
    C++ Ǥ -V199901L Ȥ __cplusplus >= 199901L ˤȡC99 ߴ⡼ɤȤʤꡢ嵭 2,3,4 εǽĥԤ1 ̵ͭ5 ϤۤƱ͡ˡ mcpp ȼγĥǤꡢC++ Standard ˤϰȿ롣
    ʤΥޥ __STDC__, __STDC_VERSION__, __cplusplus λ -D ץϻȤʤ̤Υ桼ޥȶ̤뤿Ǥ롣

STD ⡼ɤǤϼΥץ󤬻Ȥޤ

  • -3
    Trigraph νȿž롣 TRIGRAPHS_INIT == FALSE ξϤ trigraph ǧ褦ˤʤꡢդξǧʤʤ롣
  • -K
    ޥ˴ؤ򥳥Ȥ˽񤭹ǽϤ֥ޥ⡼ɡ(macro notification mode) ꤹ롣 Υ⡼ɤǤϡץץνϤ鸵ΥΥޥΰ֤Τ뤳ȤǤ롣 Υ⡼ɤ C/C++ refactoring tool Τ˼줿ΤǤ롣 C/C++ ˤϥץץȤեΤ뤳Ȥ refactoring tool ˤȤäƺΥ⡼ɤȤХץץνϤ饽ƹ뤳ȤǤ롣 ˡϤ򤽤Τޤ޺ƥץץƥѥ뤹뤳ȤǤ롣*5
    Υ⡼ɤϼ pragma ǻꤹ뤳ȤǤ롣
    #pragma MCPP debug macro_call
    
    -K ץϤ pragma 򥽡Ƭ˽񤤤ΤȤۤƱ̤ġ pragma ǤϻޥϽϤʤ Macro notification λͤˤĤƤ 3.5.8. #pragma MCPP debug macro_call 򻲾ȤΤȡ
    Υ⡼ɤǤϼ -k ץ󤬼ưŪ˻ꤵ롣 Υ⡼ɤƱ -v ץ󤬻ꤵ줿 -v ץϤΰ̣Ѥmacro notification Ƥܺ٤ˤʤ롣 ޤ-a (-x assembler-with-cpp) ޤ -C ץ󤬻ꤵ줿ϡ-K ץϼưŪ̵ˤʤ롣*6

  • -k
    horizontal white spaces (space, tab) 򰵽̤ˤΤޤ޽Ϥ롣 ȤƱĹ spaces Ѵ롣 ȥץץνϤȤ column ֤бݻ뤿ΥץǤ롣 ޥȰ֤뤬-K ץȤȤ⸵ΰ֤Τ뤳ȤǤ롣*7

:

*1 C++ __STDC__ ƤΤϥȥ֥θǤꡢɤͤǤϤʤGCC ΥɥȤˤȡإåե¿ __STDC__ Ƥ뤳ȤԤƤΤǡC++ Ǥ⤳Ƥɬפ롢ȤΤȤǤ롣ϥإåեνȸ虜򤨤ʤC90, C99, C++ ˶̤ʬˤϡ#if __STDC__ || __cplusplus Ƚ񤯤٤ʤΤǤ롣

*2 C++ Standard Ǥ C99 ȰäơUCN 硹ŪʰƤꡢȾüʼϤǤʤC 1997/11 draft Ǥ⤽ǤäUnicode 򤽤ޤƳ뤳Ȥˤϡô礭뤳꤬äƵǤ롣

*3 // C90Standard ⡼ɤξˤǤ⥳ȤȤư˥󥰤Ф

*4 GCC ȤθߴΤǤ롣

*5 GCC-specific-build mcpp 򥤥󥹥ȡ뤹ȡmcpp ˤץץϤ cc1 (cc1plus) -fpreprocessed ȤץդϤ褦ˤʤ롣 ΥץϤץץߤǤ뤳Ȥ cc1 ΤǤ뤬Ǥ⥳ȤϽ롣 äơ-K ץη̤ cc1 -fpreprocessed ץդϤƺ٤ʤ ޤgcc (g++) ޥɤ -save-temps Ȥץդȡץץ̤ *.i (*.ii) ե뤬ĤΤǡ refactoring tool ǽ뤳ȤǤ롣

*6 -x assembler-with-cpp ץǤ C/C++ ΥǤϤʤ GCC Ѥ *.S ե뤬եȤƻȤ뤬 *.S եΥץץǤϡ-K ץȤäƥȤȥ֤뤿ᡢ֥Ǥʤʤ뤫Ǥ롣 ޤ-C ץˤ륳Ȥ -K ץ줿Ȥʶ路ȤΤǡƱˤϻȤʤ

*7 ΥץȤäƤ⡢üʾˤΤбݻʤȤ롣 <backslash><newline> ˤϢȹԤޤȤˤϢ뤬Ϣ³䡢Ȥ 256 ԰ʾ³ʤɤǤ롣 ʤΥץꤷƤ⤷ʤƤ⡢'\v', '\f' space Ѵ롣


2.5. νϰʳνϤ˶̤Υץ

UNIX ϤΥƥǤϼΣĤΥץ󤬻Ȥޤ ΩǡGCC Ǥ˶̤Ǥ GCC ǤǤ GCC бƤʤȥ顼ˤʤޤ

  • -m32
    ޥ 32 ӥåѤˤ롣 CPU x86_64 ޤ ppc64 ξ硢ǥեȤǤ 64 ӥåѤλޥȤ뤬ΥץꤹȤ줾 i386, ppc ѤΤΤȤ롣
  • -m64
    ޥ 64 ӥåѤˤ롣 CPU i386 ޤ ppc ξ硢ǥեȤǤ 32 ӥåѤλޥȤ뤬ΥץꤹȤ줾 x86_64, ppc64 ѤΤΤȤ롣

GCC ϥץ¿ΤǡGCC ǤǤϤȤξͤ򤱤뤿ˤĤΥץ¾νϤȤϰ㤦ΤˤƤޤʤGCC ǥѥ뤷 mcpp Ǥ compiler-independent ǤΥץ¾νϤǥѥ뤷ΤƱǤʲΥץ GCC ǰʳ˶̤ΤΤǤ

  • -a
    Υ֥饽˸뼡Τ褦ʵˡ򥨥顼ˤ̤
    1. #APP
      

      Τ褦 # μ identifier äΥǥ쥯ƥ֤˹פʤ硢ιԤ򤽤Τޤ޽Ϥ롣

    2. # + any comment.
      

      Ȥä # μ identifier, pp-number ʳΤΤԤϡ˥󥰤ȤȤ˼ΤƤ뤬顼ˤϤʤ

    3. "Jugemjugem
      gokouno
      surikire"
      

      ȤäΤήιԤޤʸƥ
      "Jugemjugem\ngokouno\nsurikire"
      ȤԤϢ뤹롣

    4. ## 黻Ҥˤ token Ϣ pp-token ȤƤ̵ token Ƥ⡢顼ˤʤ

    5. ޥŸ space ʤ η̡ pp-token ȰۤΤϢ뤵Ƥ⥨顼ˤʤ

    GNU Υʤɤ˻ΤǤGCC ǤǤϤΥץ -x assembler-with-cpp -lang-asm Ǥ
    Υץ POSTSTD ⡼ɤǤϻȤޤ
    Υ⡼ɤ򤳤Υޥ˥奢Ǥ lang-asm ⡼ɤȸƤӤޤ
    Υ⡼ɤ mcpp C/C++ ʳΥƥȤΥޥץåȤƻȤŬƤޤxrdb ƤӽФ cpp ȤƻȤʤɤǤ

  • -I-
    ǥեȤ include directory 󥻥뤵졢Ķѿǻꤵ줿 directory ¾ -I ץǻꤵ줿 directory ͭȤʤ롣GCC ǤǤϤΥץ -I- ǤϤʤ -nostdinc Ǥ롣GCC Ǥ -I- ץϤޤäạ̈ġ 2.6 ȡˡ

2.6. ϤȤΥץ

νϤǥץץåȤ mcpp ȤˤϡϤΥץץåΤŬ֤̾Ƥޤλˡ°ΥץץåäƤޤȤΤʤ褦餫̾Υե˥ԡƤƤ
Linux, FreeBSD, CygWIN ǤˤĤƤ 3.9.5 򻲾ȤƤ GCC 3.*, 4.* ǤˤĤƤ 3.9.7, 3.9.7.1 򻲾ȤƤMinGW ǤˤĤƤ 3.9.7.1 򻲾ȤƤ

°Υѥɥ饤Ф̾ˡǤ mcpp ϤˡΤʤץ⤢ޤ
Gcc Ǥ -Wp ȤޥƥץȤȡɤʥץǤץץåϤȤǤޤ㤨С

gcc -Wp,-W31,-Q23

Ȥȡץץå -W31 -Q23 ȤץϤޤץץåϤץ -Wp, ³ , Ƕڤä¤٤ޤ*1, *2

¾νϤǤ⡢⤷ѥɥ饤ФΥСμΥޥƥץɲäۤɤǤ礦㤨С-P<opt> Ȼꤹ P Ȥä -<opt> ץץåϤ褦ˤƤȡɤʥץǤȤ褦ˤʤΤǤ

⤦Ĥˡϡ mcpp ǥץץơνϥե򥽡եȤƥѥϤ褦 makefile 񤯤ȤǤˡˤĤƤ 2.9, 2.10 򻲾ȤƤ

mcpp νϤȤΥץϰʲ̤ǤCompiler-independent ǤˤϤ󤳤ΥץϤޤ

LCC-Win32 ǤǤϼΥץ󤬻Ȥޤ

  • -g <n>
    ޥ __LCCDEBUGLEVEL <n> 롣
  • -O
    ޥ __LCCOPTIMLEVEL 1 롣

Visual C ǤǤϼΥץ󤬻Ȥޤ

  • -arch:SSE, -arch:SSE2
    ޥ _M_IX86_FP 򤽤줾 1, 2 롣
  • -Fl <file>
    GCC -include <file> Ʊ
  • -G<n>
    <n> 3, 4, 5, 6, B ǤСޥ _M_IX86 򤽤줾 300, 400, 500, 600, 600 롣
  • -GR
    ޥ _CPPRTTI 1 롣
  • -GX
    ޥ _CPPUNWIND 1 롣
  • -GZ
    ޥ __MSVC_RUNTIME_CHECKS 1 롣
  • -J
    ޥ _CHAR_UNSIGNED 1 롣
  • -RTC*
    -RTC1, -RTCc, -RTCs, -RTCu Υץ󤬻ꤵȡޥ __MSVC_RUNTIME_CHECKS 1 롣
  • -Tc, -TC
    C ΥǤ뤳Ȥؼ롣 ꤷʤƤƱ
  • -Tp, -TP
    -+ ץƱ
  • -u
    -N ץƱ
  • -Wall
    -W17 (-W1 -W16) Ʊ
  • -WL
    -j ץƱ
  • -w
    -W0 ץƱ
  • -X
    -I- ץƱ
  • -Za
    ޥ _MSC_EXTENSIONS ̤ˤidentifier '$' Ȥʤ褦ˤ롣
  • -Zc:wchar_t
    ޥ _NATIVE_WCHAR_T_DEFINED, _WCHAR_T_DEFINED 򤽤줾 1 롣
  • -Zl
    ޥ _VC_NODEFAULTLIB 1 롣

Mac OS X mcpp Ǥ GCC-specific-build Ǥ compiler-independent-build Ǥ⡢Υץ󤬻Ȥޤ

  • -F <framework>
    <framework> ǥ쥯ȥɸ framework ǥ쥯ȥͥ褷ƥ롣 ɸ framework ǥ쥯ȥϥǥեȤǤ /System/Library/Frameworks, /Library/Frameworks Ǥ롣

Mac OS X GCC-specific-build ǤϼΥץ󤬻Ȥޤ

  • -arch <arch>
    åȥޥΥƥǥեȤΤΤ <arch> ѹ롣 ˤäơޥΤĤѤ롣 <arch> ȤͭʤΤ x86 μ¹ԥץǤ i386, x86_64ppc μ¹ԥץǤ ppc, ppc64 Τɤ줫Ǥ gcc ޥɤˤϣĤΤɤǤϤ롣gcc ޥɤ -arch i386, -arch x86_64 Τɤ줫ꤹ x86 ѤΥץץåƤӽФ-arch ppc, -arch ppc64 Τɤ줫ꤹ ppc ѤΥץץåƤӽФˡ

GCC (GNU C) ǤǤϡʲΡʤ 2.6 νޤǤΡ˥ץ󤬻ȤޤʤGCC ѤǤ __STDC__ 1 ˤƤΤǡ-S1 ץϻꤷƤ⤷ʤƤƱǤ

ޤmcpp Υ⡼ɤˤʤץϼΤȤǤ

  • -$
    -fno-dollars-in-identifiers Ʊ
  • -b
    ֹäΥΥǽϤ롣
    ץץå饳ѥΤؤιֹμϤ
    #line 123 "filename"
    
    ȤäΥƱǤǤϤ̤Ǥ뤬ηϻȤʤϤ⤢롣mcpp ϤΤ褦ʽѤ build ǤϡνϤΥѥΤμǹֹϤΤǥեȤλͤǤ롣
    νǤǤ⡢ΥץȤȡäΥΥǹֹϤ롣
    ΥץϡϤ⤦٥ץץΤΤΤǡ#pragma MCPP preprocess Ȥ߹碌ƥإåեΡ֥ץץץפ򤹤˻Ȥ
  • -dD, -dM
    ץץκǸˤλͭʥޥ #define ԤηǽϤ롣-dM ץǤϥץץ̤ϽϤʤޤ줿ޥ⵬ʤɸޥǤʤнϤ롣-dD ץǤϥץץ̤Ϥ롣ޤޥϽϤʤ*3, *4
  • -fexceptions
    ޥ __EXCEPTIONS 1 롣
    -fno-exceptions ǤϤΥޥʤ
  • -finput-charset=<encoding>
    -e <encoding> ץƱGCC ϤΥץꤹ <encoding> UTF-8 Ѵ뤬mcpp ѴϤʤȤա
  • -fno-dollars-in-identifiers
    Identifier '$' ǧʤʥǥեȤǤǧˡ
  • -fPIC, -fpic, -fPIE, -fpie
    ޥ __PIC__, __pic__ Ȥ 1 롣
  • -fstack-protector
    ޥ __SSP__ 1 롣
  • -fstack-protector-all
    ޥ __SSP_ALL__ 2 롣
  • -fworking-directory
    ϤΣܤ˥ȥǥ쥯ȥɽ̤ #line ԤϤ롣
  • -I-
    ΥץȸȤ -I <directory> ץλͤѤ롣Υץ -I ǻꤵ줿ǥ쥯ȥ #include "header.h" ηΥإåեΥˤȤ롣Υץθ -I ǻꤵ줿ǥ쥯ȥϤ٤Ƥ #include directive Υ˻Ȥ롣ޤ#include "header.h" ηǤ include Υǥ쥯ȥϥʤ
  • -include <file>
    ᥤΥեˡ<file> #include ʥƬ #include <file> Ƚ񤤤ΤƱ̤ˤʤˡ
  • -iquote <dir>
    <dir> #include "header.h" ηΥإåեΥѥ˲ä롣
  • -isysroot=<dir>, -isysroot <dir>, --sysroot=<dir>, --sysroot <dir>
    <dir> system header directory root Ȥߤʤ ʤ<dir> system header directory path-list Ƭդ롣 㤨Сinclude directory /usr/include <dir> /Developer/SDKs/MacOSX10.4u.sdk Ǥ /Developer/SDKs/MacOSX10.4u.sdk/usr/include Ȥ롣
  • -isystem <dir>
    <dir> 򥤥󥯥롼ɥѥ system-specific directory ˡsite-specific directory θˡ˲ä롣
  • -lang-c, -x c
    C ΥץץԤꤷʤƤƱ
  • -mmmx
    ޥ __MMX__ 1 롣
    -mno-mmx Ǥ __MMX__ ʤ
  • -nostdinc
    ¾νϤǤ -I- ץƱ
  • -undef
    -N ץƱ
  • -O?
    ? 0 ʳοǤХޥ __OPTIMIZE__ 1 롣
  • -Wcomment, -Wcomments, -Wsign-compare
    -W1 ץƱꤷʤƤƱ
  • -Wundef
    -W4 ץƱ
  • -Wtrigraphs
    -W16 ץƱ
  • -Wall
    -W17 (-W1 -W16) ץƱclass 2, 4 warning Linux ɸإåǤȯ䤹뤵Τǡ-Wall ϤƤ롣class 8 warning ̾;פʤǤ롣ˤ portability ΤͭѤʻȤƻ롣Ȥ gcc -Wp,-W31 Ȥ뤳ȡˡ
  • -w
    -W0 ץƱ

GCC Ǥ Standard ⡼ɤǤϼΥץ󤬻Ȥޤ

  • -ansi
    __STRICT_ANSI__ ޥ 1 롣 linux, i386 εʰȿλޥ̵ˤ롣 GCC ͤβѰޥθƤӽФǤϡѰ¸ߤʤƤ⤽ľΥޤʤ*5
  • -digraphs
    Digraph ǧ-2 Ǥȿžͭˡ
  • -lang-c89, -std=gnu89
    -S1 ץƱꤷʤƤƱC90 Ǥʤ C95 λͤޤޤ롣
  • -std=c89, -std=c90
    -S1 ץȤۤƱǤ뤬-ansi ްդ롣
  • -lang-c99, -lang-c9x, -std=gnu99, -std=gnu9x
    -V199901L ץƱ
  • -std=c99, -std=c9x
    -V199901L ץȤۤƱǤ뤬-ansi ްդ롣
  • -lang-c++, -x c++
    C++ ΥץץԤ-+ Ʊ
  • -std=c++98
    -+ ȤۤƱǤ뤬-ansi ްդ롣
  • -pedantic, -pedantic-errors
    -W7 (-W1 -W2 -W4) ץƱ
  • -std=iso<n>:<ym>
    ʤΥСꤹ롣<n> C Ǥ 9899 ǤꡢC++ Ǥ 14882 Ǥ롣<n> 9899 ξϡ<ym> 1990, 199409, 1999, 199901 Ǥ롣<n> 14882 ξϡ<ym> 199711 Ǥ롣<ym> ˤ¾ͤꤵ줿ϡ__STDC_VERSION__ ޤ __cplusplus ͤʤξ 200503 Ȥ褦ˣǻꤹ뤳ȡˡ
    ΥץǤ -ansi ꤷȤˤʤ롣 ¾ǡ-std=gnu* -ansi ްդʤ -pedantic -ansi ްդʤ

GCC Ǥ STD ⡼ɤǤϼΥץ󤬻Ȥޤ

  • -lang-asm, -x assembler-with-cpp
    ¾νϤǤ -a Ʊ lang-asm ⡼ɤˤ롣 GCC-specific-build Ǥϥޥ __ASSEMBLER__ 1 졢identifier '$' ϻȤʤʤ롣 ϥե̾ *.S ǤȤϤΥץꤷʤƤ⡢Υ⡼ɤˤʤ롣
  • -trigraphs
    Trigraph ǧ-3 Ǥȿžͭˡ

GCC Ǥ pre-Standard ⡼ɤǤϼΥץ󤬻Ȥޤ

  • -traditional, -traditional-cpp
    -@old Ʊ

CygWIN / GCC ǤǤϼΥץ󤬻Ȥޤ

  • -mno-cygwin
    Include directory /usr/include /usr/include/mingw ѹޥ cygwin1.dll Ѥ msvcrt.dll Ѥѹ롣

ΥץϤ⥨顼ˤϤޤ󤬡бޤʥ˥󥰤Ф⤢ˡ

  • -A <predicate(answer)>
    GCC ǤϤΥץϥ #assert <predicate(answer)> Ƚ񤤤ΤƱ̤ˤʤ뤬#pragma Ǥʤĥǥ쥯ƥ֤ Standard C ǤǧʤΤǤ롣ޤޤǤΤȤ gcc ϥǥեȤǤ -D ץƱΥޥ cpp ϤƤΤǡºݤˤϤۤȤɤξ硢پϤʤ#assert ȤäƤ뵩ʥǤʤ¤ˡ
  • -g <n>
  • -idirafter <dir>
  • -iprefix <dir>, -iwithprefix <dir>, -iwithprefixbefore <dir>
  • -noprecomp
  • -remap

GCC V.3.3 ʹߤǤϥץץåѥ˵ۼΩץץå¸ߤʤʤäᡢgcc -no-integrated-cpp ץդƸƤӽФƤ⡢ץץåΥץǤϤʤץ󤬥ץץåϤƤ뤳ȤޤGCC V.3.3 ʹѤ mcpp ǤϡΤ褦ʤΤΤ mcpp ǧʤΤϤμΤˤץȤ̵뤷ޤ

  • -c
  • -E
  • -f*
  • -m*
  • -quiet
  • -W*

:

*1 -Wa ϥ֥Ѥ -Wl ϥѤΥޥƥץǤ롣 UNIX / System V / cc Υޥ˥奢򸫤ȡϤꤳΥץ󤬤롣GCC / cc -W<x> ץϤȤθߴΤΤΤʤΤǤ

*2 GCC V.3 Ǥ cpp cc1 (cc1plus) ˵ۼƤޤäΤᡢ-Wp ǻꤷץ̾ cc1 (cc1plus) ϤƤޤץץ cc1 ǤϤʤ cpp (cpp0) ˤ뤿ˤϡgcc θƤӽФ -no-integrated-cpp Ȥץꤹɬפ롣

*3 GCC V.3.3 ʹߤǤ̤Υޥ褦ˤʤäϻޥȤƤϰʤʤ-dD ץǤ⤳ΥޥϤ롣

*4 #pragma MCPP put_defines (#put_defines) νϤ -dM ץȤۤƱͤǤ롣äƤ롣

  1. put_defines ǤɸޥȤƵꤵƤΤ⡢ȤηǽϤ롣
  2. put_defines ǤϤΥޥΤե̾ȹֹ⥳ȤηǽϤ졢ޤɤߤ䤹褦˷ƽϤ뤬-d* ץǤ GCC ƱǽϤ롣ηꤷƤ makefile ⸫ݤ뤫Ǥ롣

*5 3.9.6.3 򻲾ȤΤȡ


2.7. Ķѿ

Compiler-independent Ǥ mcpp Ǥ include ǥ쥯ȥ UNIX OS Ǥ /usr/include, /usr/local/include ʳϥǥեȤǤꤵƤʤΤǡ¾Υǥ쥯ȥɬפǤСĶѿ¹ԻץǻꤷʤФʤޤCompiler-independent ǤδĶѿ C Ǥ INCLUDEC++ Ǥ CPLUS_INCLUDE ǤեΥϥǥեȤǤϥեΤǥ쥯ȥȤޤ 4.2 򻲾ȤΤȡˡLinux Ǥ include ǥ쥯ȥ˺𤬤Τǡ̤кɬפǤˤĤƤ 3.9.9 򻲾ȤƤ

GCC ǤǥǥեȤꤵƤ system include ǥ쥯ȥˤĤƤϡnoconfig/*.dif ե򸫤Ƥޤinclude ǥ쥯ȥΥȴĶѿ̾ˤĤƤϡ 4.2 򸫤Ƥ

Ķѿ LC_ALL, LC_CTYPE, LANG ˤĤƤϡ 2.8 򸫤Ƥ


2.8. Multi-byte character encoding

mcpp multi-byte character ¿ͤ encoding бƤޤ

EUC-JP ܤ extended UNIX code (UJIS)
shift-JIS ܤ MS-Kanji
GB-2312 EUC-like encoding ʴλ
Big-Five Ѥ encoding λ
KSC-5601 ڹ EUC-like encoding (KSX 1001)
ISO-2022-JP1ݵʤܸ
UTF-8 unicode encoding Σ

ơ¹Ի˼Τ褦ʤĤˡǼºݤ˻Ȥ encoding ꤷޤ̤ͥϤνΤȤǤ

  1. #pragma __setlocale( "<encoding>") ǻꤵ줿 encoding Visual C ѤǤ #pragma setlocale( "<encoding>") ˡȤȡܤΥեǤʣ encoding ȤȤǤ롣
  2. ¹Իץ -e <encoding> ޤ -finput-charset=<encoding> ǻꤵ줿 encoding
  3. Ķѿ LC_ALL, LC_CTYPE, LANG ǻꤵ줿 encoding̤ͥϤνˡ
  4. mcpp 򥳥ѥ뤹ꤵ줿ǥեȤ encoding
#pragma __setlocale-e ץ󡢴ĶѿǻǤ <encoding> ϸ§Ȥƶ̤ǡΤȤǤդ <encoding> Ϻդ encoding ꤷޤ<encoding> ʸʸζ̤򤷤ޤ󡣤ޤ'-', '_' ̵뤷ޤ '.' ȡޤǤ򤹤٤̵뤷ޤäơȤ EUC_JP, EUC-JP, EUCJP, euc-jp, eucjp, ja_JP.eucJP Ϥ٤ƱΤȤưޤޤ* Ǥդʸ̣ޤiso8859-1, iso8859-2 iso8859* ˥ޥåˡ

EUC-JP eucjp, euc, ujis
shift-JIS sjis, shiftjis, mskanji
GB-2312 gb2312, cngb, euccn
BIG-FIVE bigfive, big5, cnbig5, euctw
KSC-5601 ksc5601, ksx1001, wansung, eucKR
IS0-2022-JP1iso2022jp, iso2022jp1, jis
UTF-8 utf8, utf
ʤ c, en*, latin*, iso8859*

C, en* (english), latin*, iso8859* Τɤ줫ꤹȡmulti-byte character ǧʤʤޤASCII ǤϤʤ ISO-8859-* Latin Ϥ single-byte character Ȥϡꤷޤ#pragma __setlocale( "") ȶ̾ꤹȡǥեȤ encoding ޤ

ΤۤVisual C++ Ѥ #pragma setlocale ˸¤äơΤΤȤޤ Visual C++ ȤθߴΤѰդƤΤǤVisual C++ Ǥϥѥ餬ǤʤǧʤΤǡȤäۤɤǤ礦'-' mcpp ǤϾάǤ뤬Visual C++ ΥѥФƤϾάǤʤˡVisual C++ Ǥ C, english Ȥޤ

shift-JISjapanese, jpn
GB-2312 chinese-simplified, chs
BIG-FIVE chinese-traditional, cht
KSC-5601 korean, kor

Visual C++ ǤϡWindows ɤιѤǤ뤫ˤäƥǥեȤ multi-byte character encoding Ѥ뤳ȤˤʤäƤޤޤWindows ΡϰȸΥץפλˤäƤѤޤεǽȾüǤäǤ#pragma setlocale ˤϤͥ褷ޤ

GCC shift-JIS, ISO2022JP, BIG-FIVE Τ褦 multi-byte character 0x5c ͤĥХȤޤ encoding ϤޤǤʤ礬ΤǡGCC ǤǤ mcpp 䤤ޤ*1

:

*1 GCC configure --enable-c-mbchar Ȥץդȡ GCC ǤϴĶѿ LANG C-EUCJP, C-SJIS, C-JIS Τɤ줫˥åȤ뤳Ȥˤä encoding Ǥ뤳ȤˤʤäƤ롣 configuration 1998 餢ΤΤ褦Ǥ뤬ºݤˤϻȤƤ餺ȤäƤưʤ GCC Ǥ mcpp ǤϤ LANG=C-SJIS δĶѿ򥵥ݡȤƤV.2.7 ѻߤ
GCC Ǥ LANG Τۤ LC_ALL, LC_CTYPE Ǥ encoding Ǥ뤳ȤˤʤäƤ뤬ºݤˤϿǥåѤǤ롣


2.9. ѥѥ mcpp Ȥˤ

Visual C, Borland C, LCC-Win32 Τ褦˥ץץåѥ餫ΩƤʤ֥ѥѥפ¿ʤäƤޤ®٤夲뤿Ȼפޤץץפ֤ϸߤΥϡɥǤϾʤΤˤʤäƤޤޤ⤽ץץȤΤϼ¹ԻĶϤϤۤΩ̤ΥեǤ뤳Ȥ礭ʰ̣Τǡ֥ѥѥפ¿ʤΤϷ褷ɤȤȤϻפޤ󡣥ץץνϰ¸λ̤ͤˤʤޤ

Ȥ⤢ѥѥǤϡץץå mcpp ֤뤳ȤǤޤ󡣤äơmcpp Ȥˤϡޤ mcpp ǥץץνϤ򥳥ѥϤޤѥˤäƺ٥˥ץץ뤳ȤˤʤޤǤ򤨤ޤ󡣤Ǥ⡢mcpp ȤȤϥåΤͭǤꡢ°ΥץץåˤϤʤǽȤȤǤޤ
ѥѥ mcpp Ȥˤϡμ makefile ˽ɬפޤΥץȤƤϡmcpp ȤΥѥ˻Ȥ visualc.mak, borlandc.mak, lcc_w32.mak makefile ΥꥳѥѤ򸫤Ƥ

ʤGCC 3, 4 Ǥϥѥ餬ץץǽ¢褦ˤʤäΤΡץץåȤץѰդƤΤǡѤ뤳Ȥ mcpp ʤȤȤǤޤ3.9.7 ȡˡ


2.10. 糫ȯĶ mcpp Ȥˤ

GUI Τ糫ȯĶ(IDE) ȤΤϽȼλͤǤꡢŪʥ󥿥ե̾ϸƤʤΤǡ mcpp ȤˤϺ񤬤ޤξ塢ѥ餬ѥѥǤȡ mcpp ȤեΤϤ˺Ǥ

Ǥ Windows Visual C++ 2003, 2005, 2008 IDE mcpp ȤˡޤBorland C Ǥ LCC-Win32 Ǥϡޥɥ饤ǻȤäƤ

ޤMac OS X Xcode.app / Apple-GCC mcpp Ȥˡޤ

2.10.1. Visual C++ IDE mcpp Ȥˡ

Visual C++ IDE Ūʥ󥿥եƤ餺⥳ѥ餬ѥѥʤΤǡ̾Ρ֥ץȡפǤ mcpp ȤȤǤޤ󡣤mcpp Ȥ makefile 񤤤ƤСǡ֥ᥤեץȡפ뤳ȤǤޤơԽ両䡢˥٥ǥХåǽޤ IDE ȾεǽȤȤǤޤ

֥ᥤեץȡפˤϼΤ褦ˤޤˡ Visual C++ .net 2003 ɥȡפӡVisual C++ 2005 Express EditionסVisual C++ 2008 Express EditionפΡ֥إספΡ֥ᥤեץȤκפ˽񤤤ƤΤǤ

  1. IDE ΥǥХåǽȤ¤ĥ桼Ȥƥ󤹤롣*1
  2. mcpp Ȥ makefile 񤤤Ƥnoconfig/visualc.mak 򻲾ȡˡ*2
  3. Visual Studio ư롣*3
  4. ֿץȡפ򥯥å 줿ֿץȡפΥɥǡ֥ᥤե ץȡפӡ֥ץ̾פȡ־פꤷơOKפ򥯥å롣
  5. ȡ֥ᥤե ץꥱ ɡפΥɥΤǡ֥ץꥱפ򥯥åǡ֥ӥɥޥɥ饤סֽϡס֥꡼󥳥ޥɡסʤޤϡ־õޥɡסˡ֥ӥɥޥɡפϤ롣ѸϤ狼ˤmcpp Ȥ compiler-independent ǤΥѥˤȤȼΤ褦ʤȤǤ mcpp μ¹ԥץ̾ mcpp.exe Ȥˡ
    ֥ӥɥޥɥ饤:   nmake
    ֽϡ                :   mcpp.exe
    ֥꡼󥳥ޥɡ    :   nmake clean
    ֥ӥɥޥɡ    :   nmake PREPROCESSED=1
    
    mcpp Visual C Ǥ򥳥ѥ뤹 COMPILER=MSC ȤץդäƼΤ褦ˤ롣
    ֥ӥɥޥɥ饤:   nmake COMPILER=MSC
    ֽϡ                :   mcpp.exe
    ֥꡼󥳥ޥɡ    :   nmake clean
    ֥ӥɥޥɡ    :   nmake PREPROCESSED=1 COMPILER=MSC
    
    ֥ᥤեץȡפǤ make install 륳ޥɤʤΤǡ֥ӥɥޥɥ饤ס֥ӥɥޥɡפǻꤵ륳ޥɤǤ install ¹Ԥ褦 makefile 񤤤Ƥɬפ롣*4
    mcpp 򥳥ѥ뤹ΤǤʤС֥ӥɥޥɥ饤פȡ֥ӥɥޥɡפȤ̾Ʊɤ
    Ϥ顢ִλפ򥯥å롣
  6. ȡ ֥塼󥨥ץפ˥ץȤΤǡΡ֥եפȤե򥯥åơơ˥塼Ρ֥ץȡפִ¸ܤɲáפӡե򤹤٤򤷤ơOKפ롣ȡ֥塼󥨥ץפ˥ե̾롣

ǡԽס֥ӥɡס֥ӥɡס֥ǥХåεǽ٤ƻȤ褦ˤʤޤ

:

*1 VC 2003, 2005 ǥǥХåǽȤˤϡWindowsXP Pro, Windows2000 Ǥ "Debugger users" Ȥ롼פ˥桼°ɬפ롣WindowsXP HE ǤϤ롼פϤʤΤǡԤȤƥ󤷤ʤФʤʤ
VC 2008 Ǥϥ桼롼פ¤Ϥʤʤä

*2 ٥롦ǥХåǽȤˤ cl.exe θƤӽФ -Zi ץղäơǥХå褦 makefile 񤤤Ƥɬפ롣

*3 ֥ȡ->֥ץפ鵯ưȡ󥯥롼ɥǥ쥯ȥδĶѿꤵʤꤹˤˡVisual Studio ޥɥץץȡפ򳫤ơեΤǥ쥯ȥ˰ư VC 2003 Ǥ

devenv *.sln /useenv

ȤơVC 2005, 2008 express edition Ǥ

vcexpress *.sln /useenv

ȤƵưʤФʤʤ

*4 󥹥ȡ뤹ǥ쥯ȥˤϥ桼񤭹ߤθ¤äƤʤФʤʤ Ϥ bin, lib Υǥ쥯ȥ˽񤭹ϡΥѡߥåԸ¤ѹƤɬפ롣 "Power users" ޤ "Authenticated users" Ȥ롼פ˥桼ϿΥ롼פ˳Υǥ쥯ȥؤΡֽ񤭹ߡסѹפθ¤Τɤ ⤦Ĥˡϡֶͭǥ쥯ȥפΤ褦ʡ桼񤭹߸¤ĥǥ쥯ȥ˽Ϥ򥤥󥹥ȡ뤹뤳ȤǤ롣

2.10.2. Mac OS X / Xcode.app mcpp Ȥˡ

Mac OS X IDE Ǥ Xcode.app mcpp 򥤥󥹥ȡ뤷֤ʤȤȤǤޤ*1

Xcode.app Ϥʤ /usr/bin ǤϤʤ /Developer/usr/bin ˤ gcc (g++) Ȥޤ/Developer Xcode ΥǥեȤΥ󥹥ȡǥ쥯ȥˡ äơmcpp Ȥˤϡ gcc (g++) Ѥ GCC-specific-build 򥤥󥹥ȡ뤹ɬפޤ ΤˤϼΤ褦ˤޤ${mcpp_dir} mcpp ΥΤǥ쥯ȥˡ

export PATH=/Developer/usr/bin:$PATH
configure ${mcpp_dir}/configure --enable-replace-cpp
make
sudo make install

PATH ʳ /usr/bin Υѥ˥󥹥ȡ뤹ƱʤΤǡѥؤΥ󥹥ȡ universal binary 򥤥󥹥ȡ뤹ˡʤɤˤĤƤϡINSTALL-jp 򸫤Ƥ

mcpp 򥤥󥹥ȡ뤷ƤСȤ mcpp Τ̤Ϥ Xcode.app Ȥޤ Xcode.app Apple-GCC ͭ *.hmap Ȥ̾ "header map file" ʤΤޤ mcpp ǽޤ mcpp precompiled header νϤʤΤǡ#include *.pch ̾ΥإåեȤɤ߹ޤޤ ޤmcpp Objective-C, Objective-C++ νϤʤΤǡ*.m, *.mm ΥեΥץץ mcpp ̤餺 cc1obj, cc1objplus ľܡϤޤ

mcpp ȼΥץȤϡXcode.app β̥ȥåפΥ˥塼СΡ֥ץȡפ֥ץԽפǥåǸץȥǥΥɥǡ֥ӥɡץڥǡ֤¾ C ե饰פιܤԽޤ ץϼΤ褦 -Wp, ³ƥޤǶڤʤꤷޤ

-Wp,-23,-W3

:

*1 Ǽ夲Τ Mac OS X Leopard / Xcode 3.0 Ǥ롣


3. ĥǽȸߴ

mcpp ˤϤĤθͭγĥǽޤޤƽ°ΥץץåˤϤ줾γĥǽޤΰ mcpp ǤϻȤޤ󡣤ǤϤĥǽȸߴޤ

ʤStandard ⡼ɤǤ #pragma Ԥϸ§ȤƤΤޤ޽Ϥޤmcpp ȤΤˤĤƤƱͤǤƱ #pragma ѥΤˤȤäƤ̣IJǽ뤿Ǥ
#pragma MCPP ǻϤޤԤ mcpp ѤΤΤʤΤǽϤޤGCC ǤǤϡ#pragma GCC poison, dependency, system_header Τɤ줫³ԤϤޤ󡣤ޤ#pragma once, #pragma push_macro, #pragma pop_macro ⥳ѥΤˤȤäƤ̵ѤʤΤǽϤޤ ¾ǡ#pragma GCC visibility * ϥѥȥ󥫤ΤΤΤʤΤǡϤޤ*1

EXPAND_PRAGMA == TRUE ǥѥ뤵줿 mcpp Ǥ #pragma ԤΰϥޥŸоݤȤʤޤʼºݤˤ EXPAND_PRAGMA == TRUE Visual C, Borland C ǤǤˡ#pragma STDC, MCPP, GCC Τɤ줫³ԤŸޤ

#pragma sub-directive implementation-defined ǤΤƱ̾ sub-directive Ϥˤäưۤʤ̣Ķ줬ޤ̾ξͤ򤱤빩פɬפǤޤEXPAND_PRAGMA == TRUE ξϡ#pragma sub-directive ̾ȤޥŸƤϺΤǡ桼֤̾ȽŤʤʤ褦ˤȤߤɬפǤmcpp ͭ sub-directive #pragma MCPP ǻϤޤޥŸʤΤϤΤǤC99 ǵꤵ줿 #pragma STDC GCC 3 #pragma GCC ˡΤ줿ΤǤ
#pragma once ¿νϤ˼̾ͤ붲ϤʤʤäƤΤǡ̾Τޤ޼Ƥޤޤ#pragma __setlocale ϥѥΤФƤɬפʤΤ MCPP Ȥ̾դ"__" Ƭդƥ桼֤̾ȽŤʤʤ褦ˤƤޤ

*1 mcpp GCC-specific-build Ǥϡ#pragma GCC ǻϤޤ pragma Τ system_header ݡȤƤ롣poison, dependency ϥݡȤʤ


3.1. #pragma MCPP put_defines, #pragma MCPP preprocess

#pragma MCPP put_defines, #pragma MCPP preprocess, #pragma MCPP preprocessed Standard ⡼ɤΤΤǡ#put_defines, #preprocess, #preprocessed pre-Standard ⡼ɤΤΤǤʲǤ #pragma ˤȤäޤ

#pragma MCPP put_defines ǥ쥯ƥ֤˽в񤦤 mcpp ϡλƤ뤹٤ƤΥޥ #define ԤηǽϤޤ#undef 줿ΤϽФƤޤ__STDC__ #define, #undef оݤˤǤʤΤϡ #define ԤηȤäơȥޡǰϤǽϤޤ__FILE__, __LINE__ ϥޥƤӽФưŪüʥޥʤΤǡǽϤִꥹȤ̵̣ʤΤǤˡ
pre-Standard ⡼ɤ POSTSTD ⡼ɤǤϡfunction-like ޥΥѥ᡼̾ϵޤ󡣤ǤΥǥ쥯ƥ֤Ǥϡѥ᡼̾裱ѥ᡼˵Ū a, b, c, ... Ȥ̾ɽޤ27 ܰʹߤΥѥ᡼ˤ a1, b1, c1, ..., a2, b2, c2, ... Ȥ̾Ȥޤ

mcpp ϥեϥեꤻ˵ươܡɤ餤ʤ

#pragma MCPP put_defines

Ǥȡޥ򤹤٤Τ뤳ȤǤޤ줾ΥޥΤ륽ե̾ȹֹɽ륳ȤϤޤ-S1, -N ΥץդƵưȡ줾ޥäƤ뤳Ȥ狼ޤ

#pragma MCPP preprocess Ȥǥ쥯ƥ֤˽в񤦤 mcpp ϡ

#pragma MCPP preprocessed

ȤԤϤޤϡΥեϥץץѤߤǤ뤳Ȥ򼨤ΤǤ

#pragma MCPP preprocessed Ȥǥ쥯ƥ֤˽в񤦤 mcpp ϡΥե mcpp ˤäƥץץѤߤǤȽǤơ#define ԤФƤޤǤϤ򤽤Τޤ޽Ϥ˥ԡޤơ#define ԤФƤȡȤϤ٤ #define ԤǤȽǤơޥޤˤ륽ե̾ȹֹξ⵭ޤ*1, *2
#pragma MCPP preprocessed ͭϰϤϤΥǥ쥯ƥ֤Τ륽եΤι԰ʹߤǤΥե뤬 #include 줿ΤǤϡinclude ̾Υץץޤ

:

*1 ºݤνϤ⤦ʣǤ롣#pragma MCPP preprocessed ϹԤȾ򤽤Τޤ޽Ϥ˥ԡ뤬ɸޥ #define Ԥȥޡ˰ϤޤƤΤǡιԤϼΤƤ롣ޤνѤǤǤ #line ԤϽϤΥѥΤѴƽϤ롣

*2 äơpre-preprocess Ƥޥξξϼʤ

3.1.1. إåե pre-preprocess

嵭Υǥ쥯ƥ֤ѤȡإåեΡ֥ץץץפ򤹤뤳ȤǤޤ֥ץץץפ򤷤Ƥȡ֤Υץץ֤ʤṳ̂ޤˡϡ嵭λͤǤǤˤ狼äȻפޤǰΤ mcpp ȤΥˤȤäޤ

mcpp Υˤϣܤ *.c ե뤬ꡢΤΣܤϤɤ "system.H" "internal.H" include Ƥޤơ¾Υإå include Ƥޤ󡣤äΤ˸ȡǤϤʤäƤޤ

#if PREPROCESSED
#include    "mcpp.H"
#else
#include    "system.H"
#include    "internal.H"
#endif

ơsystem.H noconfig.H ޤ configed.H ȤĤɸإå include Ƥޤmcpp.H ϻ󶡤륽ˤϤޤ󡣤줬줫 "pre-pre-processed" header ʤΤǤ

mcpp.H ˤϡʤ noconfig.H ꤬Ǥˡ

mcpp > mcpp.H

Ȥ mcpp ưޤGCC Ǥϡ-b ץդˡ
ơܡɤ

#pragma MCPP preprocess
#include "system.H"
#include "internal.H"
#pragma MCPP put_defines

Ǥߡend-of-file Ϥ mcpp λޤ

mcpp.H Ǥޤ system.H, internal.H ץץΤ #define ԤνդäΤǤ include Сsystem.H, internal.H include ΤȤޤäƱ̤뤳ȤǤޤơɸإåޤีΥإåեפοʬΣΥˤʤäƤޤ#if ȥȤäƤ뤫Ǥܤ *.c ե include Τϡsystem.H, internal.H 򣷲 include Τ٤ơϤ뤫û֤Ǥߤޤ#pragma MCPP preprocess ȤȤǤ˻֤ṳ̂ޤ

֤ΥѥǤ -DPREPROCESSED=1 Ȥץդޤ
μϲΥե˽񤤤Ƥơmakefile Ǥ򻲾ȤΤɤǤ礦mcpp Υդ makefile preproc.c ˤϡ줬񤤤ƤΤǡ򸫤Ƥ
Visual C, Borland C, LCC-Win32 Τ褦ʣѥѥǤΩץץåλȤƻ¤ޤξǤ⤳εǽͭѤǤ

Υإåե pre-preprocess εǽϡGCC / cpp -dD ץεǽ򿿻ΤǤäƤޤ

  1. GCC Ϲֹ #line 123 "filename" ǤϤʤ # 123 "filename" ηǽϤ롣Τᡢ GCC Ǻƽ뤳ȤϤǤ뤬Standard C ΥץץåǤϤǤʤ
  2. GCC θŤ cpp Ǥ #define ԤϽиȤǽϤ뤬#undef ԤϽϤʤäơƽȸΰտޤȰۤʤ̤ˤʤ뤳Ȥä
  3. GCC ˤϤʤ #pragma MCPP preprocess ȤȤǡ®٤®ʤ롣
Pre-preprocess εǽȤƤϡmcpp Τְۤ㤤ʤŪǤ

3.2. #pragma once

#pragma once Standard ⡼ɤǻȤޤ
GCC, Visual C, LCC-Win32 Wave ȤñΥץץåǤ #pragma once ϻȤޤ
إåե򣱲󤷤󥯥롼ɤʤ˻Ȥޤإåե

#pragma once

Ƚ񤤤ƤȡΥե򥤥󥯥롼ɤ #include ԤФƤƤ⡢ǽΣ󤷤󥯥롼ɤޤ

̾ϡ°ɸإåǤ

#ifndef __STDIO_H
#define __STDIO_H
/* stdio.h    */
#endif

Ǥ¿ɤǤޤȻǽǤޥȤˡǤϥإåեɤޤʤǤޤȤϤǤޤʥåפʬǤ⡢#if, #endif ФƤΤƻ뤹뤿ˡɤޤʤФʤʤƬ # ǥ쥯ƥֹԡ# preprocessing directive ³ԡˤλؼǤ뤫ɤΤ뤿ˤϥȤʤФʤʤΤˤʸƥȽǤʤФʤʤǡɡɤ tokenization ȾޤǤʤФʤʤΤǤˡ
#pragma once ϡեؤΥ⤷ʤǤޤΤǤη̡¿ include ν®٤®ʤޤ

Header name ƱǤ뤫ɤϡѥΥǥ쥯ȥʬޤʸӤȽǤޤWindows Ǥʸʸ϶̤ޤ󡣤äơ"/DIR1/header.h" "/DIR2/header.h" ̤ΤΤȤư"header.h" "HEADER.H" Ȥ Windows ǤƱΡUNIX ϤǤ̤ΤΤȤưޤǥ쥯ȥХѥѴƵޤ"foo/../" ȤäĹʬϺޤUNIX ϤǤ symbolic link ϥѴޤäơƱեǤ뤫ɤϳμ¤Ƚꤵޤ*1, *2, *3

#pragma once GCC V.1.* / cpp #pragma once ΥǥѤΤǤGCC V.2.*, V.3.* Ǥ⤳εǽϻĤäƤޤobsolete ʤΤȤƤޤ#pragma once ʤƤ⡢إåեΤ #ifndef _MACRO, #define _MACRO, #endif ǰϤޤƤСcpp 򵭲󤷤 include ʤȤͤѹƤޤ
GCC V.2, V.3 λͤϡGCC λѤȤʤΤνϤʤɤǤϻȤʤȤޤɸإåνäƤ뤫Ǥޤ GCC V.2, V.3 λͤΤۤݤǤǡmcpp Ǥ #pragma once Ƥޤ

¾ΥץץåǤƱإåեȤϤ櫓ˤϤ椭ޤ󡣥ޥȤˡʻѤơإåե򼡤Τ褦ǤǤΤɤǤ礦

#ifndef __STDIO_H
#define __STDIO_H
#pragma once
/* stdio.h    */
#endif

<assert.h> ˤ #pragma once Ͻ񤤤ƤϤޤʤͳ cpp-test.html#5.1.2 ȡˡC++ <cassert>, <cassert.h> ƱͤǤ

⤦ĤϡGCC / GLIBC κǶΥƥǤ <stddef.h> Τ褦ˡ¾ system header 鷫֤ #include إåե뤬뤳ȤǤ¿ system header __need_NULL, __need_size_t, __need_ptrdiff_t, etc. ΥޥƤ <stddef.h> #include ޤΤӤˡ<stddef.h> Ǥ NULL, size_t, ptrdiff_t, etc. Ƥ椭ޤ<errno.h>, <signal.h> ƱͤǤ<stdio.h> Ǥ⡢¾ system header __need_FILE, __need___FILE ΥޥƤ #include <stdio.h> ΤӤ FILE Ƥ椯礬ޤΥեˤ #pragma once Ͻ񤭹櫓ˤϤޤ*4

:

*1 줿̤ #pragma MCPP debug path Ǹ뤳ȤǤ롣3.5.1 ȡ #pragma MCPP put_defines ǥåΥե̾ɽǤ⡢줬Ȥ롣
#line Ԥ path-list ϰ̤ˤƤ櫓ǤϤʤinclude directory ֤ɽ롣 -K ץǤɽ롣 Υ⡼ɤѤ¾ΥġνѰդˤ뤿Ǥ롣

*2 CygWIN Ǥ /bin /usr/bin/lib /usr/lib Ϥ줾Ʊǥ쥯ȥǡ/ Windows 㤨 C:/dir/cygwin Ȥ /cygdrive/c/dir/cygwin ⤽Ʊǥ쥯ȥǤ뤬mcpp ǤϤϤ٤Ʊǥ쥯ȥȤưpath-list Ϥ٤ /cygdrive/c/dir/cygwin/dir-list/file ηѴ롣

*3 MinGW Ǥ / /usr ȤϼºݤˤƱǥ쥯ȥǡ/ Windows C:/dir/msys/1.0 Ȥ /c/dir/msys/1.0 ⤽Ʊǥ쥯ȥǡ/mingw C:/dir/mingw Ȥ /c/dir/mingw ⤽Ʊǥ쥯ȥǤ롣mcpp ǤϤϤ줾Ʊǥ쥯ȥȤưpath-list Ϥ٤ c:/dir/msys/1.0/dir-list/file, c:/dir/mingw/dir-list/file ηѴ롣

*4 ʤȤ Linux / GCC 2.9x, 3.*, 4.* / glibc 2.1, 2.2, 2.3 ǤϤʤäƤ롣FreeBSD 4, 5, 6 Ǥ glibc ϻȤƤʤΤǡʣʥƥإåˤϤʤäƤʤ

3.2.1. إåե #pragma once 񤭹ġ

񤭹Τϥإåեοʤ礷ȤǤϤޤ󤬡¿ȼǤϤäȤȤˤʤޤǡưŪ˽񤭹ñʥġѰդޤ

tool/ins_once.c ϸŤ GCC ΥƥѤǤBorland C 5.5 ǤɸإåνƱ롼˽äƤΤǡȤȤǤޤGlibc 2 Τ褦ʥƥǤϾ嵭Τ褦㳰¿ΤǡȤʤ̵ۤǤ
줬Ȥ륷ƥǤ⡢إåեˤ GCC δ˽äƤʤΤ⻶ޤإåǤ GCC Ρ󤷤ɤ߹ޤʤȤǽưޤ
ǡins_once.c 򥳥ѥ뤷ơUNIX ʤ /usr/include, /usr/local/include Υǥ쥯ȥǡޤ

chmod -R u+w *

Ȥǡ

ins_once -t *.h */*.h */*/*.h

Ȥޤȡ#ifndef ޤ #if !defined ǻϤޤʤإåե뤬𤵤ޤΥإåǽƤ줫顢

ins_once *.h */*.h */*/*.h

Ȥȡƥإåեκǽ˽и #directive #ifndef ޤ #if !defined Ǥäϡľ #pragma once Ԥ񤭹ޤޤʤ줬ǤΤ root Υ桼ΤϤɬפʤ chmod -R u-w * Ȥơaccess permission 򸵤ᤷƤˡ

ins_once ˤϼΤ褦ʥץ󤬤ޤƥ˹碌Ŭʥץ򤷤Ƥ

  • -t: ե뤬ʥȤȡ#ifndef #if !defined ǻϤޤäƤ뤫ɤƥȤ롣եϽ񤭴ʤ
  • -p: եƬ #pragma once Ԥ񤭹ʥǥեȤǤ #ifndef / #if !defined Ԥμ˽񤭹ˡ
  • -g: GCC Τˡ<stddef.h>, <stdio.h>, <signal.h>, <errno.h> 񤭴ʤʥǥեȤǤϽ񤭴ʤΤ <assert.h>, <cassert>, <cassert.h> ˡ

ins_once ʣ¹ԤƤƱե˥֤äƽ񤭹ळȤϤʤ褦ˡñʥåϤƤޤ̩ʤΤǤϤޤ

ins_once ϴ֤˹碌ʤΤǡtokenization ϤۤȤɤäƤޤFreeBSD 2.0, 2.2.7, Borland C 5.5 γƥإåեǤϴ̤ư򤷤ޤüʥإåե뤬ȸư뤫⤷ޤins_once ɬХååפȤäƤ¹ԤƤ
磻ɥɤ shell ŸƤʥХåեСեϡ󤫤ʬƼ¹Ԥˡ


3.3. #pragma MCPP warning, #include_next, #warning

Υǥ쥯ƥ֤ GCC ȤθߴΤѰդƤΤǤGCC ˤ #include_next, #warning ȤʰȿΥǥ쥯ƥ֤ޤʰȿǤȤäƤ륽⵩ˤޤGlibc 2 ΥƥǤϡƥإåեˤȤäƤΤޤ mcpp ǤϡΥ򥳥ѥǤ褦ˤ뤿ᡢGCC Ѥ˸¤ä #include_next, #warning ƤޤStandard ⡼ɤǤϥ˥󥰤оݤȤʤޤStandard ⡼ɤǤ #pragma MCPP warning Ƥޤ GCC Ѥ˸¤ޤ

#include_next   <header.h>

include directory 򥵡ݤˡ include ΥեΤǥ쥯ȥ򥹥åפơμΥΥǥ쥯ȥ꤫饵Ϥޤ

CygWIN, MinGW Ǥϡإå̾ʸʸζ̵̤뤷ޤ

#pragma MCPP warning    any message

#warning    any message

Ǥϡany message 򤽤Τޤ warning Ȥɸ२顼Ϥ˽Ϥޤ #error Ȱäƥ顼ˤϤʤޤ


3.4. #pragma MCPP push_macro, #pragma __setlocale

Visual C mcpp ܿ˼ĤǤ¾νϤǤȤ褦ˤΤǤ

#pragma MCPP push_macro( "MACRO"), #pragma MCPP pop_macro( "MACRO") ϡλǤ MACRO Υޥ򥹥å "push" "pop" ꤹΤǤ
Visual C Ǥ #pragma push_macro( "MACRO"), #pragma pop_macro( "MACRO") Ȥޤ
push_macro ǤϤΥޥ򤵤졢pop_macro Ǹᤵޤpush Ƥ⤽ΥޥϤޤͭǤ̵ˤ뤿ˤ #undef 뤫ޤ̤Ǻɬפޤpush_macro ǤƱ̾Υޥ򲿽Ťˤ push 뤳ȤǤޤ

#pragma __setlocale( "<encoding>") multi-byte character encoding <encoding> ѹޤ__setlocale ΰʸƥǤʤФʤޤ<encoding> ˤĤƤ 2.8 򸫤ƤȤȡĤ translation unit Ǥʣ encoding ȤȤǤޤ
Visual C++ Ǥ #pragma setlocale Ǥꡢ#pragma __setlocale ϻȤޤEncoding λ mcpp Ǥʤѥˤɬפޤѥ餬ǧǤΤ #pragma setlocale Ǥ

#pragma __setlocale ǧǤ륳ѥΤϤޤΤȤޤ


3.5. #pragma MCPP debug, #pragma MCPP end_debug, #debug, #end_debug

#pragma MCPP debug, #pragma MCPP end_debug Standard ⡼ɤΤΤǤpre-Standard ⡼ɤǤ #debug, #end_debug Ȥʤޤ

#pragma MCPP debug <args> ǥ쥯ƥ֤ϥǤդιԤ˽񤯤ȤǤޤ<args> ǥǥХåμꤷޤĤ #pragma MCPP debug ǥ쥯ƥ֤ʣ <arg> ꤹ뤳ȤǤޤɬİʾ <arg> ꤬ɬפǤΥǥ쥯ƥ֤ȡǥХåνϤϤޤޤơ#pragma MCPP end_debug <args> ǡ<args> ΥǥХåϤޤ#pragma MCPP end_debug Ǥϡ<args> ά뤳ȤǤޤξϡꤵƤ٤ƤΥǥХåϤޤmcpp ǥݡȤʤ <args> ˤäϡ˥󥰤ФޤˤäͭǤ
ǥХåϤ٤ơץץνϤƱѥ˽ϤޤνϤƱ뤿ǤäơΥǥ쥯ƥ֤̾ϥѥǤޤ #pragma MCPP debug macro_call ǤϾϥȤǽϤΤǡƥץץƥѥ뤹뤳ȤǤޤ

ץץη̤˵䤬硢ʬ

#pragma MCPP debug token expand
/* ǥХåʬ   */
#pragma MCPP end_debug

ȤդˤϤǻȤޤ

mcpp ȤΥǥХåѤΤΤǤץץβȥ졼˻ȤޤŪŪʤΤǡ򸫤ʤǤʤȤ⤢ꡢ뤵⤢ޤޤ󤷤Ƥ

<arg> μϼ̤Ǥ

path include եΥѥɽ
token token 򣱤Ĥڤʬơμɽ
expand ޥƤӽФŸȥ졼
macro_callޥӥޥƤӽФ˺ݤơΥιԤȥ֤򥳥ȤǽϤ
if #if (#elif, #ifdef, #ifndef) οɽ
expression#if ɾȥ졼
getc ץץ 1 byte ĥȥ졼
memory mcpp λȤäƤҡץξɽ

3.5.1. #pragma MCPP debug path, #debug path

Υǥ쥯ƥ֤˽в񤦤 mcpp ϡޤꤵƤ include ǥ쥯ȥΥѥ̤ͥι⤤Τɽޤʤǽ˥륫ȥǥ쥯ȥꤪӥΥǥ쥯ȥϾάˡ

ˡ#include ԤȡΥإåե include 뤿 mcpp ºݤ˥ǥ쥯ȥ꤬ʥȥǥ쥯ȥޤơˤ٤ɽޤ
#pragma once Τإåե #include ϡλݤɽޤ
ޤmcpp path-list "foo/../" ȤäĹʬޤη̡ path-list Ȱä path-list Ȥʤäϡλݤɽޤ
UNIX ϤΥƥǤ mcpp symbolic link link Ѵޤξ⤽λݤɽޤ

3.5.2. #pragma MCPP debug token, #debug token

ޤɤ߹Ԥɽǡmcpp token 򣱤ɤिӤˡ token ȼɽޤToken ȤΤ˸ preprocessing-token (pp-token) ΤȤǤɤФǤϤʤmcpp ޥŸʤɤŪɤ֤ pp-token ⡢ΤĤɡʷ֤ơɽޤ

1 byte pp-token ΤΤΤɽޤ󡣤ϥץΤĤˤΤǤ

  1. ץץǥ쥯ƥֹԤγϤ '#'
  2. function-like ޥΥѥ᡼ꥹȳϤ '('
  3. function-like ޥΥѥ᡼ڤ ','
  4. function-like ޥƤӽФΰꥹȳϤ '('

Pp-token μϼ̤Ǥ

(NAM) identifier
(NUM) preprocessing-number
(OPE) operator or punctuator
(STR) string literal
(WSTR)wide string literal
(CHR) character constant
(WCHR)wide character constant
(SPE) $, @ ü pp-token
(SEP) token separator (white space)

Τ (SEP) ϲԥɰʳ̾ɽޤ ԥΥȥ륳ɤ <^J>, <^M> ɽޤ

3.5.3. #pragma MCPP debug expand, #debug expand

ޥƤӽФŸȥ졼ޤ

Standard ⡼ɤ #pragma MCPP debug Ǥϼ̤Ǥ
ޥƤӽФȡޤΥޥɽޤˡɤ߹ޤ졢ִꥹΥѥ᡼֤졢褦ɽޤޥͥȤƤС줬缡ŸƤޤ˥ޥСβƵŪˡʥѥ᡼Ȥִˡ˥ȥ졼ޤ

ɽ mcpp ȤΤĤδؿؤνΤӤˡδؿ̾ȤȤ˹ԤޤδؿϼΤ褦򤹤롼ǤStandard ⡼ɤΥ򻲾Ȥȡˤ褯Ǥޤ

expand_macroޥŸ롼
replace ޥ򣱥٥Ÿ
collect_args򽸤
prescan ִꥹȤ #, ## 黻Ҥν򤹤
substitute ѥ᡼ִ
rescan ִꥹȤ

Τexpand_macro ʳϸߤ˴ܺƵδطˤޤ

replace, collect_args Ǥϡmcpp Ū˥åѤǤŸΥǡɽޤΥǡǤϡmcpp ŪʥɤΤ褦ʵɽޤ

<n> n ܤΥѥ᡼
<TSEP> pp-token ڤ뤿 mcpp token separator
<MAGIC> Ʊ̾ޥκִػߤ륳
<RT_END>ִꥹȤν򼨤
<SRC> Identifier ե뤫ޤ줿Ȥ򼨤

Τ <SRC> STD ⡼ɤǤȤ졢POSTSTD ⡼ɤǤ COMPAT ⡼ɤǤȤޤ

#pragma MCPP debug token ꤷۤ狼䤹Ǥ礦

#pragma MCPP debug macro_call ޤ -K ץꤷϡmacro notification Ȥ˽񤭹ޤƽϤޤreplace() ʲΥ롼ǤϤޤȤϽ񤭹ޤ줺फ magic characterŪʥɡˤ񤭹ޤ줿줿ꤷޤ ϼΤ褦ɽޤ

<MACm> ĤΥޥƤӽФ˴ޤޤ m ܤΥޥθƤӽФ
<MAC_END> ľ MACm ǻϤޤޥƤӽФν
<MACm:ARGn>m ܤΥޥθƤӽФ n ܤΰ
<ARG_END> ľ MACm:ARGn ǻϤޤν

-v ץꤷϡMAC_END, ARG_END ˤĤƤⳫϥޡƱֹ椬 symmetrical ɽޤ

pre-Standard ⡼ɤ #debug expand Ǥ Standard ⡼ɤȤ롼˰äƤޤάޤ

3.5.4. #pragma MCPP debug if, #debug if

#if, #elif, #ifdef, #ifndef ιԤɽɾǤ뤫Ǥ뤫𤷤ޤåפ #if section Ǥϡ𤵤ޤ

3.5.5. #pragma MCPP debug expression, #debug expression

#if, #elif Ԥμɾܺ٤˥ȥ졼ޤ

DECUS cpp ȤΥǥХåѤ˥ꥸʥǰ褢ΤǡϤۤȤɼäƤޤŪʴؿ̾Ф꤫ѿ̾Ȥͤޤǥ饺ȽФƤޤmcpp ΥɤʤǤʤȡѿǤޤ
ʣʼͤɾѤΥåѤ߹ߤƤ褦ϡ򸫤ʤƤⲿȤǤǤ礦

3.5.6. #pragma MCPP debug getc, #debug getc

mcpp get_ch() ȤХɤ߹ߴؿƤӽФ뤿Ӥˡܺ٤ʥǡϤޤStandard ⡼ɤǤ pp-token 򥹥󤹤ϡΣХܤΥ롼ϸƤӽФޤ

#debug getc Ǥ token 򥹥󤹤⤳Υ롼󤬸ƤӽФΤǡȤǤʤ̤ΥǡǤФޤ

ˤƤ⡢ʥǡϤޤȤɬפϤޤޤ

3.5.7. #pragma MCPP debug memory, #debug memory

Υǥ쥯ƥ֤ȡλ mcpp Ū˻ȤäƤ malloc(), realloc(), free() ˤҡץξ򣱲𤷤ޤϻκä kmmalloc ¾βफ malloc() ȤäƤεǽǤ mcpp-porting.html#4.extra ȡˡ¾ malloc() ξϥ顼ˤϤޤ󤬡𤷤ޤ
Υǥ쥯ƥ֤ʤޤ mcpp λȡλ˺٥ҡץξ𤵤ޤmcpp out of memory ǽλƱͤǤ

3.5.8. #pragma MCPP debug macro_call

Macro notification mode 򳫻Ϥޤ Υ⡼ɤǤϡޥ뤿ӤˡޤޥŸ뤿ӤˡΥιԤȥ֤ȤޤƽϤޤ ޥľϡưˤĤƤ⤽ΰ֤𤵤ޤ ޥŸˤäƥȡϢ뤵줿ϡϢΥȡ˴ؤޥϼޤ
ˡ#undef, #if (#elif, #ifdef, #ifndef), #endif ˤĤƤ⡢ñʾ󤬽Ϥޤ
Υ⡼ɤ -K ץǻꤹ뤳ȤǤޤ

Υ⡼ɤ C/C++ refactoring tool Τ˼줿ΤǤ C/C++ ˤϥץץȤեΤ뤳Ȥ refactoring tool ˤȤäƺޤΥ⡼ɤȤХץץνϤ饽ƹ뤳ȤǤΤǡtool 䤹ʤޤ*1

#pragma MCPP debug expand ȻƤޤexpand ΤۤϥޥŸȥ졼뤿ΤΤǡܺ٤ʾ󤬽ϤΤΡ򥳥ѥ뤹뤳ȤϤǤޤ Фơmacro_call ϥΤʰ֤뤿ΤΤǡ򥳥ȤΤǡϤ򤽤Τޤ޺ƥץץƥѥ뤹뤳ȤǤΤħǤ

:

*1 λͤϼȤ Taras Glek ƤˤΤǤ롣 ༫ȤϼΤȤ mozilla Υ refactoring ˼ȤǤ롣

http://blog.mozilla.com/tglek/

3.5.8.1. #define ˴ؤ륳

㤨СƬ˼Τ褦ʥޥȡ

#define NULL 0L
#define BAR(x, y) x ## y
#define BAZ(a, b) a + b

Τ褦ʥȤϤޤ

/*mNULL 1:9-1:16*/
/*mBAR 2:9-2:25*/
/*mBAZ 3:9-3:24*/

ΥեޥåȤ

/*m[NAME] [start line]:[start column]-[end line]:[end column]*/

̣ޤ ԤȥϤȤ 1 Ϥޤޤ -K ץꤷϻޥϤޤޥˤϰ־Ϥޤ

3.5.8.2. #undef ˴ؤ륳

#undef  BAZ

ȤԤǤϡΤ褦ʥȤϤޤ

/*undef 10*//*BAZ*/

/*undef [lnum]*//*[NAME]*/ ȤեޥåȤǡ[lnum] ϤιԤιֹ[NAME] ϤΥޥ̾򼨤ޤ

3.5.8.3. ޥŸ˴ؤ륳

ޥƤӽФ뤿Ӥˡ򶴤ǤγϤȽλ򼨤ޡϤޤ ΥޡΥեޥåȤ HTML ˻ͥȲǽʤΤǡ/*<...*/ ޥŸγϤ򼨤/*>*/ νλ򼨤ޤ ޥϤΥեޥåȤϥޥΥեޥåȤ /*m /*< ѤηȤޤ

/*<[NAME] [start line]:[start column]-[end line]:[end column]*/

ޥȤϡΰΰ֤򼨤ޡȡŸγϤȽλ򼨤ޡϤޤ ΰ֤򼨤եޥåȤ /*!...*/ Ȥ򤷤Ƥޤ ˥ޥϡƵŪˤΥޥξ󤬽Ϥޤ ΥޥˤäΤǤʤС־ϽϤޤ ɤΥޥβܤΰǤ뤫򼨤ˡ id ηǼޤ

[func-like-macro-name]:[nesting level]-[argument number]

ˤä BAZ(BAZ(a,b), c) ȤäͥȤ줿Ʊ̾ΥޥȤΰߤ˶̤뤳ȤǤޤ ֹ 0 Ϥޤޤ ơ˼ηΰ־³ޤ

[start line]:[start column]-[end line]:[end column]

ޤŸγϤ򼨤ޡϼηǤ

/*<[func-like-macro-name]:[nesting level]-[argument number]*/

Ÿνλ򼨤ޡϥޥŸνΥޡƱ /*>*/ Ǥ

ʤΥ

foo(NULL);
foo(BAR(some_, var));
foo = BAZ(NULL, 2);
bar = BAZ(BAZ(a,b), c);

Τ褦ʷ̤Ϥޤ

foo(/*<NULL 4:5-4:9*/0L/*>*/);
foo(/*<BAR 5:5-5:20*//*!BAR:0-0 5:9-5:14*//*!BAR:0-1 5:16-5:19*/some_var/*>*/);
foo = /*<BAZ 6:7-6:19*//*!BAZ:0-0 6:11-6:15*//*!BAZ:0-1 6:17-6:18*//*<BAZ:0-0*//*<NULL 6:11-6:15*/0L/*>*//*>*/ + /*<BAZ:0-1*/2/*>*//*>*/;
bar = /*<BAZ 7:7-7:23*//*!BAZ:0-0 7:11-7:19*//*!BAZ:0-1 7:21-7:22*//*<BAZ:0-0*//*<BAZ 7:11-7:19*//*!BAZ:1-0*//*!BAZ:1-1*//*<BAZ:1-0*/a/*>*/ + /*<BAZ:1-1*/b/*>*//*>*//*>*/ + /*<BAZ:0-1*/c/*>*//*>*/;

-v ץ󤬻ꤵƤϡޥŸνΥޡǤŸνλ򼨤ޡǤ⡢ϥޡˤΤƱޥ̾Ȱ id Ϥޤ ʤΤ褦ˤʤޤ

foo(/*<NULL 4:5-4:9*/0L/*NULL>*/);
foo(/*<BAR 5:5-5:20*//*!BAR:0-0 5:9-5:14*//*!BAR:0-1 5:16-5:19*/some_var/*BAR>*/);
foo = /*<BAZ 6:7-6:19*//*!BAZ:0-0 6:11-6:15*//*!BAZ:0-1 6:17-6:18*//*<BAZ:0-0*//*<NULL 6:11-6:15*/0L/*NULL>*//*BAZ:0-0>*/ + /*<BAZ:0-1*/2/*BAZ:0-1>*//*BAZ>*/;
bar = /*<BAZ 7:7-7:23*//*!BAZ:0-0 7:11-7:19*//*!BAZ:0-1 7:21-7:22*//*<BAZ:0-0*//*<BAZ 7:11-7:19*//*!BAZ:1-0*//*!BAZ:1-1*//*<BAZ:1-0*/a/*BAZ:1-0>*/ + /*<BAZ:1-1*/b/*BAZ:1-1>*//*BAZ>*//*BAZ:0-0>*/ + /*<BAZ:0-1*/c/*BAZ:0-1>*//*BAZ>*/;

Ǥ狼褦ˡޥŸλΥޡŸλΥޡ⡢줾줽ˤǸƱͥȥ٥γϥޡбƤޤ äơ-v ץꤷʤƤ⡢ưŪбطȽǤ뤳ȤǤޤ

3.5.8.4. #if (#elif, #ifdef, #ifndef) ˴ؤ륳

#if (#elif, #ifdef, #ifndef) Ԥ˴ؤƤϡιԤˤޥξ󤬽Ϥޤ 㤨СΥ bar.h Ȥ

#define NULL 0L
#define BAR(x, y) x ## y
#define BAZ(a, b) a + b

foo.c Ȥȡ

#include "bar.h"
#ifdef  BAR
#ifndef BAZ
#if 1 + BAR( 2, 3)
#endif
#else
#if 1
#endif
#if BAZ( 1, BAR( 2, 3))
#undef  BAZ
#endif
#endif
#endif

foo.c ϼΤ褦ʷ̤Ϥޤ

#line 1 "/dir/foo.c"
#line 1 "/dir/bar.h"
/*mNULL 1:9-1:16*/
/*mBAR 2:9-2:25*/
/*mBAZ 3:9-3:24*/
#line 2 "/dir/foo.c"
/*ifdef 2*//*BAR*//*i T*/
/*ifndef 3*//*BAZ*//*i F*/


/*else 6:T*/
/*if 7*//*i T*/
/*endif 8*/
/*if 9*//*BAZ*//*BAR*//*i T*/
/*undef 10*//*BAZ*/
#line 11 "/dir/foo.c"
/*endif 11*/
/*endif 12*/
/*endif 13*/

ʤޤ /*if [lnum]*/ ȤեޥåȤǡǥ쥯ƥ̾³Ƹߤιֹ椬ɽޤ ơιԤ˥ޥС줬Ĥ /*[NAME]*/ ȤեޥåȤɽޤ Ǹˡ/*i T*/ ޤ /*i F*/ ǡιԤɾ true Ǥ뤫 false Ǥ뤫ʤ #if ǻϤޤ֥åѥ뤵֥ååפ֥åޤ ϤʸȰäơޥŸ̤ɽޤ #if 1 Τ褦˥ޥΤʤԤˤĤƤϡޥɽ /*[NAME]*/ ʤǤ

#elif, #ifdef, #ifndef ˤĤƤƱͤ /*elif [lnum]*/, /*ifdef [lnum]*/, /*ifndef [lnum]*/ ǻϤޤꡢޥƤ /*[NAME]*/ ³/*i T*/ ޤ /*i F*/ ǽޤ

åפ֥åΥǥ쥯ƥ֤ˤĤƤϲɽޤ

3.5.8.5. #else, #endif ˴ؤ륳

#else ԤǤϾΤ褦ˡ/*else [lnum]:[C]*/ ȤեޥåȤǾɽޤ [lnum] Ϲֹ桢[C] T ޤ F ǡ #else - #endif ֥åѥ뤵֥åȤ⥹åפ֥å򼨤ޤ

#endif ԤǤϾΤ褦ˡ/*endif [lnum]*/ ȤեޥåȤǡߤιֹ椬ɽޤ Ϥ󡢤ޤ #endif бŤƤʤǸ #if (#ifdef, #ifndef) бޤ

3.5.8.6. #line ν

ʤmacro notification mode Ǥ #line ԤΥե̾νϤǥեȤξȰ㤤#include Ԥλ full-path-list ΤϤޤ3.2 ȡˡ Refactoring tool κưפˤ뤿Ǥ


3.6. #assert, #asm, #endasm

#assert pre-Standard ⡼ɤǤȤޤGCC ǤǤϼޤStandard C #error б뵡ǽǤStandard C

#if ULONG_MAX / 2 < LONG_MAX
#error  Bad unsigned long handling.
#endif

ȤȤ

#assert LONG_MAX <= ULONG_MAX / 2

Ƚ񤱤ޤ #if Ȥɾnon-zeroˤǤв⤻0ˤǤ

Preprocessing assertion failed

Ȥդ³Ƥιԡʹ³ȥȽ򤷤ιԡˤɽޤ ϥ顼ȤƥȤޤߤޤ

#assert System V GCC #assert Ȥϡޤä̤ΤΤǤ

#asm, #endasm ΣĤΥǥ쥯ƥֹԤǤϤޤ줿֥åϥ֥饽Ȥưޤpre-Standard ⡼ɤǤȤޤ Microware C / 6809 Ѥ˽񤫤줿ΤʤΤǡ¾νϤˤܿˤϡsystem.c do_old(), do_asm(), put_asm() ˽­ɬפޤ
#asm ֥åˤĤƤϡtrigraphs Ѵ <backslash><newline> κϤޤȤν token åʸåϤƬ space ޤޥޥƱ̾äƤޥŸιԤ򤽤Τޤ޽Ϥޤ¾Υǥ쥯ƥֹԤ #asm ֥åǤϰ̣ޤ

#asm, #endasm Standard C ǤǧʤΤǤޤ#pragma sub-directive ʳγĥǥ쥯ƥ֤ʳǤФ꤫#pragma asm, #pragma endasm ̾ѤƤ褷ޤ󡣤ȸΤϡStandard C ǤϥϤ٤ƣä token sequence ΩäƤɬפޤʸ̩˸ preprocessing token sequenceˡ֥ץϣä token sequence ǤϤʤǤStandard C ǥ֥ꥳɤȤˤϡʸƥȤ token ˡޤ󡣤ơȤ߹ߴؿ򥳥ѥΤ˼ơ

asm(
    " leax _iob+13,y\n"
    " pshs x\n"
);

ȤäǸƤӽФΤǤ

ĹɤȤʤȤϤäƤʤΤǡ ξϤʬ̤δؿˤơ饤֥ؿ񤯻Τ褦ˡ̤Υեǥ֥ץऽΤΤ񤤤ơ֥ѥǽ󥯤ƻȤȤˤʤޤϵ¤Τ褦˻פ뤫⤷ޤ󤬡portable ʣåץ񤯤ˤϥ֥ʬϴʬΥɬפޤ顢ष #asm Ȥ鷺̥եǽ񤯤褦ˤۤɤǤ礦


3.7. C99 οǽ_Pragma() 黻ҡѰޥ

Standard ⡼ɤǤȤޤ
-V199901L ץ __STDC_VERSION__ 199901L ʾˤȡC99 μεǽͭˤʤޤ
C++ Ǥ -V199901L ץ __cplusplus 199901L ʾˤƱͤǤ1, 7 ʳλͤ C++ Standard ˤϤޤ󤬡Standard ⡼ɤǤ C99 Ȥθߴ뤿ˡΥץѰդƤޤ
Ѱޥ Standard ⡼ɤǤ C90 C++ ǤȤ褦ˤƤޤ*1

  1. // ޤǤ򥳥ȤȤư
  2. ѰޥȤ롣
  3. Preprocessing-number e+, E+, e-, E- Ʊͤ p+, P+, p-, P- Ȥ sequence ǧ롣ưΥӥåȥѥ 0x1.FFFFFEp+128 Ȥդˡʤɽ뤿ΤΤǤ롣
  4. _Pragma() operator ͭˤʤ롣
  5. EXPAND_PRAGMA Ȥޥ TRUE ƥѥ뤵줿 mcpp Ǥϡ#pragma ԤΰϡSTDC, MCPP, GCC Τɤ줫ǻϤޤΤǤʤ¤ޥŸоݤȤʤʥǥեȤǤ EXPAND_PRAGMA == FALSE ǤꡢޥŸʤŸΤ Visual C, Borland C ǤǤˡ
  6. #if long long ΤϤǤ long long / unsigned long long ɾ롣
  7. ̻ҡʸʸƥ롦pp-number ˤ \unnnn, \Unnnnnnnn η UCN Ȥ escape sequence ̤ Unicode ʸ̣ͤ롣#if Ǥ UCN ͤϣɽȤɾ롣ʤPOSTSTD ⡼ɤǤ UCN ϻȤʤˡ

ѰޥȤΤϡΤ褦ʤΤǤ

#define debug(...)  fprintf(stderr, __VA_ARGS__)

Ȥޥȡ

debug( "X = %d\n", x);

ȤޥƤӽФϼΤ褦Ÿޤ

fprintf(stderr, "X = %d\n", x);

ʤѥ᡼ꥹ ... İʾΥѥ᡼ִ̣ꥹ __VA_ARGS__ бޤơޥƤӽФˤ ... бʣäƤ⡢ , ޤϢ뤷ΤĤΰΤ褦˰ޤ

_Pragma 黻Ҥ _Pragma( "foo bar") Ƚ񤯤 #pragma foo bar Ƚ񤤤ΤƱ̤ı黻ҤǤʸƥޤϥ磻ʸƥ룱ĤǤʤФʤޤ󡣥磻ʸǤƬ L ʸƥϤ " ʸƥ \", \\ 򤽤줾 ", \ ֤Τ #pragma ΰȤưޤ
#pragma ϥԣԤνᤫ齪ޤǤ˽񤫤ʤФʤ餺ʾʤȤ C90 Ǥϡ˥ޥŸʤΤФơ_Pragma() 黻ҤϥΤɤ˽񤤤ƤΩԤ #pragma 񤤤ΤƱ̤ޥִꥹ˽񤯤ȤǤޥŸη̤Ȥ줿 _Pragma() operator ͭǤνѤ뤳Ȥǡ portability ä pragma directive 񤯤ȤǤϤˤ #pragma ΰ㤤򣱤ĤΥإåեǵۼ뤳ȤǤޤʥץȤƤ "Validation Suite" pragmas.h, pragmas.t 򻲾ȤΤȡˡ*2

ʤC99 Ǥ #if ηϤνϤκȤʤäƤޤlong long / unsigned long long ɬܤȤƤΤǡ#if η long long / unsigned long long ޤϤʾȤȤˤʤޤC90, C++98 Ǥ #if long / unsigned long ɾ뤳ȤˤʤäƤޤmcpp C90, C++98 Ǥ long long / unsigned long long ɾlong / unsigned long ϰϤĶͤФƤϥ˥󥰤Фޤ*1

:

*1 GCC, Visual C 2005, 2008 ȤθߴΤǤ롣¾νϤǤ⡢ C99 λͤ˼Τ񤷤Τǡ__STDC_VERSION__ 199409L ȤޤޤλͤƤ椯Ȥͽۤ롣

*2 C99 Ǥ #pragma ΰ STDC ǻϤޤϥޥŸʤǤʤ implementation-defined Ǥ롣


3.8. ϤȤüʻ

mcpp compiler-specific-build ˤϤ줾νϤ˸ͭλͤĤƤޤΤ¹ԻץǤ #pragma ǤʤüʤΤ򤳤ޤ

3.8.1. GCC, Visual C βѰޥ

GCC V.2 Τ 3.9.1.6 ˤ褦ȼλͤβѰޥäƤޤ 򤳤Υޥ˥奢Ǥ GCC2 ͤβѰޥȸƤӤޤ ޤ GCC V.3 Ǥ 3.9.6.3 Τ褦ʿͤޤ 򤳤Ǥ GCC3 ͤβѰޥȸƤӤޤ GCC 2.95 Ǥ C99 ͤβѰޥޤglibc Linux ΥƥإåǤ C99 ͤΤΤϤ GCC3 ͤΤΤȤ줺ޤ GCC2 ͤȤƤޤ

GCC-specific-build mcpp V.2.6.3 STD ⡼ɤ˸¤ä GCC3 ͤβѰޥV.2.7 GCC2 ͤΤΤޤ Linux ǻȤݤԼͳ򤱤뤿˼ΤǤ ˥󥰤Фޤ GCC ͤ portability ʤǤʤʸˡŪ˱Τǡ񤯥ǤϻȤ٤ǤϤޤ Ȥ GCC2 ͤǤ

Visual C 2003 ޤǤϲѰޥϼƤޤǤ2005 Ǽޤ C99 λͤ GCC3 ͤȻäΤǡѰǡƤϡľΥȡ󤬥ޤǤФޤ GCC Ȱä '##' ȤϻȤޤ λͤ Visual C ΥɥȤˤȡΤ褦ʷ̤ˤʤޤ ΣܤǤϥޤϺʤȤƤޤ Visual C 2005, 2008 ϼºݤˤϤΥޤƤޤޤ

#define EMPTY
#define VC_VA( format, ...)     printf( format, __VA_ARGS__)
VC_VA( "var_args: %s %d\n", "Hello", 2005);     /* printf( "var_args: %s %d\n", "Hello", 2005); */
VC_VA( "absence of var_args:\n");               /* printf( "absence of var_args:\n");   */
VC_VA( "empty var_args:\n", EMPTY);             /* printf( "empty var_args:\n", );  */  /* trailing comma   */

mcpp V.2.7 Visual C-specific-build STD ⡼ɤˤλͤޤ ˥󥰤Фޤ 嵭ΣܤǤϥޤϺ̤˼Ƥޤ

3.8.2. GCC 'defined' ν

ޥ 'defined' Ȥȡ󤬽ФƤ륱ǤϡGCC ϤΥޥ #if Ԥˤϡ¾ξȰۤʤäŪʽ򤷤ޤ ˤĤƤ 3.9.4.6 ǸƤƤΤǡȤƤ

mcpp GCC-specific-build STD ⡼ɤǤ V.2.7 GCC Ʊ򤹤褦ˤޤ Linux ΰΥƥإåʤɤǤμδְäޥȤƤΤн褹뤿Ǥ ˥󥰤Фޤ ʬν񤯥ץǤ #if 񤯤褦ˤƤ

3.8.3. Borland C asm ʸ¾üʹʸ

Borland C ˤ asm Ȥɤäơ

asm {
    mov x,4;
    ...;
}

Ȥäǥ֥ꥳɤ򵭽Ҥ褦ˤʤäƤޤϣøʸˡϤ줿ˤ§ŪʤΤǤˤޤޥޥƱ̾ȡϥޥŸƤޤޤBorland C ΤΤǤ mcpp Ǥ⡢ƱǤ֥ץ̤ .asm եǽ񤯤ΤǤ礦 mcpp ϤˤĤƤ̤ʰϲ⤷ޤ

Visual C++ ˤ __asm ȤƱͤΥɤޤ
GCC ˤ asm( " mov x,4\n") ȤޤäȤʷȤ߹ߴؿѰդƤޤ

3.8.4. #import ¾

3.8.4.1. Mac OS X / GCC #import

GCC ˤ Objective-C #import Ȥǥ쥯ƥ֤ꡢC/C++ Ǥ⤳ #pragma once ۤ #include ȤƻȤޤ Mac OS X C/C++ ˤϻˤȤΤ褦Ǥ

mcpp V.2.7 ʹߤ Mac OS X ˸¤äơGCC ǤǤ⥳ѥΩǤǤ⡢Ƥޤ

3.8.4.2. Visual C #import, #using

Visual C ˤ #import #using Ȥüʥǥ쥯ƥ֤ޤ ץץǥ쥯ƥ֤η򤷤ƤޤƤϥѥȥ󥫤ФؼǤ #import GCC ΤΤȤϴطޤ

mcpp Visual-C-specific-build ϤιԤ򤽤Τޤ޽Ϥޤ


3.9. GCC GCC Ȥθߴ

GCC Ǥ mcpp ǤϡGCC / cpp (cc1) ȤθߴѾ夢ޤؤʤ٤˳ݤƤޤߴ̤¿ޤ
ޤ¹ԻץˤĤƤϡ2 Ϥ˸褦ˤ㤤ޤ-A ץϼƤޤ󡣤ޤǥ쥯ƥ֤Ǥ #assert, #ident ϼƤޤ*1
ʤȤˡΤȤǥѥǤʤȤϤʤ褦Ǥ

षºݤȤʤΤϡŤץץåüʻͤ򤢤ƤˤǤ¿ GCC -pedantic ꤹȥ˥󥰤Фޤmcpp Standard ⡼ɤΤΤǤϥ顼å򵬳̤˼ƤΤǡۤ GCC -pedantic ǥեȤȤʤäƤޤGCC ϥǥեȤǤϤʰȿۤä̤ᡢ򤢤Ƥˤ˸ޤ򵬳ʤ˹פ褦˽񤯤ΤϤƴñʤȤǡ虜虜ʰȿν򤹤ɬϲ⤢ޤñ˰ܿ»ʤǡȥХβȤʤΤǡĤľƤޤ礦*2

:

*1 Ϥɬפʤ #pragma Ǽ٤ΤǤ롣 #include_next, #warning ƱͤǤ뤬GCC ΥƥǤϼºݤ˻ȤƤΤǡmcpp Ǥ GCC Ǥ˸¤äƼ˥󥰤оݤˤʤ롣

*2 3.9 3.9.3 1998 ǯ˽񤫤줿ΤǤ뤬θϾѤäƤƤ롣 Ťͤ˰¸륽Ͼʤʤꡢä GCC ȼγĥǽκ˰¸ΤƤƤ롣 3.9.4 ʹߡȤ 3.9.8 ʹߤǼ夲ΤϼȤƤǤ롣 (2008/03)

3.9.1. FreeBSD 2 / kernel Υץץ

ʲˡFreeBSD 2.2.2-R (1997/05) kernel 󤲤Ƥޤǥ쥯ȥ̾Ϥ /sys (/usr/src/sys) ΤΤǤΤ 7, 8 ɬ⵬ʰȿǤϤʤmcpp Ǥ̤ν򤷤ޤ֤ʤäʤΤǥ˥󥰤Фޤ6 ϳĥǽǡC99 ǤƱǽѰդƤޤGCC / cpp Ȥϵˡۤʤޤ

3.9.1.1. Ԥޤʸƥ

i386/apm/apm.c, i386/isa/npx.c, i386/isa/seagate.c, i386/scsi/aic7xxx.h, dev/aic7xxx/aic7xxx_asm.c, dev/aic7xxx/symbol.c, gnu/ext2fs/i386-bitops.h, pc98/pc98/npx.c ˤϤǥ֥饽ޤƤޤ

asm("
    asm code0
#ifdef PC98
    asm code1
#else
    asm code2
#endif
    ...
");

ʸƥĤ " ޤǤˤʤäϹĤƤȲ᤹Τ GCC / cpp ΥǥեȤλͤǤȤäƤΤǤʤ˥ѥΤǤ asm() ΤԤޤʸƥȲᤵ餷ˡ

֥饽 .s եȤڤΥƤΤɤȻפޤɤƤ .c եߤСʤ֤ʤäȤ򤷤ʤƤ⡢Τ褦ˤФߤޤǤ Standard C ΥץץåǤꤢޤ

asm(
    "    asm code0\n"
#ifdef PC98
    "    asm code1\n"
#else
    "    asm code2\n"
#endif
    "    ...\n"
);

3.9.1.2. #else junk, #endif junk

ddb/db_run.c, netatalk/at.h, netatalk/aarp.c, net/if-ethersubr.c, i386/isa/isa.h, i386/isa/wdreg.h, i386/isa/tw.c, i386/isa/b004.c, i386/isa/matcd/matcd.c, i386/isa/sound/sound_calls.h, i386/isa/pcvt/pcvt_drv.c, pci/meteor.c, pc98/pc98/pc98.h ˤϤԤޤ

#endif MACRO

ϤƤޤ礦

#endif /* MACRO */

3.9.1.3. #ifdef 0

i386/apm/apm.c ˤϤʤ

#ifdef 0

ȤʹԤޤ

#if 0

δְ㤤ǤºݤˤϻȤƤʤ ǥХå⤵ƤʤʤΤǤ礦

3.9.1.4. ޥ

gnu/i386/isa/dgb.c ǤϼιԤΥإåե̷⤹ˤʤޤ

#define DEBUG

Standard C Ǥ violation of constraint ǡºݤˤϽϤˤäơ顼ˤǽͭȤΤȡGCC 2 / cpp Τ褦˥ǥեȤǤۤäƤȤͭȤΤȤޤμ¤ˤȤͭˤˤϡľ

#undef DEBUG

٤Ǥ

3.9.1.5. #warning

i386/isa/if_ze.c, i386/isa/if_zp.c ˤ #warning ޤKernel ͣεʰȿǥ쥯ƥ֤ǤStandard C ˹碌뤿ˤϡιԤ򥳥ȥȤ뤷ޤ

mcpp GCC ǤǤ #warning ȤΤǡΤޤ̤ޤ

3.9.1.6. Ѱޥ

gnu/ext2fs/ext2_fs.h, i386/isa/mcd.c ˤϼΤ褦ʲѸİΥޥƤޤ

#define MCD_TRACE(fmt, a...)                \
{                                           \
    if (mcd_data[unit].debug) {             \
        printf("mcd%d: status=0x%02x: ",    \
            unit, mcd_data[unit].status);   \
        printf(fmt, ## a);                  \
    }                                       \
}

#   define ext2_debug(fmt, a...)    { \
        printf ("EXT2-fs DEBUG (%s, %d): %s:", \
            __FILE__, __LINE__, __FUNCTION__); \
        printf (fmt, ## a); \
        }

GCC / cpp ȼγĥͤǡ¾νϤǤѤޤ󡣤 ## a ΤȤñ a Ȥ⤢ޤ## ȡޥƤӽФ a... бʤäϡľΥޤޤ
C99 ǤϲѸİޥɲäƤޤˡۤʤꡢϼΤ褦˽񤯤Ȥˤʤޤ

#define MCD_TRACE( ...)                     \
{                                           \
    if (mcd_data[unit].debug) {             \
        printf("mcd%d: status=0x%02x: ",    \
            unit, mcd_data[unit].status);   \
        printf( __VA_ARGS__);               \
    }                                       \
}

#   define ext2_debug( ...)         { \
        printf ("EXT2-fs DEBUG (%s, %d): %s:", \
            __FILE__, __LINE__, __FUNCTION__); \
        printf ( __VA_ARGS__); \
        }

C99 Ǥ ... бƤӽФΰϣİʾɬפʤΤФơGCC / cpp Ǥ a... бϣĤǤ⤫ޤʤȤΤäǤmcpp ǤϤн褹뤿ᡢ... бĤʤϡwarning ϽФΤΥ顼ˤϤʤ褦ˤƤޤäơΤ褦ʽǤޤΤۤ񤭴ϰабǤǤΤǡñǤνǤϡľΥޤĤΤǡȤ printf( fmt, ) ȤŸ̤ˤʤäƤޤȤޤξϡޥ嵭 C99 ͤνˤ뤫ޤϥޥƤӽФǥȤʤ褦ˤ뤷ޤ󡣥ˤ NULL 0 Τ褦̵ʥȡȤäơMCD_TRACE(fmt, NULL) Ƚ񤯤Ȥˤʤޤ*1

#define MCD_TRACE(fmt, ...)
{
    if (mcd_data[unit].debug) {
        printf("mcd%d: status=0x%02x: ",
            unit, mcd_data[unit].status);
        printf(fmt, __VA_ARGS__);
    }
}

#   define ext2_debug(fmt, ...)         {
        printf ("EXT2-fs DEBUG (%s, %d): %s:",
            __FILE__, __LINE__, __FUNCTION__);
        printf (fmt, __VA_ARGS__);
        }

:

*1 GCC 2.95.3 ʹߤǤ C99 ιʸβѰޥƤΤǡȤۤɤGCC βѰޥϰĤǤɤȤ뤬εˡɤʤargs... Ȥѥ᡼Ǥ args ... ȤϤäĤƤʤФʤʤ pp-token ¸ߤʤִꥹȤǥȡϢ黻ҤƱˡ̤Ӥ˻ȤäƤΤ⡢ʤC99 εˡǡĤβѰƤȤͤǤ
ʤGCC 3 ǤϲѰޥˤĤơGCC 2 λͤ C99 λͤȤŪʽɲä줿ˤĤƤ 3.9.6.3 򻲾ȤΤȡ

3.9.1.7. ޥƤӽФΥ

nfs/nfs.h, nfs/nfsmount.h, nfs/nfsmode.h, netinet/if_ether.c, netinet/in.c, sys/proc.h, sys/socketvars.h, i386/scsi/aic7xxx.h, i386/include/pmap.h, dev/aic7xxx/scan.l, dev/aic7xxx/aic7xxx_asm.c, kern/vfs_cache.c, pci/wd82371.c, vm/vm_object.h, vm/device/pager.c ˤϤޥƤӽФޤ/usr/include/nfs/nfs.h ǤƱͤǤ

LIST_HEAD(, arg2)
TAILQ_HEAD(, arg2)
CIRCLEQ_HEAD(, arg2)
SLIST_HEAD(, arg2)
STAILQ_HAED(, arg2)

ʤΤǤ C99 ǤϸǧޤC90 Ǥ undefined ǤͥȤ줿ޥƤӽФǤޤްˤʤäΤͤȡꤵƤۤɤȸޤ˥񤯤ȤˤϤξɬʤޤ󡣰ĤΥޥǤϥȰηȤζ̤ĤʤȤ syntax Τޤ뤳Ȥ⡢˺ƤϤʤޤ

񤯤ۤɤǤ礦Ǥ Standard C ΤɤΥץץåǤꤢޤ

#define EMPTY

LIST_HEAD(EMPTY, arg2)
TAILQ_HEAD(EMPTY, arg2)
CIRCLEQ_HEAD(EMPTY, arg2)
SLIST_HEAD(EMPTY, arg2)
STAILQ_HAED(EMPTY, arg2)

ȤǡΥإåեˤϡΥޥʤ¾ΤɤΥإå #include ƤʤȤΤޤnfs ǥ쥯ȥΤΡˡΥޥ sys/queue.h ˤꡢ*.c ץब #include 뤳ȤԤƤΤǤ֤ʤäΥإåǤ

ʤkern/kern_mib.c ˤϼΤ褦ʥޥƤӽФޤ

SYSCTL_NODE(, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)

Υ EMPTY Ȥ櫓ˤϤޤ󡣤Υޥ sys/sysctl.h ˤꡢΤ褦ˤʤäƤ뤫Ǥ

#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)
    extern struct linker_set sysctl_##parent##_##name;
    SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access,
        (void*)&sysctl_##parent##_##name, 0, handler, "N", descr);
    TEXT_SET(sysctl_##parent##_##name, sysctl__##parent##_##name);

ʤΰϥޥŸʤΤǤʤˤ SYSCTL_OID ȤޥǤ⡢ϤϥޥŸʤˡϥΤޤޤˤƤޤ*1

:

*1 C99 ǤϥϹˡȤƤ롣ޤ SYSCTL_NODE(), SYSCTL_OID() Τ褦ʥޥΤȤͤȡEMPTY ȤޥȤˡǽǤϤʤΤǡΤޤޤˤƤΤ뤳ȤǤ롣EMPTY ȤäƤ⡢ޥƤӽФͥȤƤȡϤꥫȯƤޤȤ⤢롣 readability ͤȡEMPTY ȤȤǤϻȤäۤɤ褦˻פ롣

3.9.1.8. Function-like ޥִ̾ object-like ޥ

i386/include/endian.h ˤϤޥޤ/usr/include/machine/endian.h ǤƱͤǤƱĤˡ

#define __byte_swap_long(x)     (replacement text)
#define NTOHL(x)                (x) = ntohl((u_long)x)
#define ntohl                   __byte_swap_long

ntohl Ǥ object-like ޥǤʤ function-like ޥ̾Ÿ졢Τ³ƥȤ򴬤ߡ function-like ޥΤ褦ŸޤŸˡ K&R 1st. ΰۤλͤǡStandard C ǤϤʤˡȤʤäΤǤ䤬̤ΤȤƤ褦ˡλͤޥŸ̵ѤʣˤʽˤޤǺ⤿餷Ƥ븵Ǥꡢ֥ХΤ褦ʻ͡פʤΤǤ*1

ϼ֤ function-like ޥǤΤά object-like ޥȤƽ񤤤ƤΤǤfunction-like ޥ餷Τ褦˽񤤤ۤɤǤ礦Ǥв⤢ޤ

#define ntohl(x)                __byte_swap_long(x)

i386/isa/sound/os.h ˤƱΥޥޤ

#define INB                     inb
#define INW                     inb

ϤƤޤ礦

#define INB(x)                  inb(x)
#define INW(x)                  inb(x)

:

*1 ISO 9899:1990 Corrigendum 1:1994 ǤϤ undefined Ȥ줿ơC99 Ǥ Corrigendum Τι̤ΤΤ֤줿ʽϤ˴ؤƤϺ𤷤Ƥ롣ܺ٤ cpp-test.html#2.7.6 򻲾ȡ

3.9.1.9. .S եΡ֥ץץ

Kernel ˤϲܤ .S ե롢ʤ֥饽ޤȤˤ #include #ifdef äơ֥ץץפɬפʤΤǤFreeBSD 2.2.2-R ǤϤΥ cc -x assembler-with-cpp ץդƸƤӽФȤˡǽƤޤ cc /usr/libexec/cpp -lang-asm ץĤƸƤӽФ as ƤӽФޤ

.S եϤ󵬳ʳ§Ǥ줬տ̤ˡ֥ץץפ뤿ˤϡޥȤޤްפ̾פ֥饽˴ޤޤƤƤϤޤ󡣤ơ֥ץץפǤϡ֥ȡ״֤ white space ̵ͭϤΤޤ¸ʤФʤ餺Ƭ space ¸ʤФʤޤ󡣹ԤκǽΡ֥ȡפ֥ΥȤǤ # Ǥϥץץå¦üʽɬפǤȤץץåʤ¤졢Хκˤ;פʿФȤʤФʤʤΤǡ褷ɤȤȤϻפޤ*1

ʣΥޥбΤ˥ץץɬפΤǤС.S եǤϤʤ .c եȤơηǽ񤯤ΤɤǤ礦4.4BSD-Lite ǤϼºݤˤνˤʤäƤޤ

asm(
    "    asm code0\n"
#ifdef Machine_A
    "    asm code1\n"
#else
    "    asm code2\n"
#endif
    "    ...\n"
);

:

*1 FreeBSD 2.0-R ǤϤΥե̾ *.S ǤϤʤ *.s ȤʤäƤơMakefile ǤϤνˤ cc ǤϤʤ cpp ƤӽФơ as ƤӽФ褦ˤʤäƤơcpp ƤӽФ /usr/bin/cpp ư shell-script ǡ/usr/libexec/cpp -traditional ƤӽФΤۤscript 񤭴뤳ȤǻȤץץåѤ뤳ȤǤΤǡǤä

3.9.2. FreeBSD 2 / libc Υץץ

FreeBSD 2.2.2R /usr/src/lib/libc ⥳ѥ뤷ƤߤޤäϤޤǤȾ 4.4BSD-Lite 餽ΤޤƤ뤫Ǥ礦εϤǤ줤ʥäƤΤȤǡɮͤޤ

Ľꡢgen/getgrent.c ˼Τ褦ʹԤĤޤ󡢹 ; ;פǤ

#endif;

3.9.3. GCC 2 / cpp λͤ

ơʾ˸褦ˡΥ򵬳ʤ˹פܿι⤤ʥǽ񤯤ȤˤϡݤǥåȤ⤢ޤ󡣤ˤ⤫餺ʤޤ˽񤫤ƤΤǤ礦

FreeBSD 2.0-R 2.2.2-R kernel ٤Ƥ⡢μΤΤϤޤ긺äƤޤ󡣿ۤɵʹ⤯ʤäƤȤϸ¤ʤȤʤΤǤμΤ䤷ʥΥ 4.4BSD-Lite ¸ߤƤΤϤ鷺Ǥ4.4BSD Standard C POSIX ˽򤷤ƽľ줿Ǥ礦ȤFreeBSD ؤμǰΥˤŤ뤬褷ƤޤäΤǤ嵭 ntohl Τ褦 4.4BSD-Lite Ǥ ntohl(x) ηˤʤäƤΤ FreeBSD ǤϤ虜虜 ntohl η˽ؤƤΤޤäݤ줿Τʤ褹ΤǤ礦

ϤˤϡGCC / cpp ۤä̤ƤޤȤΰƶƤȻפޤ-pedantic ưǥեȤǤСΥ虜虜ֿ׽񤫤뤳ȤϤʤäǤ礦ĤƤ -pedantic-errors ǥեȤˤΤǤϥѥǤʤ¿ơŪǤϤʤäΤ⤷ޤgcc man page ˤ -pedantic ץˤĤơ֤ȤͳϲʤΥץ¸ͳ pedants ­뤳ȤǤפȤޤ(*1) Standard C ޤäƣǯ⤿ĤޤȤʤäƤϡ-pedantic-errors ȤޤǤϤʤƤ -pedantic ǥեȤˤ٤ƤȻפޤ

FreeBSD 2.0-R ǤϥȤΥͥȤޤ2.2.2-R ǤϰݤƤޤݤ줿ΤϡGCC / cpp ǧʤʤäǤ -pedantic Ȥϴطޤ󤬡ץץåΥåΰϤϤۤ礭ΤǤ

:

*1 3.9.3 񤫤줿Τ 1998 ΤȤǤ롣θ塢gcc man info ǤϡˤɽϺ줿ͤäѤä櫓ǤϤʤ

3.9.4. Linux / glibc 2.1 Υץץ

glibc (GNU LIBC) 2.1.3 (2000/02) Υ򥳥ѥ뤷Ƥߤޤˤ FreeBSD libc ȤϰäƤʤ¿꤬ޤˤ GCC / cpp undocumented ʻͤѤƤΤꡢλͤͤߤǤʤλ֤䤷ƤޤäȤ󤫤ޤ

3.9.4.1. Ԥޤʸƥ

sysdeps/i386/dl-machine.h, stdlib/longlong.h ˤ

#define MACRO asm("
    instr 0
    instr 1
    instr 2
")

ȤäιԤޤʸƥ뤬Ĥ⤢ޤ ˤϤʤĹʤΤ⤢ޤ

ޤmake ˤä compile/csu/version-info.h ˤԤޤʸƥ뤬ޤ
Ϥ󵬳ʰȿΥǤGCC ǤϤԥɤäʸƥȤưޤ
mcpp Ǥ -lang-asm (-x assembler-with-cpp, -a) ץꤹȡԤޤʸƥ

#define MACRO asm("\n    instr 0\n    instr 1\n    instr 2\n")

ȤѴƽޤ3.9.1.1 Τ褦˥ǥ쥯ƥ֤ΤϤޤäƤΤϡǤбǤľʤˡ

3.9.4.2. #include_next, #warning

catgets/config.h, db2/config.h, include/fpu_control.h, include/limits.h, include/bits/ipc.h, include/sys/sysinfo.h, locale/programs/config.h, sysdeps/unix/sysv/linux/a.out.h ˤ #include_next ޤ

ޤsysvipc/sys/ipc.h ˤ #warning ޤ

ϵʤǤǧƤʤǥ쥯ƥ֤Ǥglibc 2 ΥƥǤϤȤ #include_next ԲķΤΤȤʤäƤޤäƤΤǡmcpp Ǥ GCC ѤǤ #include_next #warning ϼƤޤ

#include_next ϵʰȿȤȤǤϤޤInclude directories ȤΥϴĶѿΥ桼¦ˤäѤ礬ΤǡˤäƷ̤äƤޤ

Glibc include ǥ쥯ȥΥեˤϡglibc install /usr/include ǥ쥯ȥ˥ԡΤ⤢ޤʤƥΥإåեȤƻȤΤʤΤǤإåե#include_next ȤƤ뤳ȤϡƥإåʤĤϤ֤ˤʤäƤƤ뤳ȤɽƤޤɬפʻˤƤ褦Ǥ

3.9.4.3. Ѱޥ

elf/dl-lookup.c, elf/dl-version.c, elf/ldsodefs.h, glibc-compat/nss_db/db-XXX.c, glibc-compat/nss_files/files-XXX.c, linuxthreads/internals.h, locale/loadlocale.c, locale/programs/linereader.h, locale/programs/locale.c, nss/nss_db/db-XXX.c, nss/nss_files/files-XXX.c, sysdeps/unix/sysdep.h, sysdeps/unix/sysv/linux/i386/sysdep.h, sysdeps/i386/fpu/bits/mathinline.h

ʾΥեˤ GCC / cpp λͤβѸİޥȸƤӽФޤ*1

:

*1 GCC2 餢ͤǤ뤬Τۤ GCC3 Ǥ C99 GCC2 ȤŪʻͤɲä줿 ˤĤƤ 3.9.6.3 򻲾ȤΤȡ

3.9.4.4. ޥƤӽФΥ

catgets/catgetsinfo.h, elf/dl-open.c, grp/fgetgrent_r.c, libio/clearerr_u.c, libio/rewind.c, libio/clearerr.c, libio/iosetbuffer.c, locale/programs/ld-ctype.c, locale/setlocale.c, login/getutent_r.c, malloc/thread-m.h, math/bits/mathcalls.h, misc/efgcvt_r.c, nss/nss_files/files-rpc.c, nss/nss_files/files-network.c, nss/nss_files/files-hosts.c, nss/nss_files/files-proto.c, pwd/fgetpwent_r.c, shadow/sgetspent_r.c, sysdeps/unix/sysv/linux/bits/sigset.h, sysdeps/unix/dirstream.h

ʾΥեˤϥޥƤӽФΥޤȤ math/bits/mathcalls.h ˤϥ 79 Ĥ⤢ޤΥإåե /usr/include/bits/mathcalls.h install ơ/usr/include/math.h #include ΤǤEMPTY ȤޥȤäƤ⡢ޥƤӽФͥȤƤΤǡϤ̤ΥȯޤäȤ줤ʥޥνϤǤʤΤǤ礦

3.9.4.5. Function-like ޥִ̾ object-like ޥ

argp/argp-fmtstream.h, ctype/ctype.h, elf/sprof.c, elf/dl-runtime.c, elf/do-rel.h, elf/do-lookup.h, elf/dl-addr.c, io/ftw.c, io/ftw64.c, io/sys/stat.h, locale/programs/ld-ctype.c, malloc/mcheck.c, math/test-*.c, nss/nss_files/files-*.c, posix/regex.c, posix/getopt.c, stdlib/gmp-impl.h, string/bits/string2.h, string/strcoll.c, sysdeps/i386/i486/bits/string.h, sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h

ʾΥեˤ function-like ޥִ̾ object-like ޥޤˤϡmath/test-*.c ˤΤΤ褦ˡfunction-like ޥ object-like ޥִơˤ줬 function-like ޥִ̾Τ⤢ޤ򤹤ɬΤǤ礦

3.9.4.6. 'defined' Ÿޥ

sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h, malloc/malloc.c ˤϡ㤨мΤ褦 defined Ȥ pp-token Ÿޥޤ

#define HAVE_MREMAP defined(__linux__) && !defined(__arm__)

ϡ

#if HAVE_MREMAP

Ȥǥ쥯ƥ֤

#if defined(__linux__) && !defined(__arm__)

Ȥʤ뤳ȤԤƤΤǤ

ޤ #if ǥޥŸη̤ defined Ȥ pp-token ФƤΤϡʤǤ undefined ǤΤȤ̤ȤƤ⡢ʤΥޥѤǤ

HAVE_MREMAP ȤޥϤä

defined(__linux__) && !defined(__arm__)         (1)

ִ졢 identifier Ǥ defined, __linux__, __arm__ 줾ޥǤ뤫ɤĴ٤졢ޥǤŸޤäơdefined ϥޥȤƤϤϤʤΤǡʤ⤷ƤС켫ΤǤ undefinedˡ __linux__ 1 Ƥơ__arm__ ƤʤСΥޥϺǽŪ˼Τ褦Ÿޤ

defined(1) && !defined(__arm__)

defined(1) Ϥ #if syntax error Ǥ

Ȥ GCC Ǥϡ#if ԤǤʤФʤΤǤ#if Ԥ˸¤ä (1) ǥޥŸƤޤ #if ȤɾޤUndefined ǤΤǤְ㤤Ȥϸޤ󤬡ޥŸ #if ԤȤǤʤȤǰۤʤΤϡӤʤͤǤʤȤ⤽λͤˤ portability ޤ*1

ΥޥϼΤ褦˽񤱤СʤΤǤ

#if defined(__linux__) && !defined(__arm__)
#define HAVE_MREMAP 1
#endif

ʤä᤯ݤƤۤΤǤ *2

:

*1 GCC 2 / cpp #if ԤǤŪ defined üʥޥȤưäƤ롣 ΤᡢΤ褦ʥȡޥŸΤ˺ΤǤ뤬η̤ޥŸˡ#if Ȥɾ뤳ȤˤʤΤǤ롣ʤޥŸ #if ɾȤʬΥ˺򤷤ƤΤǤ롣

defined(__linux__) && !defined(__arm__)

GCC / cpp Υץ๽¤ˤ⤫Ǥ롣GCC 2 / cpp Ǥ rescan() Ȥޥ롼󤬻¾Υᥤ롼ȤʤäƤơ줬ƥȤᤫ齪ޤɤߤʤƤ椯ơץץǥ쥯ƥ֤ν롼⤳椫ƤӽФΤǤ롣ǤޥǼΤϥޥץåŪʥץ๽¤Ǥ뤬ι¤ޥŸ¾νȤκطʤˤʤäƤȹͤ롣

*2 glibc 2.4 ǤϤΥޥľƤ롣 Ȥ¾ΥޥƱΤΤˤĤФƤƤ롣

3.9.4.7. .S եΡ֥ץץ

*.S Ȥ̾Υեϥץץפ륢֥ΥǤˤ #include, #define, #if Υץץǥ쥯ƥ֤ФƤޤˡMake ˤä compile/csu/crti.S Ȥեˤϡ

#APP

Ȥ

#NO_APP

ȤԤޤǸޤ ιԤ̵ʥץץǥ쥯ƥ֤ȹʸ塢̤ĤޤGNU ǤϤιԤϤΤޤޥץץ˻Ĥäơ֥ΥȤȤư褦Ǥ

ޤ## 黻Ҥˤ pp-token Ϣ뤬 invalid pp-token Ƥޤ⤢ޤGCC / cpp ϤۤäƤΤޤ޽Ϥޤ

mcpp Ǥ GCC / cpp ȤθߴΤˤʤ-lang-asm (-x assembler-with-cpp, -a) ץդȡ illegal ʥǥ쥯ƥ֤ ## ˤä줿 invalid pp-token 򥨥顼ˤ˥󥰤ФΤΤΤޤ޽Ϥ褦ˤޤ

衢֥ѤΥޥץåǽ٤ΤȻפޤGNU ˤ gasp Ȥ֥ѥޥץå褦ǤʤۤȤɻȤƤʤ褦Ǥ

3.9.4.8. rpcgen -dM ץλͤ

GCC -dM ȤץǵưȥޥϤޤmake check ǻȤ stdlib/isomac.c ϤѤƤޤisomac.c ϡޥեηȤ GCC νϷꤷƤơȤԤ⥨顼ˤʤäƤޤȤǤ

glibc make Ǥ rpcgen ȤץबȤ뤳ȤޤΥץϡץץåιֹνϷȤƤϤ GCC

#123 "filename"

ȤꤷƤơ

#line 123

#line 123 "filename"

⥨顼ˤʤäƤޤȤǤ

mcpp Ǥ GCC ǤǤ GCC ηǥեȤˤޤrpcgen üʷˤơɸŪʷбƤʤȤΤϡʻͤǤ

3.9.4.9. -include, -isystem, -I- ץ

glibc 2.1 makefile Ǥϡ-include ץ󤬤ФлȤƤޤˤ -isystem ץ -I- ץȤޤ-include ϥƬ #include ФΤǡ-isystem, -I- ϥƥإå򹹿礷ɬδʤΤǤ
mcpp Ǥ GCC Ѥμ˸¤äơΣĤΥץޤޤɬפΤʤץƤ餤ΤǤ*1

:

*1 GCC / cpp ˤϤΤۤ -iprefix, -iwithprefix, -iwithprefixbefore, -idirafter Ȥä include directory Ȥνꤹ륪ץ󤬤Ĥ⤢롣ޤlong-file-name MS-DOS 8+3 Υե̾ȤбɽλѤꤹ -remap ץ⤢롣 CygWIN ƥ specs եǻȤ뤳Ȥ뤬include directory ϴĶѿǻꤷƤФळȤǤꡢ8+3 Υե̾ؤбޤ CygWIN ɬפȤפʤ

3.9.4.10. Undocumented ʻޥ

glibc ǤϤʤGCC Ǥ

__VERSION__, __SIZE_TYPE__, __PTRDIFF_TYPE__, __WCHAR_TYPE__

ʾ̾ϥɥȤˤϸޤ󤬡GCC / cpp ǤϻޥȤʤäƤޤ__VERSION__ ͤ Vine Linux 2.1 (egcs-1.1.2) Ǥ "egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)" ȤʤäƤޤ¾ΣĤ Linux / i386 Ϥ¿ΥƥǤϤ줾 unsigned int, int, long int ȤʤäƤ褦ǤFreeBSD, CygWIN ǤϾİäƤޤʤʤ㤦ɬפΤ狼ʤˡ
ȤɤƥɥȤˤʤΤǤ礦

3.9.4.11. Undocumented ʴĶѿ

äȤʤΤ SUNPRO_DEPENDENCIES Ȥ undocumented ʴĶѿǤsysdeps/unix/sysv/linux/Makefile ˤ

SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
$(CC) -E -x c $(sysinclude) $< -D_LIBC -dM | \
... \
etc.

Ȥ script ޤ SUNPRO_DEPENDENCIES ȤĶѿǥե̾ꤷcpp Υޥȥեΰ¸طԤ򤽤λꤵ줿ե˽ϤȤΤʤΤǤ

ư򤹤ˤϡGCC / cpp Υ (egcs-1.1.2/gcc/cccp.c) ɤषޤǤ
ΤۤDEPENDENCIES_OUTPUT ȤĶѿ⤢ꡢƱͤΰ̣äƤޤSUNPRO_DEPENDENCIES Τۤ system headers ΰ¸طԤϤΤФơDEPENDENCIES_OUTPUT ϤǤϤʤȤ㤤ޤ

mcpp Ǥ GCC бǤ˸¤äơΣĤδĶѿбޤ΢͡פΤ褦ʤΤ᤯ѻߤƤۤΤǤ

3.9.4.12. ¾

Linux (i386) / GCC ǤϤΤۤspecs եλˤäơcpp θƤӽФ -Asystem(unix) -Acpu(i386) -Amachine(i386) ȤץղäޤѤ륽ϾʤȤ glibc 2.1.3 Linux / x86 ǤˤϤʤ褦Ǥ
Glibc 饤󥹥ȡ뤵륷ƥإåĤϤ餱ʣʤΤˤʤäƤƤ뤳Ȥϡ礭ǤäȤΰ㤤ˤäƽ̤äƤ붲줬ޤ

¾ǡFreeBSD 2.2.2 / kernel Ǹ줿 #else junk, #endif junk ޥ glibc 2.1.3 ǤϸޤǤGlibc 2.1 Υ FreeBSD 2 / kernel ΥƤ̤⤤餫ޤ

ΤȤƤϡglibc 2.1 ˤ GCC üʻͤ˰¸Ƥ륽ʤ餺ꡢ¾νϤؤΰܿϺˤʤäƤޤʿܤΥեǤϤǤ뤬ˡץβƥʥΤˤ⡢ GCC local ʻͤؤΰ¸ϹޤޤGCC V.3 ǤϤ΢Ūͤѻߤ˰¸륽ݤ뤳ȤԤȻפޤ

3.9.5. GCC 2 mcpp Ȥˤ

mcpp glibc 2.1 Υѥ˻ȤˤϡޤΥνɬפǤ*1
ĤϲѸİΥޥȸƤӽФǤ嵭 3.9.4.3 ˤ 14 ĤΥեˤĤơ3.9.1.6 ˤ褦ʷǽޤ󡢸ΥեĤƤۤɤǤ礦
⤦Ĥϡ3.9.4.6 ˤ룳ĤΥեΡִꥹȤ "defined" ФƤޥνǤޤ/usr/include/_G_config.h sysdeps/unix/sysv/linux/_G_config.h install ƤǤƱΥեǤ⽤ƤۤɤǤ礦

mcpp εưˤϡMakefile specs եղä륪ץΤۤˡԤޤʸƥ䥢֥ѤΥȤޤ *.S եΤ -lang-asm (-x assembler-with-cpp) ɬפǤΥץ¾ΥեΥץץˤդƤơ̾Ϥޤޤ

GCC / cpp Ȥä mcpp ȤäꡢǥեȤղä륪ץѹꤹ뤿ˤϡΤ褦ˤΤɤǤ礦

Super-user ˤʤäơcpp ¸ߤǥ쥯ȥʤǤ /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 Ȥˤ˹Ԥޤ GCC / cpp cpp Ȥ̾¸ߤmcpp mcpp Ȥ̾ install ƤȤޤޤΤ褦Ƥ mcpp.sh Ȥ̾Υեޤ*2

#!/bin/sh
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/mcpp -Q -lang-asm "$@"

-Q ץϤʤƤ⤫ޤޤ󤬡̤οǥåϿˤդۤɤǤ礦
ˡΤ褦ʥޥɤǤߤޤ

chmod a+x mcpp.sh
mv cpp cpp_gnuc
ln -sf mcpp.sh cpp

Ƥȡgcc cpp ƤӽФˡ˥󥯤Ƥ mcpp.sh ¹Ԥ졢mcpp ˾嵭Υץgcc ղä륪ץˡղäƸƤӽФޤ

ǥեȤΥץѹϡmcpp.sh ѹʤꡢmcpp ľܸƤӽФʤꤷޤơGCC / cpp Ȥ

ln -sf cpp_gnuc cpp

Ȥޤ

:

*1 mcpp V.2.7 GCC-specific-build ˤλͤ줿ΤǡʤƤץץϤǤ褦ˤʤä

*2 mcpp configure ƥ󥹥ȡ뤷ϼưŪŬڤ꤬롣 Ȥ -Q -lang-asm ץɲäǤࡣ

3.9.5.1. mcpp Υ˥󥰤ˤ

mcpp ȤΤ⤦Ĥϡ̤Υ˥󥰤Ϥ뤳ȤǤ-Q ץǥ쥯ȤƤ⡢glibc Τ褦絬Ϥʥ mcpp.err ׿ɴ MB ʾˤʤΤǡ٤Ƥܤ̤櫓ˤϤޤ
Ƥ򸫤ȡƱ˥󥰤֤ФƤ뤳Ȥ狼ޤƱ *.h ե뤬¿Υ #include 뤿ˡƱ˥󥰤֤֤ФΤǤƸˤϡΤ褦ˤޤ
ޤ顼åޤ

grep 'fatal:' `find . -name mcpp.err`
grep 'error:' `find . -name mcpp.err`

ˡ˥󥰤ޤ

grep 'warning:' `find . -name mcpp.err` | sort -k3 -u > mcpp-warnings-sorted

˥󥰤νн򤹤٤Ƹ뤿ˤϡΤ褦ˤޤ

grep 'warning:' `find . -name mcpp.err` | sort -k3 | uniq > mcpp-warnings-all

μΥ˥󥰤򸫤ˤϡȤмΤ褦ˤޤ

grep 'warning: Replacement' `find . -name mcpp.err` | sort -k3 | uniq | less

ƸĤǡ mcpp.err less ǸƤǧɬפʤ饽򸫤ޤ
ɬפʤ顢θĽ #pragma MCPP debug expand, #pragma MCPP end_debug ǶǺ٥ץץơνϤ򸫤ޤλˤϡץץνϤȿǥåȤƱե˽Ф褦ˡΤ褦ˤޤmake ϡ嵭 shell-script 񤭴ˡ

mcpp <-opts> in-file.c > in-file.i 2>&1

3.9.6. GCC 3.2 Υץץ

Linux FreeBSD ǡGCC 2.95.* GCC 3.2R (2002/08) Υ򥳥ѥ뤷Ƥߤޤơ줿 gcc Ȥä mcpp 򥳥ѥ뤷˥ץץˤȤä GCC 3.2 GCC 3.2 Υꥳѥ뤷Ƥߤޤ

GCC make ϤĤʳФ bootstrap Ƥ椯褦ˤʤäƤޤʤǽʳ줿 gcc, cc1, etc. ȤäƼʬȤꥳѥ뤷äƺ줿ΤȤäƤޤʬȤꥳѥ뤷Ȥäв򤿤ɤޤgcc bootstrap Ǥ xgcc Ȥ̾¸ߤƤޤ

ޤGCC 2 Ǥ cc1, cc1plus ΩƤ cpp GCC 3 Ǥ cc1, cc1plus ˵ۼƤޤޤΩץץåǤ cpp0 ¸ߤƤꡢgcc g++ -no-integrated-cpp ȤץդȤ˥ץץ򤵤뤳ȤǤ褦ˤʤäƤޤäơmcpp ˥ץץ򤵤뤿ˤϡgcc (xgcc), g++ θƤӽФ shell-script ֤ơmcpp => cc1 ޤ mcpp => cc1plus ȤǼ¹Ԥ褦ˤʤФʤޤ*1

GCC ΥƥǤϡƥإå䤽Υ꤬ʣˤʤäƤƤޤޤGCC 3 Ǥ GCC Ū˻Ȥ C++ shared library λͤ GCC 2 ȤѤä褦ǤΤᤫѥ뤹Ǥ⤦ޤ椫ʤȤޤޤѥȥƥȤˤ¿¾ΥեȥɬפǡΥС󤬸Ťȡޤ椫ʤȤޤΤȤǤϥϡɥǤޤѥǤʤȤ⤢ޤ

FreeBSD 4.4R Ǥ GCC 3.2 ϥѥǤޤǤFreeBSD 4.7R upgrade packages 4.7 ѤΤΤؤơ褦䤯ѥ뤹뤳ȤǤޤ*2
ΤȤǤϣΥѥƱ VineLinux 2.5 äƤޤ (K6/200MHz) Ǥ GCC 2.95.3 ȤäƤΥѥϤǤΤΡ줿 GCC 3.2 / cc1 segmentation fault 򷫤֤ƤޤʬȤΥꥳѥ뤬ǤޤǤθ塢K6 AthlonXP ˼ؤƥꥳѥ뤷Ȥ٤ segmentation fault ȯޤǤϥϡɥäΤ⤷ޤ
ޤFreeBSD Ǥ K6 Υѥ GCC 2.95.4 Ȥä GCC 3.2 򥳥ѥ뤷ϡmake -k check ǤϤۤȤɤ٤̤äΤǤ줿 GCC 3.2 GCC 3.2 Ȥꥳѥ뤷Ȥ٤ϡg++, libstdc++-v3 make -k check testsuite Σ᤯̤ʤȤݤⵯޤAthlonXP ˼ؤƤϤޤ椯褦ˤʤޤϡɥäΤ⤷ޤ

ޤVineLinux GCC 3.2 Ȥ mcpp Ȥäƥꥳѥ뤷ϡ줿 gcc make -k check ̤ޤg++, libstdc++-v3 testsuite Σ᤯̤ޤǤ*3, *4, *5
ɤˤƤ⡢줿 gcc, g++, cc1, cc1plus ǤϤʤإåե뤫饤֥꤫̯Τ褦Ǥ
mcpp GCC Ȥϴ˸ߴǤϤޤ󤬡ʤ⤤ߴäƤΤǡؤƻȤäƤۤϤʤȻפޤ

GCC 3.2 Υѥ˻ȤäƥϼΤΤǤ

OS make library CPU
VineLinux 2.5GNU makeglibc 2.2.4Celeron/1060MHz
VineLinux 2.5GNU makeglibc 2.2.4K6/200MHz
VineLinux 2.5GNU makeglibc 2.2.4AthlonXP/2.0GHz
FreeBSD 4.7R UCB makelibc.so.4 K6/200MHz
FreeBSD 4.7R UCB makelibc.so.4 AthlonXP/2.0GHz

ѥ뤷Τ C C++ Ǥ

:

*1 bootstrap γʳȤˤʤФʤʤΤǤ롣 Makefile ϼˤϤޤ礭ʣʤΤǡ̤ĥդƤơstage ѤäȤ ^C Ǥơscript ֤ȤԺٹˡȤä

*2 ⡢¿ packages δ֤ΰ¸طΤǡС󤬤ޤޤȺ롣ΤȤǤϤΤˡ kterm ưʤȤ֤˴٤äȤ⤢롣

*3 make -k check mcpp ϻȤäƤϤʤǥå GCC Ȥϰۤʤ뤫Ǥ롣

*4 make -k check ϴĶѿ LANG, LC_ALL C ȤơѸĶˤʤȤʤ

*5 Testsuite ̤ʤľܤθϤ٤ơi686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.5.0.0 Ȥ饤֥ pthread_getspecific, pthread_setspecific pthread_* Ȥؿ󥯤ǤʤȤΤǤ롣줿Υ饤֥ƤСmake -k check ̤롣FreeBSD ǤϤϵʤ̯Τ褦Ǥ롣

3.9.6.1. Ԥޤʸƥ

ΤޤˤŤ GCC 3.2 ΥˤϤޤ󡣤λͤ GCC 3.2 Ǥ褦䤯 obsolete Ȥޤˤ줬ȡ̤˽Ϥޤ˥󥰤Фޤ

3.9.6.2. #include_next, #warning

Make build/gcc/include limits.h, syslimits.h ˤ #include_next ꡢGCC 3.2 install ȡlib/gcc-lib/i686-pc-linux-gnu/3.2/include limits.h, syslimits.h ˥ԡޤ

#warning ϸޤǤ

3.9.6.3. Ѱޥ

ѰޥϤĤޤȾ testsuite ΤΤǡƥѤ˽񤫤줿ץˤޤ󡣤ơGCC 2 εˡϤޤݡȤƤϤΤΡ__VA_ARGS__ Ȥä C99 ΤΤ¿ʤäƤޤ

ޤGCC 3 Ǥ GCC 2 λͤ C99 λͤȤŪʽɲäƤޤηǤ*1

#define eprintf( fmt, ...)   fprintf( stderr, fmt, ##__VA_ARGS__)

GCC 2 ͤμνбޤ

#define eprintf( fmt, args...)   fprintf( stderr, fmt, ##args)

ϡ... бʤäϡľΥޤȤͤǤȤСΤ褦Ÿޤ

eprintf( "success!\n")  ==>  fprintf( stderr, "success!\n")

򸫤ʻͤΤ褦ǤޥִꥹΥޤϥѥ᡼ڤΤȤϸ¤ʤȡȡϢ黻ҤǤ ## ̤Ư򤵤Ƥ뤳ȡ§㳰äʣˤΤǤ뤳ȡ꤬ޤ*2, *3, *4

:

*1 Υޥ˥奢ǤϡGCC 2 βѰޥ GCC2 ͡GCC 3 ɲä줿Τ GCC3 ͤȸƤ֤Ȥˤ롣

*2 GCC 2.* Ǥ GCC2 ͤβѰޥ args... Ǥ args ... ȤϤäĤƤʤФʤʤäGCC 3 Ǥϴ֤ space äƤƤɤʤä

*3 -ansi ץ󤬻ꤵ줿-std=c*, -std=iso* ץǤƱ͡ˡѰ¸ߤʤƤ⥳ޤϺʤ '##' ۤäƾä롣

*4 mcpp Ǥ V.2.6.3 GCC-specific-build STD ⡼ɤ˸¤äơGCC3 ͤβѰޥ줿 V.2.7 GCC2 ͤΤΤˤб

3.9.6.4. ޥƤӽФΥ

ޥƤӽФΥϡ#include 륷ƥإåΤΡ/usr/include/bits/mathcalls.h, /usr/include/bits/sigset.hˤ̤ȤȡGCC 3.2 ΥΤǤϡgcc/libgcc2.h ˤޤ*1

:

*1 ΣĤΥإåե glibc install 뤳ȤǥƥإåäƤ椯ΤǤ롣FreeBSD Ǥ glibc ȤäƤʤΤǡΥƥإå¸ߤʤ

3.9.6.5. Function-like ޥִ̾ object-like ޥ

gcc/fixinc/gnu-regex.c, libiberty/regex.c ˤϡfunction-like ޥִ̾ object-like ޥޤޤ#include /usr/lib/bison.simple ƱͤǤϤ٤ alloca ˴ؤΤǤȤСlibiberty/regex.c ˤϤޥޤ

#define REGEX_ALLOCATE  alloca
#define alloca( size)   __builtin_alloca( size)

ϡ񤱤ʤΤǤʤʤȤάΤǤ礦

#define REGEX_ALLOCATE( size)   alloca( size)

regex.c Ǥ alloca ϾˤäƤϼΤ褦褦ˤʤäƤꡢ뤬ӤƤޤ

#define alloca  __builtin_alloc

ޤregex.c ˤ #include "regex.c" ȤԤꡢʬȤ򥤥󥯥롼ɤ褦ˤʤäƤޤʣʥǤ

3.9.6.6. 'defined' Ÿޥ

GCC 3.2 Υˤϸޤ

ɥȤˤȡμΥޥν GCC 2 / cpp ƱǤΤΡportability ʤפȤ˥󥰤ФȤˤʤäƤޤƥȤƤߤȡ3.9.4.6 Ǥϥ˥󥰤Фޤ

3.9.6.7. .S եΡ֥ץץ

GCC 3 / cpp ΥɥȤˤϡΤ褦˽񤫤Ƥޤ

Wherever possible, you should use a preprocessor geared to the language you are writing in. Modern versions of the GNU assembler have macro facilities.

GCC 3.2 ȤΥˤϡ*.S ե뤬 gcc/config ǥ쥯ȥ˿ܤޤ

3.9.6.8. rpcgen -dM ץλͤ

GCC 3.2 make Ǥ rpcgen -dM ץȤޤǤrpcgen -dM ץλͤäѤäƤϤʤ褦Ǥ

3.9.6.9. -include, -isystem, -I- ץ

ΥץϤФлȤƤꡢ-isystem ץ system include directory Ʊ˿Ļꤵ礵ޤƥإåΤΤ򹹿륽եȥΥѥǤϡ򤨤ʤȤʤΤǤ礦Ķѿǰ礷ƻꤷۤ狼䤹ȻפΤǤ

ǡGCC 3 / cpp ΥɥȤǤϡ-iwithprefix, -iwithprefixbefore ץˤĤƤϡֻȤʤۤɤ (discouraged)פȽ񤫤ƤޤGCC ˤ include directory ꤹ륪ץ󤬤䤿ˤޤäƤΤǤ礦*1

:

*1 GCC 3.2 Makefile -iprefix ץդƤ롣 Ȥ -iwithprefix, -iwithprefixbefore ϻȤʤΤǤ롣-iprefix ץϡθˤΣĤΥץΤɤ餫äƽựĤΤǤ뤬

3.9.6.10. Undocumented ʻޥ

GCC 2 Ǥ __VERSION__, __SIZE_TYPE__, __PTRDIFF_TYPE__, __WCHAR_TYPE__ λޥˤĤƤϡɥȤ˵ܤʤ-dM ץǤΤ뤳ȤǤޤǤGCC 3 ǤϥɥȤ˰̣ܤ졢Ūͤ -dM Τ뤳ȤǤ褦ˤʤޤ

3.9.6.11. Undocumented ʴĶѿ

GCC 2 ǤϥɥȤ˵ܤΤʤä SUNPRO_DEPENDENCIES ȤĶѿˤĤƤϡGCC 3 ǤϥɥȤ˵ܤ褦ˤʤޤʤʤʤΤɬפʤΤϤ狼ʤˡ

3.9.6.12. ¾

GCC 3 ǤϼΤ褦 #pragma Ƥޤ

#pragma GCC poison
#pragma GCC dependency
#pragma GCC system_header

GCC 3.2 ΥǤ⡢Τ poison system_header ȤƤޤmcpp ǤϤϥݡȤƤޤ󡣻ͤϾʤޤɬޤ괶ʤǤ*1

GCC 3 Ǥ #assert assertion directives ϡֿ侩ʤ (deprecated)פȤޤʤgcc ϥǥեȤ -A ץȯԤ뤬ˡ

ޤGCC 2 Ǥ -traditional ץƱ cpp ǼƤꡢΤ˸Ťͤ C90 λͤߤʻͤȤʤäƤޤGCC 3.2 Ǥϥץץå̾ cpp0 tradcpp0 Ȥʬޤ-traditional ץ gcc ФƤͭǡcpp0 ˤϤޤgcc -traditional ϥץץ tradcpp0 ƤӽФޤtradcpp0 C90 ο traditional ʥץץå˶ᤤΤȤʤäƤޤơtradcpp0 ΤۤϺ塢ʥХνʳϥƥʥ󥹤ʤȤƤޤ

GCC 2 / cpp δ̯ʻͤϤֽƤ褦˸ޤ

:

*1 mcpp V.2.7 GCC-specific-build #pragma GCC system_header 򥵥ݡȤ

3.9.7. GCC 3, 4 mcpp Ȥˤ

ʾ˸Ƥ褦ˡGCC 3.2 ΥϾʤȤץץϡglibc 2.1.3 ʤɤ٤Ȥʤ꤭줤ʤΤˤʤäƤޤTraditional ʽϤۤܰݤ졢̣ΤʤץϻȤʤʤäƤƤޤ
ޤGCC 3.2 / cpp0 ΤΤ⡢traditional ʻͤ obsolete ʤΤȤưtoken-based ʸ§ΤˤʤɡGCC 2 / cpp ٤ȳʤͥ줿ΤȤʤäƤޤɥȤ undocumented ʬ˸ޤޤṲ̋¿ޤȤƤɤ˸äƤȻפޤ

GNU ΥƥǤϥƥإåʣǡɤʤäƤΤưפİǤʤ褦ˤʤäƤޤ줬 GNU ΥƥΥȥ֥κװȤʤäƤΤǤϤʤǤ礦

⤦ĻǰʤΤϡץץѥΤ˵ۼƤޤäȤǤΤᡢmcpp Ȥˤ gcc g++ -no-integrated-cpp ȤץդƸƤӽФɬפޤʣ makefile ¿ makefile 礭ʥե뷲򥳥ѥ뤹䡢Υץफ gcc ưŪ˸ƤӽФϡgcc, g++ θƤӽФ shell-script ֤ơΥץ󤬼ưŪղä褦ˤʤФʤޤ

Ūˤϡgcc, g++ ֤Ƥǥ쥯ȥʻ Linux Ǥ /usr/local/gcc-3.2/binˤ˼Τ褦 script 򤽤줾 gcc.sh, g++.sh Ȥ֤̾ޤ

#!/bin/sh
/usr/local/gcc-3.2/bin/gcc_proper -no-integrated-cpp "$@"
#!/bin/sh
/usr/local/gcc-3.2/bin/g++_proper -no-integrated-cpp "$@"

ơΥǥ쥯ȥǼΤ褦ˤޤ

chmod a+x gcc.sh g++.sh
mv gcc gcc_proper
mv g++ g++_proper
ln -sf gcc.sh gcc
ln -sf g++.sh g++

ޤcpp ֤Ƥǥ쥯ȥʻ Linux Ǥ /usr/local/gcc-3.2/lib/gcc-lib/i686-pc-linux-gnu/3.2ˤǡGCC 2 ξƱͤˡcpp0 θƤӽФ mcpp ¹Ԥ褦ˤƤޤ 3.9.5 ȡˡ*1
Ƥȡgcc g++ ޤ mcpp ƤӽФ졢θ cc1, cc1plus -fpreprocessed ȤץץѤߤǤ뤳Ȥ򼨤ץդƸƤӽФ褦ˤʤޤ

ʤƥɸȰۤʤС GCC 򥤥󥹥ȡ뤷ղŪ include directory ꤬ɬפʤȤޤmcpp ǤϤ mcpp ΥѥȤ߹Τǡ̾ϴĶѿꤹɬפϤޤ

Ǥ cc1, cc1plus ΥץץʬǤ cpplib Υ mcpp ΤΤ֤ȤǤcpplib cc1, cc1plus ȤŪ interface cpplib Ȥ桼ץȤγŪ interface Ƥ륽ե뤬碌 46KB ⤢ꡢȤƤ֤ԲǽǤɤƤʣ interface ˤɬפΤǤ礦ǰʤȤǤ

:

*1 configure mcpp 򥤥󥹥ȡ뤷ϡ餬ưŪꤵ롣

3.9.7.1. GCC 3.3, 3.4-4.1 mcpp Ȥˤ

ɤ˸äƤ GCC V.3 ǤV.3.3 ̯žƤޤޤV.3.3 V.3.2 ٤ȡΤ褦礭ѤäƤޤ

  1. ñΤ cpp0 Ϥʤʤägcc -no-integrated-cpp ϤޤȤ뤬ƤӽФΤ cc1 (cc1plus) Ǥ롣ʤץץǤ⥳ѥǤ cc1 ƤӽФ롣ơץץե cc1 ˥ץץѤǤʤץ󤬤ФϤʲȤˡ
  2. 60 Ĥ 70 Ĥ̤ΥޥƤ롣ˤäƥƥإå GCC Ȥδطʣˤʤä
  3. tradcpp ʤʤꡢGCC V.3.2 Ǥ obsolete Ȥ deprecated Ȥ줿Ťͤΰ褷

ΤȤơĤεʥѥˤ٤ƤۼȤʤäƤꡢýϤιΤȤƤ⡢ץ󥽡νϤγȯȤƤ⡢礤˵ΤȤǤ

mcpp ΰܿǤϡgcc ɤʥץϤƤ뤫狼ʤȤΤȤǤְäץ⤹٤ƥå̵뤹ΤǤϴޤȤꤢФдְäϤƤ륪ץ̵뤹褦ˤޤʳΥץϤȥ顼ˤʤϤǤ
ѹǤ⡢mcpp νΥץˤϻȤʤʤäΤޤV.2.5 -E ץѻߤ-m ץ -e ˡ-c -@compat ѹޤ
ޤGCC V.3.2 Ǥ cpp0 θƤӽФ mcpp ֤ФȤ٤ cc1 (cc1plus) θƤӽФ mcpp cc1 (cc1plus) Ȥ˿ʬ뤳ȤɬפˤʤޤΤ shell-script src/set_mcpp.sh Ѱդޤ̤λޥϣģбƤ櫓ˤϤʤΤǡGCC -dM ץνϤ礷Ѥ褦ˤޤ*1, *2, *3

GCC V.3.4 ǤϤˡmulti-byte character Ϥ٤ UTF-8 ѴƤ褦ѤޤɥȤˤȡŪˤϼΤ褦ˤʤäƤޤ*4

  1. ץץκǽΥեǡmulti-byte character UTF-8 Ѵ롣
  2. Ѵˤ libiconv δؿȤäơiconv бƤ encoding Ϥ٤ƻȤ롣
  3. ե encoding ꤹˤ -finput-charset=<encoding> ץȤʼºݤˤϡꤷʤ UTF-8 ˤѴʤˡ
  4. ѥ encoding ϥǥեȤǤ UTF-8 Ǥ뤬-fexec-charset=<encoding> ץ¾ encoding ꤹ뤳ȤǤ롣*5

ֹݲפȸ Unicode б뤳ȤȹͤĬȤ˼ºݤ multi-byte character Ȥʤο͡δ֤ˤޤĬ GCC ˤڤǤޤä褦Ǥ

⡢ͤޤʬ˼Ƥޤ󡣼ºݤ˻ȤäƤߤȡΤ褦ˤʤޤ

  1. EUC-JP, GB2312, KSC-5601, Big5 -finput-charset ץꤹ UTF-8 Ѵ졢ꤷʤФΤޤ̤롣*6
  2. -fexec-charset ץ V.3.4, 4.0 ǤϸʤäV.4.1-4.3 Ǥϸ
  3. ISO2022-JP V.3.4, 4.0 ǤϽǤʤäV.4.1-4.3 ǤϤǤ롣
  4. ɤΥСǤ shift-JIS -finput-charset ꤹȤäƺ𤷤Ƥޤ

mcpp -e <encoding> ץ encoding ꤷޤGCC-specific-build ǤϡBIG5, shift-JIS, ISO2022-JP Ǥ <backslash> ȰפͤΥХȤľ <backslash> ƥѥη٤䤤ޤUTF-8 ˤѴ encoding Τޤ޽Ϥޤ-finput-charset ץ -e ץƱΤȤưޤϼΤ褦ͳǤ*7

  1. SJIS -f*-charset ꤹȡɤΥС GCC ǤǤ롣ɤΥС GCC Ǥ⡢SJIS, JIS, BIG5 Ѵ <backslash> äƤȤΤޤ̤ꡢ̤η̤ˤʤ롣 EUC-JP, GB2312, KSC-5601 ѴʤФΤޤ̤롣 ʤsingle byte character sequence Ǥ뤫Τ褦˰롣
  2. GCC 4.0 ޤǤΥСǤϤɤ encoding UTF-8 鸵 encoding ᤻ʤ
  3. GCC ζᤤλѹԤ

:

*1 -dM ץνϤ¾ΥץˤäƾäƤΤǤ롣 ⡢λޥȾ undocumented ʤΤǤ롣 ΤᡢƤϤʤʤİǤʤ

*2 MinGW Ǥ symbolic link Ȥʤln -s ȤޥɤϤ뤬ñ˥ԡΤΤǤ롣ޤMinGW GCC ϤȤ cc1 Ȥ̾ΥեǤäƤ⤽줬 shell-script Ǥȡưݤ롣Τᡢmcpp GCC-specific-build ǤϡMinGW ˸¤ä cc1.exe Ȥ̾μ¹ԥץʤ cc1plus.exe ˤ⥳ԡˡơ椫 mcpp.exe ޤ GCC cc1.exe ʤ cc1plus.exe ư褦ˤƤ롣

*3 CygWIN / GCC Ǥ -mno-cygwin Ȥץ󤬤ꡢꤹ system include directory ѤꡢGCC λޥѤ롣Τᡢmcpp CygWIN GCC-specific-build Ǥ V.2.6.1 ϣåȤλޥѰդ褦ˤ

*4 ΤȤ FreeBSD 6.3 ǤϤʤ GCC ΤѴϤޤäưʤlibiconv ϥ󥯤ƤΤǤ뤬 FreeBSD 5.3, 6.2 Ǥ⤽Ǥä

*5 ѴϥץץեǤϤʤѥեǹԤ褦Ǥ롣 -E ץνϤ UTF-8 ΤޤޤǤ롣

*6 GCC V.4.1-4.3 Ǥϡ-save-temps ޤ -no-integrated-cpp ץ -f*-charset ץƱ˻ꤹȡ顼ˤʤȤХ롣

*7 mcpp νϤ cc1 Ϥˤ -finput-charset Ϥ -fexec-charset ץդƤϤʤ

3.9.8. Linux / glibc 2.4 Υץץ

glibc 2.4 (2006/03) Υ򥳥ѥ뤷ơץץåƤߤޤ Ϥ GCC 4.1.1 ǡץץå mcpp 2.6.3 ֤ΤǤ ޥ x86 ϤʤΤǡ¾ CPU ѤΥɤϥåƤޤ

˻䤬å glibc 2.1.3 (2000/02) 飶ǯФäСʤΤǡ礭ѤäȤ󤢤ޤճѤäƤʤȤ¿ޤ ΤȤƤϡΥСˤĤƻ䤬夲줺ˡष뷹ˤޤ

3.9.8.1. Ԥޤʸƥ

Ԥޤʸƥϸʤʤޤ

3.9.8.2. #include_next, #warning

Υեˤ #include_next ޤ ǯȾΥС٤Ƥޤ

catgets/config.h, elf/tls-macros.h, include/bits/dlfcn.h, include/bits/ipc.h, include/fpu_control.h, include/limits.h, include/net/if.h, include/pthread.h, include/sys/sysctl.h, include/sys/sysinfo.h, include/tls.h, locale/programs/config.h, nptl/sysdeps/pthread/aio_misc.h, nptl/sysdeps/unix/sysv/linux/aio_misc.h, nptl/sysdeps/unix/sysv/linux/i386/clone.S, nptl/sysdeps/unix/sysv/linux/i386/vfork.S, nptl/sysdeps/unix/sysv/linux/sleep.c, sysdeps/unix/sysv/linux/ldsodefs.h, sysdeps/unix/sysv/linux/siglist.h

Υե make check ǻȤƥѤΤΤǤˤ #include_next ޤ

sysdeps/i386/i686/tst-stack-align.h

#warning sysvipc/sys/ipc.h ˤޤ˥ѥ뤵Ȥϥåפ֥åˤΤǡҤä뤳ȤϤޤ

3.9.8.3. Ѱޥ

ΥեˤϲѰޥޤϤ٤ GCC2 θŤͤΥޥǤ C99 λͤΤΤϤGCC3 ͤΤΤ⸫ޤ

elf/dl-lookup.c, elf/dl-version.c, include/libc-symbols.h, include/stdio.h, locale/loadlocale.c, locale/programs/ld-time.c, locale/programs/linereader.h, locale/programs/locale.c, locale/programs/locfile.h, nptl/sysdeps/pthread/setxid.h, nss/nss_files/files-XXX.c, nss/nss_files/files-hosts.c, sysdeps/generic/ldsodefs.h, sysdeps/i386/fpu/bits/mathinline.h, sysdeps/unix/sysdep.h, sysdeps/unix/sysv/linux/i386/sysdep.h

ϥƥѤΥ롼Ǥˤ GCC2 ͤβѰޥޤ

localedata/tst-ctype.c, posix/bug-glob2.c, posix/tst-gnuglob.c, stdio-common/bug13.c

ºݤˤΥޥƤӽФȤˤϡѰĤʤʥʤ§ŪʸƤӽФ¿ʤäƤޤ μ§ŪʥޥƤӽФ 142 ܤΥե˸ޤ ΤִꥹȤDzѰľ ", ##" Ȥ sequence äƤ ',' 륱ϡ120 ܤΥ˸ޤ

Ѱޥ C99 λͤȤäۤ portable ɤΤǤGCC2 뤤 GCC3 ͤβѰޥ C99 ͤΤΤ˽ľΤϡɬñǤϤޤ GCC2 뤤 GCC3 ͤǤϼºݤΥޥƤӽФDzѰʤ硢ľΥޤΤǡޥθƤӽФˤäƤ C99 ͤȤϣУбʤǤ ޥ C99 ͤ˽񤭴硢ޤʤǤ褦ˤ뤿ˤϡޥƤӽФΤۤľɬפޤ

glibc 2.1.3 ǤϤޤΥޥοۤ¿ϤʤäΤǡ桼ܤdzΤʤ饨ǥǽ񤭴뤳ȤǤޤglibc 2.4 ǤϿ⤽ΥޥθƤӽФĽ꤬ᡢ桼񤭴뤳ȤԲǽˤʤޤ

Τᡢmcpp Ǥ V.2.6.3 GCC-specific-build ˸¤äơGCC3 ͤβѰޥޤ V.2.7 GCC2 ͤΤΤˤбޤ GCC2 ͤΤΤ token-based ʸ§ݤΥƤΤǡȤޥ򿷤񤯤٤ǤϤޤ GCC2 ͤ GCC3 ͤȣУбƤΤǡޥ GCC3 ͤ˽ľȤưפˤǤޥƤӽФľʤƤ⤹ߤޤ Ǥ GCC2 ͤǽ񤫤ƤޥϤ񤭴ۤ餫狼䤹ʤޤ*1

GCC2 ͤβѰޥ GCC3 ͤ˽ľˤϡ㤨мΤ褦ʤΤ

#define libc_hidden_proto(name, attrs...)   hidden_proto (name, ##attrs)

Τ褦ˤޤ

#define libc_hidden_proto(name, ...)    hidden_proto (name, ## __VA_ARGS__)

ʤѥ᡼ attrs... ... ˤִꥹ attrs __VA_ARGS__ ˤޤ

:

*1 GCC2 ͤ GCC3 ͤβѰޥˤĤƤϡ3.9.1.6, 3.9.6.3 򻲾ȤΤȡ

3.9.8.4. ޥƤӽФΥ

ΤޥƤӽФϤ¿488 ܤΥե˸ޤ ΥС٤Ƥޤ C99 ǥǧ줿ȤƶƤΤǤ礦

Ȥ math/bits/mathcalls.h ˤ 79 ĤΥޥƤӽФޤ ȤۤƱͤǤ

3.9.8.5. Function-like ޥִ̾ object-like ޥ

Υեˤ function-like ޥִ̾ object-like ޥޤ

argp/argp-fmtstream.h, hesiod/nss_hesiod/hesiod-proto.c, intl/plural.c, libio/iopopen.c, nis/nss_nis/nis-hosts.c, nss/nss_files/files-hosts.c, nss/nss_files/files-network.c, nss/nss_files/files-proto.c, nss/nss_files/files-rpc.c, nss/nss_files/files-service.c, resolv/arpa/nameser_compat.h, stdlib/gmp-impl.h, string/strcoll_l.c, sysdeps/unix/sysv/linux/clock_getres.c, sysdeps/unix/sysv/linux/clock_gettime.c

elf/link.h ˤϼΤ褦 function-like ޥִ̾ function-like ޥޤ

#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
                                        /* sysdeps/generic/ldsodefs.h:46    */
#define _ElfW(e,w,t)    _ElfW_1 (e, w, _##t)            /* elf/link.h:32    */
#define _ElfW_1(e,w,t)  e##w##t                         /* elf/link.h:33    */
#define __ELF_NATIVE_CLASS __WORDSIZE               /* bits/elfclass.h:11   */
#define __WORDSIZE 32           /* sysdeps/wordsize-32/bits/wordsize.h:19   */
#define ELF32_ST_TYPE(val) ((val) & 0xf)                /* elf/elf.h:429    */

嵭Τ褦ʥޥȡ

    && ELFW(ST_TYPE) (sym->st_info) != STT_TLS      /* elf/do-lookup.h:81   */

ΥޥƤӽФǤ ELFW(ST_TYPE) Τ褦ŸƤޤ

    ELFW(ST_TYPE)
    _ElfW(ELF, __ELF_NATIVE_CLASS, ST_TYPE)
    _ElfW_1(ELF, 32, _ST_TYPE)
    ELF32_ST_TYPE

ơELF32_ST_TYPE (sym->st_info) 򴬤 ((sym->st_info) & 0xf) Ÿޤ ʤ_ElfW_1(ELF, 32, _ST_TYPE) Ȥ function-like macro θƤӽФ ELF32_ST_TYPE Ȥ̤ function-like macro ̾ŸΤǤ

ϣĤΥޥ򼡤Τ褦˽񤤤ơ

#define ELFW( type, val)        _ElfW( ELF, __ELF_NATIVE_CLASS, type, val)
#define _ElfW( e, w, t, val)    _ElfW_1( e, w, _##t, val)
#define _ElfW_1( e, w, t, val)  e##w##t( val)

Τ褦˸ƤӽФۤ狼䤹ʤޤ ϤĹ˸뤫⤷ޤ󤬡ؿƤӽФǥȤƹͤСΤۤǤ礦

    && ELFW(ST_TYPE, sym->st_info) != STT_TLS

3.9.8.6. 'defined' Ÿޥ

Υեˤϡִꥹ 'defined' ȤȡνФƤޥޤ*1

iconv/skeleton.c, sysdeps/generic/_G_config.h, sysdeps/gnu/_G_config.h, sysdeps/i386/dl-machine.h, sysdeps/i386/i686/memset.S, sysdeps/mach/hurd/_G_config.h, sysdeps/posix/sysconf.c

ΥեǤϤΥޥ #if ԤǻȤƤޤ ޤ嵭Υե뼫ȤǤȤƤ礬ޤ

elf/dl-conflict.c, elf/dl-runtime.c, elf/dynamic-link.h

glibc 2.1.3 malloc/malloc.c ˤ HAVE_MREMAP ȤϤִꥹȤ 'defined' ФƤޥޤglibc 2.4 ǤϤ portable ʷľƤޤ ¾ΥˤμΥޥƤޤޤ

#if Ԥִꥹ 'defined' ФƤޥƤӽФη̤ϵʤǤ undefined ǤꡢŪ˽Τ GCC ξͤǤ ¾νϤǤǤ portable ʥˤ뤿ˤϡΥޥ񤭴뤳ȤɬפǤ ˤϥޥƤӽФ񤭴ʤФʤޤ*2

ν񤭴¿ξϡ3.9.4.6 ˤˡǤǤޤ ˤϤǤбǤʤΤ⤢ޤ 'defined MACRO' ɾߥ󥰤ˤäưۤʤǤ 㤨Сsysdeps/i386/dl-machine.h ˤϼΤ褦ʥޥꡢΥޥ¾Υե #if ǻȤƤޤ

#define ELF_MACHINE_NO_RELA defined RTLD_BOOTSTRAP

򤳤񤭴ΤǤϡޤޤ

#if defined RTLD_BOOTSTRAP
#define ELF_MACHINE_NO_RELA 1
#endif

RTLD_BOOTSTRAP Ȥޥ elf/rtld.c ޤ줬 dl-machine.h include ȸ include 礬ꡢˤä 'defined RTLD_BOOTSTRAP' η̤äƤΤǤ portable ˽ľˤϡELF_MACHINE_NO_RELA ȤޥȤȤơΤ褦 #if Ԥ

#if ELF_MACHINE_NO_RELA

Τ褦ˤޤ ELF_MACHINE_NO_RELA #if ԤǤȤƤʤ̵ѤʥޥʤΤǤ

#if defined RTLD_BOOTSTRAP

glibc ǤϼºݤˤνˤʤäƤȤ¿ΤǤ줬 ELF_MACHINE_NO_RELA Ȥ undefined ʽȺߤƤޤ

:

*1 Linux Ǥ /usr/include/_G_config.h glibc sysdeps/gnu/_G_config.h 󥹥ȡ뤵줿ΤʤΤǡˤ⼡Τ褦Ʊޥ롣

#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)

Ϥ񤭴Ƥ٤Ǥ롣

#if defined (_STATBUF_ST_BLKSIZE)
#define _G_HAVE_ST_BLKSIZE 1
#endif

*2 mcpp V.2.7 GCC-specific-build STD ⡼ɤ˸¤äơ#if ԤΥޥ˽ФƤ 'defined' ȡ GCC Ʊͤ˽褦ˤ bug-to-bug н򤢤Ƥˤ٤ǤϤʤ

3.9.8.7. .S եΡ֥ץץ

*.S ե CPU ȤѰդƤΤǤ¿1000 ܤޤ⤢ޤx86 CPU ǻȤΤϤΤΰˡ

*.S եϥ֥饽 C #if, #include directive 䥳Ȥޥ򺮺ߤΤǤ֥饽 C token sequence η򤷤ƤʤΤǡ C ץץåǽ뤳Ȥˤ̵ޤ ץץå C ǻȤʤ %, $ ʸ⤽Τޤ̤space ̵ͭ⸶§ȤƤΤޤްݻʤФʤޤ C Ǥϥ顼ˤʤȤ򥨥顼ˤˤΤޤ̤褦ˡʸˡå˴¤ʤФʤޤ ơΰ #if ޥϽΥ顼å⤷ʤФʤʤΤǤ äʤȤǤ λͤˤϤ٤ŪʺϲʤGCC local ʡ¿ undocumented ʡ˻ͤȤäƤˤޤ

nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S ˤϼΤ褦ʬޤ

    .byte   8               # Return address register
                            # column.
#ifdef SHARED
    .uleb128 7              # Augmentation value length.
    .byte   0x9b            # Personality: DW_EH_PE_pcrel
                            # + DW_EH_PE_sdata4

'#ifdef SHARED' C directive ǤƹԤθȾ # ǻϤޤʬϥȤΤĤΤ褦Ǥ '# column.' Τ褦˹Ԥκǽ non-white-space-character # ξϡ̵ directive ȹʸ塢̤Ĥޤ '# + DW_EH_PE_sdata4' ˻äƤ C ǤϹʸ顼ˤʤΤǤ
¾ΥեˤϼΤ褦⤢ޤ '\'' Ȥʸ C Ǥ character constant ξü˻ȤΤʤΤǡ줬ñȤǸ tokenization Υ顼ˤʤޤ

    movl 12(%esp), %eax     # that `fixup' takes its parameters in regs.

ˡ嵭 pthread_cond_wait.S ˤϼΤ褦ʬޤϥޥθƤӽФǤ

versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
          GLIBC_2_3_2)

ΥޥϼΤ褦ˤʤäƤޤ

# define versioned_symbol(lib, local, symbol, version) \
  versioned_symbol_1 (local, symbol, VERSION_##lib##_##version)
                                    /* include/shlib-compat.h:65    */
# define versioned_symbol_1(local, symbol, name) \
  default_symbol_version (local, symbol, name)
                                    /* include/shlib-compat.h:67    */
# define default_symbol_version(real, name, version) \
     _default_symbol_version(real, name, version)
                                    /* include/libc-symbols.h:398   */
#   define _default_symbol_version(real, name, version) \
     .symver real, name##@##@##version
                                    /* include/libc-symbols.h:411   */
#define VERSION_libpthread_GLIBC_2_3_2  GLIBC_2.3.2
                            /* make  abi-versions.h:145 */

ˤäơΥޥϤŸ̤ˤʤ뤳ȤԤƤޤ

.symver __pthread_cond_wait, pthread_cond_wait@@GLIBC_2.3.2

_default_symbol_version Ǥ '@' Ȥʸ C token (pp-token) ˤϤޤ ơ ## 黻ҤϢ뤷 pthread_cond_wait@@GLIBC_2.3.2 Ȥ token ⤢ޤ Ϣˤ illegal token ޤ Υޥ C ## 黻ҤȤäƤޤʸˡ C ȤϳݤΥ줿ΤǤ

֥饽ˤĤƥץץΤ褦ʤȤ򤹤ΤǤСϤꥢ֥ѤΥޥץåȤ٤Ǥ礦 C ץץåȤΤǤС*.S ǤϤʤ *.c Ȥơ֥ѤΥɤʸƥ asm() ʤ __asm__() ʤδؿϤ٤Ǥ礦 libc-symbols.h ˤϼΤ褦̥СΥޥѰդƤơ*.c ǤФ餬Ȥޤ ϵʽ C ץץåʤǤޤ

#   define _default_symbol_version(real, name, version) \
     __asm__ (".symver " #real "," #name "@@" #version)

glibc ˤ asm() __asm()__ Ȥä *.c, *.h ե¿ޤޤȾ§Ū *.S եȤʤäƤޤ

ɤƤ⥢֥饽 C ץץåǽΤǤСƥȵȤƤ # ǤϤʤ /* */ // Ȥ٤Ǥ ºݡglibc Ǥ /* */ // ȤäƤ륽¿ΤǤ# ȤäƤ륽⤤Ĥޤ

Ȥϸglibc 2.4 Ǥ *.S ե뤬ޤˤ¿ 2.1.3 Τ C ʸˡ̵뤷¿ʤäƤΤǡmcpp Ǥ V.2.6.3 lang-asm ⡼ɤǤʸˡå˴¤§Ǥ褦ˤޤ

3.9.8.8. versions.awk, rpcgen -dM ץλͤ

3.9.4.8 ˽񤤤 stdlib/isomac.c ѤäƤޤ

rpcgen ѤäƤޤ

glibc 2.4 ˤ scripts/versions.awk Ȥե뤬ޤϥץץåνϤιƬ space οˤĤơGCC ǤѤʤǤޤ mcpp ¾ΥץץåȤˤϡΥե򼡤Τ褦˽ʤФʤޤ

$ diff -c versions.awk*
*** versions.awk        2006-12-13 00:59:56.000000000 +0900
--- versions.awk.orig   2005-03-23 10:46:29.000000000 +0900
***************
*** 50,56 ****
  }

  # This matches the beginning of a new version for the current library.
! /^ *[A-Z]/ {
    if (renamed[actlib "::" $1])
      actver = renamed[actlib "::" $1];
    else if (!versions[actlib "::" $1] && $1 != "GLIBC_PRIVATE") {
--- 50,56 ----
  }

  # This matches the beginning of a new version for the current library.
! /^  [A-Za-z_]/ {
    if (renamed[actlib "::" $1])
      actver = renamed[actlib "::" $1];
    else if (!versions[actlib "::" $1] && $1 != "GLIBC_PRIVATE") {
***************
*** 65,71 ****
  # This matches lines with names to be added to the current version in the
  # current library.  This is the only place where we print something to
  # the intermediate file.
! /^ *[a-z_]/ {
    sortver=actver
    # Ensure GLIBC_ versions come always first
    sub(/^GLIBC_/," GLIBC_",sortver)
--- 65,71 ----
  # This matches lines with names to be added to the current version in the
  # current library.  This is the only place where we print something to
  # the intermediate file.
! /^   / {
    sortver=actver
    # Ensure GLIBC_ versions come always first
    sub(/^GLIBC_/," GLIBC_",sortver)

3.9.8.9. -include, -isystem, -I- ץ

-isystem, -I- ץϻȤƤޤ

-include ץ϶üˤ˻ȤƤޤ include/libc-symbols.h Ȥإåե뤬 -include ץˤä 7000 include ΤǤ Υץϡϥ #include ǽ񤯤٤Ԥ makefile ˲ФƻȤΤΤǤ ԴˤΤǡ褷ɤȤǤϤޤ

3.9.8.10. Undocumented ʻޥ

glibc ǤϤʤGCC Ǥ GCC 2 ǤϤĤνפʻޥ undocumented Ǥξ֤ GCC 3 Dzäޤ ¾ GCC 3.3 ϻޥüΤȼäơundocumented ʤΤƤޤޤ

3.9.8.11. ¾

debug/tst-chk1.c ˤϴ̯ʬꡢΤ褦˽ʤ GCC ʳΥץץåǤϰտ̤˽ޤ

$ diff -cw tst-chk1.c*
*** tst-chk1.c  2007-01-11 00:31:45.000000000 +0900
--- tst-chk1.c.orig     2005-08-23 00:12:34.000000000 +0900
***************
*** 113,119 ****
  static int
  do_test (void)
  {
-   int   arg;
    struct sigaction sa;
    sa.sa_handler = handler;
    sa.sa_flags = 0;
--- 113,118 ----
***************
*** 135,146 ****
    struct A { char buf1[9]; char buf2[1]; } a;
    struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa;

  #ifdef __USE_FORTIFY_LEVEL
!   arg = (int) __USE_FORTIFY_LEVEL;
  #else
!   arg = 0;
  #endif
!   printf ("Test checking routines at fortify level %d\n", arg);

    /* These ops can be done without runtime checking of object size.  */
    memcpy (buf, "abcdefghij", 10);
--- 134,146 ----
    struct A { char buf1[9]; char buf2[1]; } a;
    struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa;

+   printf ("Test checking routines at fortify level %d\n",
  #ifdef __USE_FORTIFY_LEVEL
!         (int) __USE_FORTIFY_LEVEL
  #else
!         0
  #endif
!         );

    /* These ops can be done without runtime checking of object size.  */
    memcpy (buf, "abcdefghij", 10);

θϲůʤ˸ޤ¤ϤǤ printf() ޥȤƤΤǤ Τᡢ#ifdef Υǥ쥯ƥֹԤ餷Τ̾ϥޥΰȤư̤ˤʤޤ ޥƤӽФǤʤХǥ쥯ƥֹԤȤʤΤ˸줿η̤ϡʤǤ undefined Ǥ ǥ쥯ƥ֤νȥޥŸƱ translation phase ǹԤΤǡǥ쥯ƥ֤˽ΤϡGCC ξͤǤ ⤽⡢#ifdef __USE_FORTIFY_LEVEL νˤޥνɬפʤΤǡιԤ˽Ƥ printf() ޥŸȤΤϡŪʽǤ C ץץȤΤϡƬ sequentially ˽Ƥ椯٤ΤʤΤǤ

glibc configure Ȥˤ⡢GCC ü help message Ȥʬޤ Help "-z relro" Ȥץ󤬽ФƤ뤫ɤ򥵡ΤǤ ץץå mcpp ȤäƤȡϴԤ̤ˤϤʤޤ Ǥ glibc ΥѥȥƥȤ˹Ԥޤ

ʤGCC 3.2 ޤǤ gcc ư̵Ѥ -A ץ󤬤ȥǥեȤղäޤGCC 3.3 Ϥʤʤޤ

3.9.8.12. ޤ GCC ¸

glibc 2.4 ǯ glibc 2.1.3 ٤ȡ䤬ĤƼ夲 portability ϤۤȤɲƤ餺դ portability 礤ƤƤ뤳Ȥ狼ޤ

줿ΤϡԤޤʸƥ뤬ʤʤäȡ-isystem, -I- ץ󤬻ȤʤʤäȡGCC ¦ -A ץ󤬻ȤʤʤäȤ餤Ǥ

#include_nextGCC2 ͤβѰޥǤѰ 0 ĤΥޥƤӽФִꥹȤ 'defined' Τޥ*.S ե롢-include ץ󡢤ޤޥƤӽФΥޤ Portable ʥ˽ľȤñˤϤǤʤStandard C ȣУбʤΤ⡢äʤȤǤ

Ϥ٤ GCC local ʻͤؤΰ¸ˤΤǤ GCC undocumented ư˰¸Ƥʬ¿ޤ 絬ϤʥեȥǤʬȯȡ¿Υե뤬߹礦ᡢˤʤꡢǯǤƱѾƤ椯Ȥˤʤ꤬Ǥ ơ⤽˹碌ƽ񤫤뤳Ȥˤʤޤ Ѱޥ GCC2 ͤΤΤǡC99 λͤΤΤϤ GCC3 ͤΤΤȤƤʤȤϡδطüŪɽƤޤ ޤäΥ unportable ʬľƤ⡢¾Υ˸Ť˸¿ʤʤޤ

դ GCC Τۤͤѹ礭ʱƶ⤿餹ΤǡñˤϤǤʤʤäƤޤޤ ɤλפڤäɬפȻפޤ

3.9.9. Linux stddef.h, limits.h, #include_next

Linux Ǥ GCC ƥॳѥǤ˥饤֥꤬ glibc Ǥ뤿ᡢƥإåˤ GCC ꤷƤʤʬȤɤˤޤ 줬 compiler-independent-build mcpp Τ褦¾νϤȤξ㳲ˤʤޤ Ǥ stddef.h ΤĤɸإåե뤬 GCC version-specific include directory ˤä /usr/include ¸ߤʤȤΤϤʷ٤Ǥꡢmcpp ˤȤäƤкɬפǤ ΥǤϤƤޤ

Linux Ǥ GCC ΥС󤴤Ȥ㤨 /usr/lib/gcc-lib/SYSTEM/VERSION/include Ȥä include directory ƥɲäޤˤ stddef.h, limits.h ϴ̯ʤΤǤ CygWIN ǤƱǤ Mac OS X ˤ⾯꤬ޤ

3.9.9.1. /usr/include ɸإåʤ

ޤC ɸإåեΤ float.h, iso646.h, stdarg.h, stdbool.h, stddef.h ΣĤ Linux ǤϤ GCC Υǥ쥯ȥˤꡢ/usr/include ˤ /usr/local/include ˤ¸ߤޤLinux ΥƥإåϽϤ GCC Ǥ GCC ͭ include directory ȤGCC Ǥʤ /usr/include Ȥ褦˰񤫤Ƥ褦Ǥstddef.h ʤΤǤϺޤ

ȤäơGCC ʳνϤ GCC ͭ include directory Ȥ褦ˤȡ٤ϤΥǥ쥯ȥˤ limits.h GCC ͭγĥͤǤ #include_next ˤ֤ĤޤȤ #include_next Ƥ⡢٤ limits.h ν꤬ޤȤ GCC V.3.3 ʹߤǤ limits.h ٤¾塢ϤǻȤ˽ʤȤ褦ˤʤäᡢ¾νϤǤ limits.h ȤʤȤ̤ˤʤäƤޤޤ

ޤGCC Ȥ⡢ limits.h #include_next ǤԲIJư򤷤ޤ

Ȥ䤳ΤǤʤǯΤ֤ƤʤΤǡˤޤȤƤޤ

ʤ compiler-independent-build mcpp ˤʤΤǤ GCC-specific-build Ǥȯޤ

3.9.9.2. #include_next δ̯ʽ

GCC Ǥ include directory ̾ϼΤ褦ˤʤޤ

/usr/local/include
/usr/lib/gcc-lib/SYSTEM/VERSION/include
/usr/include

Υǥ쥯ȥ꤬夫鲼إޤ Σܤ GCC ͭ include directory Ǥ SYSTEM 㤨 i386-vine-linux, i386-redhat-linuxVERSION 3.3.2, 3.4.3 ȤʤޤGCC ̤ΥС /usr/local ɲå󥹥ȡ뤷Ϥ /usr/lib/gcc-lib /usr/local/lib/gcc ȤʤޤC++ Ǥ /usr/local/include ˤˤĤΥǥ쥯ȥ꤬äޤGCC V.3.*, 4.* ǤϼΤΤǤ

/usr/include/c++/VERSION
/usr/include/c++/VERSION/SYSTEM
/usr/include/c++/VERSION/backward

Υǥ쥯ȥ̾ GCC ͭΤΤ˸ޤC++ ɸǥ쥯ȥϤۤ¸ߤʤΤǡ¾νϤ /usr/include/c++/VERSION ȤޤGCC V.2.95 Ǥ C++ include directory ϼΤΤǤ

/usr/include/g++-3

-I ץĶѿǻꤵ줿ǥ쥯ȥ꤬ΥꥹȤɲäޤ

ʲǤ狼䤹뤿 GCC V.3.3 ʹߤǤ C limits.h ä¤ޤǤ LONG_MAX ˤȤޤlimits.h /usr/include GCC ѥǥ쥯ȥΣĽˤޤ

#include <limits.h>

ιԤ GCC /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h include ޤȡΥեƬ

#ifndef _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#ifndef _LIBC_LIMITS_H_
#include "syslimits.h"
#endif

ȤʤäƤΤǡ/usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h include ޤΥեϼΤ褦ûΤǤ

#define _GCC_NEXT_LIMITS_H
#include_next <limits.h>
#undef _GCC_NEXT_LIMITS_H

ơ limits.h Ƥ include ޤ#include_next ʤΤ /usr/lib/gcc-lib/SYSTEM/VERSION/include 򥹥åפ /usr/include ϤǤGCC cpp.info ˤϼΤ褦˽񤤤Ƥޤ

This directive works like `#include' except in searching for the specified file: it starts searching the list of header file directories _after_ the directory in which the current file was found.

Ȥ GCC Ϥʤ /usr/include/limits.h ǤϤʤ /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h ⤦ include Ƥޤޤ
٤ _GCC_LIMITS_H_ Ƥ֤ʤΤ

#ifndef _GCC_LIMITS_H_

ʲΥ֥åϥåפ졢Υ֥åɾޤ

#else
#ifdef _GCC_NEXT_LIMITS_H
#include_next <limits.h>
#endif
#endif

ޤƤ /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h ˤäΤȤޤäƱ #include_next <limits.h> ȤԤǤޤ /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h ʤʬȤ include ΤȻפȡ٤ GCC /usr/include/limits.h include ΤǤGCC #include_next ưϰˤ狼ޤ

/usr/include/limits.h Ǥ <features.h> include ޤޤιԤǻϤޤ֥åޤ

#if !defined __GNUC__ || __GNUC__ < 2

Υ֥åǤ <bits/wordsize.h> include ǡwordsize 32 ӥåȤǤ뤫 64 ӥåȤǤ뤫˱Ƶʤ׵ᤵƤƼ褦ˤʤäƤޤȤ 32 ӥåȤǤ LONG_MAX ϼΤ褦ޤ

#define LONG_MAX     2147483647L

GCC ǤϤΥ֥ååפޤơΥե뤬ꡢinclude /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h ޤΥե⤳ǣܤ include 򽪤ꡢ/usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h ꡢΥե⤳ǽä /usr/lib/gcc-lib/SYSTEM/VERSION/limits.h κǽ include ޤΥեϾ嵭ʬΤȤ˳ƼޤLONG_MAX ˤĤƤϼΤ褦ˤʤäƤޤ

#undef LONG_MAX
#define LONG_MAX __LONG_MAX__

ǤΥե⽪ޤ

#include <limits.h>

νϤǤ٤ƽǤ ɡLONG_MAX __LONG_MAX__ ƥޥʤΤǤ__LONG_MAX__ ȤϤäʤΤǤ礦¤ GCC V.3.3 ʹߤǤ __LONG_MAX__ 䤽¾¿ΥޥƤΤǤ32 ӥåȥƥǤ __LONG_MAX__ 2147483647L ȻƤޤLONG_MAX ʳεʤ׵ᤵƤƼޥˤĤƤ⡢줿ޥ򸵤ƤΤǡƱۤǤʤ顢Τ䤳إåե #include_next νϤäΤʤΤǤ礦

#include_next ư GCC V.2.95.3, V.3.2, V.3.4, V.4.0, V.4.1 Ǥ V.3.3 ƱǤʤ

#include_next <limits.h>

/usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h include 졢ˤƱ

#include_next <limits.h>

/usr/include/limits.h include ޤ

#include <limits.h>

Ǥ /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h include 뤳ȤˤʤޤΥե򣲲 include Ƥ̤Ѥޤ󤬡ǤꡢͤưäƤꡢưӤƤޤ󡣤ΥեμΥ֥åϥʬǤ

#else
#ifdef _GCC_NEXT_LIMITS_H
#include_next <limits.h>
#endif

3.9.9.3. GCC ǤʤɸإåȤʤ

Ǥϼ GCC ʳνϤ Linux ΥƥإåȤȤɤʤǤ礦 GCC ͭ include directory Ȥʤȡstddef.h Ĥޤ󡣤ʤ GCC include directory ȤȤɤʤǤ礦 stddef.h ϸĤޤ٤ limits.h ʤޤ

#include <limits.h>

ιԤǥץץå /usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h include ޤ /usr/lib/gcc-lib/SYSTEM/VERSION/include/syslimits.h include ޤơ

#include_next <limits.h>

ǥ顼ˤʤޤ

Ǥϡץץå #include_next ɤʤǤ礦 #include_next ̤˼ƤС /usr/include/limits.h include ޤơ嵭

#if !defined __GNUC__ || __GNUC__ < 2

ʲΥ֥å졢LONG_MAX Τ褦졢¾ΥޥŬڤޤ

#define LONG_MAX     2147483647L

ơinclude /usr/lib/gcc-lib/SYSTEM/VERSION/syslimits.h ꡢΥե뤬ä /usr/lib/gcc-lib/SYSTEM/VERSION/limits.h ޤȡ

#undef LONG_MAX
#define LONG_MAX __LONG_MAX__

Ǥä줿ޥϤ٤Ƥ˻ˤ __LONG_MAX__ Ȥ̤̾ˤʤäƤޤΤǤ

GCC V.3.2 ޤǤʤ顢Ǥޤ

#define __LONG_MAX__ 2147483647L

ȤԤäΤǡ ˻ˤƤ⤦١ľޤϥʽǤ̤ΤǻȤȤǤޤV.3.3 ʹߤΥإåեǤϤ٤Ƥϫ˽ޤ

3.9.9.4. ̤к

ʾޤȤȡϼˤޤ*1, *2, *3, *4

  1. Linux Υƥإå GCC Ѥˤʤˤ /usr/include float.h, iso646.h, stdarg.h, stdbool.h, stddef.h ɬפǤ뤬줬ʤ
  2. C++ ɸ include directory GCC ΥС¸ˤʤˤϡ/usr/include/c++/VERSION ǤϤʤ /usr/include/c++ ȤäƤ餤ΤǤ롣/usr/include/c++/VERSION/* GCC ͭΤΤ˸¤٤Ǥ롣 FreeBSD, Linux, Mac OS X ǤϤ٤ C++ standard library GCC libstdc++ ʤΤǡн褷ˤȤǤ뤬
  3. GCC #include_next ưϻͤȰۤʤäƤꡢİʤ
  4. GCC <limits.h> ޥ¾弫ǻΤǤϡ䤳إåեν򤹤̣ʤ/usr/lib/gcc-lib/SYSTEM/VERSION/include/limits.h Ǥ٤Ƥ #undef ΤǤϤʤǤ롣ʤȤ Linux CygWIN Ǥ limits.h 򣲤ĤʬɬפϤʤϤǤ롣Υǥ쥯ȥΥإåե GCC 򥤥󥹥ȡ뤹˼ưΤʤΤǡ٤ξĹϤ򤨤ʤǤˤƤ⥷ƥࡦإåȤƥ󥹥ȡ뤹ˤϱ롣

κˤΤϥƥإåιβʣǤơ#include_next Ȥĥǥ쥯ƥ֤ؤ򤫤ƤޤΥǥ쥯ƥ֤ӤϤ¤ƤꡢGCC glibc Υѥȥ󥹥ȡǻȤƤΤΡ󥹥ȡ뤵줿ƥإåǤ limits.h ˤǤ limits.h ν𤷤ƤΤǤϡ¸ͳޤ

ơLinux CygWIN mcpp compiler-independent ǤǤϰʾн褹뤿ᡢȤꤢϼΤ褦ꤹɬפޤCompiler-independent ǤǤϺ򤱤뤿ᡢ#include_next ϼޤGCC ͭ include directory Ȥ߹ߤޤ

  1. /usr/include/stddef.h /usr/lib/gcc-lib/SYSTEM/VERSION/include/stddef.h ؤΥ󥯤ȤƺƤʣ GCC ΥС󤬥󥹥ȡ뤵Ƥ⤽Τɤ줫˥󥯤ƤСLinux, CygWIN compiler-independent ǻȤʬˤʤȻפ롣 GCC ˤ⡢GCC Ǥ mcpp ˤⰭƶͿʤstdarg.h ƱͤǤ롣ޥ GCC Ȥ߹ߴؿŸ뤬ñ˥ץץʤ餽Ǥ⤹ࡣ
  2. iso646.h, stdbool.h ϤñʤΤǤꡢϤ䥷ƥ˰¸ΤǤϤʤΤǡGCC Τɤ줫ΥСΤΤ /usr/include ˥ԡ뤫ưФࡣlimits.h GCC ʳνϤǤ /usr/include ΤΤǽʬǤ롣
  3. float.h DBL_MAX_EXP __DBL_MAX_EXP__ ȤäƤʤΤǡ¾ΥץץåˤΩʤɬפʤ GCC ʤɤ򻲹ͤ˽񤯡*5
  4. GCC ͭ C include directory ϴĶѿǤꤷʤ
  5. Ķѿ CPLUS_INCLUDE /usr/include/c++/VERSION:/usr/include/c++/VERSION/SYSTEM:/usr/include/c++/VERSION/backward C++ include directory Ȥꤹ롣

GCC Ǥ mcpp Ǥ GCC ͭ include directory Ȥ߹ߡ#include_next ̤˼ߴΤλޥΤǡ̤ɬפޤ

:

*1 3.9.9 εܤ Linux / GCC 2.95.3, 3.2, 3.3.2, 3.4.3, 4.0.2, 4.1.1, 4.3.0 CygWIN / GCC 2.95.3, 3.4.4 dzǧΤǤ롣 CygWIN / GCC 2.95.3 Ǥ #include_next ưϻ̤Ǥä3.4.4 Ǥ Linux Ʊˤʤä ޤCygWIN C++ include directory 2.95.3 Ǥ /usr/include/g++-3 Ǥä3.4.4 Ǥ /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++ ʲȤʤäƤ롣

*2 FreeBSD 6.2, 6.3 / GCC 3.4.6 Ǥ /usr/include C Τ٤ƤɸإåꡢGCC ͭ include directory C Ǥ¸ߤʤ #include_next ⥷ƥإåˤ̵ C++ include directory /usr/include/c++/3.4, /usr/include/c++/3.4/backward GCC ΥС¸ȤʤäƤ롣
FreeBSD Ǥ̥С GCC 򥤥󥹥ȡ뤹 GCC-version-specific include directory 롣 ˤǤإåե¿ϥʤΤǤ롣 /usr/include Υإåե뤬񤭴뤳ȤϤʤ

*3 Mac OS X Leopard / Apple-GCC 4.0.1 Ǥ GCC version-specific include directory Linux ƱͤǤ롣 #include_next limits.h ǻȤƤ롣 limits.h ι Linux ƱͤǤ뤬 syslimits.h #include_next ϺƤ롣 ޤfloat.h, iso646.h, stdarg.h, stdbool.h, stddef.h Ϥ٤ /usr/include ˤΤǡmcpp ¦ǤкϤޤɬפʤ float.h, stdarg.h GCC Ѥ Metrowerks (for powerpc) ѤʤΤǡmcpp ǻȤʤ stdarg.h GCC version-specific ʥǥ쥯ȥΥإå include 褦˥ǥ쥯ƥ֤­float.h Ǥϥޥ­ƤʤФʤʤ float.h x86 powerpc ȤǤĤͤۤʤ뤳Ȥա

*4 MinGW / GCC 3.4.* Ǥ include directories Ȥ̤ͥ¾ΥƥȰۤʤ뤬GCC #include_next ưƱǤꡢޤɸ include directory Ǥ /mingw/include ˤĤɸإåʤ version-specific-directory ˤ CygWIN ƱǤ롣

*5 GCC 򻲾Ȥ i386 Ǥ float.h 񤱤СΤ褦ˤʤ롣

/* float.h  */

#ifndef _FLOAT_H___
#define _FLOAT_H___

#define FLT_ROUNDS      1
#define FLT_RADIX       2

#define FLT_MANT_DIG    24
#define DBL_MANT_DIG    53
#define LDBL_MANT_DIG   64

#define FLT_DIG         6
#define DBL_DIG         15
#define LDBL_DIG        18

#define FLT_MIN_EXP     (-125)
#define DBL_MIN_EXP     (-1021)
#define LDBL_MIN_EXP    (-16381)

#define FLT_MIN_10_EXP  (-37)
#define DBL_MIN_10_EXP  (-307)
#define LDBL_MIN_10_EXP (-4931)

#define FLT_MAX_EXP     128
#define DBL_MAX_EXP     1024
#define LDBL_MAX_EXP    16384

#define FLT_MAX_10_EXP  38
#define DBL_MAX_10_EXP  308
#define LDBL_MAX_10_EXP 4932

#define FLT_MAX         3.40282347e+38F
#define DBL_MAX         1.7976931348623157e+308
#define LDBL_MAX        1.18973149535723176502e+4932L

#define FLT_EPSILON     1.19209290e-7F
#define DBL_EPSILON     2.2204460492503131e-16
#define LDBL_EPSILON    1.08420217248550443401e-19L

#define FLT_MIN         1.17549435e-38F
#define DBL_MIN         2.2250738585072014e-308
#define LDBL_MIN        3.36210314311209350626e-4932L

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define FLT_EVAL_METHOD 2
#define DECIMAL_DIG     21
#endif /* C99 */

#endif /* _FLOAT_H___ */

3.9.10. Mac OS X / Apple-GCC ȥƥإå

mcpp V.2.7 Mac OS X / GCC ⥵ݡȤ褦ˤʤޤΥƥʲˤޤȤƤޤ ɮԤϤޤΥƥǤϤۤȤ mcpp firefox 餤ѥ뤷ƤʤΤǡΤʤʬ¿ޤ Ȥ Objective C / Objective C++ ˤĤƤϤޤäΤޤ

OS GCC ۤȤͣΥѥȤʤäƤ뤿ᡢΥƥإåˤ GCC-local ʻͤؤΰ¸˸ޤ 饤֥꤬ glibc ǤϤʤ٤ Linux ۤɤǤϤޤ FreeBSD ¿褦Ǥ ⤦ǤϤȻפޤ

ΥƥΤ⤦Ĥħ Apple ˤäƤʤä줿 GCC ƥॳѥȤʤäƤ뤳ȤǤ Mac OS X Υƥإå Apple ΥǤϡ̤ GCC-local ʻͤष Apple-GCC-local ʻͤؤΰ¸ΤۤΩޤ Ǥ⡢Intel-Mac PowerPC-Mac 򣱤ĤΥޥǥݡȤ뤿γĥͤħŪǤ

ʤǼ夲Τ Mac OS X Leopard / Apple-GCC 4.0.1 Ǥ

3.9.10.1. #include_next, #warning

GCC-local ʻͤǤ #include_next ¿Ϥޤ󤬡/usr/include/ float.h, stdarg.h, varargs.h /Developer/SDKs/MacOSX10.*.sdk/usr/include/ Ʊ̾ΥեǻȤƤޤ Ϥ⥳ѥ餬 GCC Ǥ뤫 Metrowerks Ǥ뤫ˤä include إåե򿶤ʬ뤿ΤΤǤ GCC stdarg.h Ʊ̾Υإåե뤬 #include_next 褦ˤʤäƤޤ
ޤLinux ƱͤˡGCC version-specific include directory Ǥ limits.h #include_next ޤsyslimits.h ΤΤϺơƤޤ

Υǥ쥯ƥ֤Ϲܤ˻ȤƤޤfloat.h, stdarg.h GCC Metrowerks ꤷƤʤΤǤ FreeBSD ƱȤޤ portable ˽񤯤ȤϤǤϤǤ*1
ޤ/usr/include Υإåե GCC Ѥ #include_next 񤯤Τϥʥ󥻥󥹤Ǥ GCC ǤϤΥǥ쥯ȥΤۤ version-specific include directory ̤ͥ㤤Ǥ äơ #include_next Ϸ褷Ƽ¹Ԥ뤳ȤϤޤ

#warning /usr/include/ objc/, wx-2.8/wx/ Υǥ쥯ȥ䤽б /Developer/SDKs/MacOSX*.sdk/usr/include/ Υǥ쥯ȥ˻ޤ ¿ obsolete ʤ deprecated ʻȤե˴ؤ륦˥󥰤Τ褦Ǥ
/usr/include/c++/VERSION/backward/ Ӥб /Developer/SDKs/MacOSX*.sdk/ backward_warning.h ϤϤ deprecated ʥإåȤʤȤ #warning ¹Ԥ뤿ΥեǤΥǥ쥯ȥΥإåեϤ٤ƤΥե include 褦ˤʤäƤޤ Linux FreeBSD ƱǤ

:

*1 mcpp compiler-independent-build ǤΥإåȤˡˤĤƤϡ3.9.9.4 Ӥ 3 򻲾ȡ

3.9.10.2. 'defined' Ÿޥ

/usr/include/sys/cdefs.h Ӥб /Developer/SDKs/MacOSX*.sdk/ Ʊ̾ΥإåեˤϡΤ褦ʥޥޤ

#define __DARWIN_NO_LONG_LONG   (defined(__STRICT_ANSI__) \
                && (__STDC_VERSION__-0 < 199901L) \
                && !defined(__GNUG__))

ơΥޥ stdlib.h ǼΤ褦˻ȤƤޤ

#if __DARWIN_NO_LONG_LONG

ΥޥϼΤ褦٤Ǥ*1

#if     defined(__STRICT_ANSI__) \
                && (__STDC_VERSION__-0 < 199901L) \
                && !defined(__GNUG__)
#define __DARWIN_NO_LONG_LONG   1
#endif

:

*1 ͳ 3.9.4.6, 3.9.8.6 򻲾ȡ

3.9.10.3. #endif ԤΥȡ

/System/Library/Frameworks/Kerberos.framework/Headers gssapi.h, krb5.h, profile.h ˤϼΤ褦ʴ #endif Ԥޤ

#endif \* __KERBEROS5__ */

\* __KERBEROS5__ */ ȤΤϥȤΤ褦Ǥʤ虜虜ʽȯΤ˶줷ߤޤ ¾Υƥ GCC ǤϤˤϥ˥󥰤ФޤApple-GCC ǤϤȤ -pedantic ΥץդƤ⥦˥󥰤ϽФޤ Apple-GCC ǤϼνˤĤƤ⥦˥󥰤Фޤ C90 δФ򤤤ޤˤҤäƤޤ

#endif __KERBEROS5__

3.9.10.4. ޥν

Τ褦üʥޥλȤϡglibc Υ Linux ΥƥإåʤɤǤФиΤǤ firefox 3.0b3pre Υ򥳥ѥ뤷¤Ǥϡ include Mac OS X Υƥإåˤϸޤ

  • GCC ͤβѰޥ
    C99 λͤβѰޥϥƥإåǤϵ˻ȤƤޤGCC ͤΤΤϸޤ
  • ޥƤӽФΥ
  • Function-like ޥִ̾ object-like ޥ

3.9.10.5. Apple-GCC ȼ

Apple-GCC ˤϰ̤ GCC ȰۤʤȼλͤĤޤ

  • Intel-Mac PowerPC-Mac ΥХʥ򣱤ĤΥޥ뤿Τ

    Mac OS X ˤ x86 Ѥ ppc ѤΥѥ餬󥹥ȡ뤵ޤϥͥƥ֥ѥ顢¾ϥѥˡ -arch ȤȼΥץ󤬤ꡢ-arch i386 -arch ppc Ȥդʣ CPU ꤹȡgcc βƤӽФơ줾 CPU ѤΥХʥ꤬졢ˤ򣱤Ĥ˥Хɥ뤷 universal binary ȤΤޤ ޤ-mmacosx-version-min= Ȥץ⤢ꡢ -isysroot --sysroot ץȹ碌ƻȤȤǡХʥθߴϰϤ Mac OS X Τ٤εСˤޤǹ뤳ȤǤ褦ˤʤäƤޤ γĥͤ Mac OS X ѤΥХʥꡦѥåʤɤǤ

    ץץ˴ؤƤϡCPU ˤäưλޥ㤦ȤդɬפǤ

  • "framework" ǥ쥯ȥ

    Mac OS ˤ NeXTstep framework ǥ쥯ȥȤΤޤ framework ϥإåե롦饤֥ꡦɥȡ¾ζͭ꥽򣱤ĤˤޤȤ᤿ΤǤ ˤإåե include ˤϼΤ褦ʥǥ쥯ƥ֤Ȥޤ

    #include <Kerberos/Kerberos.h>
    

    ϼΥǥ쥯ƥ֤Ʊ򤷤Ƥޤ

    #include <sys/stat.h>
    

    Υǥ쥯ƥ֤ include ΤϤɤ줫 include directoryʤξ /usr/includeˤ sys/stat.h ȤեǤ<Kerberos/Kerberos.h> ΤۤϤǤϤޤ Kerberos ϥǥ쥯ȥ̾Ǥ⤢ޤ /System/Library/Frameworks Ȥ framework directory Kerberos.framework/Headers/Kerberos.h ȤեʤΤǤ ơKerberos.framework/Headers Kerberos.framework/Versions/Current/Headers ؤ symbolic-link ȤʤäƤޤ ϺǤñǡframework header Τ꤫ϤäȤäʣʤΤ¿ޤ

    ä줬ʣʥƥͤΤǤ礦 ץץå path-list 򤢤줳ȤΩƤʤ饷ƥإå򥵡ʤФʤʤΤǡʤ٤ޤ إåˤäƤϤ餵¿¾Υإå include Τ⤢ޤ

  • "header map" ե

    Mac OS X IDE Ǥ Xcode.app Ǥ "header map file" ȤΤȤޤ include إåե򤢤餫᥵ơ path-list *.hmap Ȥ̾Υե˵ϿƤץץǤϤ include directory Τ褦˻ȤȤΤǤ header map file Τ Xcode.app ΥġǤ include directory Τ褦ɤΤ Apple-GCC γĥͤǤ

    framework directory ΥإåեΥ٤礭Τǡڸ뤿˹ͤ줿ΤǤ礦 header map file ȼͤΥХʥեǤꡢƩ礤Ƥޤ ष framework directory ΤۤñˤƤ餤ΤǤ

  • #endif ԤΥȡ

    Ǹ褦ˡ#endif Ԥ˲Ȥɤʥץ󤬻ꤵ褦ȡApple-GCC ϥ˥󥰤Фޤ δФǤ

  • ASCII ʸ

    GCC ǤϤޤ󤬡framework header Ǥϥ ISO-8859-* (?) copyright mark (0xA9) ASCII ʸФлȤƤޤ ϥȤϸmultibyte character ȤĶǤǤǤ ʸ encoding ˴ؤռ򾯤ϻäƤ餤ΤǤ μʸ Linux /usr/include Ǥ˸ޤMac OS framework header ˤä¿褦Ǥ

3.9.11. firefox 3.0b3pre Υץץ

firefox developing version Ǥ 3.0b3pre (2008/01) ʤ 3.0-beta3-prerelease ΥLinux/x86 + GCC 4.1.2 Max OS X + GCC 4.0.1 ǥץץå mcpp V.2.7 ֤ƥѥ뤷Ƥߤޤ mcpp -K ץΥƥȤͤơ٤ -Kv ץդƼ¹ԤνϤ cc1 (cc1plus) ϤƤޤ η̡ѥ뤬˽λfirefox ΥХʥ꤬ΤΤ뤳ȤǤޤ*1

firefox ΥΥץץ portability ΤȤƤϤʤ⤤ΤǤ glibc Υˤ褯褦 GCC-local ʻͤؤΰ¸Ϥޤ긫ޤ Linux Mac OS X GCCWindows Visual C ʥåȤȤƤΤȤϤޤ

Ȥϸץץ portability GCC Visual C ̤Ф櫓Ǥ⤢ޤ ʲ˶Ū˸ƤƤߤޤ ʤGCC ˤĤƤϽʣ򤱤뤿ᡢǤޤ 3.9.4, 3.9.8 򻲾ȤƤ firefox 椹뤿 glibc 򤷤Фа礤˽ФƤޤglibc ˤĤƤΥȤ⤳Υˤޤ*2

:

*1 mozilla.org CVS ݥȥ꤫ checkout ΤǤ롣 򥳥ѥ뤷Ĥư mcpp -K ץƥȤ뤿Ǥä Υץ Taras Glek ƤˤΤǤ뤬 mozilla project C/C++ refactoring ˼ȤǤΤǡmcpp κԤ firefox Υ򤳤ΥץΥƥȤ˻ȤäΤǤ롣 -K (-Kv) ץˤĤƤ 2.4 򻲾ȡ

*2 firefox Υǥ󥰡ɥ饤ϼΤȤˤ롣 ƤϤʤŤΤǤ롣
portable-cpp

3.9.11.1. GCC-local ʻͤϤۤȤɻȤʤ

glibc ΥǻȤƤ뼡Τ褦 GCC-local ʻͤϡfirefox Υˤϸޤ Linux ǥѥ뤹ϡƥإå GCC2 ͤβѰޥʤɤФƤޤ̤Ǥ

  • GCC ͤβѰޥ
    ɤ C99 ͤβѰޥޤȤƤޤ

ΤΤ glibc ǤǶΥСǤϻȤʤʤäƤΤǤfirefox ǤȤƤޤ

  • Ԥޤʸƥ
  • #warning
  • -isystem, -I- ץ

3.9.11.2. #include_next

#include_next ϣĤΥǥ쥯ȥ˸¤äƤ󤢤ޤ configure ˤä config/system_wrappers Ȥǥ쥯ȥǤ ΤϤ٤Ʊ򤷤 900 ܤΥإåեǤ 㤨 stdio.h ϼΤ褦ˤʤäƤޤ

#pragma GCC system_header
#pragma GCC visibility push(default)
#include_next <stdio.h>
#pragma GCC visibility pop

GCC 4.* #pragma GCC visibility * εǽѤ뤿ΤΤǤ ǡconfig/gcc_hidden.h Ȥե뤬ޤ ϼΤ褦ʤΤǡ줬¿ translation unit -include ץˤäƬɤ߹ޤޤ

#pragma GCC visibility push(hidden)

system_wrappers ǥ쥯ȥϺͥ include ǥ쥯ȥǤʤФʤʤΤǡ˺ǽ -I ץǻꤷʤФʤʤȤΤդ٤Ǥ #include_next λȤϴǤꡢäϤʤȻפޤ

nsprpub ǥ쥯ȥǤ -include gcc_hidden.h -fvisibility=hidden ץ󤬻ꤵ礬ФФޤξ system_wrappers ΥإåեϻȤޤ Υǥ쥯ȥϤޤƤʤ褦Ǥ

3.9.11.3. C99 ꤻ C99 λͤȤ

ΩĤΤ C99 ꤻ C99 λͤȤΤǤ GCC Ǥϥե̾ *.c ȥǥեȤǤ gnu89 ȤͤȤޤ C90 ˤĤ C99 ͤ GCC ȼλͤäŪʤΤǤ firefox ΥˤϡѤƼΤ褦 C99 λͤۤΤ˻ȤäƤΤޤ

  • ޥƤӽФΥ

    Linux Υƥإå̤ȤСfirefox ȤΥǤΥϤ鷺ǤޤΣܤΥեˤޤ ºݤ˻ȤƤΤ NS_ENSURE_TRUE ȤĤΥޥǤ

    layout/style/nsHTMLStyleSheet.cpp, layout/generic/nsObjectFrame.cpp, intl/uconv/src/nsGREResProperties.cpp

    ޤgfx/cairo/cairo/src μΥեˤ⤢ޤ ºݤˤ slim_hidden_ulp2 ȤĤΥޥǤ

    cairoint.h, cairo-font-face.c, cairo-font-options.c, cairo-ft-font.c, cairo-ft-private.h, cairo-image-surface.c, cairo-matrix.c, cairo-matrix.c, cairo-pattern.c, cairo-scaled-font.c, cairo-surface.c, cairo-xlib-surface.c, cairo.c

    Υ Linux ǤϻȤޤMac OS X ǤϻȤޤ ˤƤ⡢äʶ路ΤǤϤޤ

  • C90 εĶ translation limits

    identifier Ĺ#include Υͥȡޥοʤɤ C90 κݾڸ٤Ķ礬ФФޤ
    31 ХȤĶĹ identifier ϤȤ gfx/cairo/cairo/src/ ¿ޤ #include ΥͥȤ 8 ٥Ķꡢޥ 1024 ĤĶ⤢ޤLinux Mac OS X ǤϥƥإåǤθݤФеΤǤ򤨤ʤǤ礦

  • C ΥǤˤ⤫餺 // ȤȤäƤ

    Ȥɤޤ Ͼ嵭 ɥ饤 ػߤƤΤǤޤϤۤȤϤʤǤ礦

λͤ Visual C 2005, 2008 ǤȤޤ GCC Ǥ -std=c99 Ȥץ󤬤ΤǡȤȤǤ Visual C ˤϵʤΥСꤹ륪ץϤʤΤǡۤΤ˻Ȥޤ äơۤΤ C99 λͤȤȤˤĤƤϡפʽϤθǤ firefox Υդ뤳ȤϤǤޤ*1

ȤǡۤΤ C99 ͤȤäƤʤ顢ѰޥϤʤȤƤޤ Visual C Ǥ 2005 ǻȤ褦ˤʤäΤǤ2003 ޤǤϻȤʤäΤǡ򤱤ƤΤǤ礦

:

*1 C++ Ǥ GCC "gnu++98" ȤͤǥեȤǤ롣 C++98 + GCC extensions ȤƤ뤬ºݤˤ C99 λͤߤƤ롣 Visual C C Ǥ C90C++ Ǥ C++98 ˽ȤƤ뤬ºݤˤϤɤ C99 ͤȼλͤߤƤꡢVisual C 2005, 2008 ǤϤȤˤǤ롣 ʤGCC Visual C ʤȼͤߤƤΤǤ롣 Ȥ櫓 Visual C ϵʤΥСǤʤΤȤǤ롣

3.9.11.4. Function-like ޥִ̾ object-like ޥ

Function-like ޥִ̾ object-like ޥ¾Υץˤ褯ΤǤ firefox Υˤ⤢ޤ¿Ϥޤ󤬡ΤȤ˸ޤ

content/base/src/nsTextFragment.h, modules/libimg/png/mozpngconf.h, modules/libjar/zipstub.h, modules/libpr0n/src/imgLoader.h, nsprpub/pr/include/obsolete/protypes.h, nsprpub/pr/include/private/primpl.h, nsprpub/pr/include/prtypes.h, parser/expat/lib/xmlparse.c, security/nss/lib/jar/jarver.c security/nss/lib/util/secport.h, xpcom/glue/nsISupportsImpl.h

ޤfirefox make 뤳Ȥ¿ΥإåեؤΥ󥯤ȯĶѤΥǥ쥯ȥ˺졢 firefox γȯĶ򥤥󥹥ȡ뤹 /usr/include/firefox-VERSION/ äƤޤˤϾ嵭ΥեؤΥܥå󥯤Ĥޤ configure ˤä mozilla-config.h ˤ⤳μΥޥޤ

ϤϤ function-like ޥȤƽ񤤤ۤ狼䤹ʤޤ ºݡfirefox Υˤ⤽ν¿ޤ ͤˤäƽۤʤΤǤ礦ˤĤƤϥǥ󥰡ɥ饤᤿ۤɤǤ

3.9.11.5. 'defined' Ÿޥ

glibc ǻ˸ִꥹ 'defined' ȤȡνФƤޥfirefox ˤ⣱Ĥޤ

modules/oji/src/nsJVMConfigManagerUnix.cpp ȤեǤϼΤ褦ʥޥơ

#define NS_COMPILER_GNUC3 defined(__GXX_ABI_VERSION) && \
                          (__GXX_ABI_VERSION >= 102) /* G++ V3 ABI */
ʬȤǼΤ褦˻ȤäƤޤ

#if (NS_COMPILER_GNUC3)

Υޥѻߤơ#if ԤϼΤ褦˲٤Ǥ

#if defined(__GXX_ABI_VERSION) && (__GXX_ABI_VERSION >= 102) /* G++ V3 ABI */

Υե뤬 GCC Ǥѥ뤵ʤΤȤϸϤθͤѤΤɤȤǤϤޤ*1

:

*1 mcpp V.2.7 GCC-specific-build Ǥ #if ԤΥޥ˽ФƤ 'defined' GCC Ʊͤ˽褦ˤ ˥󥰤ФΤǡۤɤ

3.9.11.6. #endif Τ token sequences

jpeg ǥ쥯ȥμΥեˤϡ #endif Ԥ˥Ȥȥޡʤ˽񤫤ƤԤޤ ǶΥץǡȤȯΤǤ

jmorecfg.h, jconfig.h, jdapimin.c, jdcolor.c, jdmaster.c

ν 1990 ǯ椴ޤǤ UNIX ϤΥեȥ˸ޤޤǤϤܾۤüƤΤǤ glibc ǤȤƤޤ GCC ⤳ˤϥ˥󥰤Фޤ ΥϤʤȤˤϤޤʤΤ褦Ǥ Apple-GCC ϥ˥󥰤Фޤ󤬡 Mac OS ǥǥåȤ줿ΤʤΤǤ礦

3.9.11.7. ץץפ륢֥饽

֥饽 *.s (*.asm) Ȥ̾ˤʤäƤơˤϥޥȤƤΤ⤢ޤץץåƤӽФ뤳Ȥϸ§ȤƤޤ

Mac OS X / ppc ǤϣĤ㳰ꡢxpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s ǥץץåƤӽФޤ ΥեˤϤäԤ #if ֥åĤ뤫ǤȤʤäƤɬפʤȻפ֥åǤ

3.9.11.8. -include ץ

firefox ΥѥǤ configure mozilla-config.h Ȥإåե뤬ޤȾΥΥѥǤΥإå -include ץǻꤷƤޤ config/gcc_hidden.h ˤĤƤƱͤǤ ʤ򥽡Ƭ #include ʤΤǤ礦

3.9.11.9. ޥκ

ޥۤäƺ뤳Ȥˤޤ

  • firefox make Ǥ¿ξ -DZLIB_INTERNAL Ȥץղä gcc (c++) ƤӽФޤ ʤZLIB_INTERNAL 1 ޤ ȤΥޥ modules/zlib/src/ βܤΥ

    #define ZLIB_INTERNAL
    

    0 ĤΥȡƤΤǤ ơΤ褦˻ȤƤޤ

    #    ifdef ZLIB_INTERNAL
    

    ξϼ³Ϥޤ󤬡ޥäƤΤϴޤ ֤ Makefile ΥץΤۤ;פʤΤǤ礦

  • xpcom/build/nsXPCOMPrivate.h Ǥ MAXPATHLEN Ȥޥ /usr/include/sys/param.h ȰۤʤȤ꤬ޤ ϴϢإåեˤä /usr/include/sys/param.h include ꤷʤäꤷƤʤǤ إåեɬפǤ

  • Mac OS X Ǥ netwerk/dns/src/nsIDNKitInterface.h /usr/include/assert.h 줿 assert ޥޤ #undef assert ˽񤯤٤Ǥ

  • Mac OS X Ǥ modules/libreg/src/VerReg.c VR_FILE_SEP Ȥޥδ̯ޤ

    #if defined(XP_MAC) || defined(XP_MACOSX)
    #define VR_FILE_SEP ':'
    #endif
    #ifdef XP_UNIX
    #define VR_FILE_SEP '/'
    #endif
    

    Mac OS X Ǥ configure XP_MACOSX XP_UNIX 뤫Ǥ տŪΤ褦˸ޤʶ路ΤǡXP_UNIX ͥ褹뤳Ȥ狼褦˼Τ褦˽񤤤ۤɤǤ礦

    #ifdef XP_UNIX
    #define VR_FILE_SEP '/'
    #elif defined(XP_MAC) || defined(XP_MACOSX)
    #define VR_FILE_SEP ':'
    #endif
    

3.9.11.10. Ĺʥ

ΥեˤϿɴ԰ʾˤĹʥȤޤ

extensions/universalchardet/src/base/Big5Freq.tab, extensions/universalchardet/src/base/EUCKRFreq.tab,intl/unicharutil/src/ignorables_abjadpoints.x-ccmap, layout/generic/punct_marks.ccmap

Ȥ intl/uconv/ucv*/ Ȥǥ쥯ȥˤĹʥȤĥե뤬¿ޤ ˤϣĤΥȤ 8000 ԤĶΤޤǤޤ Ϥ٤ *.uf, *.ut Ȥ̾ˤʤäƤޤ unicode ȥγƼ encoding Ȥδ֤ mapping table Τ褦ǡġˤäƼưΤǤ C/C++ Υˤϸޤ󤬡C++ Υ include ޤ ȤϤΥɥȤ¾ΥġΤɽΤ褦Ǥ

ĹʥɥȤɽ򥳥ȤȤƥ˴ޤΤϡʤΤǤ礦 ĥ꡼˴ޤȤƤ⡢Ȥ̤ΥեʬΥ٤Ǥ礦

ʾΥեϤ Linux ǤϻȤޤMac OS X ǤϻȤޤ ¾ Mac OS X Ǥ framework ǥ쥯ȥΥƥإåФлȤޤˤϥȤȾƤ̯ʥե뤬ޤ

3.9.11.11. ԥɤκ

firefox Υβԥɤ [LF] Ǥ[CR][LF] ιԤäƤե뤬ܤޤ Ϥû֥åǡ˥ѥåˡʬ [CR][LF] ˤʤäƤޤäΤΤ褦Ǥ Windows ԽϡԥѴġǥå٤Ǥ礦


3.10. Visual C++ Υƥإå

Visual C++ 2003, 2005, 2008 ǤĤΥץץΥץץ mcpp ȤäƤߤޤΥƥΥƥإåˤϡץץθߴȤʤ褦ʤΤϤʤ褦ǤΤ褦ʤΤϤޤ¾νϤǤ⤷ФиΤǡäȤʤΤǤϤޤ

  1. C99 λͤϤۤȤɼƤʤä顢C // Ȥ¿ѤƤ
  2. Function-like ޥ̾Ÿ object-like ޥ롣
  3. Visual C++ 2003 Ǥ limits.h ˴ְäޥĤä Visual C++ 2005 Ǥľ줿 cpp-test.html#5.1.3.1 2 򻲾ȡˡ

Linux Υƥإå glibc ˤ GCC local ʻͤФлȤƤޤVisual C++ Υƥإåˤ Visual C++ local ʽϤޤ긫ޤ

3.10.1. Ȥޥ

Visual C++ ˤϣĤȤǤʤޥޤVisual C++ 2003 Vc7/PlatformSDK/Include/wtypes.h ˤϼΤ褦ʥޥޤ*1

#define _VARIANT_BOOL   /##/

ơVc7/PlatformSDK/Include/ oaidl.h, propidl.h ǼΤ褦˻ȤƤޤ

_VARIANT_BOOL bool;

ϤäǤ礦
_VARIANT_BOOL // Ÿơη̡ιԤȥȤ뤳ȤԤƤΤΤ褦Ǥơºݤ Visual C cl.exe ǤϤʤäƤޤޤ

// ϥȡ (preprocessing-token) ǤϤޤ󡣤ޤޥŸϡȡʬ򤵤쥳ȤĤΥڡѴ줿ȤΥեǽΤǤäơޥˤäƥȤ뤳ȤϷ褷ƤǤʤΤǤΥޥ // Ÿ줿Ȥǡ// ͭ preprocessing-token ǤϤʤΤǷ̤ undefined ȤʤϤΤΤǤ

mcpp ǤΥإåեȤˤϡΥޥ򥳥ȥȤꤢ _VARIANT_BOOL ΤȤ򼡤Τ褦˽񤭴ʤФʤޤ

#if !__STDC__ && (_MSC_VER <= 1000)
    _VARIANT_BOOL bool;
#endif

Visual C 5.0 ʹߤΥС󤷤ȤʤΤǤСιԤϼΤ褦˥ȥȤƤޤޤ

// _VARIANT_BOOL bool;

ΥޥǤʾʤΤϡ򥳥ȤȤƽƤޤ Visual C / cl.exe ΥץץμǤˤϡΥץץåμΤ褦ʿ꤬Ϫ褷Ƥޤ

  1. ʤȤ⤳Ǥ Token-base ǤϤʤʸ١ΥץץƤ롣
  2. ޥŸ̤ȤȤưƤꡢtranslation phases 𤷤Ƥ롣

餯cl.exe Υץץå˸Ťɤ餫ȸʸ١ΥץץåΥ򸵤ˤƤΤǤ礦ʬŪ˼äʤС󥢥åפ򷫤֤ƤƤ뤳Ȥ¬ޤ

˸Ťץ๽¤äƤȿ¬ץץå¿ޤ3.9 Ǹ GCC 2 / cpp ⤽ΣĤǤץץåǤϡʬŪ˼äвäۤɥץ๽¤㥴㤷ƤΤǡɤƤ⤢ȤʼƬǤȤʤޤŤΤƤơᤫľʤ¤ꡢäꤷץץåˤϤʤʤȻפޤ

GCC 3 / cpp ǤϥľơGCC 2 Ȥ̤ΥץץåȤʤޤmcpp ⡢DECUS cpp ȤŤץץåΥȯʤ顢ȯƤޤʤŪ˽ľ줿ΤǤ

:

*1 Visual C++ 2005 express edition ˤ Platform SDK ϴޤޤƤʤ"Platform SDK for Windows 2003" ɤƻȤȤǤ롣 PlatformSDK/Include ǥ쥯ȥ wtypes.h, oaidl.h, propidl.h Ǥ⡢ΥޥƱǤ롣
Visual C++ 2008 express edition Microsoft SDKs/Windows/v6.0A/Include ǥ쥯ȥƱ̾ΥإåեǤƱͤǤ롣

3.10.2. Identifier '$'

⤦ĤϡVisual C++ 2008 ΥƥإåǤϥޥ̾ '$' ȤȤǤ Visual C++ 2005 ޤǤˤʤϤޤǤ㳰ŪʤΤˤȤɤޤäƤޤ 2008 ǤϤ˽ФƤƤޤ

ǤΩĤΤ Microsoft Visual Studio 9.0/VC/include/sal.h ȤإåǤ Visual C++ SAL (standard source code annotation language) ʤΤ򥽡˵Ҥ뤿ΥޥƤΤǤ Ǥ '$' ޤ̤̾˻ȤƤޤ Υإå¿ɸإåե뤫 Microsoft Visual Studio 9.0/VC/include/crtdefs.h Ȥإå𤷤 #include ޤ äơ¿ΥΥѥǤϤΥޥΤʤ˻Ȥ뤳Ȥˤʤޤ

-Za ץդ clʥѥˤưȡSAL ̵ˤʤꡢsal.h '$' ޤ̾Ϥ٤ƾä褦ˤϤʤäƤޤʤ̾ɬפʤΤ˶줷ߤޤ GCC Ǥ identifier '$' ȤΤǥեȤˤʤäƤޤºݤˤϻȤƤϤۤȤɸݤʤʤäƤޤ

Microsoft SDKs/Windows/v6.0A/Include ǥ쥯ȥˤ⤳μ̾ĥإåե뤬ޤ specstrings*.h ȤإåǤ Υإå WinDef.h 𤷤 Windows.h include ޤ -Za ץꤷƤ '$' ä褦ˤϽ񤫤Ƥ餺ñ˥顼ˤʤǤ äơWindows.h include 륽 -Za ץǥѥ뤹뤳ȤϤǤޤ


4. λ

øΥץץͤ줳˽񤯤櫓ˤϤ椭ޤcpp-test.html Standard C ΥץץˤĤƾܤ񤤤ƤΤǡɤǤmcpp γƼ⡼ɤưͤˤĤƤϡ 2.1 򸫤ƤǤ Standard C ǽȤƤΤޤơץץμդΤĤλͤҤ٤ޤˤޤʽͤˤĤƤϡ5 ǥå˽񤤤Ƥޤ


4.1. λ status

mcpp λ˿ƥץ֤ͤ internal.H ȤإåƤޤ顼ʤä 0 ֤顼ä errno != 0 ʤ errno errno == 0 ʤ 1 ֤ޤ


4.2. Include directory Υѥ

#include directive include եϼνǥޤ

  1. #include ǥ쥯ƥ֤ΰ "file-name" ޤ <file-name> ηǤʤ硢줬ޥǤФŸ롣η̤ "file-name", <file-name> Τɤ餫ηǤʤФʤʤǤʤϥ顼Ȥʤ롣

  2. "file-name" ηǤ <file-name> ηǤ file-name եѥꥹȤǤСΤޤޥץ󤹤롣ץǤʤХ顼Ȥ롣

  3. եѥꥹȤǤʤ "file-name" ηǤСΥǥ쥯ȥʤХѥˤȲᤷƥ롣-I1 ץǤ 3.1-I2 Ǥ 3.2-I3 ǤϤʤνǡˤȤʤ롣ǥեȤǤϡUNIX Ϥν, GCC, Visual C ѤǤ 3.2¾Ǥϸ§Ȥ 3.1 Ǥ롣Borland C ǤǤ 3.1+3.2Ǥ롣 Compiler-independent ǤǤ 3.2 Ǥ롣

    3.1. ȥǥ쥯ȥʤ mcpp ưΡˡ#include ͥȤƤƤ⡢˥ȥǥ쥯ȥȤ롣
    3.2. եʥ󥯥롼ɸˤΤǥ쥯ȥꡣ#include ͥȤƤ硢إåե뤬̥ǥ쥯ȥˤȡΤӤ˴बƤ椯

    GCC ǤǤϤ -iqoute ץǻꤵ줿ǥ쥯ȥ꤬롣 Visual C ǤǤϥեοơʥ󥯥롼ɸ˥եΥǥ쥯ȥ缡Τܤäơ롣 ȯǤʤС<file-name> ηƱͤΥ򤹤롣

  4. եѥꥹȤǤʤ <file-name> ηǤСΥǥ쥯ȥ򥵡롣Υǥ쥯ȥꤽΤΤХѥǻꤵƤϡȥǥ쥯ȥ꤫ХѥȲ᤹롣ˤ٤ƥƤե򥪡ץǤʤХ顼Ȥ롣

    4.1. mcpp ư -I <directory> ץǻꤵ줿ǥ쥯ȥꡣʣлꤵ줿ˡʺ˥롣
    4.2. GCC ǤǤ -isystem ץǻꤵ줿ǥ쥯ȥꡣʣлꤵ줿ˡʺ˥롣
    4.3. Ķѿǻꤵ줿ǥ쥯ȥꡣδĶѿ̾ϡnoconfig.H (configed.H) ENV_C_INCLUDE_DIR Ƥ롣C++ Ǥ ENV_CPLUS_INCLUDE_DIR ƤФδĶѿ˻Ȥ롣GCC ǤǤ C_INCLUDE_PATHC++ Ǥ CPLUS_INCLUDE_PATH ˡ¾Ǥ INCLUDEC++ Ǥ CPLUS_INCLUDE ˤǥեȤδĶѿ̾ȤƤ롣ĶѿʣΥǥ쥯ȥ꤬ separator ǶڤäƻꤵƤСǽΤΤ˥separator Windows Ǥ ;¾Ǥ :ˡ
    4.4. noconfig.H (configed.H) Υޥ CPLUS_INCLUDE_DIR? 줿 implementation-specific ʥǥ쥯ȥꡣ
    4.5. system.c set_sys_dirs() ǻꤵ줿 site-specific ʥǥ쥯ȥ(UNIX ϤǤ /usr/local/include)
    4.6. noconfig.H (configed.H) Υޥ C_INCLUDE_DIR? 줿 implementation-specific ʥǥ쥯ȥꡣ
    4.7. system-specific ʥǥ쥯ȥUNIX ϤǤ /usr/includeˡ

-I- (GCC Ǥ -nostdincVisual C Ǥ -X) ץꤹȡ嵭 4.4 ʹߤΥϹԤޤ

ѥδ򥫥ȥǥ쥯ȥȤΤϡANSI C Rationale ǤϰѰΡְտ (intent)פǤȤƤޤǥ쥯ȥ꤬ưȤʤͤΤʤΤǡȻפޤUNIX ϤνǤϡʤȤ #include "header" ηǤ include ΥեΤǥ쥯ȥȤ뽬褦Ǥmcpp compiler-independent ǤǤ˽äƥեΥǥ쥯ȥȤޤ


4.3. Header name ιˡ

Header-name Ȥ pp-token ιˡȡºݤ include file Υե̾Фˡϡ̤Ǥ

  1. ʸƥηǽ񤫤ƤС򤽤Τޤ header-name Ȥ롣˥ޥǽ񤫤ƤơŸ̤ʸƥˤʤä⡢ƱͤǤ롣ʸƥη header-name Ǥϡñˤξü " ȤäΤե̾Ȥ롣
  2. <filename> ηǽ񤫤ƤС򤽤Τޤ header-name Ȥ롣˥ޥǽ񤫤ƤơŸ̤ <filename> ηˤʤä⡢ƱͤǤ롣ޥ space ʣ spaces 򣱸Ĥ space ˰̤¸롣ñξü <, > ȤäΤե̾Ȥ롣
  3. ɤξǤ⡢Windows Ǥ path-delimiter Ȥ \ / Ȥ뤬\ / Ѵ롣

4.4. #if ɾ

#if ɾϥۥȽϡmcpp 򥳥ѥ뤷ϡˤȥåȽϡmcpp ȤϡˤĺˤäƷޤޤηۤʤϡۤη #if ηˤʤޤCompiler-independent Ǥ mcpp ǤϥåȽϤ¸ߤʤΤǡۥȽϤˤäƷޤޤ

pre-Standard ⡼ɤǤ #if (signed) long ɾޤ

long long ʤϤ Standard ⡼ɤǤϡlong unsigned long ǹԤޤ

long long ĽϤ Standard ⡼ɤǤϡ#if long long / unsigned long long ɾޤC90, C++98 Ǥ long / unsigned long ɾΤǤmcpp Ǥ C90, C++98 Ǥ long long / unsigned long long ɾlong / unsigned long ϰϤĶϥ˥󥰤Фޤ*1

Visual C, Borland C 5.5 Ǥ long long Ϥޤ󤬡Ʊ __int64 ȤΤǡ#if __int64 / unsigned __int64 ɾޤʤVisual C++ 2002 ޤǤ Borland C 5.5 Ǥ LL, ULL Ȥ suffix ȤʤΤǡ suffix #if ԤǤϻȤ뤬ϤʸǻȤäƤϤʤˡ

ޤ-+ ץ C++ Υץץ򤹤ϡ#if true, false Ȥ pp-token ͤϤ줾 1L, 0L ɾޤ

Standard ⡼ɤǤζŪɾΤ򡢰ʲޤlong long ʤϤξϡʲ 4.4, 4.5 εܤϤ٤ơlong long / unsigned long long 򤽤줾 long / unsigned long ɤؤƤPre-Standard ⡼ɤǤϤ٤ long ɤؤƤ

  1. ġȡʸޤˤϡͥȡ U դƤ unsigned long long ɾpre-Standard ⡼ɤǤ U ǧΤʤˡ
  2. ǤʤСlong long ϰϤˤޤ long long ɾ롣
  3. Ǥʤ unsigned long long ϰϤ unsigned long long ɾ롣
  4. ۤͤ out of range Υ顼Ȥ롣
  5. 黻黻Τɤ餫ʤǤʤǡǤʤĤǹԤ

ɤˤƤȡϾͤȤޤ
pre-Standard ⡼ɤǤȡɾ long ϰϤǹԤۤͤ out of range Ȥޤα黻⤹٤ long ǹԤޤ

ޤۥȤ unsigned long long ΤۤåȤϰϤϡĶͤ out of range Ȥʤޤ
ƱΤα黻̤ϰϳȤʤäϡlong long Ǥ out of range Υ顼Ȥʤꡢunsigned long long Ǥϥ˥󥰤Фޤ黻ַ̤ˤĤƤƱͤǤ

αӥåȥեȤޤ껻ˤϰܿʤΤǡ˥󥰤ФޤʤĤκ黻ˤäĤͤʤͤѴ줿⡢˥󥰤Фޤºݤα黻ϡۥȽϤΥѥΤλͤ˽ޤ

C90, C++98 ǤϥץץǤ #if ɾϤ٤ long / unsigned long ǡC99 ǤϤνϤκǡ˹ԤȤˤʤäƤޤmcpp Ǥ C90, C++98 Ǥ long long / unsigned long long ɾlong / unsigned long ϰϤĶϥ˥󥰤ФޤɤˤƤ⡢ѥΤǤ if (expression) ɾλ礶äѤʤΤǤĥطˤϡѥΤȤϰ㤦̤ˤʤ뤳ȤˤƤޤ

ޤStandard C ΥץץǤ keyword ȤΤ¸ߤʤΤǡsizeof 䥭㥹ȤϻȤޤ󡣤ѿưϻȤޤStandard ⡼ɤǤ #if defined 黻ҤȤ#elif ǥ쥯ƥ֤ȤޤȤϥѥΤǤ if (expression) ƱͤˡƱ黻Ҥ̤ͥȥ롼ԥ󥰵§ʤ絬§ˤ˽äɾԤޤ黻Ҥ¿ǤϡξդƱˤ뤿λѴԤ졢 unsigned long long ξ¾ long long ǤäƤ unsigned long long Ѵޤ

:

*1 mcpp V.2.5 ޤǤ C90, C++98 ǤŪˤ long long / unsigned long long ɾʤ顢long / unsigned long ϰϤĶϥ顼ȤƤV.2.6 GCC Visual C ȤθߴΤ˥顼򥦥˥󥰤˳ʲ


4.5. #if Ǥʸɾ

#if ȡȤƤϼ̻ҡʥޥޥˡοͥȡʸޤΤʸɾλϤۤȤ implementation-defined Ǥꡢportability Ϥޤꤢޤ#if 'const' compiler-proper Ǥ if ('const') Ȥδ֤Ǥ̤㤦礬ޤStandard C Ǥ⡢줬ƱǤ뤳ȤݾڤƤʤˡ

POSTSTD ⡼ɤǤϤΤۤȤɰ̣Τʤ #if ʸɾϹԤޤʥ顼Ȥʤˡ

ʸɾ¾ȡƱͤˡlong long, unsigned long long ϰϤǾͤɾޤpre-Standard ⡼ɤǤ long ϰϤǤ

Single character Ǥʤ multi-byte character wide character ϡencoding UTF-8 ξϣХȡʳǤϤ٤ƣХȤηɾޤUTF-8 ϥѤʤΤǡХȤηɾޤEUC-JP ΣХ encoding ˤбƤޤʣХʸϣХȡܣХȤΣʸȤǧ롣η̡ͤɾ뤳ȤˤʤˡХȤ encoding Ǥʤ顢wchar_t ХȤηǤϤ⤢ޤmcpp wchar_t ˤϴΤޤ󡣰ʲǤϣХȤ multi-byte character encoding ξˤĤޤ

'' Ȥ褦 multi-byte character constant ((Хܤ << 8) + Хܤ) ɾޤ8 <limits.h> CHAR_BIT ͡ˡ

'ab', '\x12\x3', '\x123\x45' Ȥ褦 multi-character character constant Ǥϡ'a', 'b', '\x12', '\x3', '\x123', '\x45' 򤽤줾죱ХȤȤ [0, 0xFF] ϰϤɾη̤̥ХȤ缡 8 ĺեȤʤ­Ƥ椭ޤ0xFF <limits.h> UCHAR_MAX ͡ˡĤ escape sequence ͤ 0xFF Ķϡout of range Υ顼ȤʤޤäơʸåȤ ASCII ǤСΣĤΥȡͤϤ줾 0x6162, 0x1203, 顼Ȥʤޤ

L'' '' ƱͤȤʤޤL'ab', L'\x12\x3', L'\x123\x45' multi-character wide character constant ˤĤƤϡL'a', L'b', L'\x12', L'\x3', L'\x123', L'\x45' 򤽤줾죱Ĥ wide character Ȥ [0, 0xFFFF] ϰϤɾη̤̤ wide character 缡 16 ĺեȤʤ­Ƥ椭ޤĤ escape sequence ͤХʤκͤĶϡout of range 顼ȤʤޤäơʸåȤ ASCII ǤСΣĤΥȡͤϤ줾 0x00610062, 0x00120003, 0x01230045 Ȥʤޤ

Multi-character character constant, multi-character wide character constant ͤ unsigned long long ϰϤĶ out of range 顼Ȥʤޤ

__STDC_VERSION__ ޤ __cplusplus ͤ 199901L ʾξϡ\uxxxx, \Uxxxxxxxx η UCN (universal-character-name) 򣱣 escape sequence Ȥɾޤʤɾ򤷤Ƥⲿΰ̣ʤɾ뤷ʤΤǤˡ

åȽϤΥѥΤ char wchar_t 椢ξϡ#if ǤʸɾȥѥΤǤ if (expression) ˤʸɾȤϡ̤äƤ뤳Ȥޤϰϥ顼ȤʤϰϤ㤦ǽޤޤmulti-character character constant, multi-byte character constant ɾϡץץåǤʤѥΤǤϤˤäƤޤޤǤCHAR_BIT ǤäƤ⡢'ab' 'a' * 256 + 'b' ɾ뤫Ȥ 'a' + 'b' * 256 ɾ뤫⡢Standard C ǤϷƤޤ

̤ˡ#if ǤʸϤʤ¤ϻȤ٤ǤϤޤ󡣤ʤʤȤΤϡˤϻפդޤ󤬡


4.6. #if sizeof (type)

Standard C Ǥϥץץϼ¹ԻĶ䥳ѥΤλͤΩʸ̤ΥץץȤƵ꤬Τˤ졢η̡#if ԤǤ sizeof ȥ㥹ȤϻȤʤȤˤʤޤpre-Standard ⡼ɤǤ #if Ԥ sizeof (type) Ȥ褦ˤʤäƤޤ DECUS cpp Ѿơ long long, long double νɲäμäΤǤʤ˥㥹ȤΤѻʤΤǡäƤʤ뵤ʤˡ

eval.c S_CHAR S_* ȤޥǤϳƷΥƤޤϤǻȤϡ⤷ۥȤȥåȤȤǤηΰۤʤʤ顢ͤȤƥåȽϤΤηΥͤľܽɬפޤ

mcpp #if sizeof ˤϼȴޤchar, short, int, long, long long Ƭդ signed, unsigned ñ̵뤷ޤޤsizeof (void *) ϥݡȤޤ󡣤ȾüǤεǽΤ system.H Υե饰䤷ѻˤʤΤǤɤ㥹Ȥ⥵ݡȤʤΤ sizeof Ϻ褦ȤפޤäǤˤäΤʤΤǡ㴳μäǻĤƤޤ


4.7. White-space sequence ΰ

mcpp translation phase 3 tokenization ˺ݤơtoken separator ȤƤʣ white spaces sequence ϡԥɰʳϸ§Ȥ one space ˰̤ޤ STD ⡼ɤ -k ޤ -K ץ󤬻ꤵ줿Ȥϡ̤ˤΤޤ޽Ϥޤ ޤ white space sequence Ϻޤ

Ƭ white spaces POSTSTD ⡼ɤǤϺ¾Υ⡼ɤǤ̰ǡΤޤ޽Ϥޤ ԤϿʹ֤ϤɤΤĤ˹碌Ƥޤ*1

ϥץץʳäǤθ phase 4 äơޥŸȥץץǥ쥯ƥֹԤνԤޤޥŸθǤϤʣ spaces Ǥ뤳Ȥޤspace Ĥȡѥη̤ϲѤޤ

Standard C Ǥ translation phase 3 Ǥ one space ˰̤뤫ɤ implementation-defined ȤƤޤ̾ϥ桼ϤޤäˤɬפϤޤPortability ˤʤΤϡpreprocessing directive Ԥ <vertical-tab> ޤ <form-feed> Ǥξ Standard C Ǥ undefined Ǥmcpp ǤϤ space Ѵޤ

:

*1 V.2.6.3 ޤǤϸ§Ȥ one space ˰̤ƤV.2.6.4 ѹ


4.8. mcpp ¹ԥץΥǥեȤλ

noconfig ǥ쥯ȥˤƽѤκʬե makefile ȤäƥǥեȤǥѥ뤷 mcpp ¹ԥץλͤ򤳤˽񤤤ƤޤConfigure ץȤƥѥ뤷 configure η̤ˤäưäƤޤOS ȽϤΥСƱǤСʤȤ⥤󥯥롼ɥǥ쥯ȥʳƱ̤ˤʤϤǤ

Compiler-independent Ǥ mcpp λͤˤϽϤˤϤۤȤɤޤ󤬡OS CPU ˤ㤬ޤ

mcpp ˤ compiler-independent-build compiler-specific-build ȤꡢΤɤǤ⤤Ĥư⡼ɤޤˤĤƤ 2.1 򸫤ƤǤ STD ⡼ɤ濴ޤ

κʬե makefile ϼνѤΤΤǤ

FreeBSD 6.3 GCC V.3.4
Vine Linux 4.2 / x86 GCC V.2.95, V.3.2, V.3.3, V.3.4, V.4.1
Debian GNU/Linux 4.0 / x86 GCC V.4.1
Ubuntu Linux 8.04 / x86_64 GCC V.4.2
Fedora Linux 9 / x86 GCC V.4.3
Mac OS X Leopard / x86 GCC V.4.0
CygWIN 1.3.10 (GCC V.2.95), 1.5.18 (GCC 3.4)
MinGW & MSYS GCC 3.4
WIN32 LCC-Win32 2003-08, 2006-03
WIN32 Visual C++ 2003, 2005, 2008
WIN32 Borland C++ V.5.5

ΤۤλäƤʤνϤˤĤƤ⡢桼 contribute 줿ʬե뤬ϿƤޤ

WIN32 Visual C++ V.6.0, 2002
WIN32 Borland C++ V.5.9 (C++Builder 2007)

⤽νϼȤǥѥ뤵ޤ

noconfig.H, system.H ޥΤΤΤϤɤνѤ⤹٤ƱˤƤޤ

DIGRAPHS_INIT == FALSE ǥѥ뤵ƤΤǡdigraph -2 (-digraphs) ץͭȤʤޤ
TRIGRAPHS_INIT == FALSE ȤƤΤǡtrigraph -3 (-trigraphs) ץͭȤʤޤ
OK_UCN TRUE ˤƤΤǡC99, C++ UCN (universal character name) Ȥޤ
OK_MBIDENT FALSE ȤƤΤǡ̻ multi-byte-character ϻȤޤ
STDC 1 ȤƤΤǡ__STDC__ νͤ 1 Ȥʤޤ

Ƽ translation limits ϼΤ褦ˤƤޤ

NMACPARSʥޥΰκ 255
NEXP #if κͥȥ٥ 256
BLK_NEST#if section κͥȥ٥ 256
RESCAN_LIMITʥޥκͥȥ٥64
IDMAX identifier ͭĹ 1024
INCLUDE_NEST#include κͥȥ٥ 256
NBUFFʥκĹ*1 65536
NWORKʽϤκĹ 65536
NMACWORKʥޥŸХåեΥ262144

GCC ǡVisual C ǤǤϽϤκĹ NWORK ǤϤʤ NMACWORK Ǥ

Υޥ OS ˤäưۤʤäˤƤޤbuild type ˤϴطޤ

MBCHAR ʥǥեȤ multi-byte character encoding

FreeBSD, Linux, Mac OS X EUC_JP
Win32, CygWIN, MinGW SJIS

ΥޥϽϤˤäưۤʤäˤƤޤ

STDC_VERSION __STDC_VERSION__ ν͡

Compiler-independent, GCC 2199409L
¾ 0L

HAVE_DIGRAPHS digraphs 򤽤Τޤ޽Ϥ뤫

Compiler-independent, GCC, Visual CTRUE
¾ FALSE

EXPAND_PRAGMA C99 #pragma ԤΰޥŸ뤫

Visual C, Borland CTRUE
¾ FALSE

GCC 2.7-2.95 Ǥ __STDC_VERSION__ 199409L ȤʤäƤޤ3.*, 4.* Ǥ __STDC_VERSION__ ϥǥեȤǤϻ줺¹Իץ˱褦ˤʤޤmcpp GCC ѤϤбΤǤ

STDC_VERSION 0L ΤΤǤϡ__STDC_VERSION__ ϥǥեȤǤ 0L pre-define ޤ-V199409L ץ __STDC__ 1 __STDC_VERSION__ 199409Lޥ '_' ǻϤޤΤȤ̩ C95 ⡼ɤȤʤޤޤ-V199901L ץ C99 ⡼ɤȤʤޤ

C99 ⡼ɤǤ __STDC_HOSTED__ 1 pre-define ޤ__STDC_ISO_10646__, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__ mcpp Ȥ pre-define ޤ󡣽ϤΥƥإåǤޤºݤˤϡglibc 2 / x86 ΥƥǤϥƥإåˤä __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__ 1 졢¾νϤǤϤɤޤ

HAVE_DIGRAPHS FALSE ΤΤǤϡdigraph Ƥʤϡˡdigraph mcpp ̾ token ѴƤϤޤ

EXPAND_PRAGMA TRUE ǤäƤ⡢STDC, MCPP, GCC Τɤ줫ǻϤޤ #pragma ԤϥޥŸޤ

Include ǥ쥯ȥϼΤ褦ꤷƤޤ
ޤUNIX Ǹ system-specific ʤΤ site-specific ʤΤϼ̤Ǥ compiler-independent ǤǤƱǤ

FreeBSD, Linux, Mac OS X, CygWIN/usr/include, /usr/local/include

Mac OS X ǤϤΤۤframework ǥ쥯ȥ꤬ /System/Library/Frameworks, /Library/Frameworks ꤵޤ

MinGW Ǥ /mingw/include ɸ include ǥ쥯ȥˤʤޤ

Ϥ䤽ΥСˤäưۤʤ implementation-specific ʤΤˤĤƤ *.dif ե򸫤ƤCompiler-independent ǤǤϤޤWindows νϤǤϤäꤻĶѿ򻲾ȤޤĶѿ INCLUDE, CPLUS_INCLUDE ǤCompiler-independent ǤǤƱ͡
ǤĤСѤ mcpp ꥳѥ뤹뤫Ķѿǻꤹ뤫-I ץǻꤹ뤫Ƥ

mcpp GCC , Visual C ǰʳǤϡץץ̤ NWORK-1 ĶϡʲĹ˹Ԥʬ䤷ƽϤޤʸƥĹ NWORK-2 ʲǤʤФʤޤ

ǰΤ˷֤ޤʾ italic ɽƤޥϤ mcpp 򥳥ѥ뤷ΤΤǤꡢmcpp μ¹ԥץबäƤȤ߹ߥޥǤϤޤ

ϥեꤻ mcpp ươ#pragma MCPP put_defines ǤȡȤ߹ߥޥΰɽޤ

__STDC__ 1 ʾξ֤Ǥϡ_ ǻϤޤʤȤ߹ߥޥϺޤ-N (-undef) ץǤ __MCPP ʳ٤ƺޤξ -D ץꤷľƤ⤫ޤޤ󡣽ϤΥС󤬾㤦 include directory ʤϡmcpp ꥳѥ뤷ʤƤ⡢ˡǥСޥ뤳Ȥ̥Сб뤳ȤǤޤ-N -U ȤʤƤ⡢-D Υޥ뤳ȤǤޤ

-+ (-lang-c++) ץ C++ Υץץꤷϡ__cplusplus ޤνͤ 1L ǤΤۤˤˤĤΥޥޤ

GCC Ǥ V.3.2 ޤǤϻޥȸäƤ GCC ΤϾʤ¿ gcc cpp -D ץϤΤǤȤθߴΤˤ mcpp ɬפϤʤΤǤmcpp "pre-preprocess" ǡñΤưصΤ mcpp Ƥޤ
GCC V.3.3 ʹߤ60 Ĥ 70 ĤΥޥ褦ˤʤޤmcpp V.2.5 ʹߤǤ GCC ǤǤϤʤǤޤäơGCC V.3.3 ʹѤ mcpp ǤϾ嵭Τۤ¿ΥޥޤƤ mcpp 򥤥󥹥ȡ뤹 mcpp_g*.h ȤإåեǤ狼ޤ

FreeBSD, Linux, CygWIN, MinGW / GCC, LCC-Win32, Visual C 2008 long long äƤΤǡ#if long long, unsigned long long ɾޤVisual C 6.0, 2002, 2003, 2005, Borland C 5.5 Ǥ long long Ϥޤ󤬡__int64, unsigned __int64 ȤΤǤȤޤ

νϤǤ long ϰϤϤ

[-2147483647-1, 2147483647] ([-0x7fffffff-1, 0x7fffffff])

Ǥunsigned long Ϥ

[0, 4294967295] ([0, 0xffffffff])

ϰϤǤ

long long ĽϤǤϤ long long ϰϤ

[-9223372036854775807-1, 9223372036854775807]
([-0x7fffffffffffffff-1, 0x7fffffffffffffff])

ǡunsigned long long ϰϤ

[0, 18446744073709551615] ([0, 0xffffffffffffffff])

Ǥ

νΤǤϤĤɽϣǤꡢӥåȱ黻⤽бƤΤǡmcpp #if ǤƱͤǤ
αեȤϤ⻻ѥեȤǤꡢmcpp #if ǤƱͤǤʣӥåȤαեȤͤĤΤޤ 1/2 ˤʤˡ
ν; operand ޤǤϤ Standard C ldiv() ؿƱŪ黻ԤΤǡmcpp #if ǤƱͤǤ

ΥƥʣϣӡˤǤϤʸåȤ ASCII ʤΤǡmcpp ǤƱͤǤ

䤬񤤤 kmmalloc Ȥ꡼롼󤬤ꡢmalloc(), free(), realloc() ޤǤޤCygWIN, Visual C 2005, 2008 ʳǤϤ줬󥹥ȡ뤵Ƥϡmake MALLOC=KMMALLOCʤޤ -DKMMALLOC=1ˤȤץꤹȤ줬 link ޤҡץΥǥХåѥ롼󥯤褦ˤʤäƤޤerrno ֹ EFREEP, EFREEBLK, EALLOCBLK, EFREEWRT, ETRAILWRT ˤ Linux, LCC-Win32 ǤϤ줾 2120, 2121, 2122, 2123, 2124 򡢤ʳǤϤ줾 120, 121, 122, 123, 124 ƤƤޤ mcpp-porting.html#4.extra ȡˡ*2

GNU Υƥप Visual C ʳǤϡĶѿ TZ Ϥ餫 JST-9 ˥åȤƤɬפޤʤȡ__DATE__, __TIME__ ޥͤƤޤޤ

:

*1 <backslash><newline> ˤ³򤷤ιĹˤ⡢Ȥ a space ѴιĹˤŬѤ롣ȤʣԤˤޤäƤ硢ȤѴˤäƤ줬ԤϢ뤵뤳Ȥա

*2 CygWIN 1.3.10, 1.5.18 Ǥ malloc() _malloc_r() Ȥä롼󤬤ꡢ¾Υ饤֥ؿˤϤƤӽФΤĤ롣Τᡢ¾ malloc() ȤȤǤʤVisual C 2005, 2008 Ǥ⡢ץཪλΥ롼 Visual C malloc() 롼ƤӽФΤǡϤ¾ malloc() ȤȤǤʤ


5. ǥå

5.1. ǥåη

mcpp ФǥåȤΰ̣ϡʲ̤ǤǥåϤɸ२顼Ϥ˽Ϥ졢-Q ץǥȥǥ쥯ȥ mcpp.err Ȥե˥쥯Ȥޤ

ǥåϼηȤäƤޤ

  1. "filename:line: " "fatal error: ", "error: ", "warning: " Τɤ줫³ 5.3 - 5.9 ΥåΤΤɤ줫³"filename:line: " ˻Ϥޤ룱ԤοǥåȤΤϤʻͤǤ뤬UNIX ΣýϤǤŪʿǷǡƼΥġ뤬ȤƤΤǺѤƤ롣̾ΣԤˤޤʤȤФФ롣
  2. ޥŸǤСΥޥƤӽФɽ롣ͥȤ줿ޥƤӽФǤС줾Υޥ̾ɽ롣Υޥɽ졢ΥޥΤ륽ե̾ȹֹɽ롣
  3. ե̾ȹֹȤιԤɽ롣ե뤬 include 줿ΤǤСinclude Υե̾ȹֹȹԤ缡ɽ롣

ɽԤ̾ϡΡʪԡפ \ ˤä³줿ȤΡԡפ餵˥Ȥ a space ѴΤΤǤꡢȤԤޤǤʣԤϢ뤵줿ΤȤʤ롣ֹϢ뤵줿ǸʪԤֹǤ롣Ƚ translation phase ǤΥ顼Ǥϡ phase ιԤɽ롣

-j ץꤷϡ嵭ΣȣϽϤޤ

ǥåˤϼΣĤΥ٥뤬ޤ

fatal errorץץ򤳤ʾ³Ƥ̣ʤ
error ʸˡְäƤ
warning Portability Τʤְ㤤βǽΤ

Warning ˤϤ˼ΣĤΥ饹ޤClass 1, 2 ʳϤüʤΤǤ

class 1 ְ㤤βǽΤ롢ޤ portability 礤
class 2 ʾ꤬뤬ºݤˤϤ֤Τʤ
class 4 ºݤˤϤ֤꤬ʤ portability ˴ؤ warning
class 8 åפ #if group 䡢#if ɾ򥹥åפˤĤƤΤ warning
class 16trigraph, digraph ˤĤƤ warning

mcpp Ϥ¿οǥåѰդƤޤSTD ⡼ɤǤϼΤ褦ʼˤΤܤäƤޤ

fatal error 17
error 76
warning class 1 49
warning class 2 15
warning class 4 17
warning class 8 30
warning class 16 2

ˤĤơ§ȤƤιԤʬŪ˻Ŧޤ

ʤʲǤϡǥåǰѤ륽ΥȡͤʬˤȤƲΥȡϤᤳǤޤΤͤΤ˥ޥ̾񤤤ƤȤϡºݤˤϤΥޥŸͤɽޤ
ޤˤäƥ顼ȤƽФꥦ˥󥰤ȤƽФꤹå⤢ޤʲǤƱΥåˤĤƤϺǽ˵ܤȤǤäȤñ˥å¤٤ˤޤ


5.2. Translation limits

ʲΥ顼ˤϡХåեΥСե mcpp λ;¤ˤΤޤХåե translation limits system.H ΥޥƤޤɬפʾϤ礭 mcpp ꥳѥ뤷ƤʤξʤƥǤϡޤͤ礭 out of memory ȯ䤹ʤΤǡۤɤۤɤˡˡ


5.3. Fatal error

I/O 顼­ץץ򤽤ʾ³뤳ȤǤʤ硢ХåեСեץץ³Ƥ̣ʤˡΥ顼åФơץץߤޤƥץˤϡּԡפξ֤ͤޤ


5.3.1. mcpp ȤΥХ

  • Bug:
    ΥåϿ濫ޤ mcpp ȤΥХ̣ޤ줬Ф뤳ȤϤʤȻפޤ⤷Ф餼ҤξϢ

5.3.2. ʪŪ顼

  • File read error
    եɤ߹ߤΥ顼Ǥǥե륷ƥबǤΤǤ礦
  • File write error
    ϥեν񤭽Ф顼Ǥǥե륷ƥबǤ뤫äѤˤʤäƤΤǤ礦
  • Out of memory (required size is 0x1234 bytes)
    ꤬­ʤʤޤmcpp ҡפ 0x1234 bytes 褦ȤǤʤäˡξʤƥĹʥޥޤˤ¿ȯޤեʬ䤷ơ1 translation unit Υޥ򸺤餷Ƥ

5.3.3. Translation limits ХåեΥ顼

  • Too long header name "long-file-name"
    Include ٤եΥѥꥹȡʻΥǥ쥯ȥΥѥꥹȤϢ뤷Ρˤ PATHMAX ΥĶƤޤ
  • Too long source line
    ʪԤĹ NBUFF-2 ĶƤޤäΥǤϤʤΤǤ礦
  • Too long logical line
    ʪԤ \ ˤä³ԤĹ NBUFF-2 ĶƤޤޤˤĹʥޥȯ뤳ȤޤΤ褦ʥɤϥޥǤϤʤؿȤƽ񤯤٤Ǥ礦
  • Too long line spliced by comments
    Ȥ a space ѴȤιԤĹ NBUFF-2 ĶƤޤԤޤȤˤä¿ιԤϢ뤷ȯޤȤʬΥƤ
  • Too long token
    ץץιԤ NWORK-2 ĶĹΥȡ󤬴ޤޤƤޤmcpp ϥѥΤμĹ NWORK ˽ϹԤʬ䤷褦ȤޤüĹȡ󤬤ʬ䤷ƤϤǤʤȤޤ

ΣĤΥ顼ϥȡ󤬤ۤĹʤƤ⡢ޥŸˤΥȡΤȤǥХåեСեˤʤäˤⵯޤξϥޥƤӽФʬ䤷Ƥ

  • Too long quotation "long-string"
    ʸƥ롢ʸޤ header-name ĹޤʸƥǤʬ䤷Ƥܤʸƥ Standard C νϤǤХѥΤϢ뤷Ƥޤ
  • Too long pp-number token "1234567890toolong"
    Preprocessing-number token ĹޤStandard ⡼ɤξǤ
  • Too long number token "12345678901234......"
    Number token Ĺޤpre-Standard ⡼ɤξǤ
  • Buffer overflow scanning token "token"
    token 򥹥󤷤Ƥ뤦˥ХåեСեȤʤޤʸƥ롢ʸheader-namepp-number ʳΥȡǤϡΥåФޤ

  • More than BLK_NEST nesting of #if (#ifdef) sections
    #if, #ifdef, #ifndef ΥͥȤ BLK_NEST ĶƤޤBLK_NEST Υޥ̾ʬϼºݤˤϤͤɽ롣ʲƱ͡ˡ#if section ʬ䤷Ƥ
  • More than INCLUDE_NEST nesting of #include
    #include ΥͥȤ INCLUDE_NEST ĶƤޤ#include ̵ºƵˤʤäƤΤǤ礦

5.3.4. #pragma MCPP preprocessed ˴ؤ륨顼

  • This is not the preprocessed source
    #pragma MCPP preprocessed ޤ mcpp ˤäƥץץ줿եǤϤޤ
  • This preprocessed file is corrupted
    mcpp ˤäƥץץ줿եΤ褦ǤƤƻȤޤ

5.4. Error

ʸˡŪʴְ㤤ˤΥ顼åФޤ
Standard C Ǥϡviolation of syntax rule or constraint äϽϤϲ餫οǥåФʤФʤʤȤˤʤäƤޤStandard ⡼ɤǤϤ violation ФƤϸ§Ȥƥ顼åФޤϥ˥󥰤Ǥ

ޤStandard C undefined ȤƤΤ¿ˤĤƤ error åޤ warning ФޤUndefined Ǥʤ error warning ФʤΤϡΤΤǤ

  1. ʸƥη header name ' /*ñʤʸȤư롣ºݤˤϤϡե򥪡ץ󤷤褦Ȥƥ顼ˤʤϤǤ<, > ǰϤޤ줿 header name ǤϤʸӥȤγϤȲᤵΤǡ餫Υ顼Ȥʤˡheader name Ǥ \ undefined Ǥ뤬åʤºݤˤϤϤեΥץǥ顼ˤʤǤWindows ǤǤ \ class 2 warning Ф / Ѵƽˡ
  2. #undef defineddefined Ȥ̾ #undef Τ undefined Ǥ뤬mcpp Ǥ defined Ȥ̾Υޥ뤳ȤϤǤʤ褦ˤʤäƤΤǡ줬ä뤳Ȥʤ
  3. illegal multi-byte character sequence ä undefined Ǥ뤬ϼ³ϤʤΤǿǤʤʸƥ롢ʸheader name illegal multi-byte character sequence ˤϥ˥󥰤Фˡ
  4. _ ǻϤޤ identifier ϽϤΤͽ󤵤Ƥꡢ桼ץȷ̤ undefined Ǥ뤬ץץåǤϥ桼ץफǤʤɬȽ̤ǤʤΤǡǤʤ
  5. C99 ǥץȤƵꤵƤޥΤ__STDC_ISO_10646__, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__ #define #undef ꤹ undefined Ǥ뤬ǤʤΥޥϽϤΥإåե뤳ȤˤʤǤץץåϥ桼ץफɤɬȽ̤ǤʤǤ롣
  6. C99 UCN ˤĤƤϡtranslation phase 2 <backslash><newline> UCN sequence Ǥ硢ʸƥϢˤä UCN sequence 줿 undefined Ǥ뤬ϿǤʤʤ UCN Ȥưˡ

Standard C ΥץץǶŪ˲ violation of syntax rule or constraint ǡ undefined Dz unspecified Dz implementation-defined Ǥ뤫ˤĤƤϡcpp-test.html 򻲾ȤƤ

Fatal Ǥʤ error åФƤץץ³ޤλȡ顼οɽƥץˡּԡפξ֤ͤޤ

5.4.1. ʸȥȡ˴ؤ륨顼

  • Illegal control character 0x1b, skipped the character
    ʸƥ롢ʸheader nameȰʳΤȤ white space ʳΥȥ륳ɤޤʸ򥹥åפƽ³ޤ

ϥȡΥ顼ǤΣĤϤ⤽ιԤ򥹥åפƽ³ޤΣĤʸƥΥȡǡԤιޤǤ˰䤬ĤƤʤȤ򼨤ޤ

#error  I can't understand.

ʤɤȡpreprocessing-token sequence ηʤƥȤʸƥǤ⥳ȤǤʤȤ˽񤯤ȡμΥ顼ȤʤޤPre-processing-token ΡʥѥΤǤΡˣä token ꤪޤʤΤǡʸ source character set ˴ޤޤƤФۤȤɤ character sequence 餫 pp-token sequence Ȥ̤Τǡpreprocessing-token 顼ȤʤΤϤǤ

ʤåפ #if group Ǥ pp-token 顼ϥ顼Ȥʤޤ

  • Unterminated string literal
    ʸƥ뤬뤷ƤޤʸƥԤޤȤϤǤޤɬפʤ顢ʣԤʸƥ񤤤ơϤˤϢ뤵ƤΥ顼 # 黻Ҥˤʸ󲽤ȯ뤳Ȥ⤢ޤξϹԤϥåפޤ
    OLDPREP ⡼ɤǤϤϥ顼ˤʤޤʹƥνȤߤʤˡ
    ޤ-a (-lang-asm, -x assembler-with-cpp) ץǵư줿ϡԤޤʸƥȽǤơ\n ƼιԤϢ뤹Τǡ顼ˤϤʤޤʥ˥󥰤ϽФˡ
  • Unterminated character constant 't understand.
    ʸ뤷ƤޤOLDPREP ⡼ɤ lang-asm ⡼ɤǤϤϥ顼ˤʤޤʹƥνȤߤʤˡ
  • Unterminated header name <header.h
    header-name 뤷Ƥޤ<, > ǰϤޤ header-name " ޤ ' äϤΥ顼ǤϤʤ嵭ĤΥ顼Ȥʤޤޤ<, > ǰϤޤ header-name /* äϤ夬ȤȲᤵޤ
  • Empty character constant ''
    ʸȤǤ -a ץ󤬻ꤵ줿Ȥϡϥ顼ˤϤʤ餺˥󥰤Фޤ
  • Illegal UCN sequence
    std ⡼ɤ __STDC_VERSION__ ͤ 199901L ʾξ硢ޤ C++ ξϡUCN ǧޤ̻ \u, \U ǻϤޤ룱 sequence Υ줾죴Ƥޤ󡣡#if ʸǤ줬äȤϡUndefined escape sequence Υ˥󥰤Ȥʤ롣ʳξϿǤʤˡ
  • UCN cannot specify the value "0000007f"
    UCN ϣʤ [0, 9f], [d800, dfff] ϰϤͤꤹ뤳ȤϤǤޤ󡣤ԤΤ 0x24 ($), 0x40 (@), 0x60 (`) ϲĤǤԤϤΣʸȤ٤ basic source character set ͤȰפΤǡȤޤ󡣤ޤԤ special characters Τ reserved area ȤʤäƤޤC++ ǤϸԤ¤Ϥޤʤʤʤ̯˰äƤˡC++ Ǥ -V199901L Ȥƥޥ __cplusplus 199901L ʾ˻ϡ˴ؤƤ C99 Ʊͤˤʤޤ
  • Illegal multi-byte character sequence "XY"
    OK_MBIDENT == TRUE ǥѥ뤷 Standard ⡼ɤξ硢C99 Ǥ identifier multi-byte character Ȥޤmulti-byte character Ȥǧʤ character sequence ȥ顼ˤʤޤidentifier ʳ pp-token Ǥϥ˥󥰡ˡ

5.4.2. 뤷ʤեΥ顼

Υåϥե뤬뤷ʤ #if sectionޥƤӽФǽäƤ˽ФޤΥեϤξinclude 줿եǤʤˤϡ"End of file" ǤϤʤ "End of input" ɽޤ
οǥå mcpp Υ⡼ɤˤäơ顼Ȥʤȥ˥󥰤ȤʤȤޤ
Standard ⡼ɤǤϤϤ٤ƥ顼ǤΥޥƤӽФϥåפ#if section бطϤΥե뤬 include 줿ν֤ᤷޤ
pre-Standard ⡼ɤǤϤ٤ƥ˥󥰤Ǥpre-Standard ⡼ɤǤ⡢OLDPREP ⡼ɤǤ unterminated macro call ʳϥ˥󥰤Фޤ

  • End of file within #if (#ifdef) section started at line 123
    123 Ԥ #if (#ifdef, #ifndef) б #endif ޤ
  • End of file within macro call started at line 123
    123 ԤǻϤޤäޥƤӽФեνޤǤ˴뤷Ƥޤ󡣰ΥåбƤʤȡ󥨥顼äˡĤʬȤɤǤäƥեκǸޤã뤳Ȥޤʤ Buffer overflow Ȥʤ뤫⤷ʤˡޤޥŸλͤ⡼ɤˤäưۤʤΤǡ⡼ɤǤϰտ̤Ÿޥ¾Υ⡼ɤǤϤΥ顼ˤʤ뤳Ȥޤ

5.4.3. Preprocessing group бطΥ顼

#if, #else group бطΥ顼ǤιԤ̵뤷ơʤޤǤ group ³ƤΤȤơ˽³ޤΥåϤȤåפ #if group ˤäƤԤޤ
ʤ#if (#ifdef) section Ȥ #if, #ifdef, #ifndef #endif ޤǡ#if (#elif, #else) group ȤϣĤ #if (#ifdef) section Τ #if (#ifdef, #ifndef), #elif, #else, #endif ǤϤޤ줿Ĥιԥ֥åؤޤ

  • Already seen #else at line 123
    123 Ԥ #else 줿ˤޤ #else (#elif) Ƥޤ#endif ˺줿Τ⤷ޤ
  • Not in a #if (#ifdef) section
    #if (#ifdef, #ifndef) ʤ #else (#elif, #endif) Ƥޤ
  • Not in a #if (#ifdef) section in a source file
    Include 줿եǡ#if (#ifdef, #ifndef) ʤ #else (#elif, #endif) ƤޤInclude 줿ե뤬եˤХ顼ˤʤʤñΥեǤϥХ󥹤ȤƤʤȤǤStandard ⡼ɤλǤpre-Standard ⡼ɤǤϥ˥󥰡ˡ

ΣĤ #asm, #endasm бطΥ顼Ǥpre-Standard ⡼ɤνϤξǤ

  • In #asm block started at line 123
    123 ԤϤޤä #asm ֥åˤޤ #asm ޤ#asm ҤˤǤޤ󡣤֤#endasm ˺줿ΤǤ礦
  • Without #asm
    #asm ֥åǤϤʤȤ #endasm ޤ

5.4.4. ǥ쥯ƥֹԤñʹʸ顼

ʹߡ5.4.12 ޤǡˤΥ顼ϥåפ #if group Ǥϵޤ-W8 ץǵưȡUnknown directive ˤĤƤϥ˥󥰤Фˡ
# ǻϤޤǥ쥯ƥֹԤñʸˡ顼ǤιԤ̵뤷ƽ³ޤʤʤ#if section γϤȤߤʤ#line ǤϹֹѤʤˡ#include, #line ԤΰޥǤСŸǥåԤޤpre-Standard ⡼ɤǤŸʤˡ
ΥåΤΤˤϥǥ쥯ƥ̾ФƤޤ󤬡³ɽ륽Ԥǥǥ쥯ƥ֤狼ޤʥǥ쥯ƥֹԤϥȤ space ѴȡɬԤˤʤˡ

  • Illegal #directive "123"
    # ³ȡ̾ǤϤޤ# ³Τϥǥ쥯ƥ̾ǤʤФʤޤʤOLDPREP ⡼ɤǤ #123 #line 123 ƱΤȤưˡ
  • Unknown #directive "pseudo-directive"
    pseudo-directive Ȥǥ쥯ƥ֤ϼƤޤ-a (-lang-asm, -x assembler-with-cpp) ץǵư줿ϡ顼ˤϤʤ餺˥󥰤ˤʤޤ
  • No argument
    #if, #elif, #ifdef, #ifndef, #assert, #line ΰޤ
  • No header name
    #include Ԥΰޤ󡣤ޤϰޥǤŸȤˤϥȡ󤬲ʤʤޤ
  • Not a header name "UNDEFINED_MACRO"
    header name ǤϤޤheader name ϤΥޥƤʤʤɤǤ<, > ޤ ", " ǰϤޤ줿Τ header name Ǥ
  • Not an identifier "123"
    #ifdef, #ifndef, #define, #undef ˤ identifier ΰɬפǤ123 identifier ǤϤޤ
  • No identifier
    #define, #undef ΰޤ
  • No line number
    #line ΰޥǤŸȤ ˤϲȡ󤬻ĤʤʤäƤޤޤ
  • Not a line number "name"
    #line ΰͥȡpreprocessing numberˤǤϤޤ
  • Line number "0x123" isn't a decimal digits sequence
    #line ϽȡǤʤФʤޤStandard ⡼ɤξǤpre-Standard ⡼ɤϥ˥󥰤ϽФʡȡǧˡ
  • Line number "2147483648" is out of range of [1,2147483647]
    #line [1,2147483647] ϰϤˤʤФʤޤ0 ⥨顼ǤStandard ⡼ɤξǤ
  • Not a file name "name"
    #line ̾ʸƥǤʤФʤޤIdentifier 磻ʸƥǤϤޤ

Υ顼 Standard ⡼ɤξǡΥǥ쥯ƥ̵֤뤵ޤOLDPREP ⡼ɤǤϥ顼⥦˥󥰤ФKR ⡼ɤǤϥ˥󥰤Ȥʤꡢ "junk" ʤäΤȤƥץץ³ޤ

  • Excessive token sequence "junk"
    #else, #endif, #asm, #endasm ιԤ;פʥƥ junk ޤ#ifdef, #ifndef, #include, #line, #undef ιԤθ;פʥƥ junk ޤϥȤȤƽ񤤤Ƥ

5.4.5. #if ιʸ顼

#if, #elif, #assert ǥ쥯ƥμιʸ˴ؤ륨顼Ǥ

#if (#elif) ǥ顼äϡ #if (#elif) Ԥϵɾ줿ΤȤơʤʤ group 򥹥åפơˡץץ³ޤ

åפ #if (#ifdef, #ifndef, #elif, #else) group ˤĤƤϡ줬ä legal preprocessing token ΩäƤ뤫ɤȡ#if group бطϥåޤ¾ʸˡ顼ϥ顼ˤϤʤޤ

#if ԤΤΤǤϡɾ򥹥åפʬޤ㤨 #if a || b Τ褦ʼ a Ǥϡb ɾϹԤޤ󡣤Σʸˡ顼ʤ translation limit Υ顼ϤȤɾ򥹥åפʬˤäƤåޤ

  • More than NEXP*2-1 constants stacked at "12"
    #if ɾǡåѤޤƤ 12 ΤȤ NEXP*2-1 ʾˤʤޤ#if ΥͥȤޤ
  • More than NEXP*3-1 operators and parens stacked at "+"
    #if ɾǡåѤޤƤ黻Ҥȥåιפ + ΤȤ NEXP*3-1 ʾˤʤޤʥåϰФ򣲤Ĥȿˡ#if ΥͥȤޤ
  • Misplaced constant "12"
    #if Τ٤Ǥʤ֤ 12 ޤ#if Ǥϥ㥹ȤϻȤޤ󤬡(int)0x8000 ʤɤȥ㥹ȤȤäꤹȡint ޥȤƤʤ identifier Ȥߤʤ 0 ɾΤǡ(0)0x8000 ȤʤꡢΥ顼ȯޤ
  • Operator ">" in incorrect context
    #if ̯ʰ֤ > Ȥ黻Ҥޤޥ MACRO ĤΥȡƤˡ#if MACRO > 0 ʤɤȤȡޥŸη #if > 0 ȤʤΤǡΥ顼ȤʤޤʤξϤľ Macro "MACRO" is expanded to 0 token Ȥ˥󥰤ФΤǡȤ狼ˡ
  • Unterminated expression
    #if 뤷ƤޤMACRO ĤΥȡƤ #if a || MACRO ʤɤξǤ
  • Excessive ")"
    #if ( бʤ;פ ) ޤ
  • Missing ")"
    #if ( б ) ޤ
  • Misplaced ":", previous operator is "+"
    ? бʤ : ޤ
  • Bad defined syntax
    #if defined ʸˡְäƤޤäбȤƤʤäꡢ identifier ˤʤäƤʤäξǤޥŸη̡Υ顼äϡΥå³ƤŸ̤ɽޤ
  • Can't use a string literal "string"
    #if ˤʸƥϻȤޤ
  • Can't use a character constant 'a'
    POSTSTD ⡼ɤǤ #if ʸ磻ʸϻȤޤ
  • Can't use the operator "++"
    #if ˻Ȥʤ黻Ҥޤ=, ++ Ǥ
  • Not an integer "1.23"
    #if ԤˤʸޤˤȤޤ
  • Can't use the character 0x24
    #if ˻Ȥʤʸʥ 0x24ˤޤ identifier, operator, punctuator, string literal, character constant, preprocessing number Τɤ preprocessing token ˤפʤʸΥȡǤʥȥ륳ɤϤ˥åƤΤǡʳʸˡ $ identifier ǧϤǤ⡢ץˤäƤϤ줬Ȥʤʤޤ 󡢥åפ group ˤΤϥåޤ

#if sizeof ˴ؤ륨顼Ǥpre-Standard ξǤ

  • sizeof: Syntax error
    #if sizeof ʸˡְäƤޤäʤäꡢä¿ꡢäбȤƤʤäꡢʤäꤹǤ
  • sizeof: No type specified
    #if sizeof (type) type ꤵƤޤsizeof (*) ʤɤǤsizeof ((*)()) ϴؿؤΥݥ󥿤Υ legal ʹʸǤ

5.4.6. #if ɾ˴ؤ륨顼

Υ顼ɾ򥹥åפʬˤϵޤ-W8 ץǤϤˤĤƤ⥦˥󥰤Фˡ

#if C99 ǤϤνϤλĺǡC90, C++98 Ǥ long / unsigned long ɾΤǤmcpp Ǥ C90, C++98 Ǥ long long / unsigned long long ɾޤC90, C++98 long / unsigned long ϰϤĶϥ˥󥰤Фޤ
long long ΤʤϤǤϡ long long / unsigned long long long / unsigned long ɤؤƤpre-Standard ǤϤ٤ (signed) long ɤؤƤPOSTSTD Ǥ #if ʸϻȤʤΤǡ̤Υ顼ˤʤޤ

  • Constant "123456789012345678901" is out of range
    ͤ unsigned long long ɽǤϰϤĶƤޤ
  • Integer character constant 'abcdefghi' is out of range
    ʸ 'abcdefghi' ͤ unsigned long long ɽǤϰϤĶƤޤ
  • Wide character constant L'abcde' is out of range
    磻ʸ L'abcde' ͤ unsigned long long ɽǤϰϤĶƤޤSTD ⡼ɤλǤ
  • 8 bits can't represent escape sequence '\x123'
    ʸΣĤ escape sequence ͤ 8 bits ɽǤϰϡ[0, 0xFF]ˤĶƤޤ
  • 16 bits can't represent escape sequence L'\x12345'
    磻ʸΣĤ escape sequence ͤ 16 bits UTF-8 ξ 32 bitsˤɽǤϰϤĶƤޤSTD ⡼ɤλǤ
  • Division by zero
    #if 0 ˤ껻ޤ껻 / ˤΤ % ˤΤޤ#if dividend / divisor .. divisor ޥȤƤʤʤɤ˵ޤ#if defined divisor && (dividend / divisor ..) Ƚ񤯤ȤǡΥ顼򤱤뤳ȤǤޤ
  • Result of "op" is out of range
    黻 op ˤ黻η̤ long long ϰϳȤʤޤop ϣ黻 *, /, %, +, - Τɤ줫Ǥɽξϡñ '-' 黻Ҥ -LLONG_MIN ǥСեȤʤޤUnsigned long long ϥСե뤳ȤʤΤǥ顼ˤϤʤޤ󤬡Ūʱ黻̤ϰϳȤʤϥ˥󥰤Фޤ

sizeof ˴ؤ륨顼ǤåפʬǤϽФޤ-W8 ץǤϥ˥󥰤Фˡpre-Standard ξǤ

  • sizeof: Unknown type "type"
    #if sizeof (type) type ѤǤ
  • sizeof: Illegal type combination with "type"
    #if sizeof (long float) ȡȤ߹碌ѤǤ

5.4.7. #define Υ顼

#define ˴ؤ륨顼Ǥ ޥޤ

#, ## 黻Ҥ˴ؤ륨顼 Standard ⡼ɤΤΤǤ
__VA_ARGS__ ˴ؤ륨顼 Standard ⡼ɤξǤ Ѱޥ C99 λͤǤGCC, Visual C++ 2005, 2008 ȤθߴΤ C90 Ǥ C++ ǤͭȤƤޤʤ˥󥰤Фˡ

  • "defined" shouldn't be defined
    defined Ȥ̾ΥޥǤޤ󡣤 Standard ⡼ɤǥåޤ
  • "__STDC__" shouldn't be redefined
    ޥ __STDC__ #define Ǥޤ__STDC_VERSION__, __FILE__, __LINE__, __DATE__, __TIME__ C99 ⡼ɤǤ __STDC_HOSTED__ -+ ץǤ __cplusplus ƱͤǤ Standard ⡼ɤǥåޤ
  • "__VA_ARGS__" shouldn't be defined
    C99 ǤϲѰޥִꥹ __VA_ARGS__ Ȥѥ᡼Ȥޤ identifier ϥޥȤ뤳ȤϤǤޤ
  • More than NMACPARS parameters
    ޥǥѥ᡼ο NMACPARS ĶƤޤ
  • Empty parameter
    ޥ˥Υѥ᡼ޤ
  • Illegal parameter "123"
    ޥ identifier ʳΥȡ󤬥ѥ᡼˻ȤƤޤ Standard ⡼ɤǤϡidentifier ǤäƤ __VA_ARGS__ ϥѥ᡼ȤƻȤޤ
  • Duplicate parameter name "a"
    ޥ a Ȥѥ᡼̾ʣƤޤ
  • Missing "," or ")" in parameter list "(a,b"
    ޥǥѥ᡼ꥹȤĤ ) ޤ󡣤ޤϥѥ᡼ľ ',' Ǥ ')' Ǥʤ̤Υȡ󤬤ޤ
  • No token before ##
    ޥִꥹ ## 黻Ҥ˥ȡ󤬤ޤ
  • No token after ##
    ޥִꥹ ## 黻Ҥθ˥ȡ󤬤ޤ
  • ## after ##
    ޥִꥹ ## ## Ȥȡ¤Ӥޤϥ顼ǤϤʤȤ⤢뤫⤷ޤ󤬡## Ȥȡ¾ΥȡϢ뤵ɬ valid ǤʤȡȤʤΤǡΥޥŸˤɬ顼ˤʤޤmcpp ǤϤϥޥ˥顼ˤޤ
  • Not a formal parameter "id"
    ؿͥޥ # 黻ҤΥڥ id ѥ᡼̾ǤϤޤ
  • "..." isn't the last parameter
    "..." Ȥѥ᡼ϥޥκǸΥѥ᡼ǤʤФʤޤ󡣡pre-Standard ⡼ɤǤ ... Illegal parameter 顼ˤʤˡ
  • "__VA_ARGS__" without corresponding "..."
    ִꥹ __VA_ARGS__ Ȥ identifier ... Ȥѥ᡼礷Ȥޤ

GCC-specific-build STD ⡼ɤǤ GCC2 ͤβѰޥȤޤΥޥ __VA_ARGS__ ȤƤȡΥ顼ˤʤޤ __VA_ARGS__ Ȥʤ GCC3 ͤ C99 ͤǽ񤫤ʤФʤޤ

  • __VA_ARGS__ cannot be used in GCC2-spec variadic macro

5.4.8. #undef Υ顼

#undef ˴ؤ륨顼Ǥ

  • "__STDC__" shouldn't be undefined
    ޥ __STDC__ #undef Ǥޤ __STDC_VERSION__, __FILE__, __LINE__, __DATE__, __TIME__ C99 ⡼ɤǤ __STDC_HOSTED__ -+ ץǤ __cplusplus ƱͤǤ Standard ⡼ɤξ˥åޤ

5.4.9. ޥŸΥ顼

ϥޥŸ˴ؤ륨顼ǤΥޥɽ졢ΥޥΤ륽ե̾ȹֹɽޤ#, ## 黻Ҥ˴ؤ륨顼 Standard ⡼ɤǤ

  • Less than necessary N argument(s) in macro call "macro( a)"
    ޥƤӽФΰ­ޤmacro ˤϰ N ɬפǤ­ʤˤ 0 ĤΥȡƤơ³ޤѥ᡼ĤǰξϥȰηȤζ̤Ĥޤ󤬡ϥ顼ˤޤOLDPREP ⡼ɤǤϤϥ˥󥰤Ǥ
  • More than necessary N argument(s) in macro call "macro( a, b, c)"
    ޥƤӽФΰ¿ޤmacro ΰ N ĤΤϤǤ;פʰΤƤơ³ޤOLDPREP ⡼ɤǤϤϥ˥󥰤Ǥ
  • Not a valid preprocessing token "+12"
    ## 黻ҤˤäƣĤ pp-token Ϣ뤷Ȥ"+12" Ȥ invalid ʤΤˤʤޤϸڤΥ뤫⤷ޤ󤬡Τޤ޽³ޤ-lang-asm (-x assembler-with-cpp, -a) ץǤϡϥ˥󥰤Ǥ
  • Not a valid string literal "\\"str\""
    # 黻ҤˤäƥޥƤӽФΰʸ󲽤ȤͭʡñΡʸƥȤϤʤ餺"\\"str\"" Ȥ token sequence ˤʤޤƥγ \ Τ뤳ȤǤʥƥγ \ ʸ󲽤ȡUnterminated string literal Υ顼ˤʤ뤳Ȥ⤢ꡢΥ顼ˤʤʤȤ⤢ˡΤޤ޽³ޤ֤󥳥ѥեǺ٥顼ˤʤǤ礦POSTSTD ⡼ɤǤϤΥ顼ȯޤUnterminated string literal Ϥꤦˡ

ʲΥ顼ǤϡΥޥƤӽФϥåפޤ

  • Buffer overflow expanding macro "macro" at "something"
    ޥŸ something ΤȤǥХåեСեޤޥʬ䤷Ƥ
  • Unterminated macro call "macro( a, (b, c)"
    ޥƤӽФ뤷Ƥޤ󡣤Υ顼ΤϤƤϡǥ쥯ƥֹԤǤΥޥƤӽФιԤǴ뤷ƤʤǤޤStandard ⡼ɤǤϰΥޥϰִΩäŸޤλˤΥޥƤӽФϤΰǴ뤷ƤʤФʤޤPOSTSTD ⡼ɤǤϥޥִꥹˤޥƤӽФִꥹȤǴ뤷Ƥʤ⡢Υ顼Ȥʤޤ
  • Rescanning macro "macro" more than RESCAN_LIMIT times at "something"
    ޥΥͥȤơŸ "something" ΤȤǺβ RESCAN_LIMIT ĶޤStandard ⡼ɤξǤޤꤨޤ
  • Recursive macro definition of "macro" to "macro"
    ޥƵŪǤ pre-Standard ⡼ɤλꤦ륨顼Ǥβ PRESTD_RESCAN_LIMIT ãȺƵŪޥȤߤʤޤ

Υ顼 STD ⡼ɤ -K ץꤷȤΤΤǤ Ȥˡޥüʣʤᡢmacro notification ΤΥХåե­ʤʤäȤ̣Ƥޤ ºݤˤϤޤޤ

  • Too many magics nested in macro argument
  • Too many nested macros in tracing MACRO

5.4.10. #error, #assert

  • #error
    #error ǥ쥯ƥ֤¹Ԥޤ #error ԤɽޤʰΤΤ˥ȡ󥨥顼unterminated string ˤä #error ϼ¹Ԥʤˡ#error Standard ⡼ɤξǤ
  • Preprocessing assertion failed:
    #assert ǥ쥯ƥ֤¹Ԥޤθդ³ #assert ԤΰϤޤμΤΤ˥顼äϡassertion ԤΤȤߤʤޤ#assert pre-Standard ⡼ɤ COMPILER != GNUC ξǤ

5.4.11. #include μ

  • Can't open include file "file-name"
    Include ٤ե뤬¸ߤʤˤΥ顼ȯޤ֤ե̾Υڥߥ include directory λδְ㤤Ǥ礦

5.4.12. ¾Υ顼

ΣĤ Standard ⡼ɤ C99 ΤΤǤ C++ Ǥ -V199901L ץǵưƱͤǤ

  • Operand of _Pragma() is not a string literal
    _Pragma() operator ΰϣĤʸƥޤϥ磻ʸƥǤʤФʤޤ
  • _Pragma operator found in directive line
    _Pragma() operator #pragma ǥ쥯ƥ֤ˤʤΤǤ ǥ쥯ƥֹԤǻȤȤϤǤޤ

5.5. Warning (class 1)

ʸˡŪˤϴְ㤤ǤϤʤν񤭴ְ㤤βǽ portability Τˡwarning ФޤWarning ˤ 1, 2, 4, 8, 16 ΣĤ class ޤmcpp εư -W <n> Ȥץꤹ뤳Ȥǡ餬ͭˤʤޤ<n> 1, 2, 4, 8, 16 ΤǤդΤΤ OR ȤäΤǤʤʲ -W4 ȸäƤΤϡ-W<n> <n> & 4 ξΤȤǡ1|4, 1|2|4, 2|4, 1|4|8, 4|8, 4|16 ޤߤޤ

Standard ⡼ɤǤ Standard C undefined ȤƤư¿ error ˤޤˤĤƤ warning Фޤ

Ʊͤ Standard ⡼ɤǤ Standard C unspecified ȤƤͤȤФƤϡʳɬ warning Фޤ

  1. #if sub-expression ɾˤĤƤϡwarning ϽФʤ||, &&, ? : ʳα黻Ҥ˴ؤƤ operand ɾ unspecified Ǥ뤬#if ѤʤΤǡɾϷ̤ˤϱƶʤǤ롣mcpp ǤϡȡɾϾ˽иƱ˺鱦˹Ԥδ֤α黻Ͼ˱黻ҤΥ롼ԥ󥰤ε§˽äơιͤɬפˤʤä˽ƹԤ

Standard ⡼ɤǤϡimplementation-defined ȤƤư¿ˤĤƤ warning ФޤImplementation-defined Ǥʤ warning νФʤΤϡǤ

  1. #include directive include եõꡢ #include ΰ header-name Ȥ pp-token ۤˡ warning ФƤΤǤϤ뤵header-name ϥޥǤʤСΥȡ space ̵ͭޤƤΤޤ޻Ȥ롣ޥǤСŸ̤ space ̵ͭޤƤΤޤ޻ȤPOSTSTD ⡼ɤǤϡޥŸˤä pp-token ֤ space 뤬ξ < > ޤǤ space ƤäĤΤ header-name Ȳ᤹롣ɤˤƤ POSTSTD Ǥ <, > ˤ header-name obsolescent feature ǤˡWarning ϽФʤˡ#pragma MCPP debug path, #debug path ǥѥɽ롣
  2. #if Ǥ single byte ʸ'a' ˤɾȡñ multi- byte character Υ磻ʸL'' ˤɾϴʸåȤƱǤäƤ⡢single byte ΥʤȤ̵ͭȤ en-coding Ȥˤä portability Ϥ¤ΤǤ뤬꤬ʤUCN ˤĤƤƱͤǤ롣
  3. #if ӥåȱ黻ɽˤäƷ̤ͤۤʤ뤬ȾΥޥϣɽȤäƤΤǡȤ portability ϤۤȤ¸ߤʤαӥåȥեȤ operand ޤν portability ˳Τǡwarning Ф
  4. Token separator ȤƤʣ white spaces sequenceStandard C Ǥ translation phase 3 Ǥ one space ˰̤뤫ɤ implementation-defined ȤƤ뤬̾ϥ桼ϤޤäˤɬפϤʤPortability ˤʤΤϡpreprocessing directive Ԥ <vertical-tab> ޤ <form-feed> Ǥ롣mcpp ǤϤ space Ѵ뤬λ warning Фʣ space, tab sequence one space ۤäư̤롣
  5. ȼȤ߹ߥޥˤĤƤ warning ϽФʤ
  6. #pragma sub-directive ˤĤƤ⸶§Ȥ warning ϽФʤmcpp Ȥ #pragma once, #pragma __setlocale, #pragma MCPP * ǰְäƤϡwarning ФޤGCC V.3 Ǥ #pragma GCC poison (dependency) Τ褦ˡ°ΥץץåϽ뤬 mcpp Ͻʤ #pragma ˤĤƤ warning Ф
  7. C99 ǤϡUCN sequence # 黻Ҥˤäʸ󲽤硢\ \\ Ȥդ˽Ťͤ뤫ɤ implementation-defined ȤʤäƤ뤬ˤĤƤ warning ϽФʤmcpp Ǥ \ ϽŤͤʤ

äơmcpp ǤϥץץΥ٥Ǥ portability Υåܴۤ˹ԤȤǤޤ

POSTSTD ⡼ɤǤϡ 2.1 ˤͤΰ㤤 STD ⡼ɤƱͤǤ

˥󥰤ĽФƤ⡢פξ֤ͤޤ-W0 Υץǵưȡ˥󥰤ϽФޤ

5.5.1. ʸȡ󤪤ӥȤ˴ؤ륦˥

  • Converted [CR+LF] to [LF]
    ԥɤ [CR+LF] [LF] ѴޤWindows ѤΥե UNIX ϤΥƥǥѥ뤹ȡΥ˥󥰤ФơԥɤưŪѴޤΥ˥󥰤ϣ󤷤ФޤCompiler-independent-build Ǥϥ饹ǡcompiler-specific-build Ǥϥ饹Ǥ
  • Illegal control character 0x1b in quotation
    ʸƥ롢ʸheader name white space Ǥʤȥ륳ɤޤϥѥΤǥ顼ˤʤ뤫⤷ޤ󡣤ǤʤƤ⡢ʤǤȥ륳ɤʸƥ롢ʸǤ escape sequence ǽ񤯤٤Ǥ
  • Illegal multi-byte character sequence "XY" in quotation
    ʸƥ롢ʸheader name XY ΣХܤ multi-byte characterʴˤΣХܤǤХܤ multi-byte character ΣХܤǤϤޤ"XY" ɽϲϤˡ multi-byte character ȤߤʤХܤ single byte character ȤơХܤϼʸȤưޤ
    볰⵬ϰϤΥɤǤС˥󥰤ϽФޤ󡣤ޤϰϤˤºݤˤʸΤʤ꤬Ȥɤˤޤmcpp ̾ϤޤǤϥåޤ󡣵ϰϤϼ̤Ǥ
    encoding first byte second byte
    shift-JIS 0x81-0x9f, 0xe0-0xfc0x40-0x7e, 0x80-0xfc
    EUC-JP 0x8e, 0xa1-0xfe 0xa1-0xfe
    KS C 5601 0xa1-0xfe 0xa1-0xfe
    GB 2312-80 0xa1-0xfe 0xa1-0xfe
    Big Five 0xa1-0xfe 0x40-0x7e, 0xa1-0xfe
    ISO-2022-JP0x21-0x7e 0x21-0x7e
    ISO-2022-JP ˤʸɤΤۤ shift sequence ȤΤޤShift sequence ̤ˤȡUTF-8 ʳϤ٤ multi-byte character ϣХȤǤ
    UTF-8 Ǥ multi-byte character ϣХȤޤϣХȡˣХȤǤꡢȾδϣХȤ encode ޤ Хܤ 0xc2-0xefХܰʹߤ 0x80-0xbf ϰϤˤޤܺ٤ϾάޤɤˤƤ⡢ƥХȤϤϰϤˤʤФʤޤ ޤϰˤ illegal sequence ¸ߤޤmcpp Ϥ˥˥󥰤Фޤ
    ʤEUC-JP 0x8f + 0xa1-0xfe + 0xa1-0xfe ΣХ encoding JIS X 0212 ΤˤϣʸȤƤǧǤ0x8f, 0xa1-0xfe + 0xa1-0xfe ΣʸȤǧޤη̡˥󥰤Ф#if Υ磻ʸɾʳϡưޤEUC-JP ǤϣХܤ 0x8e ʸJIS X 0201 ΤȾѥʡˤϣХ encoding ǤΤǡmulti-byte character Ȥưޤ
    Υ˥󥰤ϥåפ #if group ǤϽФޤ
  • "/*" in comment
    /* Ȥ sequence ޤտޤƽ񤤤ΤǤʤСȤĤ˺Ǥ礦ȤϥͥȤǤޤ
  • Too long identifier, truncated to "very_long_identifier"
    Identifier Ĺ IDMAX ĶƤΤǡIDMAX ˽̤ޤ
  • Illegal digit in octal number "089"
    ʤοͥȡ 8 ޤ 9 ʸޤpre-Standard ⡼ɤǤФޤStandard ⡼ɤǤ̾ιԤοͥȡˤĤƤȽϤޤ#if ˤΥȡ󤬤С Not an integer 顼ΰȤʤޤ
  • Unterminated string literal, catenated to the next line
    ĤƤʤʸƥ̾ϥ顼Ǥ-lang-asm (-x assembler-with-cpp, -a) ץǵư줿ϡϹԤޤʸƥȲᤷơ'\n' ƼιԤϢ뤷ޤν򤹤åȤϲʤΤǡܤʸƥϢפεǽȤäƽ񤤤Ƥ
  • Unterminated character constant 't understand.
    ʸ뤷Ƥޤ lang-asm ⡼ɤǤϤϥ顼ˤϤʤޤ
  • Empty character constant ''
    ʸȤǤ lang-asm ⡼ɤǤϤϥ˥󥰤Ǥ¾Υ⡼ɤǤϥ顼ˤʤޤ

5.5.2. 뤷ʤեΥ˥

եκǸιԤȾüǤˡΥ˥󥰤Фޤold_prep ⡼ɤǤϥ˥󥰤Фޤ

  • End of file with no newline, supplemented newline
    ե뤬ԥɤΤʤԤǽäƤƤϤʤޤ󡣲ԥɤ䤤ޤ
  • End of file with \, deleted the \
    ե뤬 <backslash><newline> ǽäƤƤϤʤޤ<backslash> ޤ
  • End of file with unterminated comment, terminated the comment
    ȤĤ˺ǤȤĤޤ

Υ˥󥰤 pre-Standard ⡼ɤǤФޤStandard ⡼ɤǤϥ顼ˡϤνǤʤϡΥ˥󥰤̵뤷ƽ³ޤη̤Ϥ̯ʥ顼Ǥ礦OLDPREP ⡼ɤǤ unterminated macro call ʳϥ˥󥰤Фޤ

  • End of file within #if (#ifdef) section started at line 123
  • End of file within macro call started at line 123
  • End of file with unterminated #asm block started at line 123
    123 Ԥ #asm б #endasm ޤ

5.5.3. ǥ쥯ƥֹԤ˴ؤƼΥ˥

  • The macro is redefined
    ³ưΤե̾ȹֹ椬ɽޤ
    ޥȤϰäƤǺޤ Ƥʤ˰㤤ޤƱ̾ΥޥʣƤϡξƤʤȺȤʤꡢΥ˥󥰤Фޤ
    1. ѥ᡼οƱ
    2. ִꥹȤƱʤȡ֤Σİʾ white spaces ϤĤäƤ⣱ĤȤߤʤPOSTSTD Ǥ token separator äƤʤƤ⼫ưŪ a space ѴΤǡtoken separator ΰ㤤ˤʤʤˡ
    3. STD ⡼ɤǤϥѥ᡼̾ƱPOSTSTD ǤϤϥåʤpre-Standard ⡼ɤǤåʤ

  • Unknown argument "name"
    #pragma MCPP debug, #debug ΰȤ "name" ϼƤޤ
  • No argument
    #pragma MCPP debug, #debug ΰޤ
  • Not an identifier "123"
    #pragma MCPP debug, #debug ΰ identifier ǤϤޤ

Standard ⡼ɤξǤ

  • "and" is defined as macro
    C++ and ޥȤޤ
    C95 Ǥ <iso646.h> ǥޥȤ "and" Σ̾ϡC++ Ǥ operator token ǤC++ ǤϤϥޥȤ뤳ȤǤʤΤǤ operator ȤƼƤʤϤǤȤ褦ˡޥȤ뤳Ȥʤ饦˥󥰤Фޤ

STD ⡼ɤξǤ

  • No space between macro name "MACRO" and repl-text
    #define ԤΥޥִ̾ΥꥹȤȤδ֤˥ڡޤ̾ϤꤨʤȤǤ
    #define THIS$AND$THAT(a, b)     ((a) + (b))
    Ȥդ˥ޥ̾˵ʳʸȤƤȡ
    #define THIS    $AND$THAT(a, b) ((a) + (b))
    ȲᤵơΥ˥󥰤Фޤ

lang-asm ⡼ɤξǤ

  • Illegal #directive "+"
  • Unknown #directive "pseudo-directive"
    lang-asm ⡼ɤǤʤХ顼ˤʤȤǤlang-asm ⡼ɤ˸¤äƥ˥󥰤ФǤ

ʲ #pragma ˴ؤ륦˥󥰤 Standard ⡼ɤξǤ˥󥰤ϽФƤ⤽ιԤϸ§ȤƤΤޤ޽Ϥޤ#pragma MCPP, #pragma GCC ǻϤޤԤΤץץǽ٤ΤϽϤޤ #pragma GCC visibility * Τ褦˥ѥ󥫤ΤιԤϡ˥󥰤ʤˤΤޤ޽Ϥޤ

  • No sub-directive
    #pragma Ԥ˲ΰ⤢ޤ󡣤ιԤ̵뤵ޤ
  • Unknown encoding "encoding"
    #pragma __setlocale( "encoding") ǻꤵ줿 "encoding" Ȥ encoding ϼƤޤencoding ̾ˤĤƤ 2.8 򸫤Ƥ
  • Too long encoding name "encoding"
    #pragma __setlocale( "long-long-encoding") ǻꤵ줿 "long-long-encoding" Ȥ encoding ̾ 19 ХȤĶƤΤǡ̵뤷ޤ

  • Bad push_macro syntax
  • Bad pop_macro syntax
    #pragma MCPP push_macro, #pragma MCPP pop_macro, #pragma push_macro, #pragma pop_macro ιʸְäƤޤ #pragma Ǥϰϥޥ̾ ", " ǰϤߡˤ (, ) ǰϤǡ("MACRO") ȤʤФʤޤVisual C ߴΤξĹʻͤǤˡ
  • "MACRO" has not been defined
    #pragma MCPP push_macro, #pragma MCPP pop_macro, #pragma push_macro, #pragma pop_macro ΰǤ ("MACRO") MACRO Ϥ⤽ޥȤƤޤ
  • "MACRO" is already pushed
    #pragma MCPP push_macro( "MACRO") MACRO ϤǤ push 졢ˤθ #undef ƤޤMACRO κʤ push Ǥޤ
  • "MACRO" has not been pushed
    #pragma MCPP pop_macro( "MACRO") MACRO push Ƥޤ󡣤Ǥ pop 줿Τ⤷ޤ

GCC ǤǤϼΥ˥󥰤Фޤ

  • Ignored #ident
  • Ignored #sccs
    #ident, #sccs ιԤ̵뤷ޤ

GCC ѤǤ #pragma GCC poison, dependency Τɤ줫³Ԥ class 2 Υ˥󥰤ФǼΤƤޤ GCC V.3 ǤϥץץåΤǤmcpp Ͻޤ

pre-Standard ⡼ɤǽФޤStandard ⡼ɤǤϥ顼ˡ

  • Not in a #if (#ifdef) section in a source file
  • Line number "0x123" isn't a decimal digits sequence

KR ⡼ɤξȡStandard ⡼ɤ #pragma once, #pragma MCPP push_macro, #pragma MCPP pop_macro, #pragma push_macro, #pragma pop_macro, #pragma __setlocale, #pragma setlocale, #pragma MCPP put_defines, #pragma MCPP debug, #pragma MCPP end_debug ξ硢 GCC ѤǤ STD ⡼ɤ #endif ԤξФޤStandard ⡼ɤΤ¾ξϥ顼OLDPREP Ǥϥ顼⥦˥󥰤Фʤˡ

  • Excessive token sequence "junk"

5.5.4. #if ˴ؤ륦˥

ΣĤ #if, #elif, #assert ΰ˴ؤ륦˥󥰤Ǥ

  • Macro "MACRO" is expanded to "defined"
    #if ǥޥ MACRO ŸȤ defined ˤʤޤ identifier ǤϤʤ黻ҤȤưޤ䤷ʥޥǤStandard C Ǥ undefinedˡ
  • Macro "MACRO" is expanded to "sizeof"
    #if ǥޥ MACRO ŸȤ sizeof ˤʤޤ identifier ǤϤʤ黻ҤȤưޤ䤷ʥޥǤpre-Standard ξǤ
  • Macro "MACRO" is expanded to 0 token
    ޥ MACRO ĤΥȡŸޤ#if Ǥ줬ȯȡƤϲ餫Υ顼ˤʤޤΥ˥󥰤ϥ顼θ餫ˤ뤿ΤΤǤ

#if, #elif, #assert ΰ˴ؤ륦˥󥰤Ǥɾ򥹥åפʬǤϽФޤ-W8 ץǤϽФˡ

  • Undefined escape sequence '\x'
    \x Ȥ escape sequence Ϥޤñʤ \x ȤХȤ sequence Ȥɾޤ\x ˣʸ³ escape sequence Ϥ󤢤ˡUCN Υ­ʤƱͤǤ

#if (#elif, #assert) Ԥα黻ȷ˴ؤ륦˥󥰤ǤϤꥹåפʬ˴ؤƤϽФޤ-W8 ץǤϽФˡ

Standard ⡼ɤǤ #if C90, C++98 Ǥ long long / unsigned long long ɾޤC90, C++98 long / unsigned long ϰϤĶϥ˥󥰤ФޤLL Ȥ suffix ˤĤƤƱͤˡC99 ʳǤϥ˥󥰤ФޤΥ˥󥰤 compiler-independent-build Ǥ class 1 ǡcompiler-specific-build Ǥ class 2 Ǥ
POSTSTD ⡼ɤǤʸ #if ˤϻȤʤΤǡ˥󥰤Фޤʥ顼ˤʤˡ

  • Constant "123456789012" is out of range of (unsigned) long
    ͤ (unsigned) long ɽǤϰϤĶƤޤ
  • Integer character constant 'abcde' is out of range of unsigned long
    ʸ 'abcde' ͤ unsigned long ɽǤϰϤĶƤޤ
  • Wide character constant L'abc' is out of range of unsigned long
    磻ʸ L'abc' ͤ unsigned long ɽǤϰϤĶƤޤ
  • Result of "op" is out of range of (unsigned) long
    黻 op ˤ黻η̤ (unsigned) long ϰϳȤʤޤop ϣ黻 *, /, %, +, - Τɤ줫Ǥɽξϡñ - 黻Ҥ -LONG_MIN ǥСեȤʤޤUnsigned long ϥСե뤳ȤʤΤǥ顼ˤϤʤޤ󤬡Ūʱ黻̤ϰϳȤʤϥ˥󥰤Фޤ
  • LL suffix is used in other than C99 mode "123LL"
    C99 ʳΥ⡼ɤ LL ȤҤȤƤޤ
  • Shift count "40" is larger than bit count of long
    ӥåȥեȱ黻 <<, >> α operand ͤ long ΥӥåĶƤޤ

  • Negative value "-1" is converted to positive "18446744073709551615"
    ʤĤȤκ黻η̡ĤʤѴޤϥ顼ǤϤޤ󤬡֤󥽡β餫δְ㤤Ǥ礦黻 *, /, %, +, -, <, >, <=, >=, ==, !=, &, ^, | ξաӣ黻 ? : 裲裳 operand ˤĤƤϡʤξϡ¾ĤǤʤѴޤ
  • Illegal shift count "-1"
    ӥåȥեȱ黻 <<, >> α operand ͤǤޤ long long ΥӥåĶƤޤ⥽δְ㤤Ǥ礦
  • "op" of negative number isn't portable
    黻 op η̤ϡoperand ΰޤǤ portability ޤop /, %, >> Τɤ줫Ǥ operand ξ >> 黻Ҥϡѥե̿ CPU νϤδ֤Ǥ portability ϤǤʣӥåȤΥեȤǣdzä̤ˤʤˡǤʤ CPU νϤȤδ֤Ǥ portability ޤ

5.5.5. ޥŸ˴ؤ륦˥

Υ˥󥰤ǤϤΥޥɽ졢ΥޥΤ륽ե̾ȹֹɽޤ

  • Macro started at line 123 swallowed directive-like line
    123 ԤϤޤäޥ # ǻϤޤԤȤɤ߹ߤޤ֤󡢥ޥƤӽФδְ㤤Ǥ礦ޥʤС# ǻϤޤԤ directive line ȤƲᤵϤǤåפ #if group ǤϥޥäƤŸʤΤǡιԤ directive line ȤƲᤵޤ
  • Replacement text "sub(" of macro "head" involved subsequent text
    ޥ "head" ִꥹ "sub(" κǥޥƤӽФθΥƥȤޤޤ K&R 1st. Standard C ˻ޤǥ顼ǤϤޤ󤬡⤷տޤˤμΥޥȤäƤΥ˥󥰤Фʤ顢ϥޥޤϥޥƤӽФδְ㤤ǤտޤƻȤäΤǤа۾ʥޥǤ
    Υ˥󥰤 STD ⡼ɤξǤCOMPAT ⡼ɤǤϤΥ˥󥰤 class 8 ǤФޤpre-Standard ⡼ɤǤƱݤϵޤ˥󥰤ϽФޤPOSTSTD ǤϺִꥹȤθΥƥȤϼޤʤΤǡΥ˥󥰤Ϸ褷ƽФޤunterminated macro call Υ顼ˤʤȡޤääŸ̤ˤʤȤˡ
  • Less than necessary N argument(s) in macro call "macro( a)"
    ޥƤӽФΰ­ޤ̾Ϥϥ顼ǤѰޥǰĤ­ʤäϥ˥󥰤ˤȤɤƤޤGCC βѰޥ C99 ΤȤδ֤ΰܿξ㳲򸺤餹Ǥ
  • Removed ',' preceding the absent variable argument
    GCC3 ͤβѰޥθƤӽФDzѰ 0 ĤǤ뤿ᡢִꥹȤDzѰľˤ륳ޤޤStandard ⡼ɤ GCC-specific-build ξǤ
  • Old style predefined macro "linux" is used
    '_' ǻϤޤʤʰȿλޥȤޤ Standard ⡼ɤ GCC-specific-build ξǤ

ΣĤ OLDPREP ⡼ɤǤ¾Υ⡼ɤǤϥ顼ˡ

  • Less than necessary N argument(s) in macro call "macro( a)"
  • More than necessary N argument(s) in macro call "macro( a, b, c)"

5.5.6. ֹ˴ؤ륦˥

Ϲֹ˴ؤ륦˥󥰤Ǥ

  • Line number "32768" is out of range of [1,32767]
    C90, C++ Ǥ #line [1,32767] ϰϤˤʤФʤޤ0 ⥨顼Ǥ__STDC_VERSION__ >= 199901L ޤ __cplusplus >= 199901L ξϤΰͭϰϤ [1,2147483647] ǤäơC90, C++ Ǥ [32768,2147483647] ϰϤϥ顼ǤϤʤ˥󥰤ˤȤɤƤޤ
    Standard ⡼ɤξǤ

C90 Ǥ #line 32767 Ͼ˶ᤤֹꤷ硢λǤϥ顼ˤʤʤΤΡ줳ϰϤ򥪡СޤС硢mcpp Ǥ warning Фǹֹ򤽤Τޤ䤷³ƤޤѥΤˤäƤϤʤ⤷ޤ#line λ꤬ߤ礭ȤǤ

  • Line number 32768 got beyond range
    ιֹ椬 32768 ãޤλǣ warning Фޤ
  • Line number 32769 is out of range
    ޥ __LINE__ ŸȤ32767 Ķޤ

5.5.7. #pragma MCPP warning (#warning)

  • #warning
  • #pragma MCPP warning
    #pragma MCPP warning (#warning) ǥ쥯ƥ֤¹ԤޤιԤɽޤʰΤΤ˥ȡ󥨥顼Unterminated string ˤä #pragma MCPP warning ϼ¹ԤʤˡΥǥ쥯ƥ֤ص warning level 1 ΤȤ˷ǺܤƤޤºݤˤ warning level ˴طʤɬɽޤ
    #pragma MCPP warning Standard ⡼ɤξǡpre-Standard ⡼ɤǤ #warning Ǥ

5.6. Warning (class 2)

ְ㤤ǤϤʤ portability Τ륱ˤĤƤΥ˥󥰤Ǥ

  • Converted [CR+LF] to [LF]
    ԥɤ [CR+LF] [LF] ѴޤΥ˥󥰤 compiler-independent-build Ǥϥ饹ǡcompiler-specific-build Ǥϥ饹Ǥ

#if Standard ⡼ɤǤ C90, C++98 Ǥ long long / unsigned long long ɾޤC90, C++98 long / unsigned long ϰϤĶϥ˥󥰤ФޤLL Ȥ suffix ˤĤƤƱͤˡC99 ʳǤϥ˥󥰤ФޤVisual C, Borland C compiler-specific-build Ǥ I64 Ȥ suffix ȤޤˤĤƤƱͤǤΥ˥󥰤 compiler-independent-build Ǥ class 1 ǡcompiler-specific-build Ǥ class 2 Ǥ

  • Constant "123456789012" is out of range of (unsigned) long
  • Integer character constant 'abcde' is out of range of unsigned long
  • Wide character constant L'abc' is out of range of unsigned long
  • Result of "op" is out of range of (unsigned) long
  • LL suffix is used in other than C99 mode "123LL"
  • I64 suffix is used in other than C99 mode "123i64"
  • Shift count "40" is larger than bit count of long

ΣĤ Standard ⡼ɤξǤ

  • Parsed "//" as comment
    // ޤǤ򥳥ȤȤƲᤷޤC99 C++ ǤϹˡǤC90 Ǥ⥦˥󥰤ФǥȤȤưޤ
  • Variable argument macro is defined
    Ѱޥ C99 λͤǤC90, C++ DzѰޥޤ
  • Empty argument in macro call "MACRO( a, ,"
    ޥƤӽФ˥ΰޤmcpp ǤϤΰϣĤ pp-token sequence ǤȤߤʤ reasonable ʽ򤷤ޤ C99 ǤϹˡǤΤ C90 Ǥ undefined Ǥꡢportability ޤ',' ʤΤϥǤϤʤʤȤߤʤ顼Ȥ롣ĤΰȣĤΥȤϹʸ塢̤ĤʤɤǤäƤ⥨顼ˤϤʤˡ˥񤯤Τϰ̤ˤɤǤϤޤ󡣲ǽʾϡ
    #define EMPTY
    
    Ȥơ EMPTY 򥫥ʬ˽񤯤ΤɤǤ礦
  • Skipped the #pragma line
    GCC V.3 Ǥ #pragma GCC <args> Ȥ pragma ꡢˤϥץץåΤ⤢ޤmcpp #pragma GCC poison dependency ϥݡȤƤޤ
    °ΥץץåϽ뤬 mcpp Ͻʤ#pragma ˤĤƤϡΥ˥󥰤Фޤ
  • Not a valid preprocessing token "+12"
    ## 黻ҤˤäƣĤ pp-token Ϣ뤷Ȥ"+12" Ȥ invalid ʤΤˤʤޤ̾ϥ顼Ǥ-lang-asm (-x assembler-with-cpp, -a) ץǵư줿ϥ顼ˤϤʤޤ

POSTSTD ⡼ɤξǤ

  • Header-name enclosed by <, > is an obsolescent feature <stdio.h>
    <stdio.h> Ȥ header name ѻߤͤǤ"stdio.h" ȤäƤ

ΣĤΥ˥󥰤ΥƥΤΤǤΥƥǤץǤportability ʤΤǡǰΤ˥˥󥰤Фޤ

  • #include_next is not allowed by Standard
  • #warning is not allowed by Standard
    Υǥ쥯ƥ֤ GCC ǤͭǤʳΤΤǤꡢportability ޤ
  • GCC2-spec variadic macro is defined
    GCC2 ͤβѰޥޤ GCC-specific-build ǤϻȤޤΥޥˤ portability ޤ

  • Converted \ to /
    #include directive header name \ ޤޤƤΤǡ / Ѵƽޤ Windows ΣϣӤǤ path-delimiter ǤǤ undefined Ǥ/ Ȥäְۤ㤤ޤ󡣤Υ˥󥰤ϣ󤷤ФޤWindows ư mcpp ΤΤǤʤ\ " ľˤϤ " ʸƥ delimiter ȤϲᤷʤΤǡunterminated string literal Υ顼Ȥʤˡ
  • '$' in identifier "THIS$AND$THAT"
    Identifier '$' ޤޤƤޤΥ˥󥰤ϣ󤷤ФޤDOLLAR_IN_NAME TRUE ˤƥѥ뤵줿 mcpp ǤФޤΥƥǤ '$' identifier ͭʸǤportability Ϥޤ¾ΥƥǤ '$' ϣʸ pp-token ȤʤΤǡTHIS$AND$THAT THIS $ AND $ THAT ΣĤ pp-token ʬ򤵤ޤʤη̡compile phase ǥ顼ˤʤϤǤˡ

5.7. Warning (class 4)

Standard C ǤϤĤ translation limits ˤĤơݾڤ٤ͤꤷƤޤץץåϤͤĶ translation limits äƤۤͤɤȤޤ˰¸륽 portability ¤ޤmcpp ǤϤ translation limits system.H Υޥ뤳ȤǤդǤ褦ˤʤäƤޤStandard ⡼ɤǤϤͤ Standard C κǾͤĶƤϡΤȤѤ륽ФƤϥ˥󥰤ФޤϤɸإå䥽ˤäƤȯ̤ˤʤΤǡclass 1, 2 鳰Ƥޤ

  • Logical source line longer than 509 bytes
    ԤĹ 509 ХȤĶƤޤ
  • Quotation longer than 509 bytes "very_very_long_string"
    ʸƥ롢ʸheader name Ĺ 509 ХȤĶƤޤ
  • More than 8 nesting of #include
    #include ΥͥȤ٥Ķޤ٥ˤʤäΥ˥󥰤Фޤ
  • More than 8 nesting of #if (#ifdef) sections
    #if, #ifdef, #ifndef ΥͥȤ٥Ķޤ٥ˤʤäΥ˥󥰤Фޤ
  • More than 1024 macros defined
    Ƥޥ 1025 Ĥãޤοˤ pre-defined ޥ header-file 줿ޥޤޤƤޤ
  • String literal longer than 509 bytes "very_very_long_string"
    # 黻ҤȤä줿ޥŸˤäơ509 ХȤĶĹʸƥ뤬ޤ

Υ˥󥰤ϥåפ #if group ǤϽФޤ

  • More than 32 nesting of parens in #if expression
    #if ΥåΥͥȤ٥Ķޤ٥ˤʤäФޤ
  • More than 31 parameters
    ޥΥѥ᡼οĶޤ
  • Identifier longer than 31 bytes "very_very_long_name"
    Identifier ĹХȤĶƤޤ

__STDC_VERSION__ >= 199901L ξϤ translation limits ϼ̤ǤIdentifier ĹǤϡUCN multi-byte-character Ϥ줾죱ʸȿޤʥΥХȿǤϤʤ̯ʵǤˡ

ԤĹ 4095 Х
ʸƥ롢ʸheader name Ĺ4095 Х
Identifier Ĺ 63 ʸ
#include Υͥ 15 ٥
#if, #ifdef, #ifndef Υͥ 63 ٥
#if ΥåΥͥ 63 ٥
ޥΥѥ᡼ο 127
Ǥޥο 4095

-+ ץ C++ ΥץץꤷϡΤ褦 translation limits ȤޤޥΥѥ᡼κ mcpp Ǥ 255 ޤǤǤʤΤǡ256 ĤǤϥ顼Ȥʤޤ

ԤĹ 65536 Х
ʸƥ롢ʸheader name Ĺ65536 Х
Identifier Ĺ 1024 ʸ
#include Υͥ 256 ٥
#if, #ifdef, #ifndef Υͥ 256 ٥
#if ΥåΥͥ 256 ٥
ޥΥѥ᡼ο 256
Ǥޥο 65536

Υ˥󥰤ºݤˤϤ뤵Τǡclass 1, 2 鳰Ƥޤ

  • Converted 0x0c to a space
    token separator ȤƤ [FF], [VT], [CR] [CR][LF] ǤϤʤñȤ [CR]ˤΥɤ space Ѵޤ줬 directive Ԥˤ Standard C Ǥ undefined Ǥȡʸƥ롢ʸΥɤѴޤѴƤ褤ΤǤ뤬ʸåȤϽϰ¸ʤΤǡmcpp ǤϤޤݤʤɬפʥåϥѥΤǹԤǤˡ¾ǡtoken separator ȤƤ [TAB] a space Ѵޤϥѥ̤˲αƶͿʤΤǡʥץץåˤȤäƤ⥳ѥΤˤȤäƤ [TAB] space Ʊ̣ʤˡ˥󥰤ϽФޤ[FF] ϼºݤΥ˻ΤǤֲڡפտޤƤΤǤ礦ʤǤ
  • Undefined symbol "name", evaluated to 0
    #if Ԥ identifier "name" ϥޥȤͤƤޤ0 ɾޤϷ褷ƥ顼ǤϤޤ󤬡ץδְ㤤Ǥǽޤ#if defined ΰˤϤΥ˥󥰤ϽФޤ#if name .. ȤȤ #if defined name && (name ..) Ȥ뤫ޤ mcpp ư -D name=0 Ȥץդ뤳ȤǡΥ˥󥰤򤱤뤳ȤǤޤC++ Ǥ true, false Ȥȡ̰ǡ˥󥰤ʤˤ줾 1, 0 ɾޤ
  • Multi-character wide character constant L'ab' isn't portable
    磻ʸͤϡƱʸåȤνϴ֤Ǥ磻ʸ encoding ϰ¸Ǥꡢξ塢Multi-character ɾλϰ¸ʤΤǡȤä #if ϰܿޤSTD ⡼ɤǤФޤPOSTSTD Ǥ #if ʸǧʤΤǥ顼ˤʤޤΤΤƱͤǤ
  • Multi-character or multi-byte character constant '' isn't portable
    Multi-character character constant multi-byte character character constant ͤɾλϽϰ¸ʤΤǡȤä #if ϰܿޤSTD ⡼ɤǽФޤ

ΣĤ Standard ⡼ɤξФޤ

  • Macro with mixing of ## and # operators isn't portable
    ؿͥޥִꥹ ## # Ȥȡ¤ӤޤΣĤα黻Ҥ̤ͥ Standard C Ǥ unspecified ʤΤǡܿޤmcpp Ǥ # ŬѤޤʤؿͥޥǵո # ## Ȥȡ¤Ӥȥ顼ˤʤޤ# 黻ҤΥڥɤϥѥ᡼ǤʤФʤʤǤ
  • Macro with multiple ## operators isn't portable
    ޥִꥹʣ ## 黻Ҥ֤ˣĤΥȡޤϥѥ᡼ϤǤޤ## 黻Ҥɾ Standard C Ǥ unspecified ʤΤǡΥޥϰܿΤʤ礬ޤmcpp Ǥ ## 黻ҤϺ鱦ؽŬѤƤޤ

STD ⡼ɤ -k ޤ -K ץꤷȤΤΤǤ

  • Too long comment, discarded up to here
    ȤüĹΤǡޤǤʬ䰦ޤ ԤޤȤ 256 ԰ʾˤʤȡޤǤΤƤơԤ򣱹ܤȤƥȤޤ ĹʥɥȤ򥽡˴ޤΤϡɤǤϤޤ

5.8. Warning (class 8)

δְ㤤ǤǽϾʤǰΤդ¥̣ǡΥåФޤåΤ -W8 Υץǵư줿Ǥ

åפ #if group preprocessing directive ̾ #if, #ifdef, #ifndef, #elif, #else, #endif бطåޤ󤬡-W8 Ǥ Illegal directive, Unknown directive Υå⤷ޤޤStandard ⡼ɤǤ #if ΥͥȤ٥Ķ⥦˥󥰤Фޤ

  • Illegal #directive "+" (in skipped block)
  • Unknown #directive "pseudo-directive" (in skipped block)
  • Ignored #ident (in skipped block)
  • Ignored #sccs (in skipped block)
  • More than 8 nesting of #if (#ifdef) sections (in skipped block)
  • #include_next is not allowed by Standard (in skipped block)
  • #warning is not allowed by Standard (in skipped block)

#if ˴ؤ륦˥󥰤Ǥ㤨 #if a || b ȤǤϡa Ǥ b ɾϹԤޤ󡣤-W8 ȤƵưȡɾʤʬ˴ؤƤ⤳Υ˥󥰤ФޤξϤ (in non-evaluated sub-expression) Ȥ񤭤դޤ

  • Constant "123456789012345678901" is out of range
  • Constant "123456789012" is out of range of (unsigned) long
  • LL suffix is used in other than C99 mode "123LL"
  • I64 suffix is used in other than C99 mode "123i64"
  • Shift count "40" is larger than bit count of long
  • Integer character constant 'abcdefghi' is out of range
  • Integer character constant 'abcde' is out of range of unsigned long
  • Wide character constant L'abcdef' is out of range
  • Wide character constant L'abc' is out of range of unsigned long
  • 8 bits can't represent escape sequence 'x123'
  • 16 bits can't represent escape sequence L'x12345'
  • Division by zero
  • Undefined symbol "name", evaluated to 0
  • sizeof: Unknown type "type"
  • sizeof: Illegal type combination with "type"
  • Multi-character wide character constant L'ab' isn't portable
  • Multi-character or multi-byte character constant '' isn't portable
  • Undefined escape sequence '\x'
  • UCN cannot specify the value "0000007f"
  • Negative value "-1" is converted to positive "18446744073709551615"
  • Result of "op" is out of range
  • Result of "op" is out of range of (unsigned) long
  • Illegal shift count "-1"
  • "op" of negative number isn't portable

  • sizeof is disallowed in C Standard
    #if sizeof Τ pre-Standard ⡼ɤǤξǤ⤳ Standard C ǤϻȤޤȤ򤷤ޤ
  • "MACRO" wasn't defined
    #undef Ƥʤ̾ꤷƤޤϾʤȤ Standard C Ǥϥ顼ǤϤޤ
  • Macro "macro" needs arguments
    դޥȤƤΤƱ̾ñȤǸƤޤŸΤޤ޻Ĥޤpre-Standard ⡼ɤξФޤStandard ⡼ɤǤϲʤΤǡ˥󥰤ϽФʤˡ
  • Replacement text "sub(" of macro "head" involved subsequent text
    ޥ "head" ִꥹ "sub(" κǥޥƤӽФθΥƥȤޤޤΥ˥󥰤 STD ⡼ɤǤ class 1 ǤCOMPAT ⡼ɤǤ class 8 Ǥ

5.9. Warning (class 16)

Trigraph digraph ϻȤɬפΤʤĶǤϤޤäȤʤΤǤδĶǤ⤷餬ФСդפǤ礦-W16 ץϤ򸡽ФΤǤ¾ǡtrigraph 뤤 digraph ѤƤ륽ǤϤΥ˥󥰤ȯ뤳ȤˤʤäƤ뤵Ǥ礦顢¾Υ˥󥰤Ȥ̤Υ饹ˤƤޤɤˤƤ⡢ trigraph 뤤 digraph ͭʾ֤ǤФޤDigraph Standard ⡼ɤξǡtrigraph STD ⡼ɤǤ

  • 2 trigraph(s) converted
    ʪΣĤ trigraph sequence Ѵޤ trigraph ΤĤǽ񤤤ΤǤ礦
  • 2 digraph(s) converted
    ιΣĤ digraph sequence Ѵޤ digraph ΤĤǽ񤤤ΤǤ礦
    STD ⡼ɤǤ digraph ΤǤʤϤǤϡץץäƤ digraph 򼡤Τ褦̾ token ѴƽϤޤ
    <%  ->  {           <:  ->  [           %:      ->  #
    %>  ->  }           :>  ->  [           %:%:    ->  ##
    
    POSTSTD ⡼ɤǤ translation phase 1 ̾ pp-token ѴƤޤޤΰ㤤ϡdigraph # 黻Ҥˤʸ󲽤оݤˤʤä˸ޤǥեȤǤ digraph sequence Τޤʸ󲽤ޤPOSTSTD Ǥ̾ pp-token Ѵ줿Τʸ󲽤ޤޤʸƥ digraph sequence character sequence ä硢ǥեȤǤϤΤޤޤǤPOSTSTD ǤϤб pp-token character sequence Ѵޤ
    STD ⡼ɤǤϤΥ˥󥰤 digraph ΡѴפоݤȤƤΤǡpreprocessing-directive Ԥ˸ƾäƤޤ digraph ϥȤޤ

5.10. ǥå

ǥåFatal
error
ErrorWarning class
124816
"..." isn't the last parameter5.4.7
"/*" in comment5.5.1
"and" is defined as macro5.5.3
"defined" shouldn't be defined5.4.7
"MACRO" has not been defined5.5.3
"MACRO" has not been pushed5.5.3
"MACRO" is already pushed5.5.3
"MACRO" wasn't defined5.8
"op" of negative number isn't portable5.5.45.8
"__STDC__" shouldn't be redefined5.4.7
"__STDC__" shouldn't be undefined5.4.8
"__VA_ARGS__" without corresponding "..."5.4.7
"__VA_ARGS__" cannot be used in GCC2-spec variadic macro5.4.7
## after ##5.4.7
#error5.4.10
#include_next is not allowed by Standard5.65.8
#warning5.5.7
'$' in identifier "THIS$AND$THAT"5.6
16 bits can't represent escape sequence L'\x12345'5.4.65.8
2 digraph(s) converted5.9
2 trigraph(s) converted5.9
8 bits can't represent escape sequence '\x123'5.4.65.8
_Pragma operator found in directive line5.4.12
Already seen #else at line 1235.4.3
Bad defined syntax5.4.5
Bad pop_macro syntax5.5.3
Bad push_macro syntax5.5.3
Buffer overflow expanding macro "macro" at "something"5.4.9
Buffer overflow scanning token "token"5.3.3
Bug:5.3.1
Can't open include file "file-name"5.4.11
Can't use a character constant 'a'5.4.5
Can't use a string literal "string"5.4.5
Can't use the character 0x245.4.5
Can't use the operator "++"5.4.5
Constant "123456789012" is out of range of (unsigned) long5.5.45.65.8
Constant "1234567890123456789012" is out of range5.4.65.8
Converted 0x0c to a space5.7
Converted [CR+LF] to [LF]5.5.15.6
Converted \ to /5.6
Division by zero5.4.65.8
Duplicate parameter names "a"5.4.7
Empty argument in macro call "MACRO( a, ,"5.6
Empty character constant ''5.4.15.5.1
Empty parameter5.4.7
End of file with no newline, supplemented the newline5.5.2
End of file with unterminated #asm block started at line 1235.4.25.5.2
End of file with unterminated comment, terminated the comment5.5.2
End of file with \, deleted the \5.5.2
End of file within #if (#ifdef) section started at line 1235.4.25.5.2
End of file within macro call started at line 1235.4.25.5.2
Excessive ")"5.4.5
Excessive token sequence "junk"5.4.45.5.3
File read error5.3.2
File write error5.3.2
Header-name enclosed by <, > is an obsolescent feature 5.6
GCC2-spec variadic macro is defined5.6
I64 suffix is used in other than C99 mode "123i64"5.65.8
Identifier longer than 31 bytes "very_very_long_name"5.7
Ignored #ident5.5.35.8
Ignored #sccs5.5.35.8
Illegal #directive "123"5.4.45.5.35.8
Illegal control character 0x1b in quotation5.5.1
Illegal control character 0x1b, skipped the character5.4.1
Illegal digit in octal number "089"5.5.1
Illegal multi-byte character sequence "XY" in quotation5.5.1
Illegal multi-byte character sequence "XY"5.4.1
Illegal parameter "123"5.4.7
Illegal shift count "-1"5.5.45.8
Illegal UCN sequence5.4.1
In #asm block started at line 1235.4.3
Integer character constant 'abcde' is out of range of unsigned long5.5.45.65.8
Integer character constant 'abcdefghi' is out of range5.4.65.8
Less than necessary N argument(s) in macro call "macro( a)"5.4.95.5.5
Line number "0x123" isn't a decimal digits sequence5.4.45.5.6
Line number "2147483648" is out of range of 1,21474836475.4.4
Line number "32768" got beyond range5.5.6
Line number "32768" is out of range of 1,327675.5.6
Line number "32769" is out of range5.5.6
LL suffix is used in other than C99 mode "123LL"5.5.45.65.8
Logical source line longer than 509 bytes5.7
Macro "MACRO" is expanded to "defined"5.5.4
Macro "MACRO" is expanded to "sizeof"5.5.4
Macro "MACRO" is expanded to 0 token5.5.4
Macro "macro" needs arguments5.8
Macro started at line 123 swallowed directive-like line5.5.5
Macro with mixing of ## and # operators isn't portable5.7
Macro with multiple ## operators isn't portable5.7
Misplaced ":", previous operator is "+"5.4.5
Misplaced constant "12"5.4.5
Missing ")"5.4.5
Missing "," or ")" in parameter list "(a,b"5.4.7
More than 1024 macros defined5.7
More than 31 parameters5.7
More than 32 nesting of parens in #if expression5.7
More than 8 nesting of #if (#ifdef) sections5.75.8
More than 8 nesting of #include5.7
More than BLK_NEST nesting of #if (#ifdef) sections5.3.3
More than INCLUDE_NEST nesting of #include5.3.3
More than necessary N argument(s) in macro call "macro( a, b, c)5.4.9
More than NEXP*2-1 constants stacked at "12"5.4.5
More than NEXP*3-1 operators and parens stacked at "+"5.4.5
More than NMACPARS parameters5.4.7
Multi-character or multi-byte character constant '' isn't portable5.75.8
Multi-character wide character constant L'ab' isn't portable5.75.8
Negative value "-1" is converted to positive "18446744073709551615"5.5.45.8
No argument5.4.45.5.3
No header name5.4.4
No identifier5.4.4
No line number5.4.4
No space between macro name "MACRO" and repl-text5.5.3
No sub-directive5.5.3
No token after ##5.4.7
No token before ##5.4.7
Not a file name "name"5.4.4
Not a formal parameter "id"5.4.7
Not a header name "UNDEFINED_MACRO"5.4.4
Not a line number "name"5.4.4
Not a valid preprocessing token "+12"5.4.95.6
Not a valid string literal5.4.9
Not an identifier "123"5.4.45.5.3
Not an integer "1.23"5.4.5
Not in a #if (#ifdef) section5.4.3
Not in a #if (#ifdef) section in a source file5.4.35.5.3
Old style predefined macro "linux" is used5.5.5
Operand of _Pragma() is not a string literal5.4.12
Operator ">" in incorrect context5.4.5
Out of memory (required size is 0x1234 bytes)5.3.2
Parsed "//" as comment5.6
Preprocessing assertion failed5.4.10
Quotation longer than 509 bytes "very_very_long_string"5.7
Recursive macro definition of "macro" to "macro"5.4.9
Removed ',' preceding the absent variable argument5.5.5
Replacement text "sub(" of macro "head" involved subsequent text5.5.55.8
Rescanning macro "macro" more than RESCAN_LIMIT times at "something"5.4.9
Result of "op" is out of range5.4.65.8
Result of "op" is out of range of (unsigned) long5.5.45.65.8
Shift count "40" is larger than bit count of long5.5.45.65.8
sizeof is disallowed in C Standard5.8
sizeof: Illegal type combination with "type"5.4.65.8
sizeof: No type specified5.4.5
sizeof: Syntax error5.4.5
sizeof: Unknown type "type"5.4.65.8
Skipped the #pragma line5.6
String literal longer than 509 bytes "very_very_long_string"5.7
The macro is redefined5.5.4
This is not a preprocessed source5.3.4
This preprocessed file is corrupted5.3.4
Too long comment, discarded up to here5.7
Too long header name "long-file-name"5.3.3
Too long identifier, truncated to "very_long_identifier"5.5.1
Too long line spliced by comments5.3.3
Too long logical line5.3.3
Too long number token "12345678901234"5.3.3
Too long pp-number token "1234toolong"5.3.3
Too long quotation "long-string"5.3.3
Too long source line5.3.3
Too long token5.3.3
Too many magics nested in macro argument5.4.9
Too many nested macros in tracing MACRO5.4.9
UCN cannot specify the value "0000007f"5.4.15.8
Undefined escape sequence '\x'5.5.45.8
Undefined symbol "name", evaluated to 05.75.8
Unknown #directive "pseudo-directive"5.4.45.5.45.8
Unknown argument "name"5.5.3
Unterminated character constant 't understand.5.4.1
Unterminated expression5.4.5
Unterminated header name 5.4.1
Unterminated macro call "macro( a, (b,c)"5.4.9
Unterminated string literal5.4.1
Unterminated string literal, catenated to the next line5.5.1
Variable argument macro is defined5.6
Wide character constant L'abc' is out of range of unsigned long5.5.45.65.8
Wide character constant L'abc' is out of range5.4.65.8


6. Х

ץץ Standard C Ŭ٤򸡾ڤ뤿 Validation Suite mcpp ΥȤȤ˸ƤޤStandard C ΥץץΤ٤Ƥε򸡾ڤǤΤˤĤǤmcpp ϤȤäƥåƤޤ¿νϤǥѥ뤷ƥåƤޤäơХͤϤۤȤɤʤĤǤޤĤĤäƤ붲Ͻʬޤ

⤷ԲIJưȯ줿顢Ҥ𤯤
⤷ "Bug: ..." ȤǥåФ顢ϴְ㤤ʤ mcpp ޤϽϤΡʤ֤ mcpp Ρ˥ХǤޤȤ㤯ʡ֥פǤ⡢򿩤碌뤳Ȥ mcpp ˽ʤ顢ХǤ

ХˤϼΤ褦ʥǡդƤ褦ꤤޤ

  1. mcpp ܿϡ
  2. ХȻפΤƸǤʤ٤ûץ륽
  3. ν̡

ХΤۤˤ⡢mcpp λȤꡢǥåΥɥȤνʤɤˤĤƤո򤪴󤻤
ոȾ

http://mcpp.sourceforge.net/

"Open Discussion Forum" ޤϥ᡼Ǥꤤޤ

mcpp-2.7.2/doc-jp/cpp-test.html0000644000175000017500000122464211113254352013213 00000000000000

CPP-TEST

== Validation Suite for Standard C Conformance of Preprocessing ==

for V.1.5.5 (2008/11)
(kmatsui@t3.rim.or.jp)

== ܼ ==

1. Standard C Validation Suite
1.1.
1.2.
1.3. ΥɥȤɽˡ

2. Standard C ץץħ
2.1. K&R 1st. Standard C Υץץ
2.2. Translation phases
2.2.1. ³ tokenization
2.3. Preprocessing token
2.3.1. Keyword ʤ
2.3.2. Preprocessing-number
2.3.3. Token-base ư token Ϣ
2.4. #if ɾη
2.5. Portable ʥץץå
2.6. ؿͥޥŸˡ
2.6.1. ؿƤӽФƱ
2.6.2. ֤Ÿ
2.6.2.1. #, ## 黻Ҥ operand Ÿʤ
2.6.3. Ȥ
2.6.4. ƱޥκƵŪŸɻ
2.7.
2.7.1. <stdio.h> η header name
2.7.2. Character-base ΤʤĤ # 黻Ҥε
2.7.3. ޥ white spaces ΰ
2.7.4. ؿͥޥΥѥ᡼̾
2.7.5. ɾΤ狼ʤ #if ʸ
2.7.6. ޥδؿͤǤʤ
2.7.7. C90 Corrigendum 1, Amendment 1 Ǥɲ
2.7.8. Ĺʵ
2.8. C99 Υץץ
2.9. ʥץץ

3. Validation Suite
3.1. Validation Suite for Conformance of Preprocessing
3.2. ƥˡ
3.2.1. ưƥ
3.2.2. cpp_test ˤ뼫ưƥ
3.2.3. GCC / testsuite ˤ뼫ưƥ
3.2.3.1. TestSuite Ȥ
3.2.3.2. TestSuite ؤΥ󥹥ȡȥƥ
3.2.3.3. mcpp μưƥ
3.2.3.4. TestSuite ȸڥå
3.3. Violation of syntax rule or constraint ȿǥå
3.4. ܺ
3.4.1. Trigraphs
3.4.2. <backslash><newline> ˤ³
3.4.3.
3.4.4. üʥȡ (digraphs) ʸ (UCN)
3.4.5. Preprocessing directive line space, tab
3.4.6. #include
3.4.7. #line
3.4.8. #error
3.4.9. #pragma, _Pragma() operator
3.4.10. #if, #elif, #else, #endif
3.4.11. #if defined
3.4.12. #if η
3.4.13. #if α黻
3.4.14. #if Υ顼
3.4.15. #ifdef, #ifndef
3.4.16. #else, #endif Υ顼
3.4.17. #if, #elif, #else, #endif бطΥ顼
3.4.18. #define
3.4.19. ޥκ
3.4.20. Keyword Ʊ̾Υޥ
3.4.21. Pp-token ʬΥפޥŸ
3.4.22. Pp-number Υޥ sequence
3.4.23. ## 黻ҤȤäޥ
3.4.24. # 黻ҤȤäޥ
3.4.25. ޥΥޥŸ
3.4.26. ޥƱ̾ޥ
3.4.27. ޥκ
3.4.28. ޥ
3.4.29. #undef
3.4.30. ޥƤӽФ
3.4.31. ޥƤӽФΥ顼
3.4.32. #if ʸ
3.4.33. #if Υ磻ʸ
3.4.35. #if multi-character ʸ
3.4.37. Translation limits
3.5. ʬΥɥ

4. ꤵƤʤ¦̤ɾ
4.1. Multi-byte character encoding
4.2. Undefined behavior
4.3. Unspecified behavior
4.4. ˥󥰤˾ޤ¾Υ
4.5. ¾γƼʼ
4.5.1. ư˴ؤʼ
4.5.2. ץȳĥǽ
4.5.3. ¹ԸΨ
4.5.4. ɥȤʼ
4.6. C++ Υץץ

5. C ץץμ
5.1. ɸإåե
5.1.1. Ū
5.1.2. <assert.h>
5.1.3. <limits.h>
5.1.4. <iso646.h>

6. ƼץץåΥƥȷ
6.1. ƥȤץץå
6.2. ɽ
6.3. ƥץץåħ
6.4. ɾ
6.5. ƥȤո

1. Standard C Validation Suite

Martin Minow DECUS cpp Ū˽ľ mcpp V.2 ȾΤ portable ʣåץץåޤΥץץåϥ󶡤Τǡѥ뤹˥إåեΤĤΥޥؤ뤳ȤdzƼνѤ˰ܿǤ褦ˤʤäƤޤޤ Standard C (ISO/ANSI/JIS C) ȤƼư⡼ɤäƤޤΤ Standard C ⡼ɤϡʸ̤θ̩ Standard C ץץ¸ƤĤǤ

ΥץץåʤϡΥƥȤΤ "Validation Suite for Standard C Conformance of Preprocessing" ʥץץɸŬ򸡾ڤ륽եȥ켰ˤȾΤΤޤC ФǤʤ C++ ⥫СƤޤΥɥȤϤθڥå (Validation Suite) βǤθڥåȤϤΥɥȤȤȤˡBSD 饤󥹤ˤ륪ץ󥽡եȥȤƸޤ


1.1.

θڥåȤ 1998/08 NIFTY SERVE / FC / LIB 2 Ǹ졢http://www.vector.co.jp/pack ˤžܤޤˤ version number ޤǤ version 1.0 ǤäȤˤޤ

V.1.1 ϡC99 1997/08 draft б V.1.0 update ΤǤ1998/09 ˡϤ NIFTY SERVE / FC / LIB 2 vector / software pack Ǹޤ

V.1.2 ˷ꤷ C++ Standard бơV.1.1 ˤ updates äΤǤ1998/11 ˡϤ NIFTY SERVE / FC / LIB 2 vector / software pack Ǹޤ

V.1.3 ˷ꤷ C99 бơV.1.2 updates äΤǤޤưƥȤΥץϡGCC / testsuite ѤǤ褦˽ľ edition ɲäޤ

V.1.3 ϳȯǡmcpp V.2.3 ȤȤˡʵ(IPA) ʿǯ١̤Ƨեȥ¤ȡפ˿ ͵ץȥޥ͡ˤäƺ򤵤졢2002/07 - 2003/02 δ֤ IPA λȿУͤνΤȤ˳ȯʤޤѸǥɥȤ⤳ΥץȤǡͭ²ҡϥ˻䤬ȥƥäƤǤäΤǤ2003/02 ˤ mcpp V.2.3 ȸڥå V.1.3 m17n.org Ǹޤ

mcpp ȸڥåȤʿǯ١̤Ƨեȥ¤ȡפˤ PM ˤäƷ³ƺ򤵤졢줾 V.2.4, V.1.4 ؤ update Ȥʤޤ*1, *2

θ mcpp ȸڥåȤϤ˲ɤκȤ³Ƥޤ2005/03 ˤϤ줾 V.2.5, V.1.5 ꡼ޤڥå V.1.5 Ǥѹʤɤޤ2006/07 ˤϤ줾 V.2.6, V.1.5.1 ޤڥå V.1.5.1 ǤϳƽϤοСΥץץåΥƥȷ̤ɲä줿ʳˤ礭ѹϤޤ󡣤θ塢2006/11 mcpp V.2.6.2 ȸڥå V.1.5.2 2007/04 mcpp V.2.6.3 V.1.5.3 ꡼Ƥޤڥå V.1.5.2, V.1.5.3 ǤϤΥɥȤμ㴳ιäǡ¼ŪѹϤޤ ˡ2007/05 mcpp V.2.6.4 2008/03 mcpp V.2.7 ȸڥå V.1.5.4 ꡼ޤ ڥå V.1.5.4 ǤϾΥƥȥ˽ɲääۤVisual C++ 2008 Υƥȷ̤ɲäޤ 2008/05 ˤ mcpp V.2.7.1 2008/11 ˤ mcpp V.2.7.2 ȸڥå V.1.5.5 ꡼ޤ ڥå V.1.5.5 Ǥ Wave V.2.0 Υƥȷ̤ɲäޤ

:

*1 cpp V.2.2 ޤǤñ cpp ȸƤǤ̤ cpp ʶ路Τǡ V.2.3 mcpp ȸƤ֤ȤˤMatsui CPP ΰ̣Ǥ롣ΥɥȤǤ V.2.2 ޤǤΥС mcpp ȸƤ֡ޤΥɥȤ̾ V.1.2 ޤǤ cpp_test.doc ȤƤV.1.3 cpp-test.txt ѹ V.1.5.2 cpp-test.html Ȥʤä伫Ȥ̾⡢V.1.2 ޤǤ Psycho ȤƤV.1.3 kmatsui ѹ

*2 ̤Ƨեȥ¤ȡ(Exploratory Software Project) γפϼΤȤΤ뤳ȤǤ롣

http://www.ipa.go.jp/jinzai/esp/

mcpp V.2.3 V.2.5 ޤǤϼΤȤ֤Ƥ

http://www.m17n.org/mcpp/

2006/04 ˼ΤȤ˰ܤä

http://mcpp.sourceforge.net/

cpp V.2.2 Ӹڥå V.1.2 ϥ٥ҤΥȤμΤȤˤ롣dos/prog/c Ȥǥ쥯ȥƤ뤬MS-DOS ѤǤϤʤ UNIX, WIN32/MS-DOS, OS-9 бƤ롣

http://www.vector.co.jp/soft/dos/prog/se081188.html
http://www.vector.co.jp/soft/dos/prog/se081189.html
http://www.vector.co.jp/soft/dos/prog/se081186.html

Υ֥եΥƥȥեϡVector ΤΤ DOS/Windows Ϥ˹碌ơԥɤ [CR]+[LF] shift-JIS encode Ƥ롣SourceForge ΤΤ V.2.5 ޤǤ UNIX Ϥ˹碌Ʋԥɤ [LF] EUC-JP Ǥ롣V.2.6 [CR]+[LF] / shift-JIS zip Ǥ[LF] / EUC-JP tar.gz ǤΣΥ֥ե֤褦ˤ


1.2.

øεʤȤƤ ISO/IEC 9899:1990 (JIS X 3010-1993) ĹȤƤޤ1999 ǯˤ ISO/IEC 9899:1999 򤵤ޤǤԤ C90Ԥ C99 ȸƤӤޤԤ ANSI X3.159-1989 ܹԤΤʤΤǡ̤ˤ ANSI C ޤ C89 ȸƤФ뤳Ȥ⤢ޤޤISO/IEC 9899:1990 + Amendment 1995 C95 ȸƤ֤Ȥޤ

βǻȤֵʽפϼΤΤǤ

  C90:
    ANSI X3.159-1989        (ANSI, New York, 1989)
    ISO/IEC 9899:1990(E)    (ISO/IEC, Switzerland, 1990)
        ibid.   Technical Corrigendum 1     (ibid., 1994)
        ibid.   Amendment 1: C Integrity    (ibid., 1995)
        ibid.   Technical Corrigendum 2     (ibid., 1996)
    JIS X 3010-1993 ܵʶJIS ϥɥ֥å 59-1994ס1994
  C99:
    ISO/IEC 9899:1999(E)
        ibid.   Technical Corrigendum 1 (2001)
        ibid.   Technical Corrigendum 2 (2004)
  C++:
    ISO/IEC 14882:1998(E)
    ISO/IEC 14882:2003(E)

ANSI X3.159 ˤ "Rationale"ͳˤ°Ƥޤ ISO C90 ˤϤʤѤޤǤISO C99 Ǥ褷ޤ "Rationale" ޤ˿ƻȤޤ
C++ 1998 ǯǤΤȤ 2003 ǯǤꤵޤʸνǤʤȤץץˤĤƤѹϤޤ󡣤ǡʸǤ 2003 ǯǤޤ C++98 ȸƤӤޤ

C99, C++ εʽ PDF ǥեޥåȤ줿饤ǤΤȤǤޤopen-std.org γƼ draft ̵ˡ

C99, C++98, C++03:

http://webstore.ansi.org/ansidocstore/default.asp

C99+TC1+TC2:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf

C99 Rationale 1999/10 final draft:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n897.pdf


1.3. ΥɥȤɽˡ

ΥɥȤϤĤƤϥƥȥեǤV.1.5.2 html ե Ѥޤ
ΥɥȤǤϼΤ褦˥եȤȤʬƤޤ

  • source:
    եȤϡɤҡޥɥ饤ϡץνϤ򼨤Τ˻Ȥޤ
  • __STDC__:
    եȤϡɸޥ򼨤Τ˻Ȥޤ

2. Standard C ץץħ

Validation Suite β򤹤ˡStandard C (ISO C) ΥץץŪħƤޤ϶ʽŪǤϤʤK&R 1st. Ӥʤ Standard C Υץץιͤ餫ˤ褦ȤΤǤ

λȤƤϡK&R 1st. C90 Ȥ濴Ȥ C90 C99, C++ ȤդäȤȤޤߤϵʤȤƤ C99 ͭʤΤǤ¤νϤˤ C99 ϤޤȾʬƤʤΤǡC90 濴ȤۤºŪȻפ뤫Ǥ

ʤξϤǤϥץۤȤɼƤޤ󤬡Validation Suite ΤΤץʤΤǡ򻲾ȤƤ


2.1. K&R 1st. Standard C Υץץ

Pre-Standard ΣøϤˤ麹̤ޤǤץץˤϤۤȤɴबʤȸäƤ褤餤ξǤʤäϡȤʤ٤ Kernighan & Ritchie "The C Programming Language", 1st. edition Υץץε꤬ޤˤñʤޤʤΤǤäȤˤޤˤطʤˤϡץץϸΤФ֤ޤפΤ褦ʤΤȤͤäȻפޤK&R 1st. ʹߡƽϤˤäƥץץˤ¿εǽդäƤޤƤˤϸΤ䤦ΤΤȡۤʤϴ֤Ǥ portability ݤ褦ȤΤȤޤɤˤƤϴ֤㤬¿portable Ǥˤ󤤤Τ¾Ǥ

C90 ǤĹǯκθǤäΥץץΤʵ꤬Ϳޤɲä줿ǽ⤤ĤꡢˤĤƤϤ褯ΤƤޤäʤȤϡC90 ץץ˴ؤ¾ƤŪʵǤȤȤǤεˤϡޤǤޤǤä֥ץץȤϲפȤŪʤȤˤĤƤιͤ˸ƤޤC90 Υץץ K&R 1st. + ǤϤʤΤǤ򤹤ˤϡֿǽפǤʤܤΤİ뤳ȤɬפȻפޤǰʤȤˤϵʽʸˤϤΤȤޤȤƽҤ٤ƤϤ餺ʽǤ "Rationale" Ǥ⥵ȿƤǤ˻ǰʤȤˤϡΥץץȤŶη̤ȻפӤʤʬĤƤޤǡʲ C90 ץץδŪħޤȤƽҤ١ˤƤ뤳Ȥˤޤ

Pre-Standard ΥץץȰۤʤ롢뤤ϽΤˤ줿 Standard C ץץħϡΣˤޤȤ뤳ȤǤޤ

  1. Τνϰ¸ʬʤ¹ԻĶ execution environ-mentˤΩʸ̤ΥץץǤ롣Ϥˤäƥץץճʷ̤ˤʤ붲ϤƾʤޤˤäơץץåΤΤΥ portable ˽񤯤ȤǽˤʤäƱΣϣӤǤСץץåμ¹ԥץϣĤǤ⤹ȸäɤ餤Ǥ롣

  2. Translation phases εˤäơ token ʬ䤹ޤǤμ礬ΤƤ롣Token ץץޤǤ pre-processing token ȤŪʷǰ롣Preprocessing token ȤΤ token ̤˵ꤷȤ⡢ץץΤνϰ¸ʬڤΥȤΩäƤ롣

  3. ץץ preprocessing token ñ̤Ȥ롢§Ȥ token-oriented ʤΤǤ롣Ф pre-Standard Υץץ token-oriented ʷˤʤ顢Ūаޤ餯 character-oriented ʽ򤹤ʬ򾯤ʤ餺ȾüʤΤǤä

  4. ؿͥޥŸϴؿƤӽФǥˤ뤳ȤǡʸˡƤ롣ؿͥޥθƤӽФϴؿƤӽФλȤȤʤɤǤȤ롣˥ޥƤӽФν⡢ؿΰ˴ؿƤӽФɾȥѥǤꡢΥޥŸƤִꥹΥѥ᡼֤롣λΥޥƤӽФϤΰǴ뤷ƤʤФʤʤ

θ§ʲ˽缡ƤƤޤ


2.2. Translation phases

ץץμ K&R 1st. ǤϤޤäܤƤʤäˡ¿κθȤʤäƤޤC90 Ǥ translation phases ȤΤꤵơ줬Τˤޤ󤹤ȼΤ褦ʤΤǤ*1

  1. եʸɬפʤ饽ʸåȤ map 롣Trigraph ִ򤹤롣*2
  2. <backslash><newline> 롣ˤäʪԤ³Ԥˤ롣
  3. Preprocessing token white spaces Ȥʬ򤹤롣Ȥ one space character ִ롣ԥɤݻ롣
  4. Preprocessing directive ¹ԤޥƤӽФŸ롣#include directive Сꤵ줿եˤĤ phase 1 phase 4 ƵŪ˽롣
  5. ʸåȤ¹ԻʸåȤؤѴ򤹤롣Ʊͤˡʸʸƥ escape sequence Ѵ롣
  6. ܤʸƥϢ뤷ܤ磻ʸƥϢ뤹롣
  7. Preprocessing token token Ѵѥ뤹롣
  8. 󥯤롣

󡢤ϼºݤ̡ phase ˤʤäƤɬפϤʤƱ̤ˤʤ褦˽ɤȤˤʤäƤޤ

Τ phase 1 phase 4 ޤ 6 ޤǤץץϰϤ°ޤץץåΩץˤʤäƤƥץץ̤֥եȤƽϤϡԥ token separator ¸ɬפ뤿ᡢphase 4 ޤǤôΤ̤Ǥphase 5 \n escape sequence ѴƤޤȡ줬 token separator ȤƤβԥȶ̤Ĥʤʤˡ Validation Suite ǥƥȤΤ phase 4 ޤǤǤ

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases
C99 Ǥ phase 4 _Pragma() operator νդä줿 Τۤ㴳λ礬ɲäƤ뤬̣ѲϤʤ

*2 C99 1997/11 draft Ǥϡtrigraphs Ѵˡbasic source character set ˴ޤޤʤ multi-byte character \Uxxxxxxxx Ȥ Unicode Σ sequence ʤ universal character name Ѵ롢ȤˤʤäƤơphase 5 Ǥ¹ԻʸåȤ˺ѴȤΤǤ롣C++ Standard ǤۤƱͤǤ롣ͤޤǤ뤦ˡϤˤȤäƤô礭ȤǤ롣ʤȤ 1999/01 draft phase 1 νϺ졢C99 ǤǤ⤽̤Ȥʤä

2.2.1. ³ tokenization

<backslash><newline> ˤ³ K&R 1st. Ǥϡ

  1. Ĺ #define ԤˤΡ
  2. ĹʸƥˤΡ

ΣĤܤƤǡ¾ξϤɤʤΤ餫ǤϤޤǤ

C90 Ǥϡphase 3 preprocessing token token separator ȤƤ white spaces ؤʬ䤬Ԥˡphase 2 <backslash><newline> κԤ뤳ȤΤˤ졢ɤʹԤǤ⡢ɤ token ǤͭȤʤޤ

ޤtrigraph ν phase 1 ǹԤΤǡ??/<newline> Ȥ sequence Ʊͤ˺ޤ¾ǡʸåȤ ASCII multi-byte character encoding shift-JIS ǤϤǤϡĤ multi-byte character ǤΤǡХܤ 0x5c Υɤ <backslash> ǤϤޤ

Translation phase ΤˤʤäΤɤΤǤϤ token Ǥι³ʤɤȤΤǧɬפΤɤϡǤK&R 1st. Ǥϲ̣ԤˤޤʤĹʸƥ̤ˤޤ褦˽񤯤ˤϤˡʤä櫓ǤC90 Ǥܤʸƥ뤬Ϣ뤵뤳ȤˤʤäΤǡ虜虜 token DzԤɬפϤʤʤäƤޤ³ɬפʤΤĹȥԤ񤯻ǤǤСphase 2 3 ϵդΤۤɤäΤǤ

ˤ⤫餺줬ߤεΤ褦˷ޤäΤϡK&R 1st. ʸƥι³ˤϢȤͤȤƽ񤫤줿Ǥ褦ˤȤbackward compatibilityʸߴˤΤȻפޤˤĤƤϼѾϤۤȤɰ̣ΤʤǤñʡκǤưפʤΤǤΤǡǤ礦


2.3. Preprocessing token

Preprocessing tokenʰʸ塢pp-token άˤȤǰ C90 ǽƳ줿ΤǤˤĤƤ֤ǤޤΤƤʤ褦ʤΤǡƤ󤫤ϤʤФʤޤpp-token ȤƵꤵƤΤϼ̤Ǥ*1

header-name
identifier
preprocessing-number
character-constant
string-literal
operator
punctuator
嵭ΤɤˤƤϤޤʤ non-white-space character

ʤΤ褦ǸᤴƤޤǤ token ȤϤʤäƤޤToken ϼΤ褦ʤΤǤ

keyword
identifier
constant (floating-constant, integer-constant, enumeration-constant, character-constant)
string-literal
operator
punctuator

Pp-token token ȰäƤΤϼǤ

  1. Keyword ¸ߤʤ keyword Ʊ̾ identifier Ȥư롣
  2. Constant Τ character-constant ƱǤ뤬floating-constant, integer-constant, enumeration constant ¸ߤfloating-constant, integer-constant preprocessing-number ȤΤ롣
  3. Header-name pp-token ȤƤ¸ߤʤ
  4. Operator punctuator ϤۤƱǤ뤬operator #, ## punctuator # pp-token ȤƤ¸ߤʤʤ preprocessing directive ԤǤͭˡ

ȡƱʤΤ string-literal character-constant ʤΤǤǤפʤΤ keyword ¸ߤʤȤȡ token pre-processing-number ¸ߤǤΣˤĤơ˸Ƥޤ

:

*1 C90 6.1 Lexical elements 
   C99 6.4 Lexical elements
C99 Ǥ pp-token Ǥ token Ǥ operator punctuator ˵ۼ줿Operator ȤѸ token μȤƤǤϤʤñˡֱ黻ҡפȤǽɽѸȤʤäƱ punctuator token (punctuator pp-token) ʸ̮ˤä punctuator ʶڤҡˤȤƵǽꡢoperator ȤƵǽꤹ뤳Ȥˤʤ롣ޤpp-token α黻ҤȤ _Pragma ɲä줿

2.3.1. Keyword ʤ

Keyword phase 7 ǽǧޤץץ phases Ǥ keyword identifier ȤưޤơץץˤȤäƤ identifier ϥޥ̾Ǥ뤫ޥȤƤʤ identifier Ǥ뤫Τɤ餫Ǥ (*1)ȤȤϡkeyword Ʊ̾ΥޥȤȤȤˤʤޤ

εϡץץϰ¸ʬڤΥԲķΤΤȻפޤˤä㤨 #if ˥㥹Ȥ sizeof ȤȤػߤޤ*2

:

*1 äΤ˸СޥΥѥ᡼̾ identifier Ǥ롣ޤpreprocessing directive ̾ü identifier Ǥꡢkeyword ȻʤäƤ롣줬 directive Ǥ뤫ɤϹʸȽǤΤǤꡢdirective ǤʤˤСޥŸоݤȤʤꤦñʤ identifier Ǥ롣

*2 3.4.14.7, 3.4.14.8 ȡ

2.3.2. Preprocessing-number

Preprocessing-numberʰʸ塢pp-number άˤϼΤ褦˵ꤵƤޤ *1, *2

digit
. digit
pp-number digit
pp-number nondigit
pp-number e sign
pp-number E sign
pp-number .

Non-digit ȤΤ letter underscore Ǥ

󤹤Ȥʤޤ

  1. Ƭ digit ޤ . digit Ǥ롣
  2. Ȥ letter (alphabet), underscore, digit, period e+, e-, E+, E- sequence Ĥɤ¤ǤƤ⤫ޤʤ

Pp-number floating-constant, integer-constant Τ٤Ƥޤߤޤ㤨 3E+xy ȤäͤǤϤʤΤޤǤޤPp-number ϥץץñˤ뤿˺Ѥ줿Τạ̇̄ΩĤμ sequence tokenization ΩĤȤƤޤ*3

Tokenization ñˤʤΤϳΤǤ pp-number ͭ token ǤϤޤ󡣤äơϥץץνޤǤ˾ǤƤʤФʤޤ pp-number ȤΤ虜虜ǻȤɬפϤޤޤ󤬡ƻȤȤͣͤΤϡ## 黻ҤȤä줿ޥǿ pp-number Ȳ pp-token ȤϢ뤵 pp-number Ȥʤꡢ # 黻ҤȤä줿ޥˤäƤ줬ʸ󲽤ǤʸƥƤޤСɤ pp-token valid token ˤʤޤ pp-number ¸ߤǧʤȡϢˤä줿Τ valid pp-token ǤϤʤʤäƤޤޤʤη̤ undefined Ȥʤˡ

Ȥƻ϶ˤüʤΤǤܺ٤˸ƤɬפϤޤ󤬡 pp-number token-oriented ʥץץͤ뤦Ƕ̣󶡤Ƥޤ

:

*1 C90 6.1.8 Preprocessing numbers 
   C99 6.4.8 Preprocessing numbers

*2 C99 ǤưΣɽǽˤ뤿ˡpp-number p sign, pp-number P sign Ȥ sequence ɲäƤ롣

ޤ嵭 nondigit identifier-nondigit ֤줿 identifier UCN (universal character name) Ƚ multi-byte character λѤǧ줿ΤȼѹǤ2.8 ȡˡʤpp-number UCN ȤȤǤmulti-byte character ȤǽǤ롣ͥȡ UCN multi-byte character ޤޤ뤳ȤϤʤΤǤ뤬Ϥ ##, # 黻ҤȤäʸ󲽤ΤȤͤơ줬ǧ줿ΤǤ

*3 C89 Rationale 3.1.8 Preprocessing numbers
   C99 Rationale 6.4.8 Preprocessing numbers

2.3.3. Token-base ư token Ϣ

C90 Ǥϥޥ黻 ## ˤä pp-token Ϣ뤹뤳ȤǤ褦ˤʤޤΤȤ C90 ΡֿǽפȤƤ褯ΤƤޤɲä줿ǽȤϡ΢Ūˡؤ뤿Ƴ줿ΤǤܤΤϡ줬 token-oriented ʥץץΤɬܤΤΤȤʤäƤ뤳ȤǤ

token ϢˡȤƤϡ "Reiser" cpp ǤΡȤ 0 Ĥ character ִȤͤѤΤΤƤޤޤʳˤ character-oriented ư򤹤ץץåǤϡտޤʤˤޤ token Ϣ뤬ȯƤޤȤꡢѤ΢ŪˡʤǤϤޤǤϤ⡢character-oriented ʥץץη٤Ѥˡȸޤ

Ф C90 Ǥϡtoken-oriented ưˤäŪ token Ϣ뤹뤳ȤǤ褦ˤʤäƤޤTranslation phase 3 ǥ pp-token white spaces sequence ʬ򤵤ޤθ pp-token ȤΤϡ## 黻ҤˤϢ # 黻Ҥˤʸ󲽡header-name ܤʸƥϢȥ磻ʸƥϢ뤷ޤ pp-number ¸ߤ⤳ʸ̮֤ƹͤȡΰΤˤʤޤʤC90 tokenization ˤĤƤϡΤ褦ʸ§¸ߤƤȸǤ礦

  1. Pp-token ۤΤϢ뤵뤳ȤϤʤϢ ## 黻ҤˤäʤФʤʤ
  2. äϢ뤵줿 pp-token ƤʬΥ뤳ȤϤʤ

Pre-Standard character-oriented ʥץץǤϡޥƤӽФŸȡη̤ token sequence token ȰտޤʤϢȤޤ token-oriented Standard C ΥץץǤϵäƤϤʤʤȤȹͤޤ*1

:

*1 3.4.21 ȡ


2.4. #if ɾη

C90 Ǥ #if ɾ long ʤ unsigned long ΣΥǹԤ뤳Ȥˤʤޤ (*1)⡢ץץñ㲽ȤȤˡϰ¸ʬ򾯤ʤΤΩäƤޤint ΥϤˤä礭ѤΤ٤ơlong / unsigned long ȾνϤӥåȡνϤӥåȤޤϣӥåȤǤ顢̤ #if ˤϤʤ portability ݤǤޤ*2, *3

:

*1 C90 6.8.1 Conditional inclusion դ -- Semantics ̣§

*2 C99 6.10.1 Conditional inclusion

C99 Ǥ #if ηϤνϤκȤ줿 C99 Ǥ long long / unsigned long long ɬܤǤΤǡ long long / unsigned long long ޤϤʾȤȤˤʤ롣ˤä #if portability Ϥʤ㲼뤳Ȥˤʤä

*3 long ӥåȤνϤƤ뤫⤷ʤɤȤȤ ;̤Ǥ뤬ΥϼΤ褦˷ۤɤȻפäƤ롣

  1. short ϣХȡlong ϣХȤȤ롣
  2. longlonglong long ǤϤʤˤޤ quadra 򣸥ХȤȤ롣
  3. int CPU ˤȤäƤμʥȤ롣ʤ short, long, longlong Τɤ줫ĤȰפ롣
  4. short int, long int Ȥդ short, long int ν˻ȤȤϤ롣

ʤӥåȤνϤνи衢sizeof (short) <= sizeof (int) <= sizeof (long) Ȥ󤬤뤿ˤ٤ƤԼˤʤꡢɤη portability ʤʤäƤƤΤǤ롣ϤơХǷΤɤ


2.5. Portable ʥץץå

ʾΤ褦 Standard C ץץεϡץץåΤΤΥ portable ˽񤯤ȤǽˤƤޤץץåѥΤνϰ¸ʬˤĤΤʤФʤʤȤϡʤǤºݤ Standard C νϤǥץץå portable ˽񤳤ȤȤʤΤϡΤ褦ʼŪʬǤ

  1. #include ΤΣϣӤΥѥꥹȵҷɸإåեΤ꤫
  2. ե̾ȹֹξ򥳥ѥΤϤη
  3. ¹Իץ
  4. ʸåȡ
  5. ϤǤϡC90 Ǥ long / unsigned long ΡC99 ǤϺΥåȽϤΤ򲼲äƤƤϤʤʤȡ

Τȣϴ¸νϤ˼Ȥʤǡ⤤ϥƱ #line 123 "filename" Ȥ줵ƤȴԤޤ̵ƤʻȤϤȤ⤫ŪˤϡStandard C ΥץץϲǽǤ⥽νˤäƤϡ̤ implementation ɬפȤʤǽ񤱤ʤϤޤʤʸåȤϥ˥ơ֥񤯤ۤڤǤ뤬ˡϼºݤˤϡۥȽϤΤۤåȽϤΥȤȤϤۤȤɤʤǤ礦顢ȤϤʤʤǤ礦

mcpp 󡢤 Standard C ץץλͤΤΩƤ뤳ȤưȤƤޤʤmcpp ¿νϤ˰ܿ뤳ȤŪȤƤΤǡportability ݤΤ #if section ʤ¿ʤäƤ뤬ˡ


2.6. ؿͥޥŸˡ

դΥޥŸˡ C90 ǤϴؿƤӽФǥˤƵꤵ졢function-likeʴؿ͡˥ޥȸƤФ褦ˤʤޤ˥ޥޤޤƤϡ§Ȥơϥѥ᡼ȤִäŸޤ

Pre-Standard ǤϤ餫ǤϤޤǤºݤˤϡΥޥŸ˥ѥ᡼ִŸȤˡȤΤ¿äΤǤϤʤȻפޤŸˡطʤˤΤϡХǥͤΥƥִη֤ȤȯۤǤäȿ¬ޤʤޥŸϰ̤˥ǥͤΥƥִη֤Ǥޤʤ櫓ǤդޥŸˤ⹭Τ¿ΥץץåΥޥŸˡäΤǤϤʤǤ礦

ˡϥǤδؿƤӽФͤγѤȤϤޤäۤʤä̯ʥޥλȤͶȯͥȤ줿դޥθƤӽФκݤˤϡɤ줬ɤΰʤΤ狼ʤʤ֤ȯޤᤰäƽϰ¸ʬƤޤǸСäΥޥŸϹ٤ʵǽô褦ˤʤäˡǥͤΥƥִη֤ȤȯۤǤϤϤ٤ŤʤꤹȸǤ礦

2.6.1. ؿƤӽФƱ

Ƨޤ Standard C ϡfunction-like ޥθƤӽФؿƤӽФؤǤΤȤưդ뤳ȤǡʸˡȹͤޤRationale Standard C Υޥ˴ؤ뵬꤬ɤȤ§򤤤Ĥ󤲤Ƥǡ§򼨤Ƥޤ*1

  • ؿȤȤǤϤɤǤޥȤ褦ˤ뤳ȡ
  • ޥƤӽФϤɤˤäƤ⡢ʤϤʸˤäƤ⡢ޥΰˤäƤ⡢ޥˤäƤ⡢Ʊ token sequence 褦˥ޥŸꤹ뤳ȡ

ϴؿƤӽФʤΤȤǤդޥθƤӽФǤǤϤʤäΤǤǥͥƥִη֤ǤϡʤʤȤ餫Ǥ

:

*1 C89 Rationale 3.8.3 Macro replacement
   C99 Rationale 6.10.3 Macro replacement

2.6.2. ֤Ÿ

ؿƤӽФȥѥʥޥŸȤ§¸뤿˴οʤΤϡΥޥŸƤѥ᡼֤뤳ȤǤơΤˤϰΥޥƤӽФϤΰǴ뤷ƤʤФʤޤʴ뤷Ƥʤϥ顼ȤʤˡΥޥθΥƥȤ򿩤äƤޤʤɤȤȤäƤϤʤޤ󡣤ˤäơͥȤ줿ؿͥޥθƤӽФŪݤĤȤǤޤ*1

:

*1 3.4.25 ȡ

2.6.2.1. #, ## 黻Ҥ operand Ÿʤ

# 黻Ҥ operand ϥޥŸʤȤˤʤäƤޤ ޤ## 黻Ҥ operand ޥŸ줺Ϣˤä줿 pp-token Ϻ˥ޥŸоݤȤʤޤεϤʤɬפʤΤǤ礦

ε꤬̣ĤΤϡޥޤǤǤޥޤ token sequence 򤽤Τޤʸ󲽤Ϣ뤷ꤷˡε꤬ΩĤȤˤʤޤդŸƤʸ󲽤Ϣ뤷ꤷϡ#, ## 黻ҤȤʤޥ⤦Ĥ֤뤳ȤˤʤޤΤɤǤץޤǤ褦ˤ뤿ˤϡ#, ## 黻Ҥ operand ϥޥŸʤȤ꤬ɬפʤΤǤ*1

:

*1 3.4.25, misc.t / PART 3, 5 ȡ# 黻Ҥ operand ޥŸʤȤ꤬ΩɽŪ assert() ޥǤ롣5.1.2 ȡ

2.6.3. Ȥ

ơޥŸϥޥƤӽФִꥹȤ֤졢function-like ޥΰ§ȤŸƤִꥹΥѥ᡼֤줿塢ִꥹΥޥƤӽФ򤵤ƺ뤳ȤˤʤäƤޤ

κ K&R 1st. λͤǤơطʤˤϡ֥ǥͤΥƥִη֤פȤȯۤäȻפޤStandard C Ǥ function-like ޥΰ ## 黻Ҥ operand ʳ˴ŸƤޤäƤޤǤϤäŸΤǤ礦

ɬפʤΤϡִꥹΥѥ᡼ʳʬ˥ޥ硢 ## 黻Ҥޤޥξ硢⤦ĤϥޥΡפŤˤʤä cascaded macro ǤޥƤӽФΡְפŤˤͥȤƤϡϺҹ¤ŸƤΤǡ̾ϺǿŸ뤳ȤϤޤʤ㳰Ϥ롣2.7.6, 3.4.27 ȡˡ

2.6.4. ƱޥκƵŪŸɻ

Cascaded macro ϼŸƤޤʤäƤϺ礬ޤϥޥȤƵŪˤʤäƤǤ򤽤ΤޤŸ̵ºƵ˴٤äƤޤޤȤˤΥޥޤޤƤľܺƵξϤ󡢣İʾŪ˺ƵƤƱҤޤ򤱤뤿ᡢStandard C ǤϡŸΥޥƱ̾Υޥִꥹ˸Ƥ⡢ִʤפȤղäƤޤʸϤǤΰտޤϤ狼䤹ΤǤ

ϴؿͥޥξ硢ؿȤϰäʸˡˤʤǤǥִȤޤäƤޤޥͭλͤǤꡢޥǤǤʤʽȤƽȤƤΤʤΤǡλͤβƻĤΤʤȤǤ礦


2.7.

ơʾǤ Standard C Υץץɤ̡ñ̤夲Ƥޤܺ٤˸ƤȡԵ§ʤȤ䡢ϤΥСإåɤγͭܿ˳Ȥ˴ޤޤƤޤ¿ pre-Standard ŪŪʥץץˡ줺˻ĤäƤޤäΤȻפޤΩʤIJŪʬ¸ߤͤ狼ˤäˤƤޤޤStandard C ˤäƿ̵ѤѻˤʤäȤ鷺ʤ餢ޤʲˤФƤߤޤ

2.7.1. <stdio.h> η header-name

<, > ǰϤޤ줿 header-name K&R 1st. Ū˻ȤƤƤΤǤȡȤƤϤ㳰ŪԵ§ʤΤǤΤ Standard C Ǥ header-name Ȥ pp-token ˴ؤƤ undefined ʬ implementation-defined ʬ¿ʤäƤޤäƤޤ㤨 /* Ȥ sequence ޤޤƤ undefined Ǥޤ<stdio.h> Τ褦ˡheader-name Ǥʤ <, stdio, ., h, > ȤĤ pp-token ʬ򤵤Ȥ#include Ԥ˸¤äƣĤ pp-token ˹ʤФʤޤ󡣤ˡ implementation-defined ǤTokenization translation phase 3 ǹԤΤˡphase 4 ǤιԤ #include directive ǤȤ狼ȡtokenization ʤʤФʤʤΤǤϤʤϤŪʻͤȸ虜򤨤ޤPhase 3 Ǥäʬ򤵤줿ʲΡpp-token δ֤ space νȤʤޤ#include <stdio.h> ʤɤȤǥ쥯ƥ֤ϺǤ portability ι⤤ΤΤ褦˸ޤץץμͤȤʤ portability 㤤ΤʤΤǤ#include ԤΰޥǤȡԵ§ޤ

", " ǰϤޤ줿 header-name ˤϡϤޤ󡣤\ escape ʸȤưʤȤȤ <, > ˤ header-name ƱͤǡʸƥȤϰä̤äƤޤescape sequence phase 6 ǽΤʤΤǡphase 4 ǽƤޤ header-name escape sequence ¸ߤʤΤϡŪʤȤǤϤޤʵʤǤ header-name \ undefined Ǥ롣ϼڤˤ뤿θǤºݡ", " Ǥ \ " ľˤΤǤʤ¤ꡢʤ<, > ǤϤ⤦ʣǤ뤬ˡ*1

ޤ#include <stdio.h> #include "stdio.h" Ȥΰ㤤ϡԤϽξõΤФơԤϥȥǥ쥯ȥʤХѥˤõơ̵ <stdio.h> ƱõȤΤȤˤޤStandard C ǤϣϣӤ˴ؤ֤ƤʤΤǡ֥ȥǥ쥯ȥפȤѸϻȤäƤʤ¿ΣϣӤˤĤƤϤᤵˡʤ#include <stdio.h> #include "stdio.h" Ƚ񤱤ФळȤʤΤǤ

Header-name ηˣ濫뤳Ȥϡ桼Υإåȥƥ󶡤إåȤζ̤ܤǤ狼Ȥ readability ޤΤˤϤ虜虜Ե§ʥȡѰդʤƤ⡢"stdio.h" "usr.H" Ȥդ suffix Ƕ̤­ޤǰΤոȡ readability Ǥ뤫顢ƥबե̾ʸȾʸ̤ʤƤ⤫ޤʤ"usr.hdr", "usr.usr", "usr.u" Ǥ⤫ޤʤˡ

<, > ǰϤޤ줿 header-name ϸͤȤƤ̵ѤǤꡢץץ tokenization ݤˤʤΤǡѻߤۤɤȻפޤΥ򥳥ѥ뤹뤿ˤϤʤѻߤ櫓ˤϤ椭ޤ󤬡obsolescent feature ȵꤷƤۤΤǤ

*1 ȤC99 Ǥ \ ǻϤޤ UCN Ƴ줿ˡäˤʤä

2.7.2. Character-base ΤʤĤ # 黻Ҥε

ϡ# 黻Ҥ operand pp-token δ֤ token separator ȤƤ white spaces ΰǤİʾ white spaces ϣĤ space ˰̤Ĥʤ space ʤȤˤʤäƤޤ

ȾüʵǤToken-based ưŰ줹뤿ˤϡtoken separator ̵ͭ˺ʤȤɬפǤꡢΤˤ token separator 򤹤٤ƺ뤫Ȥ⤢ pp-token δ֤ one space ֤ɤ餫˵ꤹ٤ǤC89 Rationale 3.8.3.2 (C99 Rationale 6.10.3.2) The # operator ϤεˤĤơ"As a compromise between token-based and character-based preprocessing discipline"token-based ʥץץˡ character-based ʤȤƤȤơ˷ꤵ줿ȽҤ٤Ƥޤ

ϥץץåμưפˤɤ;פô򤫤̤ˤʤäƤꡢޤʣʥޥŸˡˤޤ⤿餷ƤޤC90 6.8.3, C99 6.10.3 Macro replacement ޥִ -- Examples 4. ˤ㤬ܤäƤޤ

#define str(s)      # s
#define xstr(s)     str(s)
#define INCFILE(n)  vers ## n

#include xstr(INCFILE(2).h)

#include ԤϤŸȤΤǤ

#include "vers2.h"

¿ϤǤޤ INCFILE(2) vers2 ִ뤳ȤˤϤޤϤޤ󡣤xstr() ΰǤ INCFILE(2).h Ÿ̤ vers2, ., h ȤĤ pp-token sequence ǤʽŸϤΣĤ pp-token δ֤ white spaces ʤΤȤưäƤޤˤϼΤ褦꤬ޤ

  1. vers2 ϥˤä pp-token ǤϤʤޥִˤä줿ΤǤ롣vers2 θ white spaces ʤȤݾڤ뤿ˤϡޥִ white spaces ʤ褦ˤʤФʤʤޥִˤǤȡʤȤץץåѥ餫ΩץǤ硢ޥŸη̤Ȥ pp-token ۤΤϢ뤷ƤޤȤȯ롣 token-based ʥץץθ§ȿ롣

  2. # 黻Ҥ operand ˤʤꤦޥִ white spaces pp-token ۤΤϢ뤹ΤɤˤϡؿͥޥƤӽФΰ¸ߤޥִǤϡŪ˲ white space ִ̤򤯤Ǥ줬 # 黻Ҥ operand ˤʤäϲ white space ٤ƤִäƤǸ˻Ĥä white space ʪ space ֤롢Ȥäٹɬפˤʤ (*1)ϥץץμˤȤäƤʤôǤ롣ơ˸礦åȤʤ⡢ɬפǤ뤳Ȥϵʽʸ餫ǤϤʤǤΤΤǤ롣

ޤʤ䤳Ϥ٤ơ# 黻Ҥ operand token separator ΰȾüͳ褷Ƥޤ

# 黻ҤǤϤ٤Ƥ pp-token single space ʬΥʸ󲽤Ȥͤpp-token ΰۤϢɤ䤳ȯ뤳Ȥʤʸ󲽤줿ɤ pp-token sequence Ǥä狼ΤǡɤȻפޤꤹȡΥޥ "vers2 . h" Ÿ뤳Ȥˤʤޤ󡢤ŬڤʥޥǤϤޤ

Ǥ狼褦ˡspace ΤʤȤˤ줬ƤϺۤȤͣξ礬#include ԤΥޥ #, ## 黻ҤȤ줿ǤTranslation phase 4 ǽ #include ԤǤϡphase 6 ǽʸƥϢϻȤޤ󡣤#include ԤΥޥ϶ #, ## 黻ҤȤäƥѥ᡼ʤƤ⡢ñʸƥФǤळȤǤäΤ token-based ʸ§ΤϡޤˤХ󥹤򼺤Ƥޤ

Standard C ΥץץǤ syntax token-based ʤΤǤʤ顢# 黻Ҥ semantics ΤȤ character-based ʵ꤬ơŪʰ»ʤäƤޤ*2

ξ塢ʽΤϵʸɬ餫ǤϤʤͤȤƤޤŬڤǤꡢ٤Ǥ礦

:

*1 mcpp ⤷礦ʤΤǤƤ롣

*2 JIS C ISO C ΤΤǡƤѹϲäƤʤȤˤʤäƤ롣JIS ϥɥ֥åפ X 3010 / 6.8.3 4. ΰˤϡfputs( ..) ȤޥŸ̤ʸȤ space ̵ͭäƤȤߥ롣ΰ space ΰ̵ФǤꡢ# 黻Ҥε褯򤷤ƤͤƤ뤤ϰåȤϻפʤꤽΤΤ̵ѤѻǤ뤳ȤΤǤ롣

2.7.3. ޥ white spaces ΰ

# 黻Ҥ operand white spaces ΰƱͤε꤬ޥ˴ؤƤ⤢ޤݡݥޥκϸΥޥʤΤǤʤФʤʤǤ뤿ˤϡѥ᡼ο̾ƱǡִꥹȤƱ spelling ǤʤФʤʤִꥹ white spaces ˤĤƤϡ̵ͭƱǤʤФʤʤϰäƤƤɤݡݤȵꤵƤޤ

# 黻Ҥε꤬嵭Τ褦ǤСִꥹ white spaces ˤĤƤƱ򤷤ʤФʤʤΤǡεǤϤꡢͳ # 黻Ҥεˤޤ

# 黻Ҥ operand pp-token δ֤ˤϤ٤ one space ΤȤưȤȤˤСޥκ˺ݤƤ white spaces ̵ͭˤʤʤʤޤ

ˡץץåμǤϤ̲ơΤ٤Ƥ pp-token δ֤§Ȥ one space ֤褦ˤ뤳ȤǤޤ뤳ȤˤäơޥŸ˺ݤƤ tokenization ñΤ˹ԤȤǤޤθ§㳰ĤޤĤ preprocessing directive ԤǤβԥɤǤꡢ⤦ĤϥޥǤΥޥ̾Ȥ³ '(' δ֤ white spaces ̵ͭǤФŪˣäΥץץκƤΤǤꡢޤѤ櫓ˤϤޤ

2.7.4. ؿͥޥΥѥ᡼̾

ޥκ˺ݤƤϥѥ᡼̾פƤʤФʤʤȵꤵƤ뤳Ȥ 2.7.3 ǿޤϲʵȻפޤѥ᡼̾ϡޥŸ˲ΰ㤤⤿餷ޤ󡣤˺ݤƤå뤿ˤϡץץåϤ٤ƤΥޥΥѥ᡼̾򵭲ƤɬפޤȤƤ⤽λȤƻϡʤȤ⵬ϰϤǤϡΥåʳ˲⤢ޤ󡣤äΤۤȤɰ̣ΤʤåΤˡϤ˥ХˤʤʤСإåɤ򤫤Τϡޤ

ޥκǤϥѥ᡼̾פƤʤФʤʤȤϡۤɤȻפޤ

2.7.5. ɾΤ狼ʤ #if ʸ

#if ԤΰǤ #if ǤɾϥץץǹԤΤǼ¹ԻĶΩΤǤʤФʤޤ󡣤Τᡢ̤顢¹ԻĶФ䤤碌ɬפȤ륭㥹ȡsizeof 黻ҡƤޤʤ translation phase 7 ǽɾˡʸʤӥ磻ʸˤϽƤޤ

ʸɾϼΤ褦˲ŤˤǤꡢportability ϤۤȤɤޤ

  1. ʸͤʸåȡASCII, EBCDIC ˤˤäưۤʤ롣

  2. ʸåȤƱǤäƤ⡢single-character character con-stant ΰϽǤʥѥΤǤ char ʤĤˤˡ

  3. Multi-character character constant ɾϽǤꡢʸåȤΰƱǤ⡢ͤƱȤϸ¤ʤCHAR_BIT char ʤȤƤ⡢'ab' 'a' * 256 + 'b' ȤʤΤȤ 'a' + 'b' * 256 ȤʤΤϡꤵƤʤ

  4. Multi-byte character encoding ϽǤ롣Wide char-acter encoding multi-byte character encoding ˽wchar_t Υ̵ͭǤ롣

  5. Multi-byte character encoding ƱǤäƤ⡢ͤɾƱȤϸ¤ʤƱ꤬롣

  6. ʾϤ⥳ѥΤǤʸɾˤⶦ̤Ǥ뤬˥ץץǤʸåȤϥѥΤȰäƤƤ褤ȤˤʤäƤ롣
    Translation phase 4 ޤǤоݤȤΤϥʸåȤǤꡢphase 6 ʹߤоݤȤΤϼ¹ԻʸåȤǤ롣phase 5 ʸʸƥʸΥʸåȤ¹ԻʸåȤؤѴԤʤʸåȤ⡢multi-byte character encoding ⡢ȼ¹ԻȤǰޤäƤ뤫⤷ʤ
    #if ʸɾΤ phase 4 Ǥ뤬ϥʸåȤͤǤ¹ԻʸåȤͤ򥷥ߥ졼ȤƤ⡢ɤǤ褤ȤˤʤäƤ롣ʸåȤȤƤʤ

  7. #if ɾʸåȤȼ¹ԻʸåȤƱǤäƤ⡢ɾΤϰäƤƤ褤ȤˤʤäƤ롣ʤΰ⡢multi-character character constant, multi-byte character constant ɾΥХȥ⡢phase 4 phase 7 ȤǰäƤ뤫⤷ʤ

  8. ⡢ʸɾηϡphase 7 Ǥ multi-byte character ޤ character constant intwide character constant wchar_t ǤΤФơphase 4 Ǥ C90 Ǥ long ޤ unsigned long Ǥ롣ʤphase 4 Ǥ int long ƱɽĤΤ褦˰졢unsigned int unsigned long ƱɽĤΤ褦˰롣äơʸåȡΰɾΥХȥ phase 4 7 ȤǤޤäƱǤäƤ⡢INT_MAX < LONG_MAX νϤǤϡphase 4 ǥСեʤʸ phase 7 ǤϥСե뤳Ȥ⤢ꤦ뤷phase 7 int ˤʤΤ phase 4 Ǥ long ˤʤ뤫⤷줺ˤʤ뤫ˤʤ뤫ޤäƤϤʤʸǤʤȡˤʤ뤳ȤϤʤʸˤĤƤϰŪˤϤۤȤͽ¬Ǥʤ

  9. C99 Ǥ #if ηϤνϤκȤ줿ʤɾηϤˤäưۤʤ뤫⤷ʤ

  10. ˥ץץǤʤѥˤⶦ̤Ǥ뤬multi-byte character ˤ encoding ꤬롣Ȥ UTF-8 ϣХȤ unicode ʸ򣱥ХȤʤХȤ encode 뤬ʸΡ͡פȤϤäǤ ͤ UTF-8 ΣХȤ sequence ɾ͡פǤȤ⸵ unicode Ρ͡פǤȤȤˤʤΤǤɤͤŪǤΤȽȤʤ

  11. ⥳ѥȶ̤Ǥ뤬C99, C++98 Ǥ UCN ȤΤޤƳ줿Ʊʸ UCN ɽΤ multi-byte character Ȥƽ񤤤ΤȤƱʸפǤƱʸΤϤǤ뤬Ρ͡פ multi-byte character encoding ˤäƤ줾äƤǤ

Ȥǡ#if ʸͤϽϴ֤Ǥ portability ʤСƱϤΥѥեȤδ֤Ǥ㤦⤷ʤȤ¿ɤɾ뤫ۤȤͽ¬Ǥޤ

̤ˤϣøεˤϤޤʬϾʤ黻˴ؤƤΰǤΤΡ CPU ǷޤΤǤꡢϺԤǤդ˷뤳ȤΤǤʬϤޤʤΤǤʸɾ㳰Ǥ CPU λ͡ʸåȡmulti-byte character encoding Ȥƥ¦װǷޤ¦̤ΤۤˡϺԤκ̤ˤޤƤ̤¿ޤ

줬 #if ʸȤʤȡϤκ̤ϰϤѥեȤΰפݾڤ줺ɾƤ⤤äɾΤۤȤɤ狼ޤʸɾϼ¹ԻĶؤ䤤碌ɬפȤΤȹͤޤStandard C ΥץץǤϤ䤤碌ɬפȤϽ줿ˤ⤫餺ʤʸϽޤǤơ䤤碌򤷤ʤǤ⤹൬̵˺äˡ̣ʤΤȤʤäƤޤäȻפޤ

#if ʸˤɤʻȤƻΤǤ礦 ѥեǤ char ѿͤʸӤ뤳Ȥ褯ԤޤѿȤʤץץեǤϤλȤƻ⤢ޤ#if ʸλȤƻȤƤϡˤŬڤϻפդޤ󡣤̵ѤĹʪǤꡢ㥹Ȥ sizeof Ʊͤˡ#if оݤ٤Ǥ礦Ƥ⡢㥹Ȥ sizeof 줿Τ٤С륽ϤϤ뤫˾ʤϤǤ

2.7.6. ޥδؿͤǤʤ

ޥƤӽФϤäִꥹȤ֤줿塢줬˺ޤStandard C κεǤƱΤϡΥޥƤӽФθΥȡ󤬤ִꥹȤ³Ƥ뤫Τ褦ˡִꥹȤϢ³뤳ȤǤϴؿƤӽФǥȤؿͥޥεθ§ޤäæƤꡢޥŸ狼ˤװȤʤäƤޤϡ³ΥȡоݤȤȤεϺоݤִꥹȤ˸ꤹ٤ȹͤƤޤ

¤ϸ³ΥȡоݤȤΤϡ餯 K&R 1st. ΤĹǯΰۤλͤäȻפޤStandard C ǤϤλͤɬפʤʤäϤʤΤǤIJΤ褦ĤäƤޤäƤΤǤϥޥŸκˤǤΤǡʲ˾ܺ٤˸Ƥ뤳Ȥˤޤ

ޥ rescanʺˤˡʸϤΤ˵ҤΤϡưפʤȤǤϤޤ󡣵ʽʸϤ⡢K&R 2nd. ʸϤ狼䤹ΤǤϤޤ󡣤ȤСK&R 2nd. A.12 ˤϡִꥹȤϷ֤פȤޤʽˤϷ֤ȤϽ񤫤ƤޤRescan ϣԤ褦ˤɤޤƵŪ˹Ԥ褦ˤɤޤƤ櫓ǤϤޤ

ϼȤʤȡΤ뤳ȤǤʤΤǤϤʤȻפޤˡˡʤȡľŪǤ褦ˤϤʤʤǤ礦Τ餤ޥ rescanning ȤΤϥޥŸŪʼˡ̩夷ΤʤΤǤ

ޤΥХƤƤߤޤñˤ뤿ˡ x, y ϥޥǤϤʤȤޤΥޥƤӽФϤɤŸΤǤ礦

#define FUNC1( a, b)    ((a) + (b))
#define FUNC2( a, b)    FUNC1 OP_LPA a OP_CMA b OP_RPA
#define OP_LPA          (
#define OP_RPA          )
#define OP_CMA          ,

FUNC2( x, y)

1:  FUNC2( x, y)
2:  FUNC1 OP_LPA x OP_CMA y OP_RPA
3:  FUNC1 ( x , y )

1: 2: ִ졢2: rescan ˤä 3: 뤳Ȥϡ狼ޤǤϡ3: ϥޥƤӽФǤ礦 ʤƬ⤦ rescan ٤Ǥ礦

Rescan Ƭ鲿٤Ǥ֤ⷫΤʤΤǤ礦ȤоϰϤƵŪˤ˶Ƥ椯ΤʤΤǤ礦 ¤ϡΤɤǤʤΤǤ

Rescan ȤΤμºݤŪˤ§ŪʺƵǡ뤤ϤƱ̤ˤʤ뤢η֤ǹԤƤȻפޤθŵŪ㤬 Kernighan & Plauger "Software Tools"ʡ֥եȥˡסˤ Macro Processing ξϤ˺ܤäƤΤǤϸ M4 ޥץåȯŸƤ椯Τǡ켫ΤϣåץץåǤϤޤ󤬡Ritchie äǽ񤤤ޥץåפΤȽ񤤤Ƥꡢåץץåμˡθ򤦤Τ뤳ȤǤޤ

ΥޥץåǤϡޥƤӽФȤִꥹȤϤ֤ɤľȤˡ rescanning ¸ƤޤִꥹˤޤޥƤӽФäϡ֤줬ϤˤäΤ褦ˡפοʥޥִꥹȤƱ褦֤ɤľޤ֤ϥޥִƥȤ륨쥬Ȥˡ󶡤סϤҹ¤ߤƵ򡢤Ϥμǽ褦ȤΤǤȤ褦ˡˡϥޥץåΥץ¤狼䤹뤿ˡ礤ΩäƤޤ

åץץå¿⤳Ʊ褦ˡŪϡʤΥåִꥹȤѤǡɤľȤˡǥޥ re-scan 򤷤ƤΤȻפޤ

嵭Ǥϡ2: rescan ˡFUNC1 λǤϥޥƤӽФǤʤȤ狼ȡƱˤΥȡ󤬳ꤷʸִϷ֤ˤƵˤ OP_LPA ʹߤоݤȤʤޤOP_LPA ( ִơ줬ޥǤʤȤ狼ȡ x ʹߤоݤȤʤ롢ȤդˤƬ缡ꤷƤ椭3: ǽ̤ȤʤޤϤϤޥƤӽФǤϤޤ

"Software Tools" Ρʤ뤤ϤΡˤˡϳΤ re-scan δʼˡǤ"Software Tools" ϿƤϤޤ󤬡ˤޤȤ⤢ޤϡϤ֤줿ִꥹȤϥϢ³ɤ߹ޤ뤿ˡrescan ִꥹȤۤƸΥޥƤӽФθʬޤǥ󤷤Ƥޤǽ뤳ȤǤͥȤ줿ޥǤϡrescan Ƥ뤦ˤĤδ֤ˤͥȥ٥뤬ƤƤޤȤ⤢ꤨޤĤޥ̾Ÿʤޥ䡢ִꥹȤ̤ΰĤޥθƤӽФȾʬȤ֥ޥλ֤Ҥޤ

#define add( x, y)      ((x) + (y))
#define head            add(

head a, b)

줬Ǥδ̯ʥޥƤӽФ ((a) + (b)) ŸޤȤStandard C ǤϤ줬ǧΤƤޤޤĤޤꡢΥޥ undefined ɤˡŪʤΤʤΤǤ

衢åץץåϤޤ֥ޥŸտޤƤȤϻפޤ󡣤֤󸶽Σåץץåμ嵭Τ褦ʤΤǤäˡޥۤäƤ餷Ÿ̤ȤʤꡢηռŪѤץޤǸ졢줬¾ɸͤȤʤäƤޤĤ Standard C Ǥ⤳ǧ뤳ȤˤʤäΤǤϤʤǤ礦ʤΣåץץåμΤʷ٤̯ de facto standard ͶƳStandard C ˤޤƤΤǤ줬IJIJ椨Ǥ

ơrescan ϺƵ֤Ȥäȡ§ŪʺƵǤꡢ֤ȸäƤ⤢ʤְ㤤ǤϤʤΤǤ롢ȤȤˤʤ뤫ȻפޤƵϺƵǤ̤κƵΤ褦оϰϤ˶Ƥ椯Ȥϸ¤餺षоϰϤ˸˥Ƥ椯Ȥ̯äƵʤΤǤϺƵǤʤƤ֤ⷫǼ¸뤳ȤǤޤƬη֤ǤϤʤ椫η֤ǡ˸ʬǤ椯ΤǤ

äơեΥȤץץǥ쥯ƥ֤٤ƽ줿ΥƥȤͤȡΥ쥺 rescan ǥƥȤκǽ餫Ǹޤ̤ƽƤޤȤǽǤºݡ"Software Tools" ǤϤˡȤäƤꡢߤΣåץץåΥˤ򤷤ƤΤޤʤrescan ȤϥޥŸexpandˤƱǤꡢϤޤƥΤΥޥŸȤƱʤΤǤ

Rescan оݤ˸˥Ƥ椯Ȥϡ¿ޤϤɤŸ٤ΤʥޥȤ C89 Rationale 3.8.3.4. (C99 Rationale 6.10.3.4) ˺ܤäƤΤǤνꤵʤäΤϡ֥ץץΤ quirksʵޤ졢ʡˤޤǤꤷƤⲿˤΩʤפȤƤޤϼŪǤϤषꤹ뤳ȤǤʤäΤǤ

#define f(a)    a*g
#define g(a)    f(a)

f(2)(9)

Ǥϡޤ f(2) 2*g ִޤָ³ȡפ rescan оݤȤʤСޥŸϤǤޤǡf(2)(9) 2*g(9) ȤȡȤʤޤȤָ³ȡפоݤȤ뤿ˡ g(9) ޥƤӽФƤޤf(9) ִޤǡ f(9) Ϥ 9*g ִ٤ȤƱ̾ޥκִػߤεŬѤִʤǤ٤ΤǤf(9) Ȥȡ f(2) κǽִ̤θ g ȡָ³ȡפǤ (9) ΤĤʤäΤ rescan ˤä줿ΤǤΤǡ줬 f(2) θƤӽФΥͥȤˤΤˤΤȽȤʤǤ

ˤĤƤ C90 Corrigendum 1 ԤޤAnnex G.2 Undefined behavior ˼ɲäȤΤǤ

-- A fully expanded macro replacement list contains a function-like macro name as its last preprocessing token (6.8.3).
-- Ÿ줿ޥִꥹȤκǸ礬ؿޥ̾Ǥ (6.8.3)

Ϻؤ򤫤ΤǤޤ

ޤ"fully expanded macro replacement list" Ȥʸ̣ǤϡְаΥޥŸ줿ִꥹȡפȲ᤹뤷ޤ󤬡 f(2)(9) ǤϡƱ̾ޥκִ򱾡ˡf(2) 2*g ִ졢 g function-like ޥ̾ǤȤ狼äȤǤǤ undefined Ȥʤޤʤ f g ΥޥǤϡf θƤӽФɬ undefined ȤʤΤǤ

ΡפŬѤȡISO/IEC 9899:1990 6.8.3 Examples ˤ뼡Τ褦ʥޥ㼨⤽ undefined ȤʤäƤޤޤ

#define f(a)    f(x * (a))
#define x       2
#define g       f
#define w       0,1
#define t(a)    a

t(t(g)(0) + t)(1);      /* f(2 * (0)) + t(1);   */
g(x+(3,4)-w)            /* f(2 * (2+(3,4)-0,1)) */

ʽϤΥޥƤӽФϥȤ˽񤤤褦ŸȤƤޤCorrigendum ŬѤȤϤʤޤ󡣤 f g ΥޥǤϡg Ȥ identifier ФƤɬ undefined Ȥʤޤg ִꥹȤǤ function-like ޥ̾Ǥ f ͣǺǸ pp-token Ǥ顣

t(t(g)(0) + t)(1)

Ϥޤ t θƤӽФΰŸޤ

    t(g)(0) + t

ˤޤ t(g) ȤޥƤӽФΤǡ줬ŸޤΤˤϤޤŸʤФʤޤ

        g

Ƥ줬 f ִȡ undefined ȤʤΤǤ

⤷򤳤Τޤޤˤơִ³Ƥ⡢

    t(f)
    f

Ȥʤꡢt(f) Ÿ̤κǸ pp-token f ǤΤǡƤ undefined Ǥִ³ȡʤޤ

    f(0) + t
        f(x * (0))
        f(2 * (0))
    f(2 * (0)) + t
t(f(2 * (0)) + t)
f(2 * (0)) + t

ǽ t θƤӽФŸޤִꥹȤκǸ夬Ϥ t Ȥ function-like ޥ̾ǤΤǡ undefined Ȥʤޤ

ǤϡϤɤǤ礦

g(x+(3,4)-w)

g f ִ줿ȤǤǤ undefined Ǥ

Examples G.2 Ȥ̷⤹Ȥ˴٤äƤޤäƤޤ

⤷ Examples Τ㤬ä줿ȤƤ⡢ Corrigendum ǤϷ褷ƺϲäޤˡG.2 ϵʸǤϤʤɲäʸ˺ʤΤǤʸǤϡָ³ȡפ rescan оݤȤȤ񤤤ƤʤΤǤˡ⤷ Corrigendum ʸ˼ȤƤ⡢

#define head            add(

add ִꥹȤκǸǤϤʤΤ

#define head            add

undefined ȤΤǤϡޤˤ⥢Х󥹤Ǥ"fully expanded" Ȥʸ̣ǤȤ⤢ޤ*1, *2

줬ָ³ȡפ rescan оݤȤȤˤäƤ⤿餵줿 quirks Ǥ뤳ȤϡޤǤ⤢ޤ󡣤ĤĤޤ碌褦ȤФۤɡ𤷤ƤޤΤǤʽˤƱ̾ޥִػߤε꤬ʸϤǽ񤫤Ƥޤ򤵤ΰ⤳ˤޤ

¾ Standard C function-like ޥθƤӽФ˺ݤƤϡΥޥŸϤΰǹԤȵꤷƤޤΥޥŸθΥƥȤޤǿäƤޤäΤǤ纮Ǥ顢εȸǤ

η̡ƱޥǤˤȤǤʤȤǰä̤ˤʤȤХ󥹤ȯޤ

#define add( x, y)      ((x) + (y))
#define head            add(
#define quirk1( w, x, y)    w x, y)
#define quirk2( x, y)       head x, y)

head a, b);
quirk1( head, a, b);
quirk2( a, b);

quirk1() θƤӽФǤϡ裱Ǥ head add( ִ줿塢 rescan Ǵ뤷ʤޥƤӽФȤ violation of constraintʿХ顼ȤʤϤǤquirk2() head a, b) ϥ顼ˤʤ餺

((a) + (b))

Ÿ뤳Ȥˤʤޤ

Ĥ褦ǤХȤϤ٤ơ̤˥ޥ re- scan ǡָ³ΥȡפޤǤоݤȤʤäƤޤȤȯƤΤǤϡŸ¾ΥƥʬΩƹԤ뤿ˤϡȤִꥹȤϤ֤ˡǤäƤ⡢ɤΥͥȥ٥Ǥ뤫ȤղäɬפޤȤа̤ˤָ³Υȡפ rescan оݤ˼ޤʤ褦ˤ뤳Ȥưפ˼¸ǤϤǤषߤȾüʵǤϡȤǤʤȤǽѤɬפꡢˤ;פô򤫤̤ˤʤäƤޤ

äΥޥŸŪ˥ǥͤʸִκפȤɤƤޤǥͤʸִü˹ⵡǽʣΤ pre-Standard ΥޥŸȸǤ礦

Ф Standard C ǤϡĤޥˤ虜虜 function-like ޥȤ̾ޤդơθƤӽФιʸؿƤӽФ˶դ褦ȤȹͤޤΥޥϴŸƤѥ᡼֤Ȥ⡢ŸϰǹԤȤ⡢θ§˹äΤǤȤ̤˥ޥ rescan ϸ³ΥȡȤ꤬θ§֥亮Ƥޤƥִη֤ȤĤΰʪǤ

³Υȡ rescan оݤƤޤСޥŸϴ˺ƵŪˡʤоϰϤˤˤƵΤӤ˶Ƥ椯褦ˡʾʤȤ⹭뤳ȤϤʤ褦ˡ˵ꤹ뤳ȤǤΤǤơfunction-like ޥϤ̾ˤդ路ޥȤơʤΤˤʤäȤǤ礦ƤϺȤϤäˤȤϻפʤΤǡʤʤäΤñ ANSI C Ѱ񤬡ĤѤIJڤȤǤĤʤäȤͤޤ*3

C99 ǤϤ򥹥åѥڤȤƤ餤äΤǤޤ䤳IJĤäƤޤޤ

:

*1 ԤΤ褦 function-like ޥ̾Ÿ object-like ޥȤΤϡºݤΥץǤܤˤΤǤ롣Τ褦ʤΤǤ롣

#define add( x, y)      ((x) + (y))
#define sub( x, y)      ((x) - (y))
#define OP  add
    OP( x, y);

ԤΤ褦 function-like ޥθƤӽФȾʬŸΤۤŪʤΤǤϤʤʤФʤʤͳϲʤFunction-like ޥΥͥȤϼΤ褦 function-like ޥǤΤɤ

#define OP( x, y)       add( x, y)

*2 Corrigendum ˤФƤͳϡC90 ISO C ѰSC 22 / WG 14ˤ "Record of Responses to Defect Reports" ȤʸǤ狼#017 / Question 19ˡANSI C Rationale 3.8.3.4 f(2)(9) ΥޥŸ˴ؤǾ֤줿ΤǤ롣ľܤϡƱ̾ޥִػߡפεŬϰϤäϤǤ뤬ѰƱ̾ޥ˸¤ʤŪȤƲƤޤäΤǤ롣β᤬ Examples Ȥδ̷֤ȯ뤳Ȥˤϵդʤä褦Ǥ롣

ˡ "fully expanded" Ȥʸ̯Ǥ롣f(2) 2*g ִ졢g ޤǺ줿 fully expanded ʤΤǤ

⤷ʤ顢ʾִϵʤ顢undefined ˤʤʤϤǤ롣⤷ޤ fully expanded Ǥʤʤ顢g ³ (9) ȤȤ˺졢f(9) ִ롣⤷줬 fully expanded Ǥʤ顢2*f(9) κǸ pp-token function-like ޥ̾ǤϤʤ顢βϤƤϤޤʤ

ʤޥŸϤĽΤȤʤäƤȤǡ֥ޥŸäפȸäƤΤǤ롣Ͻ۴ˡǤ롣ơޥŸϤĽΤޤޤ狼ʤʤäƤޤäΤǤ롣

C99 1997/11 draft Ǥ Corrigendum Τιܤ Annex K.2 Undefined behavior ˼ޤƤ1998/08 draft ǤϺơؤä Annex J.1 Unspecified behavior ˼Τ褦ʰ᤬ɲä줿ơɤ줬 C99 ˺Ѥ줿

When a fully expanded macro replacement list contains a function-like macro name as its last preprocessing token and the next preprocessing token from the source file is a (, and the fully expanded replacement of that macro ends with the name of the first macro and the next preprocessing token from the source file is again a (, whether that is considered a nested replacement.

ѰϤ褦䤯 Corrigendum ̷˵Ť褦Ǥ롣ʸκŪϤΤޤޤǤ롣ޤޥŸĽΤ⡢ɤ unspecified Ǥ롣⡢'(' ˤ뤫ɤǶ̤ȤΤǤϡƱޥˤ¾ΥޥִꥹˤȤǷ̤äƤȤȤǤꡢӤʤͤǤ롣

ˤĤƤϡ3.4.26 ⻲ȤΤȡ

ʤC++ Standard ǤϥޥŸ˴ؤ뵬 C90 ƱǤꡢC90 Corrigendum 1 Τ C99 Annex J.1 ɲä줿ʤ

*3 Ƥ⡢ FUNC2( x, y) Ϥ⤷줬¾ΥޥƤӽФΰˤäϡŸ FUNC1 ( x, y) Ȥʤꡢ˸Υޥ rescan ((x) + (y)) Ÿ뤳Ȥˤʤ롣ʤˤȤǤʤȤǺǽŪŸ̤ۤʤ롣Ϥޤ̤μǤꡢԹǤϤʤǤ

2.7.7. C90 Corrigendum 1, 2, Amendment 1 Ǥɲ

ISO/IEC 9899:1990 ˤĤƤϡ1994 Corrigendum 1ˤ1995 Amendment 1ˤФ졢 1996 Corrigendum 2 Фޤ

Corrigendum 1 ΤۤϤʸۤȤɤǤĤץץ˱ƶͿΤޤޤƤޤΣĤ 2.7.6 Υޥκ˴ؤΤǤ

⤦ĤϥޥΥޥ̾ $ ޤޤƤˤĤƤΡüʵǤ

Standard C Ǥ identifier ʸȤ $ ǧƤޤ󤬡ǧϤŪ¸ߤƤޤtest-t/e_18_4.t ˤ 18.9 ϡStandard C Ǥ $ ʸǣĤ pp-token ȲᤵΤǡޥ̾ THIS $ ʹߤ object-like ޥִꥹȤȤʤꡢTHIS$AND$THAT Ȥ̾ function-like ޥȤץΰտޤȤϤޤää̤ˤʤޤ

Corrigendum 1 Ǥϡ˴ؤ㳰Ū꤬ɲäޤʤobject-like ޥִꥹȤ non-basic character ǻϤޤϡޥִ̾ꥹȤȤ white-space ʬΥƤʤФʤʤפȤΤǤ 18.9 ФƤ Standard C ϿǥåФʤФʤʤΤǤˤäơ$ @ ޥ̾˻ȤƤ륽ۤäưտޤʤ̤˥ץץ֤ɤȤ櫓Ǥ쿴εǤ㳰ΤϺäΤǤ$ @ identifier ǧʤϤǤϡޥϤȤץץǥ顼ȤʤʤƤ⡢ѥեɬ顼ˤʤϤʤΤǡ㳰ɬפϤʤȻפޤ*1

ΤۤISO 9899:1990 Ǥ header-name Ȥ pp-token #include directive ˤƤϤʤʤȤ̣ constraint ޤCorrigendum 1 ǡheader-name #include directive Ǥǧʤޤ

Amendment 1 multi-byte character, wide character Ӥʸ饤֥ؿɲä濴ǡȼä <wchar.h>, <wctype.h> ȤɸإåɲäޤޤISO 646 ʸåȤ˴ޤޤʤʸ䤽Ȥä token, pp-token ɽˡȤơtrigraph ¤֤⤦ĤȤ <iso646.h> Ȥɸإå digraph ε꤬ɲäޤ<iso646.h> ϤĤ operator ޥ뤴ñʥإåǡäϤޤ*2

digraph Ǥ trigraph Ȥ褯ƤơӤϤۤȤƱʤΤǤץץǤΰ֤ŤϤޤääƤޤTrigraph character Ǥꡢtranslation phase 1 ̾ character ѴΤФơdigraph token, pp-token ʤΤǤDigraph sequence # 黻Ҥˤäʸ󲽤ϡѴˤΤޤʸ󲽤ʤФʤޤʤ # ΤΤ digraph Ǥ %: Ƚ񤯤ΤǤ뤬ˡΤᡢƤΤˡϤϾʤȤ phase 4 ޤǤϤ pp-token ȤݤäƤɬפޤѴȤСθǤʸƥ digraph ǤϤʤtoken ȤƻĤä digraph sequence Ѵˡ

ϽϤ̵Ѥô򤫤ΤǤTrigraph Ʊͤ character Ȥǧphase 1 ѴƤޤۤˤʤޤ pp-token Ȥݤϲ⤢ޤAmendment ⡢digraph ̾ token Ȥΰ㤤ʸ󲽤ˤȯʤƤޤPhase 1 Ѵ褦ˤ "%:" Ȥäʸƥ񤯤Τ˺Ȥ뤫⤷ޤ󤬡 trigraph ǤƱͤǤꡢ夲ˤϤޤˤüǤɤƤ񤭤 "%" ":" ȤФߤޤDigraph trigraph alternative Ȥ phase 1 Ѵ褦˰֤Ťʤ٤Ǥ礦

:

*1 C99, C++ Standard ǤϤεϾäƤ롣

C99 ǤϤΤˡ6.10.3 Macro replacement / Constraints ˼ΰ̲꤬դä줿

There shall be white-space between the identifier and the replacement list in the definition of an object-like macro.

tokenization 㳰ǤΤǡʤ

*2 C++ Standard Ǥϡ identifier operator ϥޥǤϤʤ token Ǥ롣ʤΤ򤷤ʥץץ٤Ȥϸ餹ȤȯۤˡȤˤϤˤȤäƤϤäʤȤǤ롣

2.7.8. Ĺʵ

C90 5.1.1.2, C99 5.1.1.2 Translation phasesեˤ 3 ˤϡ³ϤʤΤξĹʵ꤬ޤ

A source file shall not end in a partial preprocessing token or comment.

Translation phase 2 ǡե <newline> ̵Ǥޤ <backslash> <newline> ǽäƤϤʤʤȤΤǡphase 2 ̤äեɬ <backslash> Τʤ <newline> ǽޤPartial preprocessing token ǽ뤳ȤϷ褷ƤޤPartial preprocessing token षΤȤƤϡ " ' <, > бΤȤƤʤΤޤ C90 6.1 Lexical Elementsʻǡ/ Semanticsʰ̣§ˤ undefined ȤƤΤǤꡢޤ˸¤äǤϤޤ"partial preprocessing token or" פʸǤ

C90 6.8.1, C99 6.10.1 Conditional inclusionʾդߡ/ Constraintsˤˤϸ򾷤ɽޤ

it shall not contain a cast; identifiers (including those lexically identical to keywords) are interpreted as described below;

"it shall not contain a cast; " ϼ­Ǥ³ʬ Semanticsʰ̣§ˤǡkeyword Ʊ identifier ޤह٤Ƥ identifier ϥޥǤŸ졢Ĥä identifier 0 ɾ뤳Ȥ餫ˤƤޤCast 򤽤󤷤̤˼夲ɬפϤޤ(type) ȤʸǤ type ñʤ identifier Ȥư뤳Ȥ餫Ǥ

դˡ줬 constraint ˤȡϤ cast ιʸǧơФǥåФʤФʤʤȤ⡢ᤵޤϵʽΰտޤǤϤʤǤ礦Translation phase 4 Ǥ keyword ¸ߤʤΤǡcast ǧΤ褦ʤΤǤsizeof ⤳ǤƱǤ sizeof ˸ڤcast 夲ƤΤ̯ʤȤǤʸּ­פȸޤ


2.8. C99 Υץץ

C99 Ǥϡץץ˴ؤƤϼλͤɲäƤޤ

  1. ̻ҡʸƥ롢ʸpp-number \uxxxx, \Uxxxxxxxx η 16 sequence UCN (universal-character-name) ȸUnicode ʸ̣ͤ롣 basic source character set ˴ޤޤʤ extended character ꤹΤǤʤФʤʤ# 黻Ҥˤä UCN ʸ󲽤줿 \ Ťͤ뤫ɤ implementation-defined Ȥ롣

  2. ̻ implementation-defined ʸȤȤǤ롣äơΤ褦 multi-byte-characters ̻˻Ȥ imple-mentation ǽȤʤä

  3. // ޤǤ򥳥ȤȤư

  4. Pp-number e+, E+, e-, E- Ʊͤ p+, P+, p-, P- Ȥ sequence ǧ롣 0x1.FFFFFEp+128 ȤդˡưΥӥåȥѥ򣱣ʤɽ뤿ΤΤǤ롣

  5. #if ηϤνϤκȤ롣long long / unsigned long long ɬܤǤΤǡ#if η long long ޤϤʾΥȤʤ롣

  6. ѸĤΥޥȤ롣

  7. ޥƤӽФΥͭʰȤ롣

  8. ޥ __STDC_HOSTED__ ɲä롣 hosted implementation Ǥ 1 ˡǤʤ 0 롣ޥ __STDC_VERSION__ 199901L 롣

  9. ޥ __STDC_ISO_10646__, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__ 򥪥ץȤɲä롣

  10. _Pragma operator ߤ롣

  11. #pragma STDC ǻϤޤǥ쥯ƥ̾򵬳ʤȽѤͽ󤷡ư黻ɽĤ #pragma STDC ǥ쥯ƥ֤ɲä롣#pragma STDC ǻϤޤǥ쥯ƥ֤ϥޥŸоݤȤʤǤʤ #pragma ԤϥޥŸоݤȤ뤫ɤ implementation-defined Ǥ롣

  12. Wide-character-string-literal character-string-literal ȤܤƤΤ C90 Ǥ undefined Ǥä Wide-character-string-literal ȤϢ뤹롣

  13. #line ΰȤƻȤֹϰϤ [1,2147483647] ˳礹롣

  14. Translation limits 򼡤Τ褦˰夲롣
    ԤĹ 4095 Х
    ʸƥ롢ʸheader name Ĺ4095 Х
    identifier Ĺ 63 ʸ
    #include Υͥ 15 ٥
    #if, #ifdef, #ifndef Υͥ 63 ٥
    ΥåΥͥ 63 ٥
    ޥΥѥ᡼ο 127
    Ǥޥο 4095
  15. Header name ϣʸ + . + ʸޤǤݾڤƤʸ + . + ʸޤǤѹ롣

ѰޥȤΤϡΤ褦ʤΤǤ

#define debug(...)  fprintf(stderr, __VA_ARGS__)

Ȥޥȡ

debug( "X = %d\n", x);

ȤޥƤӽФϼΤ褦Ÿޤ

fprintf(stderr, "X = %d\n", x);

ʤѥ᡼ꥹ ... İʾΥѥ᡼ִ̣ꥹ __VA_ARGS__ бޤơޥƤӽФˤ ... бʣäƤ⡢ , ޤϢ뤷ΤĤΰΤ褦˰ޤ

C90 undefined behavior ȤƤΤˤϡʬ̣ΤβǽʤΤޤޥƤӽФΥʤɤǡ 0 Ĥ pp-token Ȳ᤹뤳ȤͭѤʾ礬ޤC99 Ǥϡ줬ͭʰȤޤ

_Pragma( "foo bar") Ƚ񤯤 #pragma foo bar Ѵ _Pragma Ȥĥ黻Ҥ C99 Ǽ夲Ƥޤ#pragma Ԥΰ C90 ǤϥޥŸ줺ޥŸη̤Ȥ #pragma ǥ쥯ƥιԤϥǥ쥯ƥ֤Ȥư줺ޥִꥹ #pragma 񤯤ȤǤʤΤФơ_Pragma ϥޥִꥹ˽񤯤ȤǤη̤Ȥ #pragma ϥǥ쥯ƥ֤ȤưȤĥܤȤǡˤ #pragma portability 夵褦ȤΤǤ

§Ūʳĥ򤷤ʤƤ⡢#pragma ԤΰϥޥŸоݤȤȤѹäۤǤꡢ portability ΰտޤϤʤãǤϤǤξϥޥ #pragma 񤯤ȤǤʤȤ󤬻ĤꡢޥŸƤϤʤ #pragma ΰϥ桼֤̾ڤΥ __ ǻϤޤ̾ѹʤФʤʤȤ꤬ФƤޤ_Pragma() operator §ŪǤϤΤΡݤȤۤɤǤʤʻͤȻפޤ

Unicode Ƴˤ꤬ꤹޤޤϤ multi-byte character Unicode ȤѴΤ˵ɽѰդʤФʤ餺礭 overhead ޤ16 ӥåȰʲΥƥǤϻ¾塢ԲǽǤUnicode 򰷤äƤʤƥ¸ߤޤޤUnicode multi-byte character ȤǤϰа mapping Ǥʤ礬¿ޤץιݲȤ̾ܤ Unicode øɸϰ̤֤ΤϡȻפޤ

C99 Ǥ 1997/11 draft C++ Standard ٤ UCN ΰ˸षץץåôŪʤޤΤᡢmcpp Ǥμǽˤʤޤ*1

ѥΤôϰ礭ΤޤޤΤʤɽǤΤǡtrigraph ƱͤˡޤȤʤǽ뤳Ȥͽۤޤ*2

:

*1 1997/11 draft Ǥ C++ Standard ȤۤƱͤˡtranslation phase 1 basic source character set ˴ޤޤʤ extended character Ϥ٤ UCN Ѵphase 5 execution character set ʸ˺Ѵ뤳ȤˤʤäƤ

⤷ϡץץȸˤѴ򤹤ġƤӽФȤȤˤʤȻפ롣Ѵ OS ˰¸ΤʤΤǡ̤ΥġˤۤŪǤ롣

*2 C99 Rationale 5.2.1 Character sets ˤȡλͤϽ°Υġ multi-byte character ΥȤδ֤ߤѴƻȤȤꤷΤȤƤ롣Multi-byte character ʸƥʬڤΥ̥եˤޤȤƤƽȤȤǤɤޤǼѤˤʤΤǤ


2.9. ʥץץ

ʾ˽Ҥ٤Ƥ Standard C ץץȻ䤬ͤΤϡΤޤ޾ Standard C ؤ˾Ǥ⤢ޤޤȤȡΤ褦ʤȤˤʤޤ

  1. <stdio.h> η header-name obsolescent featureѻͽ굡ǽˤȤ롣Ǥ header-name ʸƥΤΤˤ롣
  2. Token-based ʥץץθ§Ӥ# 黻Ҥϰ token separator ̵ͭ˺ʤ褦ˡtoken separator ʤƤ pp-token ֤ˤϤ٤ single space ʸ󲽤뤳Ȥˤ롣
  3. Ʊͤˡޥκ˺ݤƤϡִꥹ token separator ̵ͭΰ㤤ˤʤȤˤ롣
  4. ޥκ˺ݤƥѥ᡼̾ΰ㤤å뤳ȤϡϤΥСإåɤ䤹ǤۤȤͭʤΤǡΰ㤤ˤʤȤˤ롣
  5. ʸɾϼ¹ԻĶؤ䤤碌ɬפȤΤǤꡢ#if ǤͭۤȤɤʤΤǡ #if оݤ롣
  6. ؿͥޥδؿͤΰŰ줷ޥƤӽФˤäƤִꥹˤäƤ⸶§ȤƱ pp-token sequence 褦ˡޥ rescanning ִꥹȤоݤȤޥƤӽФ³ pp-token sequence оݤȤʤȤˤ롣
  7. Digraph token ǤϤʤtrigraph Ʊͤ character spelling Ȥtranslation phase 1 Ѵ뤳Ȥˤ롣
  8. Translation phase 3 εΤ"partial preprocessing token or" Ϻ롣
  9. #if ˴ؤ "it shall not contain a cast; " Ȥܤ con-straint C99 footnote 140 ˵ۼ롣
  10. Trigraphs ϥ衼åΦǤϼºݤ˻ȤƤΤǤ ⤷ʤȤƤΤǤлĤʤǤʤѻߤ

Ϥ⡢Ե§ʵ§ץץñˤ褦ȤΤǤˤäƥץץ狼䤹ʤ뤳Ȥϴְ㤤ʤǤ礦դ˺뤳ȤϤۤȤɤʤϤǤ

mcpp ǤϡStandard ⡼ɤǤ Standard C εʤȤޤ Standard C Υץץ˼ƤĤǤpost-Standard Ȥ⡼ɤǤϰʾѹäץץ¸ƤޤʤΤۤUCN, identifier multi-byte characters λѤƤˡ

C90 Amendment 1, Corrigendum 1 ǤϡץץˤĤƤԵ§ʵ§Ե§䤹ưƤޤޤ

C99 Ǥ⡢ǽɲä줿Фǡ嵭Τ褦κ𤬤ɤʤäΤϻǰǤ*1

C99 ɲä줿ͤˤĤƤϡ׵ᤷȻפޤ

  1. Unicode (UCN) ƳϥץˤȤɤ롣

ʤ嵭Τۤˡ#if ŬѤα黻§ˤĤƤ⤦꤬ޤ

  1. α黻̤ϤηɽǤϰϤˤʤФʤʤȤ constraint 뤬Ϥ٤ƤŬѤΤʤΤɤǤ롣㳰ϵܤƤʤȤߤȡʸξǤϤ٤ƤŬѤȲ᤹뤷ʤStandard C ΰտޤϡɬפʤȤǤϡפȤȤǤΤˤ٤Ǥ롣ޤ¾ǡʤϷ褷 overflow ʤפȤ⤢ꡢʤ黻ϰϤĶ˿ǥåФ٤ɤϡȤˤޤǤϥѥɾǤΤǤΤǡǥåФΤŬȻפˡ

ϥץץͭǤϤʤΤǡʾޤ

ޤC90 Ǥ /, % 黻Ҥˤγ껻ˤĤơʬ졦ʬҤޤξη̤ implementation-defined ȤҤɤ꤬ޤC99 Ǥ div(), ldiv() ƱͤεȤʤޤ

:

*1 C99 ؤγƼ defect report 䤽Ф response corrigendum draft ϼ ftp site ˤ롣 ISO/SC22/WG14 official ftp server ȤʤäƤꡢʤȤ⺣ΤȤ anonymous ftp ǤSC ȤΤ steering committee άǡWG working group Ǥ롣SC22 ȤΤϥץεʤ򿳵ĤȤǡWG14 C εʤôƤˡ

http://www.open-std.org/jtc1/sc22/wg14/


3. Validation Suite

3.1. Validation Suite for Conformance of Preprocessing

test-t, test-c, test-l, tool, cpp-test Ȥǥ쥯ȥäƤΡӤ cpp-test.html ΤΤκä "Validation Suite for Standard C Conformance of Preprocessing" ʡ֥ץץɸŬѥȥ켰סˤǤǤդνϤΥץץ Standard C (ISO C) ٤ܺ٤˥ƥȤΤǤStandard C/C++ ǵꤵƤ뤹٤ƤΥץץͤ夷ƤĤǤˡ곰λ˴ؤ뤪ޤ⤿󤢤ޤ

Standard C ׷ȤƤϡϤư뤳ȤϤǤǤʤɥȤɬפʻबΤ˵ܤƤ뤳ȤɬפǤˤĤƤ 3.5 ޤ

3.1.1. test-t ǥ쥯ȥΥƥѥץ

test-t Ȥǥ쥯ȥˤ 183 ܤΥץƥȤäƤޤΤ 30 ܤϥإåե롢145 ܤϺڤΥץƥȤǡ8 ܤϺڤΥץƥȤޤȤ᤿եǤإåեʳϰ *.cc Ȥ̾ǤȤϤ٤ *.t Ȥ̾ĤƤޤϥѥեȤϴطʤץץեƥȤΤǤäơɬäץηˤϤʤäƤޤ󡣥ץץƥѤΥץƥȤȸ٤ΤǤ

Standard C νϤϥץץȥѥȤ򰵽̤ƽ뤳ȤǤΤǡϤˤäƤϥץץڤΥƥƥȤ뤳ȤǤޤ󡣤 *.t Υץ뤽ΤΤ Standard C ˽äƤʤȤޤץץڤΥƥƥȤǤϤ¿ꡢǤʤڤΥƥƥȤۤͤΤˤʤޤ *.t ΥץϤΤΤΤǤ

C++ ΥץϡϤˤäƤ *.c, *.t Ȥ̾Ǥ C++ ΥȤưʤΤ⤢Τǡ*.cc Ȥ̾ΤΤѰդƤޤƤб *.t ƱǤ

ץƥȤΥեˤ̾ n_ ǻϤޤΡnormal ΰաˡi_ ǻϤޤΡimplementation-dependent ΰաˡm_ ǻϤޤΡmultibyte character ΰաˡe_ ǻϤޤΡerroneous ΰաˤޤ

n_ ǻϤޤΤϡץץ˴ؤƤϴְ㤤 undefined ưΤ implementation-defined ʬޤޤʤץǤStandard C Υץץåϡ򥨥顼ˤǤʤФʤޤ

i_ ǻϤޤΤϡʸåȤ˴ؤ implementation-defined ʻͤ˰¸륵ץǡASCII ʸåȤȤƤޤASCII ʸåȤ Standard C νϤΥץץåϡ򥨥顼ˤǤʤФʤޤ

e_ ǻϤޤΤϡ餫 violation of syntax rule or constraintʤ顼ޤॵץǤStandard C ΥץץåϡƨȤʤǤǤʤФʤޤ

n_, i_, m_, e_ θ˿³Τ C90 Υץץ, C90 C99 ζ̤ΥץץͤƥȤ륵ץǤإåեΤpragmas.h, ifdef15.h, ifdef31.h, ifdef63.h, long4095.h nest9.h nest15.h ޤǤ C99 ΥץץͤƥȤ륵ץǡ¾Υإåե C90 C99 ζ̤ΤΤǤ

n_, i_, e_, u_ std, post ʳΥե٥åȤ³Τ C99 C++ ΥץǤn_dslcom.t, n_ucn1.t, e_ucn.t, u_concat.t C99 C++98 ζ̤Ρn_bool.t, n_cnvucn.t, n_cplus.t, e_operat.t, u_cplus.t C++ Ρ¾ C99 ΥץץͤƥȤ륵ץǤ

?_std.t Ȥ̾Υե C90 κڤեޤȤ᤿ΤǤ?_std99.t Ϥ C99 ǤǤ?_post.t, ?_post99.t Ȥ̾Υեϥޥǡmcpp post-Standard ⡼ɤΥƥȤΤΤΤǤ

u_*.t Ȥ̾Υեϥޥǡundefined behavior ΥƥȤ򤹤ڤΥեǤundefs.t ϤܤˤޤȤ᤿ΤǤunbal?.h ϤǻȤإåեǤunspcs.t unspecified behavior ΥƥȤ򤹤Τǡwarns.t ϰʾΤɤˤƤϤޤʤϤ˥󥰤ФΤ˾ޤƥȤ򵭺ܤեǤunspcs.t, warns.t ⥪ޥǤm_ ǻϤޤΤϡmulti-byte character, wide character Ȥƿ encoding ĤΤѰդƤޤǤС¿ encoding 뤳Ȥ˾ޤޤm_* ϵʽΥƥȤǤϤʤu_* Ʊͤʼɾܤ°Ƥޤ

misc.t, recurs.t, trad.t ϥޥΥޥǤΣĤϥץץåɾоݤȤϤޤmisc.t ϵʽ䤽¾νҤ˺ܤäƤΡɽˤäƷ̤ۤʤƥȡtranslation phase 5, 6 ˴ؤƥȡĥǽΥƥȡ򽸤᤿ΤǤrecurs.t üʺƵŪޥΥץǡtrad.t ϸŤ "Reiser model cpp" ΤΥץǤ

3.1.2. test-c ǥ쥯ȥΥƥѥץ

test-c Ȥǥ쥯ȥˤ 133 ܤΥե뤬äƤꡢΤ 26 ܤϥإåե24 ܤ test-t ΤΤƱˡ102 ܤϺڤΥץ륽ǡ3 ܤϺڤΥץ륽ޤȤ᤿ե롢¾ 2 ܤϼưƥȤ˻ȤեǤΤ 32 ܤϥޥΥץ륽ǤإåեʳΥϤ٤ *.c Ȥ̾ĤƤޤϣäΥץηˤʤäƤޤ

Ϥꡢn_, i_, m_, e_ ǻϤޤ̾ĤƤޤn_ ǻϤޤΤϡStandard C Ǹ strictly conforming program ʴְ㤤ϰ¸ʬʤץˤǤϤϤ򥨥顼ˤѥ뤷¹ԤǤʤФʤޤ¹ԤǤϤ줾

started
success

ȤåФޤn_std.c ˸¤äƤϡΥåϽФ

<End of "n_std.c">

ȤäλΥåФޤǤʤϲ餫μԤΥåФޤi_ ǻϤޤΤ ASCII ȤʸΥץǡASCII ʸåȤĽϤϡ n_ ǻϤޤΤƱͤѥ뤷¹ԤǤʤФʤޤe_ ǻϤޤΤˤĤƤϡϤϥѥʥץץ˻ǤǤʤФʤޤ

ѥ뤢뤤ϼ¹ԤˤƥȤϺǤΥƥˡǤˡǤϽϤ˴ְ㤤뤳ȤϤ狼äƤ⡢ɤ˴ְ㤤ΤΤˤʤʤ礬ޤ *.c եץץåˤ̤ơη̤ܤǸƥƥȤ뤳ȤǤΤǡϤ¤ꤽۤΤɾǤޤ*.t եΤۤüŪǤˡ
?_std.c Ȥ̾ΥեϺڤեޤȤ᤿ΤǤ
u_*.c Ȥ̾Υեϥޥǡundefined behavior ΥƥȤ򤹤ڤΥեǤundefs.c ϤܤˤޤȤ᤿ΤǤunspcs.c unspecified behavior ΥƥȤ򤹤Τǡwarns.c ϰʾΤɤˤƤϤޤʤϤ˥󥰤ФΤ˾ޤƥȤ򵭺ܤեǤunspcs.c, warns.c ⥪ޥǤm_ ǻϤޤ륵ץˤϿ multi-byte character encoding бΤޤ
test-c ǥ쥯ȥˤ C99 ΥƥȤϴޤޤƤޤ󡣤ޤC99 ˽ʬбƤ륳ѥΤʤǤC++ ΥƥȤ test-t ǥ쥯ȥˤޤ

3.1.3. test-l ǥ쥯ȥΥƥѥץ

test-l ǥ쥯ȥäƤΤϡ translation limits ΥƥȤ򤹤뤿ΥץǤ144 ܤΤ٤ƤޥǤ*.c, *.t, *.h ե뤬äƤޤ

*.h ե test-t, test-c, test-l γƥǥ쥯ȥ˽ʣƴޤޤƤΤʤꤢޤʣإåեĤΥǥ쥯ȥˤޤȤȡ㤨

#include "../test-t/nest1.h"

Ȥä󥯥롼ɤΤɬפˤʤޤѥꥹȤηեõˡʴǥ쥯ȥɤ֤ˤ٤ implementation-defined ǤꡢߴݾڤƤʤΤǡ򤱤뤿˽ʣ򤤤Ȥ鷺ƥǥ쥯ȥ˥إåե֤Ƥޤʤ⤽֥ǥ쥯ȥפȤǰ C Standard ϽƤˡ

3.1.4. tool ǥ쥯ȥΥġ

tool Ȥǥ쥯ȥˤϡưƥԤΤɬפʥġ뤬äƤޤ

3.1.5. cpp-test ǥ쥯ȥ GCC/testsuite ѥץ

cpp-test Ȥǥ쥯ȥˤΤϡGCC / testsuite ǻȤΥץǤtest-t, test-l ǥ쥯ȥΤΤ testsuite Ѥ˽ľǤ֤Ƥޤ


3.2. ƥˡ

Validation Suite ǥƥȤˤϡϤ Standard C ˶դ뤿Υץ󤬤ϡ򤹤٤ƻꤷޤʶ 6.1 ȡˡ

3.2.1. ưƥ

test-t, test-c γƥǥ쥯ȥȤ⡢礭ޤȤ᤿եȤʤڤΥեȡΥץ뤬ޤץץå Standard C ٤⤱СʤȤ n_* ˤĤƤϤޤȤ᤿եǥƥȤǤޤۤɹ⤯ʤϤΥեǤ椫ץץå˴٤äơʹߤιܤΥƥȤǤʤʤäƤޤȤΤǡڤΥեѰդƤޤޤڤˤȥեο䤿ƥƥȤμ֤ΤǡøʤȤŶƤޤϤˤäƤϡκڤΥץǤǸޤǽǤʤȤޤξϤΥץ򤵤ʬ䤷ƥƥȤƤ

ޤ#error directive ϽϤˤäƤϽλΤǡ#error ΥƥȤ򤹤륵ץϤޤȤ᤿եƤޤ#include Υ顼򤽤ǽλ뤳Ȥ¿ΤǡޤȤ᤿եˤƤޤ

3.2.1.1. ܻƥ

*.t ΥץϡץץåΩץˤʤäƤ硢ޤϥѥ˥ץץΥƥȤϤ륪ץ󤬤˻ȤޤΥեץץ̤ľܡܤǸơ˽񤫤Ƥ̤Ȱפ뤫ɤΤޤץץη̤ľܸ뤳ȤǤΤǡϤ¤ꤳǥƥȤۤΤȽǤǤޤ

*.c Υץ¿ "defs.h" Ȥإåե include Ƥޤ "defs.h" ˤϣ assert ޥ񤤤ƤΤǡΤΤɤ줫ĤϤǤ #if 0 0 1 ˤޤܤΤΤ <assert.h> include ǤܤΤΤ assertion ԤƤ abort ʤ assert ޥǤϤ assert ޥǤϤޤ󤬡ΥƥȤǤϤषΤۤǤ礦

Multi-byte character νϼ¹ԻĶˤäƽϤưͤѤ礬Τǡm_* ΥƥȤˤդɬפǤ4.1 ȡˡ

3.2.1.2. ƥȤ륿å

ƥȤˤ񤷤꤬ޤ ƥȤ褦ȤȡϤ¾η٤ˤҤääƤޤȤ뤫Ǥ㤨 <limits.h> ְäƤ硢 include #if ΥƥȤ򤷤褦Ȥȡ<limits.h> ΥƥȤ򤷤ƤΤ #if ΥƥȤ򤷤ƤΤ狼ʤʤäƤޤޤ*.c ե򥳥ѥ뤷¹ԤƥȤǤϡ*.t եץץƥȤäȤäˤʤޤǽŪʷְ̤äƤСϤ˲餫η٤뤳ȤϤϤäꤷޤƥȤ褦Ȥ˷٤Τɤϡɬ餫ǤϤޤ

Validation Suite ǤϥåȤȤŪʤ褦ˤפĤǤValidation Suite Τ portable ǤʤФʤʤȤ󤬤ꡢޤƥȤ뤿ˤ¾θͤƤ뤳ȤȤ򤨤ޤ󡣤äơΡפȤƻȤץץλϡλ򥿡åȤȤƥȹܰʳΤȤǤۤΤ˥ƥȤ뤳Ȥˤʤޤ˽Ҥ٤פˤĤƤ⡢ۤ뤳ȤαդƤޤϤ륵ץν˼Ԥ硢ˤΥץ뤬åȤȤƥȹܤǼԤΤȤ¾װǼԤΤϡ¾ΥƥȤȤʻƸʤȽǤǤʤȤޤ

3.2.1.3.

ƥƥȹܤˤĤƤϡ줾Ƥޤδ񤤤ƤޤStandard C ˤϥ֥åȤȤΤϤʤΤǡܤ˹פƤʤи̩ˤ Standard C Ȥϸޤ󤬡¤ˤϤϤϤʤʤʤΤǡϤɾˤ Standard C ٤ȤʪȤ虜򤨤ޤ󡣤ơܤν٤ˤ礭ʺΤǡʹܤο櫓ˤϤ椫٤˱򤻤򤨤ޤ

󤳤ˤϵҴŪʴϤޤ󡣤 Validation Suite ϻ䤬˷᤿Τǡ礷Ϥޤ󡣤Ǥ⡢Ϥεʹ٤ҴŪɾ뤿ܰ¤ˤϤʤǤ礦

n_*, i_*, e_*, d_* ϵʽ٤˴ؤƥȤǡϸ§Ȥ 2 ñ̤ޤʳΥƥȤʼɾǤϡq_* 2 ñ̤ǡ¾ 1 ñ̤ޤǥåФ٤ȤǤϡФˤϽФʤΤǤϡϤʤȤˤޤޤäְ㤤ǤϤʤΤΤʤԥȤΤ줿ǥåξϡȾʬ뤳ȤޤޤץǿǥåФȤϽϤμͳǤְäǥåФϸоݤȤޤ

3.2.2. cpp_test ˤ뼫ưƥ

tool ǥ쥯ȥˤ cpp_test.c Ȥץ򥳥ѥ뤷 test-c ǥ쥯ȥưȡC90 n_*.c, i_*.c ΥƥȤưŪ˹ԤȤǤޤϡߤĤǡܺ٤Τ뤳ȤϤǤޤe_*.? ΥƥȤޤޤƤޤ󡣥ץץå C90 ٤ˤĤƴñ˸Ĥ뤿ΤΤǤC99 ˤĤƤΥƥȤޤޤƤޤ󡣸ߤϤޤѥ¿ C99 ˤϹ⡹ȾʬбƤʤǤ*1, *2, *3

cpp_test λȤ Visual C++ 2005 ˤȤȡ̤Ǥ

cpp_test VC2005 "cl -Za -TC -Fe%s %s.c" "del %s.exe" < n_i_.lst

ʲϤ줾 " " ǰϤɬפޤshell ", " ϤƤޤϡǸΰޤǤΤ ' ' Ǥ˰Ϥкɬסˡ%s n_*, i_* ץץ̾ .c Τ֤ޤ

Ϥ̾ꤷޤϣХȰǡ'.' ޤޤʤΤǤʤФʤޤ󡣤̾ .out, .err, .sum Ĥ̾Υե뤬ޤ
ѥ뤹뤿Υޥɤ񤭤ޤ
軰ʲ ѤΤե륳ޥɤ񤭤ޤʣäƤޤޤ

n_i_.lst test-c ǥ쥯ȥˤޤn_*.c, i_*.c γƥե̾ .c ΤΥꥹȤ񤫤Ƥޤ
ϤˤäƤϡɤ줫Υν˽ϤΤ⤢ޤξϡn_i_.lst ΤΥ̾㤨 none Ȥä¸ߤʤե̾˽ؤơƼ¹Ԥޤ

cpp_test ¹Ԥȡn_*.c, i_*.c 缡ѥ뤵졢¹ԤƤ椭ޤn_*.err, i_*.err Ȥեˡץץ stderr ؤνϤϿޤơVC2005.sum ˤκ̤ģ˽񤭹ޤޤȸäƤ⡢Σκޤ

*:
o: ѥϤǤ¹Է̤Թ
-: ѥǤʤä

VC2005.out cpp_test θƤӽФޥɥ饤󤬵Ͽ졢Ϥ stdout ˽ФåФ⤽˵ϿޤVC2005.err ˤϡϤ stderr ˽ФåС줬Ͽޤ򸫤뤳Ȥˤäơ⤦Τ뤳ȤǤǤ礦

ˡΤ褦ˤޤ

paste -d'\0' side_cpp *.sum > cpp_test.sum

ȡƽϤΥƥȷ̤Ǥ *.sum ե뤬Ϣ뤵ƣĤɽ졢cpp_test.sum ˽񤭹ޤޤside_cpp ϥƥȹܤΥȥ񤤤ɽ¦ʬǡtest-c ǥ쥯ȥˤޤ

䤬ƺä cpp_test.sum doc ǥȥ֤Ƥޤʤ6 ˤϼưˤܺ٥ƥȤη̤񤤤ƤޤǤ cpp_test.sum ¿ΥץץåƥȤƤޤΥץץåˤϤɤνϤΥѥɥ饤ФˤбƤʤΤꡢץץåˤĤƤ cpp_test ˤ뼫ưƥȤϤǤޤ

:

*1 cpp_test.c "Plum-Hall Validation Sampler" runtest.c summtest.c Ȥץߤˤƽ񤤤ΤǤ롣

*2 cpp_test.c Borland C / bcc32 ǥѥ뤹ȴ̤ư򤷤ʤcpp_test stdout, stderr 쥯Ȥ system() ƤӽФƤ뤬bcc32 ǤɸϤ¹Υץ˷Ѿʤ褦Ǥ롣Visual C, LCC-Win32 ǥѥ뤷Τʤư

*3 m_36_*.c 0x5c ('\\') ͤΥХȤ encoding ΥƥȤǤ뤬 encoding ̾ϻȤʤƥ⤢ΤǡǤϽ롣

3.2.3. GCC / testsuite ˤ뼫ưƥ

3.2.3.1. TestSuite Ȥ

GCC ˤ testsuite ȤΤޤGCC Υ򥳥ѥ뤷ǡmake check Ȥȡ testsuite Υץ뤬ȥå졢̤𤵤ޤ
θڥåȤ V.1.3 ϡGCC testsuite ȤƤȤ˽ľ edition ɲäޤ testsuite Ƥȡmake check ǼưŪ˥åޤ3.2.2 cpp_test ȤġǤ n_*, i_* Ȥ̾Υץ뤷ƥȤǤޤ󤬡testsuite Ǥ e_*, w_*, u_* οǥåפ륵ץ⼫ưŪ˥ƥȤǤޤǤ GCC 2.9x ʹߤ cpp0 (cc1, cc1plus) mcpp ΥƥȤ򤹤뤳ȤǤޤ
ǤϡGCC / testsuite ǤθڥåȤλȤޤ

ڥåȤ cpp-test ǥ쥯ȥ test-t, test-l ǥ쥯ȥ GCC / testsuite бƽľΤǡcpp-test test-t, test-l γƥǥ쥯ȥ꤬ޤ
m_*, u_1_7_* multi-byte character γƼ encoding бΤǤGCC 3.3 ޤǤΥСǤϴĶѿ encoding ˱Ѥ뤳ȤɬפǡѥδĶѤ뤳Ȥ testsuite ǤϤǤʤΤǡcpp-test ˤϴޤƤޤ*1
GCC / cpp λͤѹ testsuite λͤѹޤǤˤꡢ줫⤢ͽۤޤˤäƤϸڥåȤΰɬפˤʤޤȤ˿ǥåɲä줿ѹ줿ꤷϡtestcase ˤɬפޤΤȤ GCC ΥС󤬤ҤɤŤʤ¤ꡢʽɬפʤȻפޤcpp-test testcases GCC 2.95.3, 3.2, 3.3.2, 3.4.3, 4.0.2, 4.1.1 γ cpp (cpp0, cc1, cc1plus) mcpp ưΤƤޤ
testsuite Ǥϼ¹ԻץϤˤäѤ뤳ȤϤǤޤʣεʤ¾ʻ¸Ƥ븽ߤξǤ std= ȤץǵʤΥСɬפޤΥץ GCC θŤСˤ¸ߤޤ󡣤äơ testsuite ŬϰϤ GCC 2.9x ʹߤ mcpp V.2.3 ʹߤȤȤˤʤޤ

Testsuite ϥץץ˽񤫤줿Τ褦ʷΥȤᤷƼ¹ԤޤϥȤʤΤǡ¾νϤΥƥȤˤϱƶޤ

/* { dg-do preprocess } */
/* { dg-error "out of range" } */

dg-error Ȥ dg-warning ȤȤν񤫤줿ץǤϡǥåƥȤޤʣνϤΥƥȤ򤹤뤳Ȥ⡢줾νϤοǥå '|' (OR) Ϥ¤٤ƽ񤯤Ȥǡǽˤʤޤ
¹ԤΤ DejaGnu Ȥġǡľܤˤ runtest Ȥ shell-script ǤDejaGnu *.exp Ȥ̾ΤĤΥե˽񤫤Ƥޤ*.exp expect ȤġΤ script Ǥơ expect Tcl Ȥޥɸǽ񤫤줿ץʤΤǤ
äơtestsuite Ȥˤϡ testsuite ˱ơ¿ΥġŬڤʥСΤΤäƤʤФʤޤ󡣤ϻθڥåȤȤǤ⡢ȤʤƱǤ

:

*1 ºݤˤϴĶѿꤷƤ GCC ưʤ

3.2.3.2. TestSuite ؤΥ󥹥ȡȥƥ

GCC / testsuite ǻθڥåȤȤˤϡΤ褦ˤޤ
ޤ cpp-test ǥ쥯ȥ GCC testsuite Ŭʥǥ쥯ȥ˥ԡޤ
cpp-test ǥ쥯ȥϡtest-t, test-l γƥǥ쥯ȥɬפʥեľcpp-test.exp ȤƥѤեäΤǤ*.t Ȥ̾Υե suffix .c ѤƤޤC++ Υե *.C Ȥ̾ˤƤޤ
ȾΥץϥץץåƥȤΤǤĤ DejaGnu, Tcl Ǥ줬ǤʤΤǡcompile & run 뤿ΥץˤʤäƤޤ*_run.c Ȥ̾ΤΡˡΣĤΥץˤ { dg-options "-ansi -no-integrated-cpp" } ȤԤޤ-no-integrated-cpp ȤΤ GCC 3, 4 ΤΥץǤGCC 2 ˤϤΥץϤʤΤǡGCC 2 ǥƥȤϤΥץϤʤФʤޤ󡣤ΤˡΣĤ testcase ˤĤƤ *_run.c.gcc2, *_run.c.gcc3 ȤΥեѰդƤޤŬʤۤ *_run.c ˥󥯤ƻȤäƤ

ʲǤϡΤȤ Linux Ǥ GCC 3.4.3 ˤȤäޤGCC 3.4.3 Υ /usr/local/gcc-3.4.3-src ֤ƤȤޤޤGCC Υѥ /usr/local/gcc-3.4.3-objs ǹԤȤޤ

cp -r cpp-test /usr/local/gcc-3.4.3-src/gcc/testsuite/gcc.dg

ǡgcc.dg ǥ쥯ȥ cpp-test ʲΥե뤬ԡޤ
Ƥȡ/usr/local/gcc-3.4.3-objs

make bootstrap

Ȥ GCC Υ򥳥ѥ뤷ǡ

make -k check

Ȥȡcpp-test testcases ޤ᤿٤Ƥ testsuite ƥȤޤ

ޤcpp-test ȤäƥƥȤˤϡ/usr/local/gcc-3.4.3-objs/gcc ǥ쥯ȥǼΤ褦ˤޤ

make check-gcc RUNTESTFLAGS=cpp-test.exp

Testsuite log ./testsuite ǥ쥯ȥ gcc.log, gcc.sum ˵Ͽޤ
make check ϡĶˤäƤ GCC Υ INSTALL/test.html 褦ˡDEJAGNULIBS, TCL_LIBRARY ȤĶѿ꤬ɬפǤ
ޤGCC 3 ǤϴĶѿ LANG, LC_ALL C ȤƱѸĶˤʤФʤޤ
GCC Υѥ make check ǻȤΤϡǤ˥󥹥ȡ뤵Ƥ gcc, cc1 ǤϤʤgcc ǥ쥯ȥ줿 xgcc, cc1, cc1plus, cpp0 Ǥ뤳ȤդƤ
cpp-test ˤƥȤϼΤ褦ˤƤǤޤ

runtest --tool gcc --srcdir /usr/local/gcc-3.4.3-src/gcc/testsuite cpp-test.exp

ξϡ¹Ԥǥ쥯ȥǤդǤϥȥǥ쥯ȥ˽ϤޤƥȤΤϡǤ˥󥹥ȡ뤵Ƥ gcc, cc1, cpp0 Ǥcpp-test testsuite ɬפʤΤϡGCC ѤγƼե (config.*, *.exp) ˤ뤫Ǥ

runtest --tool gcc ǻꤹ 'gcc' Ȥ̾ϤΤȤǤʤФʤޤ󡣤⤷ºݤ˻Ȥѥ餬Ȥ cc, gcc-3.4.3 gcc ʳ̾ξϡܥå󥯤ä gcc Ȥ̾ǸƤӽФ褦ˤƤޤ
ʤcpp-test ˤϥץץå˥󥰤ФΤ˾ޤȹͤ륱ˤĤƤΥ˥󥰤 testcases ¿ޤޤƤޤGCC ΥץץåϤȾʬʲ PASS ޤ󤬡̤ʤȤäơưְäƤȤץץåѥ뤵ƤʤȤȤȤǤϤޤ󡣤ְäƤ뤫ǤϤʤץץåΡʼפʤΤǤ

3.2.3.3. mcpp μưƥ

cpp-test Ǥɸ⡼ɤ mcpp ΥƥȤǤ褦ˤʤäƤޤäơGCC Υץץ mcpp ֤ơgcc ǥ쥯ȥ

make check-gcc RUNTESTFLAGS=cpp-test.exp

Ȥȡmcpp μưåޤǤդΥǥ쥯ȥ runtest ľܸƤӽФƼ¹Ԥ뤳ȤǤޤ

runtest --tool gcc --srcdir /usr/local/gcc-3.4.3-src/gcc/testsuite cpp-test.exp

mcpp GCC 3, 4 Ǽ¹Ԥ硢cpp-test testcases Ƥ٤Ƥ PASS ϤǤGCC 2 Ǽ¹ԤϤ⤦̤ʤΤޤ gcc -D__cplusplus=1 Ȥץդ mcpp ƤӽФǤꡢmcpp ΤǤϤޤ
ץץ mcpp ֤ˡˤĤƤϡmcpp-manual.html#3.9.5, mcpp-manual.html#3.9.7 򸫤Ƥ Testsuite ŬѤϡmcpp εư -23j Ȥץդ褦ꤹɬפޤ-2 digraph-3 trigraph ͭˤ륪ץǤ-j ϿǥåνϤ˥ξղäʤΥץǤ¾ΥץꤷʤǤޤtestsuite ǥƥȤǤΤɸ⡼ɤ mcpp ǡ¾Υ⡼ɤ mcpp ΥƥȤϤǤޤ

ʾ GCC make θǹԤˡǤGCC / testsuite 󥹥ȡ뤵ƤƼ¹ԤǤ֤ˤʤäƤСmcpp Ȥ configure make mcpp μưƥȤ򤹤뤳ȤǤޤξϡɬפ򤹤٤ make check ưŪˤäƤΤǡǤñǤˡˤĤƤϡmcpp INSTALL 򸫤Ƥ

3.2.3.4. TestSuite ȸڥå

GCC ˤ testsuite Ť餢ޤץץ˴ؤƤ V.2.9x ޤǤϤ鷺Υץ뤷ޤǤ˥ץץڻ뤵Ƥ狼ޤΥץץ testcases V.3.x Ǥϥ㤤ޤץץåΥȥɥȤ쿷졢up-to-date ʤΤˤʤäȤȼΤǡץץŻ뤵褦ˤʤäȤ狼ޤ
testcases ϰȤƤʤҴäΤˤʤäƤޤθϡtestsuite μΤ褦ʤͳ褹ΤȻפޤ

  1. 桼󤻤 bug report νѤǤ뤳ȡʤºݤȯ줿ХȯɤΤΤ濴Ǥ롣
  2. ˡȯԤǽˡΥǥХåΤ˽񤤤ΤɲäƤ롣

ϥץ󥽡ʤǤϤΥǥХåˡǡGCC ¿ͥ줿ץޤ˻ȤƤȤDzǽȤʤäΤǤˡƱˡtestcases ΥҴ⤿餷Ƥȹͤޤ
ޤ testcases ˤ GCC ǤѤʤץ뤬¿¾νϤˤŬѤǤޤ󡣤ɤGCC 3 testcases ˤ GCC 2 / cpp ˤŬѤǤʤΤ¿ޤޤƤޤץץϤ spacing ΰ㤤ǥåΰ㤤뤿Ǥ
ФƻθڥåȤϡϻΥץץåΥǥХåΤ˻䤬ͤǽ񤤤ΤǤǹͤѤơץץͤƥȤ褦˽ľޤ¿Υץ뤬ΤȤƥƥޥƥå˹Ƥޤƥޥƥå testcases GCC / testsuite ɲä뤳Ȥϡʤʤ̣ĤȻפޤ
ޤ testsuite ǸڥåȤ GCC 2.9x / cpp0, GCC 3.x, 4.x / cc1, mcpp ȤĤΥץץåΥƥȤǤ褦˽񤫤ƤޤʤDejaGnu, Tcl ɽεǽѤСϤˤץץϤ spacing κۤǥåκۤۼ뤳ȤǤΤǤ*1

Testsuite ڥåȤ򤳤ΣĤΥץץåŬѤ̤ʲ˺ܤƤޤmcpp 2007/03 Ρ¾ 2006/10 Υƥȡˡ
GCC 4.1.1 ǥץץå mcpp V.2.6.3 ֤Ƽ¹ԤϤʤޤ

            === gcc Summary ===

# of expected passes            264
# of unexpected failures        1
# of expected failures          4
/usr/local/bin/gcc version 4.1.1

Ĥ FAIL ΤϡC++98 Ǥ universal-character-name <=> multi-byte character ѴƤʤȤˤΤǤ
GCC 3.2 / cc1 ǤϤʤޤ

            === gcc Summary ===

# of expected passes            216
# of unexpected failures        51
# of unexpected successes       2
# of expected failures          2
/usr/local/bin/gcc version 3.2

FAIL ¿ϡ˥󥰤ФƤۤȤǽФƤʤȤΤǤ
GCC 4.1.1 / cc1 ۤȤѤޤ

            === gcc Summary ===

# of expected passes            214
# of unexpected failures        53
# of unexpected successes       2
# of expected failures          2
/usr/local/bin/gcc  version 4.1.1

GCC 2.95.3 / cpp0 ǤϤʤޤ

            === gcc Summary ===

# of expected passes            181
# of unexpected failures        87
# of unexpected successes       3
# of expected failures          1
gcc version 2.95.3 20010315 (release)

GCC 3, 4 / cc1 ⤵˥˥󥰤ʤԥȤγ줿ǥå⤤ĤޤC99, C++98 οͤȾʬ̤Ǥ
GCC ΥСˤäƷ㤦ΤϡĤ testcase ʣ FAIL ȯ뤳Ȥ뤫Ǥ

:

*1 Τˡ testcases dg script Ϥ䤿 \ 䵭¿ unreadable ʤΤˤʤäƤ롣DejaGnu, Tcl ɽνˤϤʤʤ٤ꡢȤˤϼιפɬפǤ뤬פʣνϤˤĤư̤μưƥȤǽǤ뤳Ȥ狼äǤϡνϤμ¹ԻץΤ testcases ǻȤ륪ץ󤬶̤Ǥ뤳ȤǤ롣


3.3. Violation of syntax rule or constraint ȿǥå

Standard C νϤʤФʤʤΤϤǤְäФƤϿǥåФʤФʤޤ󡣤ޤStandard C ˤϡưͤϤˤޤƤʬ䡢ɤư򤹤뤫ꤵƤʤʬ⤢ޤΤȤޤȤƼȡΤ褦ˤʤޤ*1

  1. ץǡǡɤνϤǤƱ̤ˤʤΡ
  2. ץȥǡǤäƤ⡢νˡϵꤵʤΡϥɥȤ˵ܤʤƤɤ unspecified behavior̤ưˤȸƤ֡
  3. ץȥǡǤäƤ⡢νϽϤˤޤƤΡλͤϳƽϤɥȤ˵ܤʤФʤʤ implementation-defined behaviorʽưˤȸƤ֡
  4. ְä뤤ϰܿΤʤץޤϥǡǤ뤬νˤĤƤϲ⵬ꤵʤΡϤϤ˿ǥåФƤɤФʤƤɤ餫ץȤƤν򤷤Ƥɤ undefined behavior̤ưˤȸƤ֡
  5. ְäץޤϥǡǡФƽϤ diagnostic messageʿǥåˤФʤФʤʤΡˤ violation of syntax ruleʹʸ§ȿˤ violation of constraint ȿˤȤ롣*2

Τ 1 ΥץȥǡΤΤ strictly conforming program ʵʸ̩ץץˤȸƤӤޤ2, 3 ⡢ϤˤäƷ̤˰㤤νФʤΤǤСޤޤƤƤɤȲᤵˡ
1, 2, 3 ΥץȥǡΤΤ conforming program ʵʹץץˤȸƤӤޤ

ǥåνФ implementation-defined Ǥ餫 violation of syntax rule or constraint ޤ translation unit ĤˤĤƣİʾβ餫οǥåФʤФʤʤȤƤޤViolation of syntax rule or constraint ޤޤʤץФơǥåФȤϽϤμͳǤ strictly conforming program 䡢νϤ implementation-defined, unspecified λͤ˹פ conforming program ϺǸޤǤʤФʤޤ
ΥɥȤǤϡviolation of syntax rule or constraint ֥顼פȸƤ֤Ȥˤޤ

Validation Suite e_* եˤϡʣΥ顼ޤΤ󤢤ޤʲκǤϡϤĤΥ顼ˤĤƣİʾοǥåФȤԤƤޤĥ顼äƤ⣱Ĥ translation unit ˤĤƣĤοǥå"violation of syntax rule or constraint" ȤäˤФʤϤ⤢뤫⤷ޤ󡣤ޤ顼Ȥθν𤹤Ϥ⤢뤫⤷ޤ󡣤μϽϤΡʼפǤʽ٤ǤϤޤɬפʾϥץХ餷ƺƥƥȤƤʼ 4 ̤ˤȤꤢޤ

:

*1 C90 3 Definitions of Terms Ѹڤӵ
   C90 4 Compliance ʹ
   C90 5.1.1.3 Diagnostics ǥå
   C99 3 Terms, definitions, and symbols
   C99 4 Conformance
   C99 5.1.1.3 Diagnostics

*2 C++98 Ǥ C90, C99 ȤѸ줬ʤäƤ뤬ݤä˰ʤ


3.4. ܺ

ʲˡƥƥȹܤˤĤƣĤIJ⤷ޤ Standard C ץץΤΤβȤʤΤǤK&R 1st. ȶ̤λͤˤĤƤϡ餿ƲϤޤ󡣹ܤֹ *.t ե *.c եȤǶ̤Ǥ

3.4.1. Trigraphs

n.1.1. Ĥ trigraph sequences

äδʸåȤˤ ISO 646:1983 Invariant Code Set ˴ޤޤʤʸĤΤǡϼΣʸ sequence Ǥ⥽˽񤯤ȤǤ褦ˤʤޤ C90 ǿߤ줿Ǥ*1

??=#
??([
??/\
??)]
??'^
??<{
??!|
??>}
??-~

ΣĤ trigraph sequence translation phase 1 бʸ֤ޤĤʸ򥭡ܡɤϤ뤳ȤΤǤ륷ƥǤϡ trigraph ȤɬפϤޤ󡣤ƥǤ Standard C ˹פץץ trigraph ѴǤɬפޤ

: 6ĤȤǤ 6 Ǥʤ trigraph Ĥ뤴Ȥ 2 0 򲼸¤Ȥ롣

:

*1 C90 5.2.1.1 Trigraph sequences ʸɽ
   C90 5.1.1.2 Translation phases ե
   C99 5.2.1.1 Trigraph sequences
   C99 5.1.1.2 Translation phases

n.1.2. ȥ trigraph sequence

Trigraphs Ѵ translation phase 3 Ǥ tokenization phase 4 ǤΥȥԤνΩäƹԤΤǡ󥳥ȥԤǤɤǤ trigraphs 񤯤ȤǤޤ

: 2

n.1.3. Trigraphs ϣĤ¸ߤʤ

Trigraphs Ͼ嵭ΣĤʤΤǡʳ ?? ǻϤޤ sequence ¾ʸѴ뤳ȤϤʤ?? åפ뤳Ȥ⤢ޤTrigraph ȤǤʤ ? ޤ sequence ߤƤ⡢ץץǤɬפޤ

: 2

3.4.2. <backslash><newline> ˤ³

\ äƤľ˲Ԥ³ƤФϡ <backslash><newline> sequence translation phase 2 ̵˺ޤη̡ĤιԤ³ޤʽǤϡեιԤ physical lineʪԡˡ<backslash><newline> ʤС˺³줿ιԤ logical lineԡˤȸƤǶ̤ƤޤTranslation phase 3 νϤԤоݤȤƹԤޤ*1
K&R 1st. Ǥ #define Ԥʸ <backslash><newline> ǼΥԤ³뤳ȤǤȤƤޤΰʳξˤĤƤϿƤޤ󡣼ºݤνϤǤϤޤޤǤȥԤ #define ˸¤餺³ǤΤ¿ä褦Ǥ

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases

n.2.1. #define ԤΥѥ᡼ꥹȤִꥹȤȤδ

#define Ԥ³ K&R 1st. ǤǧƤΤǤꡢۤȤɤνϤDzǽǤ

: 4ʤǤ 4 Ǥʤ 0

n.2.2. #define ԤΥѥ᡼ꥹȤ

#define ԤǤäƤѥ᡼ꥹȤΤ褦ʤޤ̤ǤϤʤȤ <backslash><newline> ȡǤʤϤ⤢ޤ

: 2

n.2.3. ʸƥ

ʸƥ <backslash><newline> K&R 1st. ΤΤǤ

: 2

n.2.4. ̻Ҥ

Standard C Ǥϡ̻ҤǤȤɤǤȡ<backslash><newline> ̵ǺʤФʤޤ

: 2

n.2.5. Trigraph ˤ <backslash>

<backslash> \ Ǥʤtrigraph ˤ ??/ ⤢ޤ ??/ translation phase 1 \ ѴƤޤ顢phase 2 Ǥ \ ΤΤǤ

: 2

3.4.3.

Translation phase 3 ǤԤ pp-token white spaces ʬ򤵤ޤκݡȤϣĤ space Ѵޤ*1
ǽϤϡϢ³ white spacesʥȤޤˤ򣱸Ĥ space Ѵ뤫⤷ޤ󡣤ɤˤƤ <newline> ѴΤޤ޻Ĥޤϡ phase 4 Ǥ preprocessing directive νΡֹԡפоݤȤ뤫Ǥ
ȤԤޤäƤϡȤˤ¾ι³Ԥޤ

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases

n.3.1. One space Ѵ

Reiser θŤ cpp ǤϥȤϡcpp Ǥ token separator ȤƵǽϤޤǤδ֤ˤϺƤޤΤȤѤơȡϢ˥ȤȤˡޤλͤ K&R 1st. ⳰줿ΤǤꡢStandard C ǤΤꤵޤStandard C ǤϥȡϢˤ ## 黻ҤȤޤ

: 6

n.dslcom. //

K&R 1st. C90 ˻ޤǡȤ /* ǻϤޤ */ ǽΤǤ*1
C99 Ǥ C++ // ⥳ȤȤưȤˤʤޤ*2

: 4
C90 ǤϤϥȤǤϤʤñʤ / Ȥ pp-token Ĥ sequence Ȥƽ٤ΤǤ뤬C99 // 򥳥ȤȤƽϤŪǤämcpp Ǥ C90 ⡼ɤǤ⤳򥳥ȤȤƽǥ˥󥰤Ф

:

*1 C90 6.1.9 Comments 
*2 C99 6.4.9 Comments

n.3.3. Ȥ pp-directive νΩäƽ

# ǻϤޤ preprocessing directive ϡֹԡפоݤȤޤΡֹԡפϥʪԤȤϸ¤ޤ<backslash><newline> ˤä³줿ԤǤ뤳Ȥ⤢СʪԤޤȤˤäʣʪԤˤޤֹԡפǤ뤳Ȥ⤢ޤ translation phase 1 4 νͤƤߤСΤȤǤ

: 4

n.3.4. Ȥ <backslash><newline>

<backslash><newline> ȥȤˤäƤĤʪԤˤޤ pp-directive Ԥ¸ߤޤTranslation phase ƤʤץץåǤϡ뤳ȤǤޤ

: 2

3.4.4. üʥȡ (digraphs) ʸ (UCN)

C90 / Amendment 1 (1994) ǤϡĤ operator, punctuator ˤĤ digraph Ȥ spelling ɲäޤ*1
C99 Ǥ UCN (universal character sequence) Ȥʸɽɲäޤ*2
e.4.? Ǥϥȡ󥨥顼夲ޤ

:

*1 Amendment 1 / 3.1 Operators, 3.2 Punctuators ISO 9899 / 6.1.5, 6.1.6 ؤɲá
   C99 6.4.6 Punctuators

*2 C99 6.4.3 Universal character names

n.4.1. Preprocessing directive digraph spelling

Digraph token (pp-token) Ȥưޤ %: # spelling Ǥpreprocessing directive ԤƬ pp-token ȤƤ⡢ʸ󲽱黻ҤȤƤȤޤ

: 6

n.4.2. Digraph spelling ʸ

Digraph trigraph Ȱä token (pp-token) ʤΤǡʸ󲽤˺ݤƤѴ줺ˤΤޤޤ spelling ʸ󲽤ޤ̵̣ʻͤǤˡ

: 2

n.ucn1. UCN ǧ 1

UCN ʸƥ롢ʸ̻Ҥǧޤ

: 8ʸƥ UCN ץץ򤽤Τޤ̲᤹ 4 ʸidentifier UCN г 2 UCN Ǥ뤳ȤǧۤäƤΤޤ޽ϤΤԲġ

n.ucn2. UCN ǧ 2

UCN pp-number ǤȤޤץץνޤǤ number-token ϾǤƤʤФʤޤ󡣤 C99 εǡC++ ˤϤޤ

: 2

e.ucn. UCN θ

UCN \U ǻϤޤΤϣ\u ǻϤޤΤϣΣʿǤʤФʤޤ
UCN [0..9F], [D800..DFFF] ϰϤˤäƤϤʤޤ󡣤24($), 40(@), 60(`) ͭǤ

: 4ĤΥץΤ줾ˤĤơǤǤг 1

e.4.3. ʸ

äΥȡη򤷤Ƥʤ sequence Ǥ⤿Ƥ pp-token Ȥǧޤäơץץ tokenization ǥ顼Ȥʤϡޤꤢޤ
Τۤ undefined behavior Ȥʤ礬Ĥޤ4.2 ȡˡ
ʸϥץץ #if ԤǤ⥳ѥǤ⡢violation of syntax rule Ǥ*1

: 2

:

*1 C90 6.1.3.4 Character constants ʸ -- Syntax ʸ§
   C99 6.4.4.4 Character constants -- Syntax

3.4.5. Preprocessing directive line space tab

Space, tab, vertical-tab, form-feed, carriage-return, new-line white space Ȥư礵ޤʸƥ롦ʸإå̾Ȥˤʤ white space ̾ token separator ȤƤΰ̣äƤޤ󤬡translation phase 4 ޤǻĤä newline ̤ʤΤǡpp-directive ζڤȤʤޤơpp-directive line ǤϻȤ white space ˼㴳¤ޤ

n.5.1. # space tab

Standard C ǤϡPreprocessing directive line κǽ pp-token Ǥ # space, tab ϡäƤʤƤƱ̤ˤʤ뤳ȤݾڤƤޤ(*1)K&R 1st. ǤϤ줬ΤǤϤʤºݤˤ # space, tab ǧʤϤޤ
ιԤΤʹߤ space, tab ϡK&R 1st. Ǥ Standard C Ʊͤˡñʤ token separator ȤǧƤȲᤵޤ
pp-directive line space, tab ʳ white space ä undefined Ǥ4.2 u.1.6 ȡˡ

: 6

:

*1 C90 6.8 Preprocessing directives  -- Description ­, Constraints 
   C99 6.10 Preprocesssing directives -- Description, Constraints

3.4.6. #include

#include K&R 1st. κǤŪ pp-directive ǤStandard C Τ directive εˤ undefined ʬ implementation-defined ʬȤ¿ʤäƤޤ(*1)ͳϼˤޤ

  1. directive ΰǤ header-name Ȥ pp-token ϣϣӤΥե륷ƥ˰¸ΤǤꡢɸಽ
  2. ե򤵤ɸפξϽϤ˰¸롣
  3. ", " ǰϤޤ줿ʸƥη header-name Ǥ⡢\ escape ʸǤϤʤʸƥȤ̤ pp-token Ǥꡢ <, > ǰϤޤ줿 header-name ˤäƤϺǤ§Ū pp-token Ǥ롣

n.6.* ǤϡΤ褦ʺǤŪʥƥȤϡܤʬƹԤȤϤޤ󡣤¾ΥƥȹܤȤƴޤޤƤꡢ줬ǤʤΤǤ¿ΥƥȤ»ܤǤʤΤǡǤ

#include    <ctype.h>
#include    "header.h"

:

*1 C90 6.8.2 Source file inclusion ե
   C99 6.10.2 Source file inclusion

n.6.1. Ĥηˤɸإå include

Header-name ˤϣĤηޤ ΰ㤤ϡ<, > ǰϤޤ줿ǤϽξʣǤɤˤ餽 header 򤵤", " ǰϤޤ줿ǤϤΥեޤˡǤơ줬Ԥ <, > ǰϤޤ줿Ʊͤν򤹤롢ȤȤˤޤ󡣤äơ", " ǰϤޤ줿ɸإå include 뤳ȤǤޤ K&R 1st. ǤƱͤǤ
ʤStandard C ǤϡƱɸإåʣ include Ƥ⤫ޤʤȤˤʤäƤޤϤɤˤƤץץåǤϤʤɸإåνǤ4.1.1 ȡˡ

: 10ĤΥץʤΤ 4

n.6.2. ޥˤ header-nameΣ

K&R 1st. Ǥ #include Ԥ˥ޥȤȤϤƤޤǤStandard C Ǥϥޥǧޤ#include ΰĤΤɤηȤפʤϡ˴ޤޤޥŸޤη̤ϣĤηΤɤ餫˰פɬפޤ
εˤ̯ʤȤ⤢ޤ㤨СΤ褦ʥϤɤ٤Ǥ礦

#define MACRO   header.h>
#include    <MACRO

ϡMACRO ޤŸ

#include    <header.h>

Ȥ٤Ǥ礦Ȥ⡢ޥŸ < б > ʤȤƥ顼Ȥ٤Ǥ礦

ʤϤȤޤǰռƽ񤫤ƤȤϹͤޤ äơ<, > ", " Ʊͤ quotation delimiter ȤưΤʤȻפޤ˥ޥŸΤ⡢ʰȿȤϸޤ󤬡 Validation Suite ˤϡʤηĤĤƥȤϴޤޤƤޤ

: 6

n.6.3. ޥˤ header-nameΣ

ĤޤʤȤǤޥɬ⣱ĤǤɬפϤޤ

: 2

3.4.7. #line

#line Ȥ pp-directive ϥ桼ȤȤ̤ϤʤΤǤ¾βΥġǡʣäȤϸ¤ʤ˥ pre-preprocess ʤɤˡΥΥե̾Ȥλιֹ뤿˻ȤΤΤ褦ǤK&R 1st. 褢Ȥ򸫤ȡŪˤʤӤΤǤ礦
ޤץץåνϤˤ̤ #line ޤϤѷե̾ȹֹ򥳥ѥΤ뤿˻ȤޤϵꤵƤ뤳ȤǤϤޤ
#line ǻꤵ줿ե̾ȹֹϻޥ __FILE__, __LINE__ ͤȤʤޤ__LINE__ ϤʪԣԤȤ˥󥯥ȤƤ椯ˡ*1

*1 C90 6.8.4 Line control 
   C99 6.10.4 Line control
   C90 6.8.8 Predefined macro names 餫줿ޥ̾
   C99 6.10.8 Predefined macro names

n.7.1. ֹȥե̾λ

Line number filename ꤷ #line K&R 1st. ˤ⤢ޤK&R 1st. Ǥ filename ", " ǰϤߤޤǤ
Standard C Ǥ filename ʸƥǤ #include header-name ȤϰäȡǤꡢ̩˹ͤ \ ΰ̯ޤǤޤǤʤǤ礦#line filename <stdio.h> ηΤΤʤΤϹǤˡ

: 6

n.7.2. ե̵̾Ƥɤ

Filename ΰϥץǤꡢʤƤ⤫ޤޤ K&R 1st. ƱǤline number λΤʤΤ undefinedˡ

: 4

n.7.3. ޥˤֹȥե̾λ

K&R 1st. Ǥ #line ΰ˥ޥȤȤϤƤޤǤStandard C ǤϻȤ뤳Ȥݾڤޤ

: 4

n.line ֹϰ

#line ǥ쥯ƥ֤ line number ϰϤ C90 Ǥ [1..32767] ǤC99 Ǥ [1..2147483647] ˳礵ޤ

: 2

e.7.4. ե̾磻ʸƥ

Filename ΰʸƥǤʤФʤ餺ĤޤʤȤǤ磻ʸƥǤ violation of constraint Ȥʤޤʤʳ pp-token ǤϤʤ undefinedХ󥹤ʵǤˡ

: 2

3.4.8. #error

#error C90 ǿߤ줿 directive Ǥ ץץˡ򤽤ΰȤƴޤ२顼åɽޤŤϤǤ #assert directive ĤΤ⤢ޤɸŪʤΤϤޤǤ
ʤ#error ǤϽλ٤ɤϵꤵƤޤ󤬡Rationale ˤȡʤǤϤޤ׵ǤʤΤǵꤷʤäǡߤΤ ANSI C ѰΰտޤǤȤΤȤǤ*1

:

*1 C90 6.8.5 Error directive ɽ
   ANSI C Rationale 3.8.5
   C99 6.10.5 Error directive
   C99 Rationale 6.10.5

n.8.1. ޥŸʤ

#error ΥޥŸޤ ȥԤǥޥŸΤϡ#if (#elif), #include, #line Ǥ*1

: 8ޥŸƽΤ 2 λ뤫ɤʤ

:

*1 C90 6.8 Preprocessing directives  -- Semantics ̣§
   C99 6.10 Preprocessing directives -- Semantics

n.8.2. å̵Ƥɤ

ĤޤʤȤǤ#error ԤΰϥץǤꡢʤƤ⤫ޤޤ

: 2

3.4.9. #pragma, _Pragma()

#pragma C90 ǿߤ줿ΤǤȼγĥ directive Ϥ٤ #pragma sub-directive Ǽ¸뤳ȤˤʤäƤޤ*1

:

*1 C90 6.8.6 Pragma directive ץ饰޻
   C99 6.10.6 Pragma directive

n.9.1. ǧǤʤ #pragma ⥨顼ˤϤʤʤ

äơϤȤǧǤ #pragma sub-directive ۤʤޤǧǤʤ #pragma 顼ˤʤäΤǤ portable ʥץब񤱤ʤΤǡϤǧǤʤ #pragma ̵뤹뤳ȤˤʤäƤޤץץǤϼʬǧǤץץ˴ؤ #pragma ơ¾ #pragma Ϥ٤ƤΤޤޥѥΤϤȤˤʤޤ

: 10#pragma 򥨥顼ˤƤϤʤ˥󥰤ФȤϤޤʤ

n.pragma. _Pragma() operater

C99 Ǥϡ#pragma Ʊ̤#pragma Ȱäƥޥˤ񤯤ȤΤǤ _Pragma() operator ɲäޤ
ޤpragma ³ pp-token STDC Ǥеꤵ줿ɸεǽξϥޥŸػߤ뤬¾ξϥޥŸоݤȤ뤫ɤ implementation-defined ȤƤޤ

: 6

e.pragma _Pragma() ΰʸƥ

_Pragma() operator ΰʸƥǤʤФʤޤ

: 2

3.4.10. #if, #elif, #else, #endif

#if, #else, #endif K&R 1st. 褢ΤǤ *1
#if ȤʤϤǤϡn.10.1, n.11.*, n.12.*, n.13.*, e.12.*, e.14.* ɤǤʤФǤʤ¾¿ΥƥȤ⼺Ԥ뤳Ȥˤʤޤ

:

*1 C90 6.8.1 Conditional inclusion դ
   C99 6.10.1 Conditional inclusion

n.10.1. #elif Ȥ

C90 Ǥ #elif ɲäޤˤäơ#if 򲿽ŤˤͥȤɤߤˤ򤱤褦ˤʤޤ
#if ˤϥޥȤȤǤޤޥȤƤʤ identifier 0 ɾޤ

ʤʽǤϡ#if 餽б #endif ޤǤ #if section #if (#ifdef, #ifndef), #elif, #else, #endif Ƕڤ줿֥å #if group ȸƤǤޤ#if, #elif Ԥμ #if ȸƤӤޤ

: 10

n.10.2. åפ #if group Ǥ pp-token

åפ #if group Ǥϡ#if group бطȥ졼뤿 #if, #ifdef, #ifndef, #elif, #else, #endif Ĵ٤ʳ preprocessing directive Ͻ줺ޥŸޤ

tokenization ϹԤޤˡäΥϽᤫ齪ޤǥȤ pp-token sequence Ǥꡢˡ#if бطĴ٤뤿ˤϾʤȤ⥳Ȥνɬפǡ/* ȵǤ뤳ȤΤ뤿ˤϤ줬ʸƥʸˤΤǤϤʤȤΤʤФʤʤǤ

: 6

3.4.11. #if defined

C90 Ǥ #if defined Ȥ黻Ҥߤޤ #ifdef, #ifndef #if (#elif) 礹Τǡˤäơ#ifdef ŤˤͥȤ줿ɤߤˤ򤱤褦ˤʤޤ

n.11.1. #if defined

defined 黻Ҥ operand ϼ̻ҤǤ (, ) ǰϤȰϤޤʤǧƤޤɤ̣Ʊǡoperand ޥȤƤ 1Ǥʤ 0 ɾޤ

: 8Ĥ #if section ǤʤΤ 2

n.11.2. defined ñ黻

defined ϱ黻ҤΣĤǤꡢ1 0 Τɤ餫ͤͿΤǡη̤򤵤¾μȱ黻뤳ȤǤޤ

: 2

3.4.12. #if η

#if ˤĤƤ K&R 1st. ǤȤƤǡηϤäꤷƤޤǤC90 Ǥ #if Ǥꡢint long ȡunsigned int unsigned long ƱɽäƤ뤫Τ褦˰ȤΤˤޤʤ#if ϤޤƤ٤ long unsigned long ɾޤСȡˤϤ٤ L ޤ UL ҤդƤΤƱ褦˰ޤ*1

ˡC99 Ǥ #if ηϤ줾νϤκȤޤη <stdint.h> Ȥɸإå intmax_t, uintmax_t Ȥ̾ typedef ޤC99 Ǥ long long ɬܤȤƤΤǡ#if η long long ޤϤʾΥȤȤˤʤޤlong long / unsigned long long ɽˤ LL (ll) / ULL (ull) ȤҤȤޤ*2
long long / unsigned long long ͤ printf() ɽˤϡ%ll Ȥ length modifier Ŭ conversion specifier Ȥޤ%lld, %llu, %llx ˡintmax_t, uintmax_t ͤɽ length modifier %j Ǥ%jd, %ju, %jx ˡ*3

:

*1 C90 6.8.1 Conditional inclusion դ -- Semantics ̣§
*2 C99 6.10.1 Conditional inclusion -- Semantics
*3 C99 7.19.6.1 The fprintf function -- Description

n.12.1. long #if

C90 #if Ǥ long ɾǤʤФʤޤ

: 6

n.12.2. unsigned long #if

C90 #if Ǥ unsigned long ɾǤʤФʤޤ

: 4

n.12.3. ʿ

#if ǤϣɾǤʤФʤޤK&R 1st. ǤƱͤǤlong κͤۤ K&R 1st. Ǥ long ͤɾ줿ΤФơC90 Ǥ unsigned long ɾȤäƤޤ*1

: 4ʿǧ뤬ɾꥪСեꤹΤ 2 ʿǧʤΤ 0

*1 C90 6.1.3.2 Integer constants 
   C99 6.4.4.1 Integer constants

n.12.4. ʿ

#if ǤϣɾǤʤФʤޤK&R 1st. ǤƱͤǤlong κͤۤ K&R 1st. Ǥ long ͤɾ줿ΤФơC90 Ǥ unsigned long ɾȤäƤޤ

: 4ʿǧ뤬ɾꥪСեꤹΤ 2 ʿǧʤΤ 0

n.12.5. L, l

#if Ǥ L, l դȡɾǤʤФʤޤK&R 1st. Ǥ long κͤۤʤˤĤƤƱǤץץǤϤҤϤäƤʤƤɾƱǤ

: 2

n.12.6. U, u

#if Ǥ U, u դȡɾǤʤФʤޤ󡣤 K&R 1st. ˤϤʤC90 Ǹǧ줿ˡǤ

: 6

n.12.7.

#if ǤοⰷʤФʤޤK&R 1st. λͤǤ

: 4

e.12.8. ȡͤɽǤϰϤˤʤ

C90 Ǥϡ#if ˸ȡͤ long ޤ unsigned long ɽǤϰϤˤʤ violation of constraintʿХ顼Ȥʤޤ #if ˤĤľܵꤵƤ뤳ȤǤϤޤ󤬡̤ˤĤƤε꤬ꡢ#if 㳰ǤϤʤȹͤޤ*1
ʤʸ overflow ˤĤƤϡe.32.5., e.33.2, e.35.2 ǥƥȤޤ

: 2

:

*1 C90 6.4 Constant expressions  -- Constraints 
   C99 6.6 Constant expressions -- Constraints

n.llong. long long / unsigned long long ɾ

C99 #if ǤϾʤȤ long long / unsigned long long ɾǤʤФʤޤ
long long κͤۤ unsigned long long ɾޤ
C99 Ǥ LL, ll, ULL, ull ȤҤɲäޤ*1

: 10ĤΥץˤĤơǤФ줾 2

:

*1 C99 6.4.4.1 Integer constants
   C99 6.6 Constant expressions -- Constraints

e.intmax. 黻η̤ intmax_t ϰϳ

C99 #if Ǥϡintmax_t, uintmax_t ϰϤۤ violation of constraint Ȥʤޤ

: 2 <stdint.h> ʤϥޥŬ˽񤤤Ƥ⤫ޤʤ

3.4.13. #if α黻

#if ΰǤ ̤٤ȼΤ褦ʰ㤤Ǥ

  1. C90 Ǥ int longunsigned int unsigned long ƱɽĤΤ褦ɾ롣C99 Ǥ int, long intmax_tunsigned int, unsigned long uintmax_t ƱɽĤΤ褦ɾ롣
  2. defined 黻ҤȤ롣
  3. ޥŸ˻Ĥä identifier Ϥ٤ 0 ɾ롣*1
  4. ץץǤ keyword ¸ߤʤΤǡkeyword Ʊ̾ identifier ñʤ identifier Ȥư롣äơ㥹Ȥ sizeof ϻȤʤ

ؿƤӽФޱ黻Ҥϡ̤ǤȤޤѿǤϤʤΤǡ󥯥ȡǥȡȤޤ
n.13 Ǥϰ̤ȶ̤ɾ롼ˤĤƥƥȤޤΤ n.13.5 K&R 1st. ȤѤäȤǡn.13.6. pre-Standard #if ǤϤޤޤäȤǡn.13.13., n.13.14 K&R 1st. ǤΤǤʤäΤǤ¾ K&R 1st. ޤäѤäƤޤ*2
ʤ#if int ͤɾǤʤϤˤĤƤ⤳Υ롼ΥƥȤǤ褦ˡn.13. ǤϤ٤ƾͤȤäƤޤ󡣤ޤ黻 defined, >= n.13 ˽ФƤޤ󤬡¾Τɤ˽ФƤƤޤ

:

*1 C++ Standard Ǥ true, false ̰졢줾 1, 0 ɾ롣ϥޥǤϤʤ keyword Ǥ뤬ץץǤ boolean literal Ȥư뤳ȤˤʤäƤ롣

*2 C90 6.3 Expressions 
   C90 6.4 Constant expressions 
   C99 6.5 Expressions
   C99 6.6 Constant expressions

n.13.1. <<, >>

ӥåȥեȱ黻ϾʤȤ˴ؤƤϡݤϲ⤢ޤ

: 2

n.13.2. ^, |, &

ϤηϰϤˤޤäƤ¤ꡢƱͤΥӥåȥѥ CPU ϤΤˤ餺ƱʤΤǡ^, |, & Ȥ츫 CPU λͤ˰¸ʱ黻⡢ϰϤǤϤɤνϤǤޤäƱ̤ˤʤޤ

: 2

n.13.3. ||, &&

ǤʤϤϤʤǤ礦

: 4

n.13.4. ? :

ǤʤϤϤʤǤ礦ʤȻפ줿ºݤˤϤʤʤˡ

: 2

n.13.5. <<, >> Ǥ̾λѴϹԤʤ

¿Σ黻ҤǤξդη򤽤뤿 usual arithmetic conversion ̾λѴˤԤޤK&R 1st. Ǥϥեȱ黻ҤǤ⤳줬Ԥ뤳ȤˤʤäƤޤStandard C ǤϹԤʤȤˤʤޤդͤϾ˾Ǥ뤳ȡʳɽǤϡѴ줿ΤǤϥӥåȥѥѤäƤޤäƤΤ狼ʤʤäƤޤȤͤȡʵǤ礦*1

: 2

:

*1 C90 6.3.7 Bitwise shift operators ӥåñ̤Υեȱ黻 -- Semantics ̣§
   C99 6.5.7 Bitwise shift operators -- Semantics
¿Σ黻Ҥ˴ؤƤϡξդѷǤСФ̾λѴԤפȤ񤤤Ƥ뤬<<, >> ˴ؤƤϤεܤʤC89 Rationale 3.3.7 (C99 Rationale 6.5.7) ˤˤĤƤβ⤬롣

n.13.6. ̾λѴˤؤѴ

黻 *, /, %, +, -, <, >, <=, >=, ==, !=, &, ^, |, ˴ؤƤϡξդη򤽤뤿ᡢξդ operand Ф̾λѴԤޤ黻 ? : 裲裳 operand ˤĤƤƱͤǤäơʤǤȡ¾ʤѴ졢ˤʤäƤޤޤ
ʤ̤Ǥ̾λѴˡ operand int ûǤäϤФ integer promotion ĥˤԤޤ#if ǤϤ٤Ƥ operand ƱηȤưΤǡintegral promotion ȯޤ

: 6ĤΥƥȤ򣱤Ǥ뤴Ȥ 2
ɾ§ K&R 1st. ǤƱʤΤǤ뤬Υץ 0U Ȥȡ U ҤȤäƤΤǡK&R 1st. νϤǤϽǤʤ

n.13.7. ||, &&, ? : ǤɾǤڤ

||, && 黻ҤǤɾޤäƤꡢդɾǷ̤ꤹбդɾޤ? : Ǥ operand ɾ̤ˤä軰Τɤ餫ɾ졢¾ɾޤ*1
äơɾʤˤϤȤ 0 ˤäƤ⥨顼ˤϤʤޤ

: 6ĤΥץΤԤĤ뤴Ȥ 2 İʲʤΤ 0 ְäǥåФΤ 2

:

*1 ? : 黻ҤǤϤ operand 軰 operand Ȥδ֤̾λѴϹԤ뤳ȤˤʤäƤ롣ɾʤΤѴȤ̯ʤȤǤ롣Ȥ #if ǻȤȡͤɾʤȷޤʤΤǡʤȸäƤդ̵Ǥ뤬ˤȽꤹ뤿ˤϡͤɾ򤨤ʤ0 ˤϤƤϤʤΤǤ롣äʤȤǤ롣

n.13.8. ñ黻 -, +, !, ~ Υ롼ײ

n.13.8 n.13.12 ޤǤ #if Υ롼ײΥƥȤǤϱ黻Ҥ̤ͥȷ絬§˽äƥ롼ײޤ̤Ǥ̤ͥ˹ʸǷޤʬޤ#if ϥ롼ԥ󥰤 (, ) ʳˤϹʸȤʤȤϤޤn.13.8. n.13.10 ޤǤϷ絬§ΥƥȤǡn.13.8. ñ黻 -, +, !, ~ η絬§ΥƥȤǤñ黻ҤϤⱦ麸ط礵ޤ

: 2

n.13.9. ? : Υ롼ײ

黻 ? : ϱ麸ط礵ޤ

: 2

n.13.10. <<, >> Υ롼ײ

黻ҤϤ⺸鱦ط礵ޤn.13.10. Ǥ <<, >> ΥƥȤ򤷤ޤ

: 2

n.13.11. ̤ͥΰۤʤ黻ҤΥ롼ײΣ

ñ黻 -, +, ! ȣ黻 *, /, >> Ȥ̤ͥ絬§ۤʤ黻Ҥδޤޤ뼰ΥƥȤ򤷤ޤ

: 2

n.13.12. ̤ͥΰۤʤ黻ҤΥ롼ײΣ

ñ黻 -, +, ~, ! ȣ黻 -, *, %, >>, &, | ^, ==, !=ˣ黻 ? : ޤवʣʼΥ롼ײΥƥȤ򤷤ޤ

: 2

n.13.13. 黻ҤŸޥ

#if ˤϥޥޤळȤǤޤ Υޥ̾ŸΤǤˤĤƤ n.10.1, n.12.1, n_12.2, n.13.7 ΥƥȤ˴ޤޤƤΤǡǤϤ餿ƥƥȤޤ
黻ҤŸޥȤΤϿҾʤΤǤϤޤ󤬡Ϥ긶§ȤƱ黻ҤȤư٤Ǥ礦ISO C 1990 / Amendment 1 Ǥ <iso646.h> ȤɸإåꤵޤϤĤα黻ҤޥΤǤ (*1)&, |, !, ^, ~ ȤäʸȤʤƤ⥽񤯤ȤǤ褦ˡȤݤΤ褦Ǥץץ #if ǤϤΥޥŸʤ顢黻ҤȤưȤޤ
¾ #if Υޥ defined Ÿ undefined Ȥ꤬ޤdefined identifier ʶ路Τ̰ˤʤäΤǤ礦u.1.19 ȡˡ

: 4

:

*1 C++ Standard Ǥϡʤ identifier ͱ黻ҤϥޥǤϤʤ token Ǥ롣

n.13.14. ĤΥȡŸޥ

ĤΥȡŸޥޤ #if ҾʤΤǤϤޤ󤬡ϤϤꤽΥޥȤŸ˾ɾ٤Ǥ礦

: 2

3.4.14. #if Υ顼

e.14.1 e.14.10 ޤǤ #if Ǥ violation of syntax rule violation of constraint ΥƥȤǤϤϤΤɤ줫Ĥޤह٤ƤΥФơǥåФɬפޤ*1

:

*1 C90 6.8.1 Conditional inclusion դ
   C90 6.4 Constant expressions 
   C99 6.10.1 Conditional inclusion
   C99 6.6 Constant expressions

e.14.1. ʸƥ

#if Ǥꡢݥ󥿤ϻȤʤΤǡʸƥϻȤޤ

: 2

e.14.2. 黻 =, ++, --, .

#if ǤΤǡѤı黻ҤѿϻȤޤ A --B A - -B Ȥϰä violation of constraint Ǥ

: 4ĤΥץΤǤǤʤΤУĤ 2 İʾ夢 0

e.14.3. 뤷ʤ

黻Ҥ operand ʤäꡢäбȤʤäꤹΤϡ violation of syntax rule Ǥ

: 2

e.14.4. #if defined Υå

#if Ԥ defined Ȥ黻Ҥΰ (, ) ǰϤǤϤޤʤƤ⤫ޤޤ󤬡åΤ violation of constraint Ǥ

: 2

e.14.5. ʤ

#if ǼʤΤϤ violation of syntax rule Ǥ

: 2

e.14.6. ޥŸȼʤʤ

ޥȤƤʤ identifier 0 ɾޤޥŸȲʤʤäƤޤ #if ԤΰϤ violation of syntax rule Ǥ

: 2

e.14.7. Keyword ǧʤsizeof

sizeof Ȥ pp-token ϥץץǤñʤ identifier Ȥư졢#if ǤϡޥȤƤʤ 0 ɾޤint Ȥ pp-token ƱͤǤäơsizeof (int) 0 (0) Ȥʤꡢviolation of syntax rule Ȥʤޤ

: 2

e.14.8. Keyword ǧʤ̾

e.14.7 Ʊͤˡ(int)0x8000 (0)0x8000 ȤʤꡢϤ violation of syntax rule Ȥʤޤ

: 2

e.14.9. 0 ˤ

e.14.9 ȼ e.14.10 ˤĤƤϡǥåФ٤ɤĤβ;Ϥꡢ꤬ޤǤʽˤϼΤ褦ʵ꤬ޤ

  • C90 6.4 Constant expressions -- Constraint
  • C99 6.6 Constant expressions -- Constraint
    Each constant expression shall evaluate to a constant that is in the range of representable values for its type.
    ɾ̤ϡηɽǽͤϰˤǤʤФʤʤ

εŬϰϤ餫ǤϤޤ󤬡ʤȤɬפʤȤˤŬѤ뤳ȤϼǤ#if ϤǤʤФʤޤ󡣤¾ǼΤ褦ʵ⤢ޤ

  • C90 6.3.5 Multiplicative operators 黻 -- Semantics ̣§
  • C99 6.5.5 Multiplicative operators -- Semantics
    if the value of the second operand is zero, the behavior is undefined.
    2ڥɤͤ0ξ硢ư̤Ȥ롣

  • C90 6.1.2.5 Types
  • C99 6.2.5 Types
    A computation involving unsigned operands can never overflow,
    ̵ڥɤޤ׻ϡ褷ƥСեʤ

0 ˤʤ黻ǤϡɤεŬѤ٤Ǥ礦 ɤβ⤢ꤦ褦˻פޤ

ǤϤ᤹뤳Ȥˤޤ

׵ᤵȤǤ 0 ˤޤơηϰϤˤޤʤ̤Ȥʤϸ§ȤƿǥåФʤФʤʤ

Ǥ̤ˤʤȤΤϥץδְ㤤ͤ줺ϼ¹ԻǤϤʤѥɾΤʤΤǡ˿ǥåФΤȻפ뤫Ǥޤ0 ˤ㳰ΤԼǤ̵黻η̤ϰϳȤʤˤĤƤϵΤޤŤˤʤΤǡˤϴޤ᤺undefined Ȳ᤹뤳Ȥˤޤ

ISO 9899:1990 / Corrigendum 1 ǤϡViolation of syntax rule or constraint СȤ¾ΤȤ undefined or implementation-defined Ū˵ꤵƤƤ⡢ϤϿǥåФʤФʤʤפȤ꤬ɲäޤ C99 ˤѤƤޤ*1

: 2

:

*1 C99 5.1.1.3 Diagnostics

e.14.10. 黻η̤ɽǤϰϤˤʤ

C90 Ǥϡ#if ͤ long / unsigned long ɽǤϰϤˤʤФʤޤ

: 4 ĤΥƥȤ򤹤٤ǤǤ 4 ĤǤǤ 2 İʲǤǤʤ 0

3.4.15. #ifdef, #ifndef

n.15 #ifdef, #ifndef ˴ؤƥȤǤ K&R 1st. Ǥ Standard C ǤޤäƱǤe.15 Ϥ violation of syntax rule ΥƥȤǤ*1

:

*1 C90 6.8 Preprocessing directives  -- Syntax ʸ§
   C90 6.8.1 Conditional inclusion դ
   C99 6.10 Preprocessing directives -- Syntax
   C99 6.10.1 Conditional inclusion

n.15.1. #ifdef ˤޥΥƥ

: 6

n.15.2. #ifndef ˤޥΥƥ

: 6

e.15.3. ̻ҤǤʤ

#ifdef, #ifndef Ԥΰ identifier ǤʤФʤޤ

: 2

e.15.4. ;פʰ

#ifdef, #ifndef Ԥΰ identifier ʳ;פʥȡ󤬤äƤϤޤ

: 2

e.15.5. ʤ

ʤΤ⡢ violation of syntax rule Ǥ

: 2

3.4.16. #else, #endif Υ顼

#else, #endif violation of syntax rule ΥƥȤǤ syntax K&R 1st. ѤäƤޤʤviolation of syntax rule or constraint ФƿǥåФʤФʤʤȤΤϡC90 ǽƵꤵ줿ȤǤˡ*1

:

*1 C90 6.8 Preprocessing directives  -- Syntax ʸ§
   C99 6.10 Preprocessing directives -- Syntax

e.16.1. #else ;פʥȡ󤬤

#else ιԤˤ¾Τɤʥȡ⤢äƤϤޤ

: 2

e.16.2. #endif ;פʥȡ󤬤

#endif ιԤˤ¾Τɤʥȡ󤬤äƤ⤤ޤ

#if     MACRO
#else   ! MACRO
#endif  MACRO

ǤϤʤ

#if     MACRO
#else   /* ! MACRO  */
#endif  /* MACRO    */

Ƚ񤭤ޤ礦

: 2

3.4.17. #if, #elif, #else, #endif бطΥ顼

#if (#ifdef, #ifndef), #elif, #else, #endif б˴ؤ violation of syntax rule ΥƥȤǤ syntax ۤ K&R 1st. ƱǤ#elif C90 ǿä줿ΤǤޤбϥեñ̤ΩäƤʤФʤʤȤϡK&R 1st. ǤΤǤϤʤäȤǤ*1

:

*1 C90 6.8 Preprocessing directives  -- Syntax ʸ§
   C99 6.10 Preprocessing directives -- Syntax

e.17.1. #if Τʤ #endif

Ԥ #if ʤΤ #endif ФƤΤϡ violation of syntax rule Ǥ

: 2

e.17.2. #if Τʤ #else

б #if Τʤ #else ְ㤤Ǥ

: 2

e.17.3. #else θˤޤ #else

#else θˤޤ #else ФƤΤ⡢󤤤ޤ

: 2

e.17.4. #else θ #elif

#else θ #elif ФƤƤ⤤ޤ

: 2

e.17.5. 󥯥롼ɤ줿ե #if Τʤ #endif

#if, #else, #endif ϥեpreprocessing fileñ̤бȤƤʤФʤޤ󡣥󥯥롼ɤ줿ե뤬ᤫ鸵եˤäΤ褦˰ȽбȤ롢ȤΤǤϥǤ

: 2

e.17.6. 󥯥롼ɤ줿ե #endif Τʤ #if

: 2

e.17.7. #endif Τʤ #if

#endif ˺뤳Ȥϼºݤˤ褯ޤϤϤФƿǥåФʤФʤޤ

: 2

3.4.18. #define

#define syntax K&R 1st. Ф C90 Ǥ #, ## 黻ҤɲäޤȤѤäƤޤ*1
C99 ǤϤ˲Ѱޥɲäޤ2.8 ȡˡ*2

:

*1 C90 6.8 Preprocessing directives  -- Syntax ʸ§
   C90 6.8.3 Macro replacement ޥִ

*2 C99 6.10 Preprocessing directives -- Syntax
   C99 6.10.3 Macro replacement

n.18.1. Object-like ޥ

#define ԤκǽΥȡϥޥ̾Ǥľ white spaces ȡ裲Υȡ ( ǤäƤ⡢ִꥹȤγϤȤߤʤ졢function-like ޥȤϤߤʤޤ󡣤ޤޥ̾θ˲ȡ󤬤ʤСΥޥϣĤΥȡޤ

: 30ĤΥޥΤΣĤǤʤ 10

n.18.2. Function-like ޥ

ޥ̾ľ white spaces Ϥޤ ( ȡ function-like ޥΥѥ᡼ꥹȤγϤȤߤʤޤε K&R 1st. ΤΤǡwhite spaces ̵ͭ˺ character-oriented ʥץץκפĤäƤޤޤȤʤäƤϤɤ褦⤢ޤ

: 20

n.18.3. ʸƥִоݤˤʤʤ

"Reiser" model ΥץץåǤϡִꥹʸƥޤʸ˥ѥ᡼ƱʬȡʬޥŸˤäư֤ޤ Standard C ϤK&R 1st. ǤǧƤʤäΤǤִ character-oriented ʥץץħ褯ͤǤtoken-oriented ʥץץǤǤ

: 10

n.vargs. Ѹİޥ

C99 ǤϲѸİޥƳޤ

: 10

e.18.4. ̾ʤ

#define ԤκǽΥȡϤ identifier ǤʤФʤޤ

: 2

e.18.5. ʤ

#define Ԥ˥ȡ󤬣ĤʤΤ violation of syntax rule Ǥ

: 2

e.18.6. Υѥ᡼

Υѥ᡼ violation of syntax rule Ǥ*1

: 2

:

*1 C90 6.5.4 Declarators  -- Syntax ʸ§
   C99 6.7.5 Declarators -- Syntax

e.18.7. ѥ᡼̾νʣ

ĤΥޥΥѥ᡼ꥹȤƱѥ᡼̾ʣΤ violation of constraint Ǥ*1

: 2

:

*1 C90 6.8.3 Macro replacement ޥִ -- Constraints 
   C99 6.10.3 Macro replacement -- Constraints

e.18.8. ѥ᡼̻ҤǤϤʤ

ޥΥѥ᡼ identifier ǤʤФʤޤ *1

: 2

:

*1 C99 Ǥ ... Ȥѥ᡼ɲä줿ִꥹ __VA_ARGS__ Ϥбüʥѥ᡼̾Ǥ롣

e.18.9. ޥִ̾ꥹȤüȤ߹碌

Standard C Ǥ identifier ʸȤ $ ǧƤޤ󤬡ǧϤŪ¸ߤƤޤΥץϤϤǥѥ뤵륽˸ΤΤǤ Standard C Ǥ $ ʸǣĤ pp-token ȲᤵΤǡޥ̾ THIS $ ʹߤ object-like ޥִꥹȤȤʤꡢTHIS$AND$THAT Ȥ̾ function-like ޥȤץΰտޤȤϤޤää̤ˤʤޤ
ISO 9899:1990 Corrigendum 1 Ǥϡ˴ؤ㳰Ū꤬ɲäޤФƤ Standard C νϤϿǥåФʤФʤʤΤǤ*1
C99 ǤϤäơ̤ object-like macro Ǥϡޥִ̾ꥹȤδ֤ white spaces ʤФʤʤȤޤ*2

: 2

:

*1 Corrigendum 1 ˤ C90 6.8 Constraints ؤɲá
C++ Standard ǤϤεϾäƤ롣

*2 C99 6.10.3 Macro replacement -- Constraints

e.vargs1. ִꥹȤǤϤʤȤ __VA_ARGS__

C99 βѰޥǤϡޥΥѥ᡼ꥹ ... бѥ᡼ȤִꥹǤ __VA_ARGS__ Ȥޤ identifier ϤʳΤȤ˻ȤäƤϤޤ

: 2ĤΥץǤǤ 2 ĤǤ 0

3.4.19. ޥκ

ޥκˤĤƤ K&R 1st. Ǥϲ⿨Ƥ餺ޤޤǤStandard C ǤϡƱϵ뤬ۤʤǧʤȤˤʤޤޥϻ¾塢ʤȤˤʤޤ#undef Ǥääʤ¤ˡ*1, *2

:

*1 C90 6.8.3 Macro replacement ޥִ -- Constraints 
   C99 6.10.3 Macro replacement -- Constraints

*2 ˥󥰤ФǺǧϤ¿mcpp ¸νϤȤθߴΤᡢV.2.4 Ϥ

n.19.1. ִꥹȤ white spaces ΰ㤤

White spaces οäƤϵޤ

:4

n.19.2. ѥ᡼ꥹ white spaces ΰ㤤ȹԤޤ white spaces ΰ㤤

White spaces ˤϡ<backslash><newline> sequence 䥳ȤˤäƥԤޤΤޤޤޤ

: 4

e.19.3. ִꥹȤΥȡ󤬰㤦

ִꥹȤΥȡ󤬰ۤʤ violation of constraint Ǥ

: 4

e.19.4. ִꥹ white space ̵ͭ㤦

ִꥹ white space ̵ͭۤʤ violation of constraint Ǥˤ character-oriented ʥץץοĤäƤޤ

: 4

e.19.5. ѥ᡼λȤ㤦

ѥ᡼λȤΰ㤦ϼ¼ŪˤۤʤʤΤǡviolation of constraint Ǥ

: 4

e.19.6. ѥ᡼̾㤦

ѥ᡼̾㤦μ¼ŪƱ violation of constraint Ȥʤޤ constraint Ȼפޤ

: 2

e.19.7. Function-like, object-like ޥ̾ζ

ޥ̾ϰĤ֤̾°Τǡfunction-like ޥ object-like ޥȤƱ̾ȤȤϤǤޤ

: 2

3.4.20. Keyword Ʊ̾Υޥ

ץץǤ keyword ¸ߤʤΤǡkeyword Ʊ̾ identifier ޥȤŸ뤳ȤǤޤ*1

:

*1 C90 6.1 Lexical elements  -- Syntax ʸ§
   C99 6.4 Lexical elements -- Syntax
   C89 Rationale 3.8.3 (C99 Rationale 6.10.3) Macro replacement

n.20.1. ̾Ϥ٤ŸоݤȤʤ

: 6

3.4.21. Pp-token ʬΥפޥŸ

ե pp-token ؤʬ translation phase 3 ǹԤޤ ơΤȤʣ pp-token Ĥ pp-token Ϣ뤵ȤΤϡ## 黻ҤȤä줿ޥŸϢ뤵硢# 黻ҤȤä줿ޥŸʸ󲽤硢ܤʸƥ뤬Ϣ뤵礷ꤵƤޤ󡣤äơʣ pp-token ۤΤϢ뤵뤳ȤϡäƤϤʤʤȤȲᤵޤ token-oriented ʥץץθ§餹ȡΤȤǤ*1

:

*1 C90 5.1.1.2 Translation phases ե
   C90 6.8.3 Macro replacement ޥִ
   C99 5.1.1.2 Translation phases
   C99 6.10.3 Macro replacement

n.21.1. Pp-token ۤΤϢ뤵뤳ȤϤʤ

ץץΩץǹԤϡΥץνϤΣĤ - Ĥ̡ pp-token Ǥ뤳ȤѥΤˤ狼褦ˡ򲿤餫 token separator ʬΥϤɬפޤ

: 4

n.21.2. ޥΥޥʬΥ

ޥΰ˥ޥä⡢Ÿִ̤ꥹ pp-token ȤäĤƤޤäƤϤޤ

: 2

3.4.22. Pp-number Υޥ sequence

Preprocessing-number Standard C ǽƵꤵ줿ΤǤ ȡưȡ碌ΤϰϤidentifier ʬޤळȤ⤢ޤץץǤ tokenization ñˤ뤿˵ꤵ줿ΤǤޥʬ pp-number 硢ñ tokenization 򤽤̤ˤʤȡְ㤤ޤ*1

:

*1 C90 6.1.8 Preprocessing numbers 
   C99 6.4.8 Preprocessing numbers

n.22.1. Pp-number Υޥ sequenceΣ

12E+EXP Ȥ sequence ϣĤ pp-number ʤΤǡȤ EXP ȤޥƤƤ⡢Ÿ뤳ȤϤޤ

: 4

n.22.2. Pp-number Υޥ sequenceΣ

Pp-number digit ޤ . ǻϤޤޤ

: 2

n.22.3. Pp-number γΥޥŸ

C90 Ǥϡ+ ޤ - E ޤ e ˤ³ pp-number ˸뤳ȤǤޤ12+EXP 12E+EXP Ȱ㤤12 + EXP ȤĤ pp-token ʬ򤵤ޤϤ줾 pp-number, operator, identifier ǤEXP ޥǤСŸޤ

: 2

n.ppnum [Pp][+-] sequence

C99 Ǥϡư򣱣ʤɽ뤿ˡpp-number P ޤ p + ޤ - ³ sequence ɲäޤ
ʤprintf() ư򣱣ʤɽˤ %a, %A Ȥ conversion specifier Ȥޤ*1

: 4

:

*1 C99 7.19.6.1 The fprintf function -- Description

3.4.23. ## 黻ҤȤäޥ

## C90 ǿ줿黻Ҥǡ#define ԤִꥹǤȤޤ## pp-token ϥޥŸϢ뤵ƣĤ pp-token Ȥʤޤ## pp-token ѥ᡼ξϡޥŸ˼°֤ƤϢ뤵ޤ*1

:

*1 C90 6.8.3.3 The ## operator ##黻
   C99 6.10.3.3 The ## operator

n.23.1. ȡϢ

## 黻ҤȤäǤñ function-like ޥǤ

: 6

n.23.2. Pp-number

## 黻Ҥ operand ϥޥŸʤΤǡ xglue() Τ褦ˤ⤦Ĥΰ츫̣ʤʥޥ򤫤֤ƻȤȤФйԤޤϰΥޥŸƤϢ뤹뤿ǤΥץΥޥƤӽФ줿 12e+2 Ȥ sequence ͭ pp-number Ǥ

: 2

e.23.3. ## ˥ȡ󤬤ʤobject-like ޥ

ִꥹ ## 黻Ҥˤɬ pp-token ʤФʤޤ󡣤 object-like ޥǤObject-like ޥ ## ȤȤ̵̣ǤǤϥ顼ǤϤޤ

: 2

e.23.4. ## ˥ȡ󤬤ʤfunction-like ޥ

function-like ޥִꥹ ## 黻Ҥ pp-token ΤʤǤ

: 2

3.4.24. # 黻ҤȤäޥ

# 黻Ҥ C90 Ƴ줿ΤǤFunction-like ޥ #define ԤִꥹȤǤȤޤ# 黻Ҥ operand ϥѥ᡼ǡΥޥŸб°ʸƥѴޤ*1

:

*1 C90 6.8.3.2 The # operator #黻
   C99 6.10.3.2 The # operator

n.24.1. ʸ

# 黻Ҥ operand бξü " " ǰϤޤʸ󲽤ޤ

: 6"a + b" ȥȡ֤ space Τ 2

n.24.2. ȡ֤ white spaces ΰ

# 黻Ҥ operand бʣ pp-token sequence ΩäƤϡ pp-token ֤ white spaces a space ѴƤʸ󲽤졢white spaces ʤ space ޤ󡣤ʤwhite spaces οˤϱƶʤΤΡ̵ͭˤäƷ̤äƤޤʤ character-oriented ʥץץοĤäƤˡ white spaces Ϻޤ

: 4

n.24.3. \

# 黻Ҥ operand бʸƥޤʸϡˤ \, " ʸƥϤ " ʸľ \ ޤʸƥʸ򤽤Τޤޤηɽ뤿ʸƥˡƱǤ

: 6

n.24.4. <backslash><newline> ޤޥƤӽФ

<backslash><newline> sequence translation phase 2 Ǻޤ顢ޥŸˤϻĤäƤޤ

: 2

n.24.5. ޥŸη̤ token separator Ĥʤ

̤˥ޥŸǤϤη̤ pp-token ȤäĤƤޤʤ褦˲餫 token-separator 뤳ȤԤޤ3.4.21 ȡˡޥŸη̤ʸ󲽤ϡϺʤФʤޤ
ʤ token-based ʽ§Ȥʤ character-oriented ʬäƤ뤿ˡ䤳꤬ȯޤ

: 2

e.24.6. # 黻Ҥ operand ѥ᡼̾Ǥʤ

# 黻Ҥ operand ϥѥ᡼̾ǤʤФʤޤ

: 2

3.4.25. ޥΥޥŸ

Function-like ޥθƤӽФ˺ݤơ˥ޥޤޤƤˤ򤤤Ÿ뤫ˤĤƤϡK&R 1st. ǤϿƤޤǤPre-C90 νϤǤμޤޤä褦ǤִꥹȤκŸΤ¿ä⤷ޤStandard C ǤϤϡƱꤷȡѥ᡼֤ŸȵꤵޤؿƤӽФǤΰɾƱͤνǡ狼䤹ʤޤ #, ## 黻Ҥ operand Ǥѥ᡼бΤξϡ˥ޥ̾ޤޤƤƤ⡢ϥޥƤӽФȤϤߤʤ줺Ÿޤ*1

:

*1 C90 6.8.3.1 Argument substitution °ִ
   C99 6.10.3.1 Argument substitution

n.25.1. ΥޥŸ

ΥޥϡƱꤵ줿ȤŸ졢줫ִꥹΥѥ᡼֤ޤäơĤΰȤƱꤵ줿ΤϡȤŸʣΰΤ褦ʷˤʤäƤ⣱ĤΰǤ

: 4

n.25.2. ĤΥȡŸ

ƱͤˡŸȣĤΥȡˤʤäƤޤ⡢ˡŪʤΤǤ

: 2

n.25.3. ## 黻ҤȤޥǸƤӽФ

## 黻Ҥ operand ѥ᡼ξ硢бϥޥŸʤΤǡޥŸϤ⤦ĤΥޥͥȤɬפޤ
Ǥϡxglue() ## 黻ҤȤäƤʤΤǡΰǤ glue( a, b) ϥޥŸ ab Ȥʤꡢxglue() ִꥹȤ glue( ab, c) Ȥʤޤ줬 abc ǽ̤Ȥʤޤ

: 2

n.25.4. ## 黻Ҥ operand Ÿʤ

glue() ľܸƤӽФƤΤǡΰ˥ޥ̾äƤŸޤ

: 6

n.25.5. # 黻Ҥ operand Ÿʤ

# 黻Ҥ operand Ǥѥ᡼б⡢ޥŸޤ

: 4

e.25.6. ΥޥŸϰϤǴ뤷ʤ

ΥޥŸϤΰǹԤޤ뤷ʤޥ violation of constraint ǤFunction-like ޥ̾ϤǤϥޥƤӽФǤϤޤ󤬡 ( ³ȡ줬ޥƤӽФ sequence γϤȤʤޤϤ줿Ǹ塢 ( б ) ʤФʤޤ*1

: 4

:

*1 C90 6.8.3 Macro replacement ޥִ -- Constraint 
   C99 6.10.3 Macro replacement -- Constraints

3.4.26. ޥƱ̾ޥ

ޥƵŪˤʤäƤ硢Υޥ򤽤ΤޤŸƤ椯̵ºƵˤʤäƤޤޤΤᡢK&R 1st. ǤϺƵŪʥޥȤȤǤޤǤStandard C Ǥ̵ºƵɤʤƵŪޥŸǽˤ뤿ᡢִޥ̾ϺִʤȤ꤬ߤޤεϤʤǤΤ褦˥ѥե졼Ǥޤ*1

  1. ޥ A ִꥹȤκˤޤ A Ȥ̾ĤäƤ⡢Ϻִʤ
  2. ޥ A ִꥹ˥ޥ B θƤӽФꡢޥ B ִ A Ȥ̾ФƤͥȤ줿ִξ⡢ A Ϻִʤ
  3. ޥ B ִǸΥޥ A ִꥹȤθΥȡ󤬼ޤ줿ϡμޤ줿ʬˤ A ִ롣ִΤϡ A ʲ餫ΥޥִꥹǤϤʤ˥ˤ˸¤롣
  4. ޥ B ִˤĤƤ⡢飳ƵŪŬѤ롣ʤޥ B ִˤޤ B 졢줬 B ִꥹȤθΥΥȡˤΤǤʤС B Ϻִʤ
  5. Υޥ A θƤӽФΰ˥ޥ C θƤӽФꡢִ˸줿 C 飳ŬѤƺִػߤ줿硢 C ϸΥޥ A ִꥹȤκǤִʤ

ѥե졼ƤޤǤȤˣϡ³ΥȡμߤȤŪʥޥͤͳ褹Τǡ줬̵ѤѻˤƤޤˤĤƤϵʤ corrigendum ФꤷƤƤޤ󤬤餬Ǥޤ³ȡ󤬥ˤȤǤʤȤŸˡѤȤΤ⡢ΤʤͤǤ*2

³ȡޥŸȤΤ۾ʤΤǤˡʬˤäִػߤ줿ޥٸȤΤŤ˰۾ʥǤ Validation Suite ǤϡŤ˰۾ʥޥˤĤƤΥƥȹܤ n.27.6 ޤ󡣡ָ³ȡμߡפȤޥŸΰ۾ʵ꤬뤳Ȥ򡢴ԤȻפޤ*3

:

*1 C90 6.8.3.4 Rescanning and further replacement Ⱥִ
   C99 6.10.3.4 Rescanning and further replacement

*2 2.7.6 ȡ

*3 ƵŪޥŸ˴ؤ뵬ʤλͤˤĤƤϡˣ̤β᤬ꡢ newsgroup comp.std.c 褬󤫹ԤƤ롣recurs.t ϤǺΣĤǤ롣recurs.t ΥȤ򻲾Ȥ줿ΥץɾоݤȤϤʤ

mcpp Standard ⡼ɤǤϡƵŪޥŸˤĤƤĤˡƤ롣ǥեȤǤƱ̾ޥִػߤϰϤ嵭 1-5 ΤȤ깭ȤꡢΥץ NIL(42) Ÿ롣-@compat ץꤹȺִػߤϰϤ򶹤Ȥꡢ42 Ÿ롣λͤΰ㤤ФƤΤϡ嵭 3 Ǵؿޥ A θƤӽФȾʬ B ִꥹ˸Ǥ롣ǥեȤǤϡA ̾ B ִꥹ˸줿 A κִػߤ뤬-@compat ץǤϡA ̾ǤʤꥹȤȤϤ '(' ')' Τ٤Ƥ B ִꥹ˸줿ִػߤ롣ޤA ̾ˤ뤫ɤǶ̤ʤ

n.26.1. ľܺƵ object-like ޥϺŸʤ

object-like ޥľܺƵǤ

: 2

n.26.2. ܺƵ object-like ޥŸʤ

Object-like ޥδܺƵǤ

: 2

n.26.3. ľܺƵ function-like ޥŸʤ

Function-like ޥľܺƵǤ

: 2

n.26.4. ܺƵ function-like ޥŸʤ

Function-like ޥδܺƵǤ

: 2

n.26.5. κƵŪޥ

Standard C ˤϡְٺִػߤ줿ޥϡ̤ʸ̮ǺƤִʤפȤ̣ʵ꤬ޤŪˤ˳ΤϰΥޥοƥޥΰǤ˺ƵŪޥäϡ٤ִޤ󤬡ϿƥޥκǤִޤ

: 2

3.4.27. ޥκ

ޥִꥹȤΤ K&R 1st. λͤǤȯ줿ޥϺƵŪޥǤʤ¤ꡢִޤˤäơͥȤ줿ޥޤStandard C Ǥäѹä櫓ǤϤޤ󤬡K&R 1st. ǤΤǤʤäȤ餫ΤˤʤäƤޤ*1

:

*1 C90 6.8.3.4 Rescanning and further replacement Ⱥִ
   C99 6.10.3.4 Rescanning and further replacement

n.27.1. Object-like ޥΥͥ

K&R 1st. ǤƱǤ

: 6

n.27.2. Function-like ޥΥͥ

K&R 1st. ǤƱǤ

: 4

n.27.3. ## 黻Ҥ줿̾ŸоݤȤʤ

## 黻Ҥ operand бϥޥŸޤ󤬡pp-token Ϣˤä줿 pp-token ϡ˥ޥŸоݤȤʤޤ

: 2

n.27.4. ִꥹ˷줿 function-like ޥ

Function-like ޥ̾ФƤƤ⡢ ( ³ƤʤϡϥޥƤӽФȤϤߤʤޤ󡣰 function-like ޥ̾졢ִꥹˤ̾Ȥä function-like ޥθƤӽФȡŸޤ

: 4

n.27.5. Function-like ޥȾִꥹ

ִꥹȤ function-like ޥθƤӽФȾȤ۾ʥޥϡpre-Standard ǤϰۤλͤǤStandard C ǤϸǧƤޤޤִꥹȤθ pp-token 󤬼ޤơޥƤӽФ뤷ޤ

: 2

n.27.6. ִƱ̾ޥ

Ǥϰ̤Ʊ̾ΥޥϺִޤ󤬡ִ⤢ޤͥȤ줿ޥƤӽФǺִꥹȤθΥ pp-token ߡƱ̾ޥȤ۾ʾǤ3.4.26 򻲾ȡˡ

: 2

e.27.7. ˰οʤ

Function-like ޥθƤӽФǤϰοѥ᡼οȰפƤʤФʤޤ󤬡ִꥹȤκȯ줿 function-like ޥǤ⡢ƱͤǤ , ǶڤΤʤΤǡȥåʥޥǤϰοľŪˤ狼ˤȤޤ

: 2

3.4.28. ޥ

C90 ǤϣĤüʥޥϤ뤳Ȥˤʤޤ*1
C90 / Amendment 1 Ǥϡ__STDC_VERSION__ Ȥޥɲäޤ
__FILE__, __LINE__ ưŪѲƤ椯üʥޥǤassert() ޥǥХåѥġǤλȤƻޤ¾ɸޥϣĤ translation unit νѲޤ

:

*1 C90 6.8.8 Predefined macro names 餫줿ޥ̾

*2 C99 6.10.8 Predefined macro names

n.28.1. __FILE__

ץץΥե̾ɽʸƥޤ #include ˤäƼޤ줿եǤϤΥե̾ˤʤΤǡƱ translation unit ǤѲޤ

: 4"n_28.t" ȤʸƥǤʤ n_28.t Ȥäñʤ̾ˤʤΤ 0

n.28.2. __LINE__

ץץΥեιֹɽޤֹϣϤޤޤֹʪԤֹǤ

: 4ֹ椬 0 ϤޤΤ 2

n.28.3. __DATE__

ץץιԤƤդɽʸƥޤ asctime() ؿΤȤۤƱ "Mmm dd yyyy" ηǤ 10 ̤ξ dd Σܤ 0 ǤϤʤ space ˤʤȤäƤޤ

: 410 ̤ξ dd Σܤ 0 ȤʤΤ 2

n.28.4. __TIME__

ץץιԤƤɽʸƥޤasctime() ؿΤƱ "hh:mm:ss" ηǤ

: 4

n.28.5. __STDC__

C90, C99 νϤǤ 1 ޤ

: 4

n.28.6. __STDC_VERSION__

C90 / Amendment 1:1995 бϤǤϡ줬 199409L ޤ*1

: 4

:

*1 Amendment 1 / 3.3 Version macroISO 9899:1990 / 6.8.8 ؤɲá

n.stdmac. C99 λޥ

C99 Ǥ __STDC_VERSION__ ͤ 199901L Ǥ
ޤ__STDC_HOSTED__ Ȥޥɲäޤ ϽϤ hosted implementation Ǥ 1 ˡǤʤ 0 ޤ

: 4 2

n.28.7. 󥯥롼ɤ줿ե __LINE__

__FILE__, __LINE__ translation unit ǤϤʤեоݤȤΤǡinclude 줿ǤϤ include ե̾ȹֹˤʤޤ

: 4ֹ椬 0 ϤޤΤ 2

3.4.29. #undef

#undef K&R 1st. Τǡ礭ѲϤޤ󡣻ꤵ줿ޥäޤޥƱ translation unit ǡ#define Ƥ #undef ǼäޤǤδ֤ͭϰϤǤ*1

:

*1 C90 6.8.3.5 Scope of macro definitions ޥͭϰ
   C99 6.10.3.5 Scope of macro definitions

n.29.1. #undef ˤޥμä

#undef 줿ǤϤΥޥ̾ϤϤޥǤϤޤ

: 10

n.29.2. Ƥʤޥ #undef

ޥȤƤʤ̾ #undef 뤳ȤϵƤޤ ϤϤ򥨥顼ˤƤϤޤ

: 4

e.29.3. ̾ʤ

#undef Ԥˤ identifier ɬפǤ

: 2

e.29.4. ;פʥȡ󤬤

#undef ԤˤϣĤ identifier ʳΤΤäƤϤޤ

: 2

e.29.5. ʤ

#undef Ԥ˰ʤΤ violation of syntax rule Ǥ

: 2

3.4.30. ޥƤӽФ

ޥƤӽФ˺ݤƤϡԤñʤ white spaces ΣĤȤưޤ äơޥƤӽФʣιԤˤޤ뤳ȤǤޤ K&R 1st. ǤΤǤϤޤǤ*1
ؿͥޥƤӽФΰȤΤ , Ƕڤ줿ΤǤ( ) ΥڥäƤ , ϰڤΤȤϤߤʤޤ󡣤ΤȤϤǤľܤϥƥȤޤ󤬡n.25. ᡢǰۤΤ˥ƥȤƤޤޤ*.c Υץ¿ assert() ޥȤäƤΤǡ˴ؤƤϤʤʣʥƥȤ뤳Ȥˤʤޤ

:

*1 C90 6.8.3 Macro replacement ޥִ -- Semantics ̣§
   C99 6.10.3 Macro replacement -- Semantics

n.30.1. ޥƤӽФʣԤˤޤ뤳ȤǤ

: 6

n.nularg. ޥƤӽФΥ

C99 ǤϥޥƤӽФǥǧޤ ϰβᾯȤϰۤʤޤʬΥ ',' ϾάǤޤʥѥ᡼ĤξϤξԤ̤Ǥʤˡ

: 6

3.4.31. ޥƤӽФΥ顼

ϥޥƤӽФΤĤΥ顼Ǥ

e.31.1. ¿

οѥ᡼οȰäƤΤ violation of constraint ǤUndefined ǤϤޤ*1

: 2

:

*1 C90 6.8.3 Macro replacement ޥִ -- Constraint 
   C99 6.10.3 Macro replacement -- Constraints

e.31.2. ­ʤ

οѥ᡼ο꾯ʤΤ violation of constraint Ǥ
C99 Ǥϥǧޤ ϰβᾮȤϰۤʤޤʬΥ ',' ǡƤƤϤޤ

: 2

e.31.3. ǥ쥯ƥֹԤǴ뤷ʤޥƤӽФ

̤ˤϥޥƤӽФʣιԤˤޤ뤳ȤǤޤ# ǻϤޤ preprocessing directive line ϤιԡʥȤ a space ѴιԡˤǴ뤹ΤǡˤޥƤӽФ⤽ιԤǴ뤷ƤʤФʤޤ

: 2

e.vargs2. Ѱޥΰʤ

C99 βѰޥǤ __VA_ARGS__ б°ϡʤȤ⣱ĤɬפǤ

: 2

3.4.32. #if ʸ

#if ǤʸȤȤǤޤɾϤۤȤ implementation-defined ǡݡӥƥϤޤꤢޤ32.? ǤϺǤñʣХȤʸsingle-byte character constantˤ夲ޤ*1
Validation Suite i_* ΥץϤ٤ơ#if ǤδʸåȤ ASCII Ǥ뤳ȤȤƤޤ

:

*1 C90 6.1.3.4 Character constants ʸ
   C90 6.8.1 Conditional inclusion դ -- Semantics ̣§
   C99 6.4.4.4 Character constants
   C99 6.10.1 Conditional inclusion -- Semantics

ʲ33, 34, 35 ΥƥȤŵƱǤ롣

n.32.1. Character octal escape sequence

ʸǤϣ escape sequence ȤȤǤޤ ˴ؤƤϤɤνϤǤƱǡimplementation-defined ʬϤޤ

: 2

n.32.2. Character hexadecimal escape sequence

ʸǤϣ escape sequence ȤȤǤޤ implementation-defined ʬϤޤ󡣣 escape sequence K&R 1st. ˤϤʤäΤǤ

: 2

i.32.3. Single-byte character constant

Escape sequence ǤϤʤХȤʸñʤΤǤʸåȤˤäͤۤʤޤѥȼ¹ԻȤǴʸåȤ㤦ѥǤϡ#if ɾǤϤΤɤȤäƤ⤫ޤʤȤˤʤäƤޤ
ޤƱʸåȤǤäƤ⡢ΰ implementation-defined ǡ⥳ѥΡtranslation phase 7ˤȥץץphase 4ˤȤǰۤʤäƤƤ⤫ޤʤȤˤʤäƤޤ
äơ#if ʸͤ򸫤ƴʸåȤȽꤹ뤳ȤϡݾڤƤˡǤϤޤ

: 2

i.32.4. '\a', '\v'

Standard C Ǥ '\a', '\v' Ȥ escape sequence ɲäޤ

: 2

e.32.5. Escape sequence ͤ unsigned char ϰϳ

ʸΣĤ escape sequence ϣĤ single-byte character ͤɽΤʤΤǡunsigned char ϰϤˤʤФʤޤ

: 2

3.4.33. #if Υ磻ʸ

磻ʸ Standard C ǿߤ줿ΤǤ ͤɾ single-byte character constant ˤ implementation-defined ǡХȤɾƤޤ
磻ʸˤϳƼ encoding ޤ 4.1 ǤȤꤢޤ Ǥ ASCII ʸб磻ʸȤꤢޤ

e.33.2. 磻ʸͤϰϳ

磻ʸǤ⣱ʤޤϣʤ escape sequence Ȥޤͤϥ磻ʸͤʤɽϰϤˤʤФʤޤ

: 2

3.4.35. #if multi-character ʸ

ʸˤ multi-character character constant ȤΤ⤢ޤMulti-byte character constant ʶ路ѸǤ̤γǰǡʣ character ʤʸ̣ޤ character ˤϡsingle-byte character, multi-byte character, wide character ꡢ줾б multi-character character constant ΤǤʵʽǤ character ȤѸ single-byte character ΰ̣ǻȤƤ뤬ǤϣʸؤդȤƻȤˡ
Multi-character character constant λȤƻä˲ʤǤ줬 K&R 1st. ǧƤΤñˡcharacter constant η int int ϰϤΤǤвǤ⤫ޤʤȤȤˤʤȻפޤ

i.35.1. multi-character ʸɾ

Single-byte character multi-character character constant ϡK&R 1st. 餢äΤǤA.16ˡɾΥХȥ K&R 1st. Ǥ Standard C Ǥ⵬ꤵƤޤ

: 2

e.35.2. multi-character ʸͤϰϳ

ʤޤϣ escape sequence ˤ multi-character character constant ͤ̾ int ޤ unsigned int ϰϤˤʤФʤʤȹͤޤC90 Ǥ #if Ǥ int / unsigned int long / unsigned long ƱɽĤΤ褦˰Τǡlong ޤ unsigned long ϰϤˤ뤫ɤåФȹͤޤϵʤΤǤϤޤͤɾλΤΤ implementation-defined ǤΤǡϰϥå implementation-defined ǤȤǤޤ
ˤƤ⡢Υץ long ӥåȰʲνϤǤϤɤɾƤ unsigned long ϰϤĶΤǡǥåФΤŬǤ礦
C99 Ǥ #if ηϤνϤκȤʤޤ

: 2

i.35.3. Multi-character 磻ʸɾ

磻ʸ multi-character constant ȤΤ¸ߤޤ ɾλϤϤŪ implementation-defined Ǥб multi-byte character multi-character constant ȹäƤɬפޤ

: ʤ

3.4.37. Translation limits

Standard C ǤϡϤȤΤǤƼ translation limits κ¤ꤵޤεϤʤˤ䤫ʤΤǤʤθ³ͤˤĤƤ줾졢򣱤İʾޤץǤ¹ԤǤʤФʤʤȤΤǤ Validation Suite Υץ򸫤Ф狼褦ˡΥץϽϤˤȤäƺǤôʤʤ褦ˡñºŪ˽񤯤ȤǤޤ translation limits ݾڤ櫓ǤϤʤȤˡդƤTranslation limits εܰ¤ˤʤȸޤΥץϥץץδط룸 translation limits ΥƥȤ򤹤ΤǤ*1, *2, *3
ʤΥƥȥץΰϲˤޤ褦˹Ԥޤ֤ƤޤϤˤäƤϡ³νԤʤˤΥƥȤ˼Ԥ뤳ȤޤBorland C ˡ³ΥƥȤǤŪǤϤʤΤǡԤϥǥǹԤĤʤǺƥƥȤƤ

:

*1 C90 5.2.4.1 Translation limits ³

*2 C99 5.2.4.1 Translation limits

C99 Ǥϡtranslation limits ˳礵Ƥ롣 C++ Standard ǤϤ礭4.6 ȡˡ

n.37.1. ޥΣĤΥѥ᡼

C90 ǤϡޥΥѥ᡼ϣĤޤǤݾڤƤޤ

: 2

n.37.2. ޥƤӽФΣĤΰ

Ʊͤ C90 ǤϡޥƤӽФΰϣĤޤǤݾڤƤޤ

: 2

n.37.3. ʸμ̻̾

C90 ǤϡTranslation unit Ū identifierʥޥ̾⤳˴ޤޤˤƬ 31 characters ͭդǤ뤳ȤݾڤƤޤץץϤ31 ХȤ̤̾ɬפޤ*1

: 4

:

*1 C90 6.1.2 Identifiers ̻ -- Implementation limits ϸ³

n.37.4. Ťξ

C90 Ǥϡ#if (#ifdef, #ifndef) section ΥͥȤϣŤޤǤݾڤƤޤ

: 2

n.37.5. Ť #include

C90 Ǥϡ#include ΥͥȤϣŤޤǤݾڤƤޤ

: 4

n.37.6. ŤΥåդ #if

C90 Ǥϡ (, ) ΥͥȤϣŤޤǤݾڤƤޤ #if ˤŬѤȹͤޤ#if Ǥϰ̤μȰäƤޤݾڤɬפϤʤȤפ롣#if long / unsigned long ɾ뤳Ȥȡ¹ԻĶؤ䤤碌ɬפȤ¹Ի phase 7 ƱɾλǤʤƤ褤ȤȤ㳰ȤƵꤵƤơ¾¦̤Ǥ̰ƤʤΤǡʵˤʤäƤȤ⤢ˡ

: 2

n.37.7. 509 ХȤʸƥ

C90 ǤϡʸƥĹ 509 ХȤޤǤݾڤƤޤĹϥȡĹǤꡢchar ǿǤϤޤξü " ޤߡ\n ϣХȤȿޤ磻ʸƥǤ L Ȥ prefix ޤߤޤ

: 2

n.37.8. 509 ХȤ

C90 ǤϡԤĹ 509 ХȤޤǤݾڤƤޤ

: 2

n.37.9. 1024 ĤΥޥ

C90 Ǥϡޥ 1024 ĤޤǤݾڤƤޤtranslation limits εǤ⤳줬Ǥ⤢ޤʤΤǤΥץΤ褦˺ǤñʥޥФξȡĹʥޥ¿ޤȤǡϤɬפȤ̤Ϥޤäۤʤޤޤ1024 Ĥ˻ޥޤफɤǤ⡢ƥȥץबäƤޤºݤΥץǤϡ桼ץǥޥˡɸإå¿ΥޥޤεϤޤ礶äѤܰ¤ˤޤ󡣼ºݤθ³ϥƥ󶡤Ǥ̤ˤäƷޤǤ礦

: 4

n.tlimit. C99 translation limits

C99 Ǥ translation limits ˳礵ޤ

: ʲΤ줾ˤĤ 2

n.37.1.L. ޥ 127 ĤΥѥ᡼

n.37.2.L. ޥƤӽФ 127 Ĥΰ

n.37.3.L. 63 ʸμ̻̾

n.37.4.L. 63 Ťξ

n.37.5.L. 15 Ť #include

n.37.6.L. 63 ŤΥåդ #if

n.37.7.L. 4095 ХȤʸƥ

n.37.8.L. 4095 ХȤ

n.37.9.L. 4095 ĤΥޥ


3.5. ʬΥɥ

Standard C ˤ implementation-definedʽˤȸƤФʬޤ ʬλͤϽϤˤäưۤʤޤϤϤλͤɥȤ˵ܤʤФʤʤȤƤޤ*1

Implementation-defined ȤΤˤϡϤΤΤΤΤۤˡCPU ϣӤˤäƷޤʬޤޤƤޤѥξ硢CPU ϣӤȼ¹ԻȤǰۤʤ⤢ޤ

ʲιܤϥץץ˴ؤ implementation-defined ʬˤĤơϤΥɥȤ˵ܤ뤫ɤåΤǤץץǤ顢CPU ϣӤϤΤΤǤd.1.* ϥץץͭλͤǤꡢd.2.* ϥѥΤλͤȤطΤΤǤ#if ǤμɾϡѥΤȤϻͤۤʤäƤ⤫ޤʤȤˤʤäƤޤ

ʲιܤΤۤˤ⡢#if ɾˤ implementation-defined ¦̤ĤޤޤʸåȤǤʴʸåȤ ASCII EBCDIC ˡޤ encodingʣ͡ˤ⤽Ǥˡ̾λѴˤäĤʤѴ줿̤⤽ǤϤޥȣϣӤǷޤΤǤΤǤΥɥȤ­ꡢϤΥɥȤˤϵܤϤʤƤ⤫ޤʤȹͤޤäơǤϤɾоݤȤޤ

:

*1 C90 3 Definitions of Terms Ѹڤӵ
   C99 3 Terms, definitions, and symbols

d.1.1. Header-name ۤˡ

Header-name ȤΤü pp-token Ǥ <, > ޤ ", " ǰϤޤ줿 sequence ɤä header-name ȤĤ pp-token ˷礹Τ implementation-defined ȤʤäƤޤ ", " ǰϤޤ줿ΤʸƥȤ pp-token ȤưФΤǴñʤΤǤ<, > ǰϤޤ줿ΤϤüäƤޤ<stdio.h> translation phase 3 <, stdio, ., h, > ȤĤ pp-token ˤäʬ򤵤줿ǡphase 4 ǣĤ pp-token ˹뤳Ȥˤʤ뤫Ǥʬޥǽ񤫤Ƥϡ̯꤬ޤ*1

: 2ʤλͤϤΥɥȤ˵ܤƤ 2 ܤƤʤ 0
ʤheader-name ʸʸζ̵̤ͭե̾ε§ implementation-defined Ǥ뤬ϣϣӤǷޤ뤳ȤʤΤǡϤΥɥȤˤɬ⵭ܤɬפϤʤȹͤ롣

:

*1 C90 6.8.2 Source file inclusion ե -- Semantics ̣§
   C99 6.10.2 Source file inclusion

d.1.2. #include ǥإå򤵤ˡ

#include Ԥ header-name Ф줿塢 header file ɤäƤΤ implementation-defined Ǥ", " ǰϤޤ줿 header-name ξϡޤ implementation-defined ˡǥե뤬졢Ĥʤä <, > ǰϤޤ줿 header-name Ʊͤ˥뤳ȤˤʤäƤޤȤθԤޤ implementation-defined ʤΤǤΤʤǤ Standard C ϣӤˤĤ֤ȤǤʤᡢɽˤʤ餶ʤΤǤ
ǥ쥯ȥ깽¤äϣӤǤϡԤϥȥǥ쥯ȥ꤫Хѥ򡢸ԤϽϤδΥǥ쥯ȥ򥵡Ȳ򤵤ޤԤǤ include Υե뤫Хѥ򥵡Ϥ⤢ޤImplementation-defined Ǥ뤫ˤϡְ㤤Ȥϸޤ󡣤ˤĤ Rationale ϡȥǥ쥯ȥ꤫ХѥǥͤѰΰտޤǤϤ뤬ϣӤˤĤ֤ȤǤʤΤʸǤʤäƤޤ*1
ޤԤΥϥݡȤʤƤɤ", " ǰϤޤ줿 header-name <, > ȤޤäƱ˰äƤɤˤȤƤޤԤɬեǤʤƤ褤ȤƤޤϤȤ߹ߤ header ⤢ꤦȤȤǤ*2

: 4ʤ header ܤɥȤ˽ʬ˵ܤƤ 4 Խʬʵܤʤ 2 ۤȤɵܤƤʤ 0

:

*1 ANSI C Rationale 3.8.2 Source file inclusion

*2 C90 6.8.2 Source file inclusion ե -- Semantics ̣§
   C99 6.10.2 Source file inclusion

d.1.3. #include ΥͥȤθ

#include ΥͥȤɤǤ뤫 implementation-defined ǤʤȤ C90 Ǥϣ٥롢C99 Ǥ 15 ٥ݾڤʤФʤޤ*1, *2

: 2

:

*1 C90 5.2.4.1 Translation limits ³
   C99 5.2.4.1 Translation limits

*2 C90 6.8.2 Source file inclusion ե -- Semantics ̣§
   C99 6.10.2 Source file inclusion

d.1.4. Ƥ #pragma sub-directive

#pragma Ȥ preprocessing directive Ͻϸͭγĥǽꤹ뤿ѰդƤ directive ǤץץˤƤ⡢ĥǽϤ٤ #pragma sub-directive ȤƼʤФʤޤ*1

: 4νϤͭ #pragma sub-directive ˤĤơʥץץΥɥȤǤϾʤȤץץΤΤ٤Ƥ #pragma sub-directive ˤĤơ˥ɥȤ˽ʬʵܤ 4 Խʬʵܤʤ 2 ۤȤɵܤʤ 0 ޤ#pragma sub-directive ʳνϸͭ directive 2 򸺤ʤ0 ¡Standard C ˺Ǥᤤͤꤹ륪ץˤäƶػߤ directive ϴޤޤʤˡ

:

*1 C90 6.8.6 Pragma directive ץ饰޻
   C99 6.10.6 Pragma directive

d.pragma. #pragma ǤΥޥŸ

C90 Ǥϡ #pragma Ԥ pp-token ϥޥŸоݤȤʤޤǤC99 Ǥ #pragma STDC Ȥ token ³ΤϥޥŸоݤȤʤޤ󤬡ʳ #pragma sub-directive ޥŸ뤫ɤ implementation-defined Ȥʤޤ

: 2

d.1.5. ޥ

__FILE__, __LINE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ C99 Ǥ __STDC_HOSTED__ ˰ʳλޥ implementation-defined ǤϣĤ _ ʸ³̾ޤϣĤ _ ǻϤޤ̾ǤʤФʤޤ*1

: 4Խʬʵܤʤ 2 ¤ȿ̾λޥ 2 򸺤ʤ0 ¡Standard C ˺Ǥᤤͤꤹ륪ץˤäƶػߤޥɾоݤȤʤˡ

:

*1 C90 6.8.8 Predefined macro names 餫줿ޥ̾
   C99 6.10.8 Predefined macro names

d.predef. C99 λޥ

C99 Ǥϡ__STDC_IEC_559__, __STDC_IEC_559_COMPLEX__, __STDC_ISO_10646__ ȤޥˤäƻΤȤɲäƤޤ
__STDC_IEC_559__, __STDC_IEC_559_COMPLEX__ IEC 60559 ưʤ˹פǤϤ줾 1 ȤƤޤΣĤư黻Υ饤֥ˤäƷޤΤǡºݤˤ <fenv.h> ΤŬ⤷ޤɬץץåǻɬפϤʤȹͤޤ

__STDC_ISO_10646__ wchar_t ʸͤ٤ ISO/IEC 10646Unicode Ϥ Universal Character Setˤβ餫Υɲ줿Ǥϡ򤹤 ISO/IEC 10646 amendment corrigendum ޤ᤿ʤǯɽ 199712L ȤäȤƤޤ <wchar.h> 뤳Ȥͤ졢ץץåǻɬפϤʤǤ
ɤˤƤɥȤƤ뤳ȤɬפǤ

: 6ĤΤ줾ˤĤƳ 2

d.1.6. Phase 3 white-spaces 򰵽̤뤫

Standard C Ǥ translation phase 3 tokenization Ԥޤλ <newline> ʳ white-space sequence one space ˰̤뤫ʤ implementation-defined ȤƤޤ*1
̾ϥѥ̤ˤϱƶͿʤϤͤʤΤǡ桼ΤɬפϤʤΤǤƬȹ white-spaces ˤäƤϡƤ⤫ޤޤ

ǤϤε̵ѤȸȡĤ⤽櫓ǤϤʤɬפʾ礬Ĥޤ preprocessing directive Ԥ [VT], [FF] ǤˤĤƤ Standard C Ϥ狼ˤλ򤷤ƤޤǤ violation of constraint Ȥ¾ǤϾ嵭εߤƤΤǤʤphase 3 [VT], [FF] 򤽤 space, tab ȹ碌 one space ˰̤뤳ȤǤξ phase 4 ˤ [VT], [FF] ϻĤʤ̤ʤäϤ줬Ĥä violation of constraint ȤʤΤǤ
ɥȤˤϡ [VT], [FF] ΰ񤫤Ƥнʬȹͤޤ

: 2

:

*1 C90 5.1.1.2 Translation phases ե 3
   C90 6.8 Preprocessing directive  -- Constraints 
   C99 6.10 Preprocessing directive

d.ucn. ʸ󲽤 UCN \ Ťͤ뤫

UCN ޤ pp-token # 黻Ҥˤäʸ󲽤硢UCN \ Ťͤ뤫ɤ implementation-defined Ǥ*1

: 2

:

*1 C99 6.10.3.2 The # operator

d.2.1. #if: Single-character character constant ɾ

̤ʸͤɾ implementation-defined Ǥ ˤϤĤμޤ

  1. ʸåȤϲ
  2. ¿Хʸ磻ʸ encoding ϲ
  3. ΰϤɤ
  4. ʣХȤʸɾΥХȥϤɤ

Τ 1 ϥϡɥȣϣӤǷޤΤʤΤǡǤɾоݤȤޤ 2, 3, 4 Ǥ
ХȤ single-character ʸǤ⡢ΰ implementation-defined ǤޤץץȥѥȤɾäƤƤɤȤˤʤäƤޤ*1

: 2ɥȤ˵ܤ硢ޤϥѥեǤɾˤĤƤεܤ #if ǤƱɾ 2 ܤʤ 0

:

*1 C90 6.1.3.4 Character constants ʸ
   C90 6.8.1 Conditional inclusion դ -- Semantics ̣§
   C99 6.4.4.4 Character constants
   C99 6.10.1 Conditional inclusion -- Semantics

d.2.2. #if: Multi-character character constant ɾ

'ab' Ȥä multi-character ʸɾˤϡХȥ꤬ޤ implementation-defined Ǥ

: 2ɾλ d.2.1 Ʊ͡

d.2.3. #if: Multi-byte character constant ɾ

¿Хʸɾ encoding ΰ㤤ΤۤˡΰХȥΰ㤤ꡢϤ implementation-defined Ǥ

: 2ɾλ d.2.1 Ʊ͡

d.2.4. #if: 磻ʸ character constant ɾ

磻ʸɾˤ encoding ΰ㤤ΤۤˡΰХȥΰ㤤ꡢϤ implementation-defined Ǥ

: 2ɾλ d.2.1 Ʊ͡

d.2.5. #if: αե

̤αӥåȥեȤӥåȤɤ뤫 implementation-defined Ǥ CPU λͤˤޤϤμˡˤȻפޤ*1

: 2ɾλ d.2.1 Ʊ͡

:

*1 C90 6.3.7 Bitwise shift operators ӥåñ̤Υեȱ黻 -- Semantics ̣§
   C99 6.5.7 Bitwise shift operators -- Semantics

d.2.6. #if: ν;

̤˱դޤϺդޤǤΡȾ;η̤ implementation-defined Ǥ CPU λͤˤޤϤμˡˤȻפޤ*1, *2

: 2ɾλ d.2.1 Ʊ͡

:

*1 C90 6.3.5 Multiplicative operators 黻 -- Semantics ̣§
   C99 6.5.5 Multiplicative operators -- Semantics

*2 C99 Ǥϡdiv(), ldiv() Ʊͤ˾ 0 ڤΤƤ뤳Ȥˤʤä

d.2.7. ̻ҤͭĹ

ޥ̾ޤ identifier Ƭ鲿ХȤޤǤͭդǤ뤫 implementation-defined Ǥޥ̾Ū̻ҤˤĤƤϡC90 Ǥ 31 ХȡC99 Ǥ 63 ХȤݾڤʤФʤޤ*1

: 2

:

*1 C90 6.1.2 Identifiers ̻ -- Implementation limits ϸ³
   C99 6.1.2 Identifiers -- General -- Implementation limits

d.mbident. ̻ multi-byte character

C99 Ǥϡidentifier multi-byte character Ȥ뤳Ȥˤʤޤ implementation-defined Ǥ*1

: 2

:

*1 C99 6.1.2 Identifiers -- General

4. ʤ׵ᤵƤʤ¦̤ɾ

ʤϤФ׵ᤷƤʤȤǤäƤ⡢ϤΡʼפɾ뤿˽פʤȤޤξϤǤϡʼɾΥƥȤ⤷ޤ


4.1. Multi-byte character encoding

Multi-byte character ˤϳƼ encoding ޤλͤ implementation-defined ǤǤϽϤɤ¿ͤ encoding ˤɤޤбƤ뤫ΥƥȤʼפȤƤȤꤢޤ
Validation Suite Ǥϡm_33, m_34, m_36 ˤĤƤϿ encoding бץѰդƤޤϤϤΥƥǤɸ encoding бƤʤФʤʤΤϤǤ¿б뤿ˤϡ¿ encoding бƤɬפޤ*1
ƥȤˡϥƥϤˤäưۤʤꡢñǤϤޤ

GCC ϴĶѿ LC_ALL, LC_CTYPE, LANG бưѤ뤳ȤˤʤäƤޤȾüǤƤˤǤޤ󡣤ޤGCC ǤεǽȤ뤫ɤ GCC Ȥ򥳥ѥ뤷 configuration ˤäưۤʤޤ
GCC V.3.4 Ǥ multi-byte character νѤޤץץκǽˡtranslation phase 1 ˡ˥ե encoding UTF-8 ѴƤޤޤʤȡ#if ʸ UTF-8 ǤʤɾǤ encoding ȤϴطʤʤäƤޤޤ
C++98 εʤˤƱ꤬ͤꡢtranslation phase 1 multi-byte character UCN ѴƤޤΤǡ#if ʸ UCN ȤƤǤʤɾǤʤȤˤʤޤ
ʤȼΤ𤷤ȡ̤ #if ʸȤΤ portability ̵Ọ̵̇̄Ƨޤơ Validation Suite Ǥ V.1.5 #if multi-byte/wide character ʸΥƥȤɾоݤϤޤm.33, m.34, m.36.1ˡ

Visual C++ ˤ #pragma setlocale Ȥʥǥ쥯ƥ֤Τǡ줬ȤޤWindows ǤϡϰȸΥץפˤäƻѸѹǤ뤳ȤˤʤäƤޤȾüǤäǤ#pragma setlocale Windows 򤤤餺˻ȤΤǡץޤˤȤäƤʤΤǤVisual C++ ȤɤޤƤ뤫̤Ǥ뤬ˡ
ΥƥȤ¾νϤǤϺΤȤνϤǤΥǥեȤ encoding ˤбƤʤ褦Ǥ饤֥ setlocale() δؿĽϤ¿ޤϥΥץץ䥳ѥˤϴطޤ󡣤ɬפʤΤϡϼȤ encoding ǧǽϤʤΤǤ

:

*1 C99 Ǥϡ\u, \U ǻϤޤ Unicode sequence Ƴ졢multi-byte / wide character ȤδطƤ狼ˤʤäƤޤäƤ롣C++ Standard ǤϤʣǤ롣

m.33. 磻ʸɾ

磻ʸˤĤƤϡ3.4.33 򻲾ȤƤ

: ʤ

m.34. #if multi-byte ʸɾ

#if ǤʣХȤ multi-byte character constant¿ХʸˤȤޤʵʽǤ multi-byte character ȤѸ single-byte character ޤΤȤƻȤƤ뤬ǤϺ𤷤ʤ褦ˡsingle-byte ǤϤʤ multi-byte character ؤȤˤˡɾ single-byte character constant ʾ implementation-defined Ǥ

: ʤΥƥȤϸҤ u.1.7 ΥƥȤȹ碌ȽǤɬפ롣 ñʸͤɾǤǤϡ encoding ǧƤ뤳ȤˤϤʤʤu.1.7 multi-byte character encoding ǧϰϤ˼ޤäƤ뤫ɤΥƥȤǤ롣m.34. ʸͤɾǡ u.1.7 ŬڤʿǥåФƽƤ encoding ǧƤȸ롣

m.36.1. Multi-byte character 0x5c escape ʸǤϤʤ

(Multi-byte | wide) character encoding shift-JIS, Big-5, ISO-2022-* ξϡʸ '\\' Ʊ 0x5c ͤĥХȤФƤ뤳Ȥ뤿ᡢ鷺路꤬ޤϤϤ escape ʸȤƤ \ (backslash) ȲᤷƤϤޤ󡣣Ĥ (multi-byte / wide) character ϣĤʸǤꡢĤ single-byte character ǤϤʤǤ
Multi-byte character ͤ 0x5c ΥХȤäƤ⡢ escape sequence λϤޤȲᤷƤϤޤ

: ʤ

m.36.2. # 黻Ҥ multi-byte character \ ʤ

# 黻Ҥ operand б 0x5c ͤΥХȤ multi-byte character ޤޤƤƤ⡢ \ ƤϤޤ󡣤äȤ⡢ѥΤ multi-byte character бƤʤ˥ץץå \ 뤳ȤбȤˡޤϤޤ̤μΤȤǤ
ޤ⤽⤳μ multi-byte character ޤʸʸƥ tokenization ˤ⡢¾ΥƥȤϰäݤ꤬ޤ
ISO-2022-* encode 줿 multi-byte character ˤ '\\' ФǤʤ '\'', '"' ȰפͤΥХȤޤޤΤǡøʽ򤹤 tokenization ˼Ԥޤ

: 7Shift-JIS, Big-5 encoding ˤĤƳ 2 ISO-2022-JP ˤĤƤϣĤΥץˤĤƳ 1
ʤιܤ m_36_*.t Ǥʤ m_36_*.c ƥȤɬפ롣ʸ󲽤Ǥץץåassert() ޥ 0x5c ΥХȤĴޤʣʸƥȤƱꤹ뤳Ȥ˼Ԥ뤳Ȥ뤫Ǥ롣m_36_*.c ʸƥ tokenization ΥƥȤˤʤäƤ롣
GCC 3.4-4.1 encoding UTF-8 ѴƤޤ򸵤 encoding ᤹ȤؼȼԤ뤳Ȥ¿Ѵ;פʤäǤ뤬ǤϤޤǤϥƥȤʤ0x5c ΥХȤйʤȤʴŤƥȤǤˡ


4.2. Undefined behavior

Standard C ˤ undefined behavior Ȥ꤬󤢤ޤUndefined behavior Τϡְäץޤϥǡ뤤ϾʤȤܿΤʤץǤviolation of syntax rule or constraint ȤϰäơϤϤФƿǥåФȤ̳դƤޤ󡣤ϡϤϤɤƤ⤫ޤʤΤǤץȤƲ餫 reasonable ʽ򤷤ƤɤǥåФƥ顼ˤƤɤǥåФ˽ߤ˽ꤷƤ⵬ʰȿǤϤޤ

ϤΡʼפɾˤϡundefined behavior ŪˤɤΤǤ뤫ˤʤޤϤϲ餫οǥåФΤŬǤ礦顼ˤΤǤФΤȡץȤưǤ⥦˥󥰤ФȤץ˰ܿʤȤΤ餻뤿ͭѤǤ˽ΤǤ

ʲΥƥȤǤϡundefined behavior ФƽϤŬڤʿǥåФɤåޤǥåϥ顼Ǥ⥦˥󥰤Ǥ⤫ޤޤ󡣤󡢥˥󥰤ξϲ餫 reasonable ʽ򤹤ɬפޤ
u.1.* ϥץץͭǡu.2.* ̤˶̤Ǥ

: ŬڤʿǥåФСʲγƹܤΤäǤΤʤܤˤĤƤ 1 ʿǥåǤǥåФʤ 0

u.1.1. ե뤬 <newline> ǽäƤʤ

ǤʤեκǸ夬 <newline> ǤʤΤϡundefined behavior ޤʤäȤ⡢ϣӤˤäƤϥե˲ʸȤǡ¸ߤեɤ߹˽ϤˤäƼưŪղäΤǤˡ*1
u.1.1, u.1.2, u.1.3, u.1.4 Ϥ⥽ե뤬뤷ƤʤΤǤtranslation unit ΥեǽäƤϡǥåФϤ¿ȻפޤϤǤ⡢Υե뤬 include 줿ΤǤ硢include ΥեϢ³ƽ뤳ȤǡʥȤưǽޤ undefined behavior ΰǤꡢְäǤϤޤ󤬡ϤǥåФΤŬǤ

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases

u.1.2. ե뤬 <backslash><newline> ǽ

ե뤬 <backslash><newline> sequence ǽäƤΤϡundefined behavior ޤ*1

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases

u.1.3. ե뤬ȤǽäƤ

ե뤬ȤǽäƤΤϡundefined behavior ޤϼºݤˤϥȤĤ˺ޤϥȤΥͥȤǤ*1

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases

u.1.4. ե뤬ޥƤӽФǽäƤ

ե뤬뤷ʤޥƤӽФǽäƤΤϡundefined ȹͤޤ*1
ϥޥΰĤ륫å˺줿ʤɤȯΤǡǥåϽפǤ

:

*1 C90 6.8.3.4 Rescanning and further replacement Ⱥִ
   C99 6.10.3.4 Rescanning and further replacement

u.1.5. ѤǤʤȤ character

ʸƥ롢ʸheader-nameȰʳΤȤ˽񤱤ʸϤ¤ƤޤʸȾʸ alphabetε桢 white space characters ǤǤΤȤǤ*1
Ǥϡwhite space ʳΥȥ륳ɤäΥƥȤ򤷤ޤȥ륳ɤϤȤʸƥǤäƤȹͤޤϥѥΤǥåϤǤꡢޤ̤ʸåȤˤ locale-specific ʤ implementation-defined ̤¿ϰϤɬΤǤϤʤΤǡǤϥƥȤޤ󡣤ޤ嵭ʳξǤ undefined ȹͤޤƱͤͳǥƥȤޤ

:

*1 C90 5.2.1 Character sets ʸ
   C99 5.2.1 Character sets
C99 Ǥ UCN ɲä줿

u.1.6. ȥ [VT][FF]

White space characters ǤäƤ⡢# ǻϤޤ preprocessing directive ԤǤ [SPACE][TAB] ʳ violation of constraint Ȥʤޤ translation phase 4 Ǥäǡ phase 3 Ǥ򤽤 <newline> ʳ sequence of white spaces ȤȤ one space ˰̤뤳ȤǤξ violation ȯޤ*1
ϤǤϤꤳˤϿǥåФΤŬǤ礦ΥƥȤ undefined behavior ΥƥȤǤϤޤ󤬡¾ʬषüʤΤʤΤǡص夳Ƥޤ

:

*1 C90 5.1.1.2 Translation phases ե
   C99 5.1.1.2 Translation phases
   C90 6.8 Preprocessing directives  -- Constraints 
   C99 6.10 Preprocessing directives -- Constraints

u.1.7. Ѥ multi-byte character sequence

ʸƥ롢ʸheader-nameȤǤäƤ⡢multi-byte character Ȥǧʤ sequence undefined ǤMulti-byte character ХȤμΥХȤХȤȤƻȤʤΤǤǤ*1

: 9γ encoding Τ UTF-8 ʳΤΤˤĤƳ 1 UTF-8 ˤĤƤ 3 UTF-8 ˤĤƤϣĤΥƥȤ뤬ܤ encoding ǤȤΣĤ illegal encoding Ǥ롣 Ĥ illegal encoding ΤοǤǤȤ롣 encoding ˸ʿǤ򤹤Τ 0 ʤm.34 򻲾ȤΤȡ

:

*1 C90 5.2.1.2 Multibyte characters ¿Хʸ
   C99 5.2.1.2 Multibyte characters

u.1.8. ԤʸǽäƤ

ʸȤ pp-token ϤԤǴ뤷ƤʤФʤޤб ' ʤ ' undefined Ǥ*1
#error ԤˤǤդΥå񤯤ȤǤޤȤƤ pp-token ¤ӤˤʤäƤʤȤʤΤǡñȤ apostrophe Ϥޤ󡣤ΥץǤϡȤΤĤΤȤʸν ' 򥵡뤿˿ƤޤǤ礦

:

*1 C90 6.1 Lexical elements  -- Semantics ̣§
   C99 6.4 Lexical elements -- Semantics

u.1.9. ԤʸƥǽäƤ

ʸƥ⤽ԤǴ뤷ƤʤФʤޤ ñȤ " undefined Ǥ*1
ĤƤ UNIX Ϥ¿νϤǤϡԤޤʸƥȤΤǧƤ褦Ǥޤˤ򤢤Ƥˤ˸ޤ

:

*1 C90 6.1 Lexical elements  -- Semantics ̣§
   C99 6.4 Lexical elements -- Semantics

u.1.10. Ԥ header name ǽäƤ

#include ԤǴ뤷ʤ header-name undefined Ǥ*1

:

*1 C90 6.8.2 Source file inclusion ե -- Semantics ̣§
   C99 6.10.2 Source file inclusion -- Semantics

u.1.11. Header name ', ", /*, \

Header-name Ȥ pp-token ', /*, \ undefined Ǥ<, > ǰϤޤ header-name " ƱͤǤʸƥη header-name Ǥϡᤫ " pp-token νˤʤäƤޤΤǡ顼ˡ*1
\ ʳϤ⡢ʸʸƥ롢Ȥʶ路ɤˤǤ뤫Ǥ

ޤ\ escape sequence ʶ路header-name ˤ escape sequence ¸ߤʤΤΡ줬 header-name Ȥ狼Τ translation phase 3 Ǥ tokenization ä phase 4 ˤʤäƤǤΤǡϤϤ϶̤˺ΤǤEscape sequence Τ phase 6 Ǥphase 3 Ǥ \" ʸƥνǤϤʤ escape sequence Ȳ᤹뤿 escape sequence ǧ뤳ȤɬפǤ

\ Windows ΣϣӤǤ path-delimiter ǡΣϣӾνϤʸȤưޤʸƥη header-name ǤκǸʸ \ Ǥ̤ȤơˡUndefined behavior ⤿餹Τ¿ξϴְäץǤˤȤ櫓ǤϤޤ󡣤/ ǤȤ虜虜 \ Ƚ񤯤Τϡportability ξǴޤ󡣽Ϥϥ˥󥰤ФȤ˾ޤޤ¾ΣϣӤǤϥե򥪡ץ󤷤褦Ȥƥ顼ˤʤǤ礦顢ɬץץ tokenization ǿǤɬפϤޤ

:

*1 C90 6.1.7 Header names إå̾ -- Semantics ̣§
   C99 6.4.7 Header names -- Semantics

u.1.12. #include ΰ header name Ǥʤ

#include Ԥΰ header-name ǤʤΤ undefined ǤʤʸƥηǤʤ<, > ˰Ϥޤ줿ΤǤʤΤɤ餫ŸޥǤʤǤ*1

:

*1 C90 6.8.2 Source file inclusion ե -- Semantics ̣§
   C99 6.10.2 Source file inclusion -- Semantics

u.1.13. #include ΰ;פʥȡ󤬤

#include Ԥΰ header-name ĤǤ ʳ;פ pp-token undefined Ǥ*1

:

*1 C90 6.8.2 Source file inclusion ե -- Semantics ̣§
   C99 6.10.2 Source file inclusion -- Semantics

u.1.14. #line ΰ˹ֹ椬ʤ

#line ΰ˹ֹ椬ʤΤ undefined Ǥʥե̾ optionalֹǤʤФʤʤˡ*1

:

*1 ʲu.1.18 ޤǤŵϤƱ

    C90 6.8.4 Line control  -- Semantics ̣§
    C99 6.10.4 Line control -- Semantics

u.1.15. #line Υե̾ʸƥǤʤ

#line Ǥե̾ʸƥǤʤФʤޤ
줬磻ʸǤä violation of constraint ǡ¾ #line δְ㤤Ϥ٤ undefined ȤΤϡХ󥹤礤Ǥ

u.1.16. #line ΰ;פʥȡ󤬤

#line ԤˣİʾΰΤ undefined Ǥ

u.1.17. #line ιֹΰ [1, 32767] ϰϤˤʤ

C90 Ǥϡ#line ιֹ [1, 32767] ϰϤˤʤФʤޤ󡣤ʳǤ undefined Ǥ
ΥץǤϡ#line ǤλϤϰϤˤΤΡθǥιֹ椬ĶƤޤäȤΥƥȤ⤷ƤޤϤˤäƤϡǹֹ椬ۤä wrap round ꤷޤϤꥦ˥󥰤ФΤŬǤ礦

: 2ĤΥץΤĤޤϣĿǤǤ 1

u.line C99: #line ιֹΰϰϳ

C99 ǤϡϰϤ [1, 2147483647] Ǥ

: 2 ĤΥץΤĤޤϣĿǤǤ 1

u.1.18. #line ιֹΰʿǤʤ

#line ιֹϣʿǤʤФʤޤ󡣣ʿʤɤ undefined Ǥ

u.1.19. #if defined Ÿޥ

defined 黻ҤǤʤ identifier ʶ路򤷤Ƥ뤳ȤϡޤޤޤTranslation phase 3 ǤϤä identifier Ȥ tokenize 졢phase 4 Ǥ줬 #if ˤä˸¤äƱ黻ҤȤǧΤǡ#define Ԥ defined Ÿޥ뤳Ȥ⡢ꤨʤȤǤϤޤ󤽤ơ#if Ԥ˼ºݤˤΥޥ줿ϡundefined ǤŸ̤黻ҤȤưݾڤϤޤ*1

defined Ȥ̾Υޥ뤳ȤϤ켫Τ undefined Ǥu.1.21 ȡˡºݤˤϸݤޤ󡣤ִꥹ defined ȤȡΤޥϡ˸ݤޤϤˤäƤϡˤĤüʽ򤷤ƹˡŪʤΤȤưΤ⤢ޤŪʻͤǤϤޤ

: 2ĤΥץΤĤǤǤ 1

:

*1 C90 6.8.1 Conditional inclusion դ -- Semantics ̣§
   C99 6.10.1 Conditional inclusion -- Semantics

u.1.20. #undef ΰ defined, __LINE__, etc. Ǥ

#undef ΰ defined, __LINE__, __FILE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ Ǥ undefined Ǥ*1, *2, *3

:

*1 C90 6.8.8 Predefined macro names 餫줿ޥ̾
   C99 6.10.8 Predefined macro names

*2 Amendment 1 / 3.3 Version macro

*3 C99 Ǥϡ__STDC_HOSTED__, __STDC_ISO_10646__, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX ɲä줿

u.1.21. #define Υޥ̾ defined, __LINE__, etc.

#define ޥ̾ defined, __LINE__, __FILE__, __DATE__, __TIME__, __STDC__, __STDC_VERSION__ Ǥ undefined Ǥ*1, *2, *3

: 2ĤΥץΤĿǤǤ 1

:

*1 C90 6.8.8 Predefined macro names 餫줿ޥ̾

*2 Amendment 1 / 3.3 Version macro

*3 C99 Ǥϡ__STDC_HOSTED__, __STDC_ISO_10646__, __STDC_IEC_559__, __STDC_IEC_559_COMPLEX ɲä줿

u.1.22. ## 黻Ҥˤä pp-token 줿

## 黻Ҥˤä pp-token Ϣ뤵줿̤ͭʡñΡpp-token ˤʤʤФʤޤ󡣤Ǥʤ undefined Ǥ*1
ΥץǤ pp-number Ȥ Standard C ǿꤵ줿 pp-token ˤƤޤ

:

*1 C90 6.8.3.3 The ## operator ##黻 -- Semantics ̣§
   C99 6.10.3.3 The ## operator -- Semantics

u.concat. C99: ## 黻Ҥˤä pp-token 줿

// C99, C++ ǤϥȥޡǤ pp-token ǤϤޤ## 黻ҤˤäƤ sequence 褦ȤƤ⡢η̤ undefined Ǥ
⤽⥳Ȥϥޥ줿Ÿ줿ꤹ a space ѴƤΤǡޥˤäƥȤ뤳ȤϤǤޤ

u.1.23. # 黻Ҥˤä pp-token 줿

# 黻Ҥˤִη̤ͭʡñΡʸƥˤʤʤФʤޤ󡣤ʤʤä undefined Ǥ*1
Ϥäȯ뤳ȤΤʤǤΥץǤ狼褦ˡ\ ƥγˤȤ̯ʾΡΤޤüʾ˸¤ޤΥץ⡢ץץǿǤʤƤ⥳ѥեǿǤǤ礦ǽʬǤϤ󤷤ꡢۤä̤ƤޤäꤹΤϤޤ

:

*1 C90 6.8.3.2 The # operator #黻 -- Semantics ̣§
   C99 6.10.3.2 The # operator -- Semantics

u.1.24. ޥƤӽФ˶ΰ

ؿͥޥθƤӽФ˶ΰΤ C90 Ǥ undefined Ǥ*1
ΰ򣰸ĤΥȡȲᤷ reasonable ʥޥŸԤȤϡC99 ǹˡȤʤä褦˽ʬǽǰ̣Τ뤳ȤǤ*2
undefined ʵ˽ϤͭյͿ뤳ȤΤǤ룱ĤǤϤǤäƤ⡢ʤȤ pre-C99 ǤϤˤϰܿʤΤǡ˥󥰤ФΤŬǤ礦

: 2ĤΥץΤĤޤϣĿǤǤ 1

:

*1 C90 6.8.3 Macro replacement ޥִ -- Semantics ̣§

*2 C99 6.10.3 Macro replacement -- Semantics

u.1.25. ޥƤӽФ˥ȥΰ

ؿͥޥθƤӽФʣԤˤޤ뤳ȤǤޤ äơ preprocessing directive ʶ路Ԥޤޤ뤳Ȥꤨޤη̤ undefined Ǥ*1
ְפϡåפ #if group ˤ pre-processing directive ԤȲᤵǤ礦

:

*1 C90 6.8.3 Macro replacement ޥִ -- Semantics ̣§
   C99 6.10.3 Macro replacement -- Semantics

u.1.26. Function-like ޥ̾ǽޥŸ

C90 ǤϡޥŸη̤ function-like ޥ̾ǽΤ undefined ȤƤޤɲä줿Ǥ̣ʤΤǤ2.7.6 򻲾ȤƤ*1
Validation Suite Ǥ V.1.2 ޤǤϤƥȤ˴ޤƤޤV.1.3 ޤ

:

*1 ISO/IEC 9899:1990 / Corrigendum 1
C99 ǤϤεϺ졢ʣʵ꤬ɲäƤ롣

u.1.27. ̵ʥǥ쥯ƥ

Ԥκǽ pp-token # Ǥθˤ pp-token ϡ̾ # μ preprocessing directive ǤʤФʤޤ# ιԤϤʤǧƤޤ*1
Ƭ # ̵ʥǥ쥯ƥ֤䤽¾ pp-token ³Ȥϡץץ violation of syntax or constraint ǤϤޤ󡣤ʤʤ顢u.1.25 Ǥ狼褦ˡ# ǻϤޤԤ٤ƥץץǥ쥯ƥֹԤǤʤФʤʤ櫓ǤϤʤǤɤ줬ץץǥ쥯ƥֹԤǤΤϡʸ̮ˤäƷޤΤʤΤǤ

ʽϤ undefined ȤƤޤ󤬡ֵꤵƤʤפȤ̣Ǥ undefined ΰǤϤϲ餫οǥåФȤ˾ޤޤɬץץǤɬפϤޤ󡣥ץץιԤ򤽤Τޤ޽ϤСѥեǥ顼ˤʤϤǤ顢Ǥ⤫ޤޤ󡣥ץץ #ifdefined #if defined Ȳᤷƥ顼ˤʤ餺ޤʤɤȤȤʤСϤޤ
C99 Ǥ # non-directive Ȥ̣ʤΤɲäޤƤϲ⵬ꤵƤ餺¾ undefined Ǥȸޤ*2

:

*1 C90 6.8 Preprocessing directives  -- Syntax ʸ§

*2 C99 6.10 Preprocessing directives -- Syntax

u.1.28. directive ̾˥ޥϻȤʤ

# ǻϤޤԤץץǥ쥯ƥ֤Ǥ뤿ˤϡ pp-token ȤƤ directive ̾ޤDirective ̾Ϸ褷ƥޥŸޤ
# μ directive ̾ǤϤʤ identifier ơ줬ޥ̾Ǥäϡ¸ߤʤǥ쥯ƥ֤ȿǤ뤫̾ΥƥȤȤߤʤƥޥŸƽϤ뤫ΡĤνꤨޤԤǤⲿ餫οǤ˾ޤޤԤǤϥѥեǥ顼ˤʤϤǤ顢Ǥ⤫ޤޤ󡣥ޥŸΤ򤵤ˡץץץǥ쥯ƥ֤Ȥƽ뤳ȤϡäƤϺޤ

u.2.1. #if ̤ character escape sequence

ʸƥޤʸ character escape sequence \', \", \?, \\, \a, \b, \f, \n, \r, \t, \v ꤵƤޤʳ \ ǻϤޤ character sequence undefined ǤȤ \ ˾ʸ³ sequence ϡ escape sequence ɲä뤿ͽ󤵤Ƥޤ*1
οǤ¿ϥѥեˤޤФߤޤ#if ʸˤ줬äϡץץʳ˿ǤԤϤޤ

:

*1 C90 6.1.3.4 Character constants ʸ -- Description ­
   C99 6.4.4.4 Character constants -- Description
   C90 6.9.2 Character escape sequences ʸĥɽ
   C99 6.11.4 Character escape sequences

C99 Ǥ \uxxxx, \Uxxxxxxxx η UCN (universal-character-name) Ȥ escape sequence ɲä줿

u.2.2. #if ˥եȥȤʥӥåȥեȱ黻

Υӥåȥեȱ黻Ǥϡ operandʥեȥȡˤͤǤä꺸 operand ηΥӥåȿʾǤäꤷ undefined Ǥ*1
#if Ԥˤ줬äϥץץǤ٤Ǥ礦

:

*1 C90 6.3.7 Bitwise shift operators ӥåñ̤Υեȱ黻 -- Semantics ̣§
   C99 6.5.7 Bitwise shift operators -- Semantics

4.3. Unspecified behavior

Standard C ˤ unspecified ȤʡֵꤷʤפȤˤ⤢ޤϡץǤäƤ⡢νˡϵꤷʤϤϽˡɥȤ˽ɬפʤȤΤǤ
Ϥޤ¿ϤޤǤ⡢ˡˤäƷ̤˰㤤ФΤϡüʾǤüǤäƤ⡢̤˰㤤νФ붲ΤΤФƤϥ˥󥰤ФΤ˾ޤȻפޤ
Unspecified ư˰¸ץη̤ undefined Ǥ

ץץǤ unspecified ǡ⤽νˤäƷ̤äƤΤϡΣǤΣĤΥƥȤǤϤ줾졢 pp-token ƿǥåФ뤫ȤܿʤȤ˥󥰤Ф뤫ɤǤ 2 Ϳ뤳ȤˤޤޤԤξϡޥǤŸǤɤǤɤȤˤޤ
ʤΤۤ #if Ǥα黻ɾ unspecified Ǥ#if ϤˤäƷ̤Ѥ뤳ȤϤʤΤǡƥȤ˴ޤƤޤ

s.1.1. # 黻Ҥ ## 黻ҤɾϻꤵƤʤ

ĤΥޥ # 黻Ҥ ## 黻Ҥä硢Τɤ餬ɾ뤫ϵꤵƤޤ*1
Υץ # ## Τɤ餬ɾ뤫Ƿ̤äƤǤ⡢## ɾ # ϱ黻ҤǤϤʤñʤ pp-token Ȥư졢Ϣη̤ pp-token ƤޤޤޥˤϰܿʤΤǡϤϥ˥󥰤ФΤŬǤ

: 2

:

*1 C90 6.8.3.2 The # operator #黻 -- Semantics ̣§
   C99 6.10.3.2 The # operator -- Semantics

s.1.2. ʣ ## 黻ҤɾϻꤵƤʤ

ĤΥޥʣ ## 黻Ҥ硢ɾϵꤵƤޤ*1
ΥץǤϡɾˤäƤ pp-token ޤޥˤϰܿʤΤǡϤϥ˥󥰤ФΤŬǤ

: 2

:

*1 C90 6.8.3.3 The ## operator ##黻 -- Semantics ̣§
   C99 6.10.3.3 The ## operator -- Semantics

4.4. ˥󥰤˾ޤ¾Υ

Undefined, unspecified Τۤˤ⡢Ϥ˥󥰤ФȤ˾ޤĤޤ򤳤˽ޤ

w.1.*, w.2.* ϵʤǤϤޤäץǤºݤˤϲ餫δְ㤤Ǥ礬¿ǤפʤΤǤw.1.* ϥץץ˸ͭǡw.2.* ϥѥեǤα黻Ȥⶦ̤ #if ǤǤ

w.3.* translation limits Ȥ implementation-defined ¦̤ĵ˴ϢΤǤʤݾڤƤǾ¤ͤĶ translation limits 뤳ȤϡϤʼ夲뤳ȤǤȤޤ¾ǡ˰¸ץϰܿ¤ƤޤȤȯޤäơǾ¤ͤĶ translation limits ƤϤǤϡΤȤѤץФƥ˥󥰤ФΤ˾ޤȹͤޤ
ʲΥƥȤǤϡŬڤʿǥåФйʤȤޤw.3.* ϽϤ translation limits ʤκǾͤȰפƤơΤᤳΥץ뤬顼Ȥʤ뤳ȤƤ뤳ȤˤޤǾͤʤ˥顼ȤʤΤԹʤǤƤ뤫ɤ n.37.* Ǥ狼ˡ

w.1.1. /*

ȤͥȤƤꥳȥޡʤäꤹ륽Υԥ󥰥ߥϤ褯ޤΤ/* /* */ */ ȤȤΥͥȡ */ */ Ȥ sequence ϣøˤϤʤΤǡѥեɬ顼ˤʤޤ*/ æƤϼΥȤνޤǤȤȲᤵΤǡ顼ˤʤʤȤޤϴʴְ㤤Ǥꡢץץ˥󥰤ФȤǤѥեDz餫Υ顼ˤʤäǤ⡢λˤϸϤ狼ʤʤäƤޤ

: 4

w.1.2. ޥκ³Υȡ

ޥκִꥹȤθΥȡ󤬼ޤ礬ΤϡK&R 1st. ǤϰۤλͤǤꡢStandard C ǤϸǧλͤǤλ֤ΤϿҾʥޥǤϤޤ󡣤ȤִꥹȤ¾ function-like ޥƤӽФȾʬΤϡư۾ʥޥǤºݤˤϥޥδְ㤤Ǥǽ礭˥󥰤ФȤ˾ޤޤObject-like ޥ function-like ޥ̾ŸΤϼºݤˤޤreadability ΰǤ

ˤĤƤϵʤΤ꤬ۤޤִꥹǴ뤷ʤϥ顼violation of constraintˤȤ٤ǤȻפޤ2.7.6 ȡˡ

: 4ĤΥץΤĤǤǤ 2

w.2.1. #if ̾λѴ̵Ѵ

դ̵Ȥκ黻˺ݤƤϡ̾λѴפԤ졢դ̵ѴޤդǤäͤѤޤ󤬡ǤäϤ줬礭Ѵޤϥ顼ǤϤޤ󤬡۾ʤΤǤꡢδְ㤤ǤǽޤϤ˥󥰤ФȤ˾ޤޤץץǤϤθݤ #if ˸ޤ

: 2

w.2.2. #if ʤ黻 wrap round

̵黻η̤ϰϳȤʤä wrap round 뤳ȤˤʤäƤΤǡ顼ˤϤʤޤ󤬡ְ㤤βǽΤǥ˥󥰤ФΤ˾ޤǤ礦

: 1

w.3.1. 31 ĤĶޥѥ᡼

w.3.2. 31 ĤĶޥ

w.3.? Ϥ C90 translation limits ˴ؤƥȤǤ ƤϼΤȤǡפʤǤ礦n.37.* ٤ƤߤƤ

: 13.1., 3.2 ϣĤΤɤ餫ǤФࡣ

w.3.3. 31 ХȤĶĹ identifier

: 1

w.3.4. 8 ٥Ķ #if (#ifdef, #ifndef) Υͥ

: 1

w.3.5. 8 ٥Ķ #include Υͥ

: 1

w.3.6. #if 32 ٥ĶΥͥ

: 1

w.3.7. 509 ХȤĶĹʸƥ

: 1ϥץץåǤʤƤ⡢ѥΤǤɤȤޤ

w.3.8. 509 ХȤĶĹ

: 1

w.3.9. 1024 ĤĶޥ

n.37.9 ƱΤˤʤäƤޤTranslation limits εǤϡ줬Ǥ⤪ޤʤΤʤΤǤ1024 ĤΥޥȤ߹ߥޥ뤫ɤɸإåޥ뤫ɤǡäƤޤΥץǥƥȤޥϥإåեǤ 1024 ܤǤwarns.t, warns.c ˤϤƤޥĤΤǡΥޥϤɤˤƤ 1024 ܤĶ뤳ȤˤʤޤϤŬʤȤǥ˥󥰤ФȤԤޤ

: 1

w.tlimit. C99 translation limits

C99 Ǥ translation limits ˳礵ޤ ĶͤĽϤǤ⡢portability ΤˤϵĶ륽ФƤϥ˥󥰤ФȤ˾ޤޤ

: 8ƹܤˤĤơ1 ġ3.1, 3.2 Ϥɤ餫ǤǤФࡣ3.7 ϥѥΤǤʤ顢Ǥġ
ƥѥץ test-l ǥ쥯ȥˤ롣ʤl_37_8.c ϥץץϤǤƤ⥳ѥϤǤʤǤ롣

w.3.1.L. 127 ĤĶޥѥ᡼

w.3.2.L. 127 ĤĶޥ

w.3.3.L. 63 ХȤĶĹ identifier

w.3.4.L. 63 ٥Ķ #if (#ifdef, #ifndef) Υͥ

w.3.5.L. 15 ٥Ķ #include Υͥ

w.3.6.L. #if 63 ٥ĶΥͥ

w.3.7.L. 4095 ХȤĶĹʸƥ

w.3.8.L. 4095 ХȤۤĹ

w.3.9.L. 4095 ĤĶޥ


4.5. ¾γƼʼ

ʲˤϡϤλȤ䤹ʼ˴ؤ򽸤Ƥޤq.1.1 ʳϥץץǥƥȤ뤳ȤΤǤʤΤǤ

q.1.* ư˴ؤΤǤ
q.2.* ϥץĥǽ˴ؤΤǤ
q.3.* ϲƯ륷ƥ䥷ƥǤθΨ˴ؤΤǤ
q.4.* ϥɥȤ˴ؤΤǤ

ˤϡʤŪɾˤ餶򤨤ʤΤ⤢ޤ ޤҴŪɾǤΤΡμ٤ǤʤΤ⤢ޤ6.2 򻲹ͤˡŬ˺Ƥ

4.5.1. ư˴ؤʼ

q.1.1. translation limits

Translation limits ˤĤƤϡʤǤϺ¤λͤ䤫˵ꤵƤޤºݤνϤϤͤäƤ뤳Ȥ˾ޤޤȤˡ#if Υͥȥ٥롢#include Υͥȥ٥ˤĤƤϡC90 ׵㤹ȹͤޤ
C99 Ǥ translation limits ˰夲Ƥޤޤidentifier ĹˤĤƤϡ255 Х̤¤ƤΤ obsolescent featureѻͽεˤȤƤޤ
q.* ιܤǤϤƥѥץ뤬ѰդƤޤtest-l ǥ쥯ȥˤ l_37_?.t, l_37_?.c ǡ줾켡Τ褦 translation limits ƥȤޤ C99 ΤΤ򤵤˾äƤޤʤC++ Standard Υɥ饤ȤƤ translation limits ͤϲäƤˡ

37.1LޥΥѥ᡼ο255
37.2LޥƤӽФΰο 255
37.3Lidentifier Ĺ 255 bytes
37.4L#if Υͥȥ٥ 255
37.5L#include Υͥȥ٥ 127
37.6L#if Υͥȥ٥ 255
37.7LʸƥĹ 8191 bytes
37.8LԤĹ 16383 bytes
37.9Lޥο 8191

l_37_8.c ϥѥ뤷Ƥ¹ԥץˤϤʤޤ󡣥ץץǤз̤򸫤Ф狼ޤѥ뤹 cc -c l_37_8.c Ȥƥ֥ȥեäƤץץСѥΤɤĹιԤ뤳ȤǤ뤫狼ޤ

: 9ΥץˤĤƳ 1 ѥΤΥƥȤϴޤޤʤ

q.1.2. ǥåŪΤ

ǥåФ뤳ȤϽФΤΡ狼ˤäꡢޤꡢθĽ꤬狼ʤäꤹΤ⤢ޤοǥåϾܤФ뤬̤μοǤϥԥȤƤȤ⤢ޤǥåñ "syntax error" ʤɤȤΤǤϤʤʤְ㤤ǤΤ򼨤Ƥ餤ΤǤĽϹԤ򼨤ơΥȡŦƤ餤ΤǤ
ޤ#if section бطΥ顼Ǥϡб٤Ԥ򶵤Ƥʤȡɤ˥顼θΤ狼ޤ
ƱΥ顼ФƤĤοǥåʣƽФΤϡޤޤ

: 10

q.1.3. ֹɽΤ

ץץåѥΤϤֹ椬ƤޤΤϺޤ Ͽǥå˸ΤǤصΩܤˤƤޤκϡޤǤΥץץΥƥȤǹֹ椬Τɽ줿ɤǹԤޤ

: 4

q.1.4. ˽

: 20 Validation Suite Τɤ줫Υץ˽ꡢǤ٤ǤʤǤϤˤϡΤ褦˸롣˽פȤΤϡ^C Ǥ򤨤ʤʤäꡢꥻåȤ򤨤ʤʤäꡢե륷ƥĤꤹΤǡǡפȤΤϡﳲϤʤΤΡǽλƤޤΤؤ

  1. n_std.cstrictly conforming programˤ˽ 0
  2. n_std.c ǽǤ 10 ǤĽθʬ򤵤˥ƥȤ˽顢˽פʬˡ
  3. ʳΤɤ줫Υץ˽ 10

4.5.2. ץȳĥǽ

q.2.1. Include directory λ

ɸإåե֤뤤 include directory ϺǤñʾϣĽ˸ꤵƤޤʣ¸ߤ⤷ФФꡢ桼ꤷʤФʤʤ⤢ޤޤ桼٥ΥإåեˤĤƤϡȥǥ쥯ȥˤꤢޤ󤬡̤Υǥ쥯ȥˤäơ줬̤Υإåե include ϡϤˤäƥǥ쥯ȥ򥵡뵬§ۤʤޤɤˤƤ⡢include directory ϥץĶѿˤäƥ桼Ū˻ꤹ뤳ȤǤʤؤǤ-I ץȤϤ¿ˡޤʣΥǥ쥯ȥ˥ϡƥǴΥǥ쥯ȥ򳰤ץʤؤǤ뵬§ΤΤѹ륪ץˤ⡢¸ͳޤ

: 4

q.2.2. ޥץ

֥ͥޥ򥽡ǤʤѥǤ륪ץϡͭѤʤΤǤ-D ץȤϤ¿ˡˤäơƱΥäͤΥ֥Ȥäꡢäƥǥѥ뤷ꤹ뤳ȤǤޤִꥹȤά 1 ϤȣĤΥȡϤȤꡢȤϥɥȤΤʤФʤޤ
Ĥޥ⥪ץǤǤϤ⤢ޤ

: 4

q.2.3. ޥäץ

ϸͭȤ߹ߥޥäץ⡢äۤɤǤ礦Τ褦ʼबޤ

  1. -U ȤäץǣĤΥޥäΡ
  2. ϸͭȤ߹ߥޥ礷̵ˤ륪ץ
  3. Standard C ǶػߤƤȤ߹ߥޥ_ ǻϤޤʤ unix ˤ礷̵ˤ륪ץ

: 2 1 ޤ 2 Υץ󤬤 2 3 d.1.5 ǤǤɾƤΤǡǤоݤȤʤ

q.2.4. Trigraphs ץ

Trigraphs ɬפʴĶǤϾѤΤǤ礦¿δĶǤɬפʤΤǤۤȤɻȤޤ󡣤ϥѥΥץͭˤ̵ˤǤۤɤǤ

: 2

q.2.5. Digraphs ץ

Digraphs trigraphs ƱͤˡѥΥץͭˤ̵ˤǤۤɤǤ礦

: 2

q.2.6. ˥󥰻ꥪץ

Violation of syntax rule or constraint ǤϤʤΤФ륦˥󥰤ϡʤ٤¿Ū˽ФƤ줿ۤΩޤˤäƤϤ뤵Ȥ⤢ޤ˥󥰤Υ٥ꤹ륪ץ󡢤ޤϼऴȤ˥˥󥰤ͭˤ̵ˤꤹ륪ץϡߤΤǤ

: 4

q.2.7. ¾Υץ

ץץˤϤΤۤˤͭѤʥץ󤬤Ĥꤨޤ 䤿˥ץ¿ΤѻǤʤȲλؤʤΤ⤢ޤŪ褯ΤϡֹϤʤץ-P ¿ˤǡϣøʳŪ˻ȤΤȻפޤȤ˽ϤΤ⤢ޤϣӤΥޥɥץåˤäƤϡǥåΥ쥯ȤϤΤۤǼ¸ɬפΤ⤢ޤޤץץΩץǤϤʤ룱ѥѥǤϡץץνϤꤹ륪ץ󤬤ߤȤǤ
C90 (C95), C99, C++ ̤륪ץɬפʤΤǤ C99 C++ θߴ夲C++ Υץץ C99 ΤΤ˶Ť˥ץͭѤǤ礦
Makefile 뤿Ρեΰ¸طҹԤϤ륪ץäƤץץå⤢ޤ

: 10

q.2.8. #pragma ˤĥ

Standard C Ǥϡϸͭ directive Ϥ٤ #pragma sub-directive ȤƼ¸뤳ȤˤʤäƤޤץץϤƤ #pragma 򤽤ΤޤޥѥϤޤ #pragma ϼʬȤޤץץ #pragma ¿Ϥޤ

#pragma once Ƚ񤤤Ƥإåեϲ #include Ƥ٤ɤޤʤȤΤޤ¿ include 򤱤뤿Ǥʤ®٤夲뤿ͭʤΤǤ#pragma once Ȥ鷺ˡإåեΤ㤨

#ifndef __STDIO_H
#define __STDIO_H
...
#endif

ȤäǤޤƤȡưŪˤ򼡲ϥʤ褦ˤϤ⤢ޤ

mcpp ˤϥإåե "pre-preprocess" ơ¿ΥإåեܤˤޤȤƤޤȤȤΤǤ #pragma directive ⤢ޤʤ#include Ǽޤإå򤤤äץץƽϤ˸줿 #define directive ޤȤƽϤɲäȤǽǤΥѥǤϤ include ­ޤ pre-preprocess إåեϡȤ #if ʤʤΤǥʤꡢޥƤӽФʤʤޤե⣱ĤǤߤޤ̤Ȥƥץץ®ʤޤ
إå pre-compile ȤǽĽϤ⤢ޤϼȤ C++ ǵʥإåե뤿˹ͤ줿ΤΤ褦Ǥpre-compiled header ΥΥإåեιפ礭ʤ뷹ꡢʤȤ C Ǥ®ٸθ̤Ϥޤʤ褦ǤPre-compiled header Ƥ compiler-proper ͤ˰¸Ƥơ桼ˤϸʤ black box ˤʤȤ⡢Ǥ
ɤˤƤ⡢ʾϤ٤ƥץץ®뤿ΤΤǡʳΰ̣Ϥޤ󡣤äơεǽϤǤɾq.3.1 ɾ뤳Ȥˤޤ

Multi-byte character encoding ꤹ #pragma ĽϤ⤢ޤץץå䥳ѥ˥ʸ encoding ˡȤƤϡʤΤǤ

mcpp ϥץץȥ졼ǥХåϤ #pragma äƤޤ̾ΥǥХåǤϥץץΥǥХåϤǤʤΤǡϥץץåǤǤʤפʵǽǤεǽϥץǻꤹ #pragma ȤۤǥХåĽǤΤǻȤ䤹ʤޤ

顼䥦˥󥰤ΥȥλΤ褦ˡ̾ϥѥץǻꤹ뤳Ȥ #pragma ǼƤϤ⤢ޤ#pragma Standard C νϤǤ portability ꤬ʤȤȡξꤷƻǤȤĹ꤬ޤѹϥؤ뤳ȤˤʤȤû⤢ޤʤ顢ѥץǤƤ餤ΤǤ

ʳ #pragma ǥץץǽΤϡޤꤢޤ
Ȥǡ#pragma sub-directive implementation-defined Ǥ뤿Ʊ̾ sub-directive Ϥˤäưۤʤ̣Ķ줬ޤ̾ξͤ򤱤빩פ˾ޤޤGCC 3 Ǥ #pragma GCC poison Ȥդ GCC Ȥ̾ǻϤޤޤɤˡǤmcpp V.2.5 Ϥޤͤ #pragma MCPP debug Ȥդ MCPP Ȥ̾ǻϤޤ褦ˤޤ

: 10

q.2.9. ĥǽ

ĥǽ #pragma Ǽ뤳ȤˤʤäƤޤȤ̤˥ץץοͤƤȤ #pragma ǤϤʤǥ쥯ƥ֤⤢ޤ

Linux ΥƥإåǤ GCC #include_next ȤƤޤϥƥإå̵ѤʣƤ뤳ȤˤΤǡȤǤϤޤGCC / cpp ˤϤΤۤˤ #warning, #assert εʳΥǥ쥯ƥ֤ޤ⤢ޤɬδʤΤǤ

GCC / cc1 Ǥɸ⡼ɤưΤۤ traditional ⡼ɤλͤΥץ󤬤ޤmcpp ˤ¿ͤưͤΥץ󤬤ޤߤˤϤʤΰ̣ޤ

: 6

4.5.3. ¹ԸΨ

q.3.1. ®

ΤȿǤŪΤȤϺǤפʤΤǤ®٤®ˤȤϤޤ
®ٸΤ #pragma 䥪ץươ̤ȤƤɤ®٤ˤʤ뤫򸫤ޤ

: 20ϤϤ˥ԡΡ⤷ʤץ®٤ 20 ȤŪˤɤ٤ˤäդ롣Ūʼ٤ 6.2 򻲹͡Ū®٤Ϥϡɥˤäư㤦ΤǡƱ٤ΥϡɥȤӤ롣ޤƱץƤ⡢ɤ߹ޤϤɸإå̤ˤäƽ֤äƤ롣mcpp ȤӤΤɤ
֤¬ˤϡUNIX ϤǤ time ޥɤȤbash, tcsh ǤȤ߹ߥޥɤǤ)Windows ǤϡCygWIN Ȥʤ顢Ϥ bash time ޥɤ롣ޤWindowsNT Ρ֥꥽åȡפ TimeThis ȤƱͤΥޥɤ (*1)餬ȤʤĶǤϡtool/clock_of.c 򥳥ѥ뤷ƻȤʤʤΤǤ뤬ˡ
ǶΥϡɥǤϥץץʤɰ֤ǽäƤޤȤ¿Τǡʤʤ֤¬뤳ȤǤʤ Windows Ǥ Windows.h include ԹŤΤǡ줬Ȥ롣 UNIX ϤǤ glibc ΥʤɤŤǻȤ

:

*1 WindowsNT Υ꥽åȤΥץˤ WindowsXP ǤϻȤΤȻȤʤΤȤ뤬TimeThis ϻȤ褦Ǥ롣

q.3.2.

̤Ͼʤ˱ۤȤϤޤ󡣤Ȥ˥ƥͿ̤˸¤ϡڼ¤Ȥʤޤ

ץץϥѥΰǤΤǡºݤˤϽΤΥ̤ȤʤޤץץΩץץåˤäƹԤϡ̾ϥѥΤΤۤ򿩤ΤǡץץåΥ̤ϤޤˤʤʤǤ礦ޥ¿ʤɡץץåΤۤ񤹤뤳Ȥ⤢ޤ̤ˤϥץ礭ФǤϤʤǡꥢλ̤ޤޤޤ

: 20 ¬ΤϤϤʤʤŬˡʤ UNIX ϤǤ glibc firefox Τ褦礭ʥ make ʤ top Ω夲Ƥ cc1 mcpp Υ̤Ϥ狼롣 Windows Ǥϥޥ͡Ω夲ơWindows.h include Ȥ狼롣

q.3.3. ܿ

ץץåΤΤΥΰܿϡϤδ¸Υץץåȼؤ褦Ȥ䡢ʬȤ򥢥ץǡȤꥫޥꤷ褦ȤˡȤʤޤΤ褦ɾоݤȤʤǤ礦

  1. Ƥ뤫ʸƤʤ 0 ˡ
  2. ¿νϡϣӤбƤ뤫
  3. ܿǤϡϣӤϰϤϤɤɤ郎󤵤Ƥ뤫
  4. ܿ䤹
  5. ܿΤΥɥȤƤ뤫

: 20䤬ɤΤϣȾ餤ˤʤ į᤿Ǥ롣äơκϤƤäݤǤ롣

4.5.4. ɥȤʼ

q.4.1. ɥȤʼ

d.* Ǥ Standard C ΡֽפˤĤƤΥɥȤ뤫ʤ򸫤ޤǤϥɥȤΤ¾ʼɾޤ
ɥȤȤƤϽΤۤˡ¡ΤΤɬפǤ礦

  1. Standard C ȤΰƱ
  2. ץλ͡
  3. ǥåΰ̣
ΤۤStandard C ʬޤ᤿ץץΤλͤβ⤢С˱ۤȤϤޤ
ˤĤơΤɤߤ䤹ɾоݤȤʤǤ礦ܿΤΥɥȤ q.3.3 ɾ˴ޤޤ

: 10


4.6. C++ Υץץ

ýϤ C++ ϤȤä󶡤뤳Ȥ¿ʤäƤޤξϥץץåϣä C++ ȤƱΤȤƤ褦ǤΤξԤΥץץϤۤȤƱʤΤǡ虜虜̤ΥץץåѰդɬפϤʤǤ礦ξԤϤޤäƱǤϤޤ

C++ Standard C90 ٤ȡC++ Υץץ C90 Υץץ˼λͤդäΤˤʤäƤޤ

  1. Basic source character set ˴ޤޤʤ character ϡtranslation phase 1 \Uxxxxxxxx η Unicode Σ sequence Ѵ롣ơ translation phase 5 Ǽ¹ԻʸåȤ˺Ѵ롣*1
  2. // ޤǤ򥳥ȤȤ롣*2
  3. ::, .*, ->* 򤽤줾죱Ĥ pp-token Ȥư*3
  4. #if Ǥ true, false boolean literal Ȥơ줾 1, 0 ɾ롣*4
  5. ISO C : Amendment 1 (1995) Ǥɸإå <iso646.h> ǥޥȤ 11 identifier operator ϡ٤ƥޥǤϤʤ token Ǥ̵̣ʻ͡ˡ(*3) Ʊͤˡnew, delete operator Ǥ롣*5
  6. ޥ __cplusplus 199711L pre-define Ƥ롣*6
  7. __STDC__ 뤫ɤȤФɤ뤫 implementation-defined Ǥʵդ C99 Ǥ __cplusplus undefined Ǥˡ*6
  8. Translation limits ϼΤ褦˳礵Ƥ롣ϥɥ饤Ǥꡢ׵ǤϤʤϤ translation limits ɥȤʤФʤʤ*7
    ԤĹ 65536 Х
    ʸƥ롢ʸheader name Ĺ65536 Х
    Identifier Ĺ 1024 ʸ
    #include Υͥ 256 ٥
    #if, #ifdef, #ifndef Υͥ 256 ٥
    #if ΥåΥͥ 256 ٥
    ޥΥѥ᡼ο 256
    Ǥޥο 65536
  9. Header name '.' Ĺˡʵʤˤ¤Ϥʤʤä*8

C99 ǤϤΤƱͤˤʤäƤޤ¾ϰۤʤޤޤC99 ǤϤˡư p+, P+ Ȥ sequenceidentifier multi-byte character ȤθǧѰޥιˡ #pragma ԤΰΥޥŸġ_Pragma() operator#if long long ʾǤɾܤ wide-character-string-literal character-string-literal wide-character-string-literal ȤƤϢääơ㤬ȯƤޤUCN C99 Ǥ translation phase 5 εˤʤޤUCN ˴ؤ constraint ⾯㤷ƤޤTranslation limits C99 Ǥ C90 ˳礵줿ΤΡC++ Standard ۤɶüǤϤʤǤ㤤ФƤƤޤ

ۤ礭ʰ㤤ǤϤʤȤޤǤ⤳㤦ȡäC++ ƱץץǤޤ櫓ˤϤޤ󡣣äˤĤƤ⡢C90 (C95) C99 ȤƱΥץץǴ֤˹碌뤳ȤϤǤޤ

ʤC++ __STDC__ ƤΤϴְ㤤ΤȤǤꡢޤȤǤϤޤ
__cplusplus ˤĤƤϡ -D ץϤ⤢ޤǤϥ桼ޥΣĤˤʤäƤޤΤǡŬڤǤ
::, .*, ->* 򣱤Ĥ token ȤưɤϡץץǤϤۤȤˤʤʤȤǤ˱ۤȤϤޤ

ȤǡC90 (C95), C99, C++ δ֤ǥץץå̤ˤ뤿ˤϡ¹ԻץǻԤ̤˱ƾ嵭νѤȤΤޤȤʼȻפޤ

ʤmcpp ǤϾ嵭λͤΤΣϡѤ٤Ƽô礭뤿ᡢбƤޤ󡣼ѾϤǤۤȤʤȻפޤ

  1. Translation phase 1 Ǥ UCN ؤѴϼƤʤC++ Standard Ǥϡɬ UCN ѴʤƤ⡢Ʊ̤ˤʤʤɤȤƤ롣ѾϤȤ⤫̩ˤϡѴ˾Ʊ̤ˤʤϤϤʤΤǤ롣#if Ǥ UCN multi-byte-character ȤʸӤͤФ狼롣# 黻Ҥˤʸ󲽤Ǥ⸷̩˸С꤬롣*9
  2. ޥκѥ᡼ 255 ĤޤǤǤʤ

ʲˡC90 Υץץղä C++ ȼΥץץؤŬΥƥȤ򼨤ޤ
Translation limits ˤĤƤ test-l ǥ쥯ȥˤΰʾΥץѰդƤޤC++ Ǥ translation limits ϥɥ饤ˤʤȤȤ⤢ꡢǤɾоݤȤޤ󡣤ޤheader name Ĺ OS ʤΤǡƥȤоݤȤޤ

:

*1 C++ 2.1 Phases of translation

*2 C++ 2.7 Comments

*3 C++ 2.12 Operators and punctuators

*4 C++ 2.13.5 Boolean literals

ʤC99 Ǥ <stdbool.h> bool, true, false, __bool_true_false_are_defined ޥȤƤ줾 _Bool, 1, 0, 1 뤳ȤˤʤäƤ롣

*5 C++ 2.5 Alternative tokens

*6 C++ 16.8 Predefined macro names

*7 C++ Annex B Implementation quantities

*8 C++ 16.2 Source file inclusion

C90 6.8.2 Ǥϡheader name '.' 麸ˤϣʸޤǤݾڤƤʤäC99 6.10.2 ǤϣʸǤ롣C++ ǤϤ¤Ƥ롣

*9 C99 Ǥϡ# 黻Ҥˤä UCN ʸ󲽤줿硢\ Ťͤ뤫ɤ implementation-defined Ǥ롣C++ ˤϤεϤʤ
Ťͤϡ UCN ϤϤ multi-byte character ʤΤǡŤͤʤۤɤǤ롣C++ εǤϡŤͤʤΤϡְִä׼ˤʤäƤޤ

4.5.n.ucn1. UCN ǧ

: 4

4.5.n.cnvucn. Multi-byte character UCN ؤѴ

: 2

4.5.n.dslcom. //

: 4

4.5.n.bool. true, false boolean literal

: 2

4.5.n.token1. ::, .*, ->* ϥȡ

: 2ƥȤ츫褦Ǥ⡢äǽƤƱ褦ˡΥ˥󥰤Ф˥ȡϢ뤬פƤޤΤǤϡԲġ

4.5.n.token2. Operator إȡ

: 2

4.5.n.cplus. ޥ __cplusplus

: 4__cplusplus < 199711L ξ 2

4.5.e.operat. identifier-like operator ϥޥ̾˻Ȥʤ

: 2ĤȤ⥦˥οǥåФ 2

4.5.u.cplus. #define, #undef __cplusplus

: 1˥οǥåФ 1

4.5.d.tlimit. Translation limits Υɥ

: 2


5. åץץμ

åץץåεʽ٤ʼȤ̤ˡºݤ˥ץץåȤ˽в񤦼դ򡢰ʲ˼夲Ƥߤޤ


5.1. ɸإåե

Validation Suite ΥץǤϡĤɸإå include ƤޤΥإå񤫤ƤʤȡץץåΤΤΥƥȤΤˤǤޤ
ʲˡɸإåμ䤹Ȥ򸫤Ƥޤ

5.1.1. Ū

ɸإåϵꤵƤؿ䷿ޥ򤹤٤ƴޤǤʤФʤʤΤϤǤ˼Τ褦ʾʤФʤʤȤˤʤäƤޤ

  1. ꤵƤ餺ͽ󤵤Ƥ⤤ʤ identifier ꤷƤϤʤǤϰϤɸإåˤäƷޤäƤʣɸإåǽʣ롢뤤϶̤ϰϤ⤢ˡ*1
  2. äơĤɸإå̤ɸإå include Τ̾Ϥʤ
  3. ʣɸإåɤΤ褦ʽ include Ƥ⡢Ʊ̤ˤʤʤФʤʤ*2
  4. Ʊɸإåʣ include Ƥ⡢<assert.h> ʳƱ̤ˤʤʤФʤʤ*2
  5. Ÿ object-like ޥȤƵꤵƤΤϤ٤ #if ǤʤФʤʤ*3

ͽ󤵤 identifier ϰϤϵꤵƤꡢʳ identifier ϥ桼˲ƤʤФʤޤ'_' ĤޤϣĤǻϤޤ̾Ϥ٤Ʋ餫λѤΤͽ󤵤ƤΤǡϤɸإåǻȤȤǤޤʵդ˥桼 '_' ĤޤϣĤǻϤޤ̾ƤϤʤˡ
ϾʵǤʳŪ̾Ϥ٤ '_' ǻϤޤΤѹʤ Standard C ǤϻȤʤȤȤˤʤޤStandard C Υ饤֥ɸإåενȯȤʤä POSIX Ǥ⡢Standard C εʳ̾

#ifdef  _POSIX_SOURCE
    ...
#endif

ǰϤळȤˤƤޤʤȤ⤳ʬȤϽϤ Standard C ǤϤʤʤäƤޤޤ

⡢㤨 open(), creat(), close(), read(), write(), lseek() δؿ̾ɸإåˤϸƤʤƤ⡢fopen(), fclose(), fread(), fgets(), fgetc(), fwrite(), fputs(), fputc(), fseek(), etc. δؿ open(), etc. ȤäƼƤСŪ˥桼֤̾򿯳뤳Ȥˤʤޤäơɽ open(), etc. _POSIX_SOURCE ʬ <unistd.h> ̥إåˤꤷƤ⡢̣ޤ
֥ƥॳؿפ '_' ǻϤޤ̾ѹ뤫Ȥ¾ɬܤΤΤ Standard C ˼뤫ɤ餫Ԥ뤷ޤ

2 ϵƤ뤳ȤǤϤޤ󤬡ɸإå¾ɸإå include ȡ̾ϤɸإåǤʤ̤̾ˤʤΤǡ1 ˤҤäޤ<stddef.h> ɸإå include ꤹΤȿ§Ǥ򤱤뤿ˤ <sys/_defs.h> Ȥä̤̾ɸǤϤʤإåѰդơɸإå<stddef.h> Ȥˤ include 褦ˤɤΤǤơǻȤ̾Ϥ٤ '_' ǻϤޤΤˤ뤳ȤǤ*4, *5

3 ϼºݤȤʤ뤳ȤϤʤǤ礦

4 ϸŤϤǤΤäȤǤߤνϤǤϤۤȤбǤƤ褦Ǥ

#ifndef _STDIO_H
#define _STDIO_H
...
#endif

ȤäɸإåΤ򤯤ˡŪǤΤۤ#pragma once Ȥäĥ directive Ȥˡ⤢ޤ

5 ȤʤΤϡsizeof 䥭㥹ȤȤäޥɸإå˽񤫤ƤϤ뤳ȤǤStandard C Ǥϡ#if sizeof 䥭㥹ȤϻȤޤ󡣼ºݤɸإåΥޥ sizeof 䥭㥹ȤȤäƤϤǤϡ#if Ǥ sizeof 䥭㥹ȤȤ褦ǤBorland C 5.5ˡϳĥͤΤĤʤΤǤ礦

桼ʬΥץ #if Ԥ sizeof 䥭㥹ȤȤʤ¤ꡢportability ꤬ȯ뤳ȤϤʤ¾ȯ뤳ȤϼºݤˤϤޤʤǤ礦Υץץμ Standard C ΡֳĥפǤϤʤְæפȸ虜򤨤ޤ󡣤ʤʤ顢Standard C Ǥ #if Τ translation phase 4 Ǥꡢ phase Ǥ keyword ¸ߤʤΤǤKeyword phase 7 ǽǧޤPhase 4 Ǥ keyword Ʊ̾Ϥ٤ñʤ identifier Ȥư졢#if ԤǤϥޥȤƤʤ identifier Ϥ٤ 0 ɾΤǡsizeof (int) 0 (0) ȡ(int)0x8000 (0)0x8000 Ȥʤꡢviolation of syntax rule ȤʤޤФƽϤϿǥåФʤФʤޤ󡣿ǥåФʤΤϡStandard C ΡֳĥפǤϤʤְæפǤޤ⤽ phase 4 ǰ keyword ǧȤΤϡץץȤ̵ꡢcompile phase (translation phase 7) "pre"process phase ȤƤΰ̣𤵤ΤȤޤ*6

:

*1 C90 7.1.3 Reserved identifiers ͽѤ߼̻
   C99 7.1.3 Reserved identifiers
*2 C90 7.1.2 Standard headers ɸإå
   C99 7.1.2 Standard headers
*3 C90 7.1.7 Use of library functions 饤֥ؿλˡ
   C99 7.1.4 Use of library functions

*4 ܤǤϤˡȤƤ롣 ܤϤȤ˽ϤμˤȤäơͤȤʤ¿

P. J. Plauger "The Standard C Library", 1992, Prentice Hall

*5 GNU glibc ΥƥǤϡɸإåȤˤä <stddef.h> ¾ɸإåʣɤ߹ޤ褦ˤʤäƤ뤬λΤͽ󤵤줿ϰϤ̾Τ褦Ǥ롣ϵʰȿȤϸʤɸإå readability »ʤƥʥ󥹤ˤΤǡɤˡǤϤʤ<sys/_defs.h> ȤäեȤۤɤ

*6 2.3, 3.4.14 ȡ

5.1.2. <assert.h>

˸ġɸإå򸫤Ƥޤ ĤνϤ°ɸإå򸫤ȡǤ¿Τ <assert.h> <limits.h> Τ褦ǤΣĤϺǤñʥإåʤΤǤC90 ǿꤵ줿ΤǤ뤿ᤫְ㤨뤳Ȥ褦ǤΣĤˤĤƤϡȤˤ⾯ޤ

ޤ <assert.h> Ǥ*1, *2
¾ɸإåȰäƤϡ include ƤƱȤ櫓ǤϤޤNDEBUG Ȥޥ桼뤫ʤˤäơinclude 뤿Ӥ˷̤ѤޤʤΥإåɬפ˱Ƥ

#undef      NDEBUG
#include    <assert.h>
    assert( ...);

ȤȤ򤹤ΤǤơǥХåΤȤ

#define     NDEBUG
#include    <assert.h>
    assert( ...);

ȤƤޤNDEBUG ƤСassert( ...); ˻ĤäƤƤ⡢ޥŸȾäƤޤޤ... ѤļǤäƤ⡢ɾʤΤǡѤȯʤȤաˡ

ȤǤ뤿ˤϡ<assert.h>

#ifndef _ASSERT_H
#define _ASSERT_H
    ...
#endif

ʤɤȤǤǤϤޤ #pragma once ʤɤ⡢񤤤ƤϤޤ

ޤΤȤ狼褦ˡassert() ϥޥǤꡢNDEBUG ˤäƤѤޤ<assert.h> Ϥ #undef assert ȤǡNDEBUG ˱ assert ޥʤɬפޤ
assert( expression) ȤƤӽФǤϡNDEBUG ƤʤСexpression Ǥв⤻ǤФλݤɸ२顼Ϥ𤷤ޤϡexpression 򤽤Τޤ޻̤ɽʥޥäƤŸˡΥΥե̾ȹֹɽޤϥץץå # 黻Ҥ __FILE__, __LINE__ ޥƤСñ˼¸Ǥޤ

ºݤˤϸŤϤǤϡ# 黻ҤƤʤäꡢ<assert.h> ְ㤨ƤΤޤ Validation Suite Υץˤ <assert.h> include ƤΤ¿ޤ<assert.h> 񤫤ƤʤȥץץåȤΥƥȤΤˤǤޤ <assert.h> ϴñ˽񤱤Τǡ°ΤΤнľƤۤɤǤ礦ΤΤ C89 Rationale 4.2.1.1 㼨ƤΤǤ󤳤Ǥ⡢# 黻ҤƤʤΤʷ̤ˤϤʤޤ󤬡ϥץץåʤΤǡ򤨤ޤ

#undef  assert
#ifndef NDEBUG
#   define  assert( ignore)     ((void) 0)
#else
extern void __gripe( char *_Expr, char *_File, int _Line);
#   define  assert( expr)   \
    ((expr) ? (void)0 : __gripe( #expr, __FILE__, __LINE__))
#endif

__gripe() ȤؿϼΤ褦˽񤱤ޤʤ__gripe Ȥ̾ '_' ǻϤޤΤʤ鲿Ǥ褤ˡ

#include    <stdio.h>
#include    <stdlib.h>

void    __gripe( char *_Expr, char *_File, int _Line)
{
    fprintf( stderr, "Assertion failed: %s, file %s, line %d\n",
        _Expr, _File, _Line);
    abort();
}

__gripe() δؿȤ鷺 fprintf() 뤤 fputs() abort() ľ <assert.h> ˽񤤤ƤϤ⸫ޤäƤǤʤȤǤϤޤ󤬡ΤˤϤδؿɬפǤFILE stderr ɬפǤ<stdio.h> include 櫓ˤϤʤΤǡʤäǤ̴ؿְۤ㤤ޤ
ޤʤȤǤ٤ƤޥǼ¸ϡƤӽФΤӤʸƥ뤬ʣޤʣʸƥ򣱤Ĥ˥ޡŬϤʤϡɥξǤǤϤޤ

:

*1 C90 7.2 Diagnostics <assert.h> ǵǽ<assert.h>
   C99 7.2 Diagnostics <assert.h>

*2 C99 Ǥϡassert() ޥɤδؿƤӽФ줿ɽ뤳ȤˤʤäӤΤˡ__func__ Ȥ̻ҤꤵƤ롣

5.1.3. <limits.h>

ɸإåϰɽޥ񤤤ƤΤǤΥޥνϡͤȹפƤ뤳ȤϤǤ˼ξƤɬפޤ*1

  1. #if directive ǻȤǤ뤳ȡ
  2. б뷿Υ֥Ȥ integral promotion ̤ηƱμǤ뤳ȡ

㥹ȤȤäƤϤޤ #if directive Ǥ sizeof 䥭㥹Ȥ Standard C ϰϤˤʤȤϡ5.1 ޤ⤽⡢<limits.h> ꤵ줿̣ϡ㥹Ȥ sizeof Τ褦ʼ¹ԻĶ˴ؤȲ򡢥ץץåɬפʤ褦ˤ뤳Ȥˤޤ
㤨С

#if (int)0x8000 < 0

Ȥ

#if sizeof (int) < 4

ȤȤˡ

#include    <limits.h>
#define VALMAX  ...
#if INT_MAX < VALMAX

ȤΤǤ#if Ǥ <limits.h> ΥޥȤС㥹Ȥ sizeof ȤɬפϤʤϤǤ

<limits.h> Υޥְ㤨ƤϡޤϤΥץץåλͤ餯ΤǤϤʤ<limits.h> 񤯿ͤ嵭2. integral promotionĥˤ usual arithmetic conversion̾λѷѴˤε§ȡɾε§Τɤ줫ǰ뤳Ȥ鵯ΤΤ褦Ǥ

㤨СΤ褦򤷤ƤΤޤ

#define UCHAR_MAX   255U

unsigned char ͤϡCHAR_BIT 8 ǤСˤ٤ int ϰϤˤޤΤǡunsigned char Υǡ֥Ȥͤ integral promotion ˤä int ˤʤޤä UCHAR_MAX int ȤɾΤǤʤФʤޤ󡣤Ȥ255U Ǥ unsigned int ˤʤäƤޤޤ

#define UCHAR_MAX   255

ȤʤФʤʤΤǤ

ɤǤѾʤΤǤϤʤȻפ⤷ޤ󤬡ɬ⤽ǤϤޤ̵ηޤ黻ϡ̾λѴפƱդη̵ؤѴޤΤᡢ羮Ӥη̤äƤΤǤ

assert( -255 < UCHAR_MAX);

ȤƤߤȡ狼Ǥ礦

δְ㤤ˤϡintegral promotion usual arithmetic conversion ε§ Standard C ǤϤޤǤ¿νϤǺѤƤΤѹ줿Ȥ𤬴طƤޤK&R 1st. ˤ unsigned char, unsigned short, unsigned long ȤϤޤǤθ塢¿νϤ˼褦ˤʤꡢƤνϤ¿Ǥϡ̵Ͼ̵Ѵ뤳ȤˤʤäƤޤ
Standard C integral promotion Ǥϡunsigned char, unsigned short Ϥ줾줹٤Ƥͤ int ϰϤˤޤ¤ int promote 졢Ǥʤ unsigned int promote ޤޤunsigned int long Ȥδ֤ usual arithmetic conversion Ǥϡunsigned int Τ٤Ƥͤ long ϰϤˤޤΤǤ long ˡǤʤ unsigned long Ѵޤ"unsigned preserving rules" "value preserving rules" ؤѹȸƤФΤǤΤۤľŪ˰ճʤȤΤεͳȤƤޤ<limits.h> Ǥϡε§դɬפǤ*2

ʲǤϤ٤ơshort ϣӥåȡlong ϣӥåȤȤޤUSHRT_MAX ͤ 65535 Ǥν int ӥåȤξȣӥåȤξȤǰäƤޤ

#define USHRT_MAX   65535U      /* int ӥåȤξ   */
#define USHRT_MAX   65535       /* int ӥåȤξ   */

unsigned short int ӥåȤξ int ϰϤˤޤʤΤǡunsigned int promote ޤäơUSHRT_MAX unsigned int ȤɾΤǤʤФʤޤ65535 Ǥ long ȤɾƤޤޤ 'U' ɬפʤΤǤ¾ int ӥåȤξ unsigned short ͤϤ٤ int ˤޤΤǡint promote ޤä USHRT_MAX int ȤɾΤǤ뤳ȤɬפǤ'U' դƤϤޤ󡣤Ȥ줬դˤʤäƤ㤬ޤ

#define USHRT_MAX   0xFFFF

ʤ顢int ӥåȤǤ⣳ӥåȤǤɾޤStandard C ǤϡU, u, L, l ȤҤɤդʤʤޤϣʤȡϡint, unsigned int, long, unsigned long νǡǤͤɽǤ뷿ɾޤʤ0xFFFF int ӥåȤʤ unsigned int 65535int ӥåȤʤ int 65535 ɾΤǤФơҤդʤȡϡint, long, unsigned long νɾޤ65535 int ӥåȤʤ longint ӥåȤʤ int ɾ뤳Ȥˤʤޤ*3

C99 Ǥϡ long long / unsigned long long ɲäޤ0 1 ͤʤ _Bool Ȥɲäޤ¾η⥪ץǼǤ褦ˤʤޤInteger promotion Υ롼礵졢unsigned long ɽǤʤȡ long long / unsigned long long ɾ뤳Ȥˤʤޤ
ޤǧ줿Τȼäơ羮ط狼ˤʤäᡢinteger conversion rankѴ󥯡ˤȤǰƳޤγǰϤʣǤѾϵˤɬפϤޤɸǤϥ󥯤羮طϼ̤Ǥ

long long > long > int > short > char > _Bool

ǡȤ long int Ȥ 32 ӥåȤȤ褦ʥƱǤäƤ⡢󥯤羮϶̤ȤȤݥȤǤ *4, *5

:

*1 C90 5.2.4.2.1 Sizes of integral types <limits.h> 礭<limits.h>
   C99 5.2.4.2.1 Sizes of integer types <limits.h>

*2 C90 6.2.1 Arithmetic operands ѥڥ
   C99 6.3.1 Arithmetic operands

*3 C90 6.1.3.2 Integer constants 
   C99 6.4.4.1 Integer constants

*4 C99 6.4.4.1 Integer constants

*5 C99 Ǥ integer types νϤˤۼ뤿 <stdint.h> <inttypes.h> ȤɸإåɲäƤ롣64 bits ƥоˤä integer types μबơбط狼ˤʤäƤᡢlong Ȥ short Ȥ̾ΤۤˤĤη̾ typedef 褦ȤΤǤ롣η̾ 26 ⤢ꡢб͡Ǿͤɽޥ 42 б fprintf() format specifier Ѵޥ 56 Ʊͤ fscanf() format specifier Ѵޥ 56 ˤ롣ϤôϤޤʤȤϸѻơɾδѤ褷Ƥ롣

5.1.3.1. INT_MIN

<limits.h> ΥޥΤǺǤ⺮θΤɽĥƥǤ INT_MIN LONG_MIN ǤǤ int ӥåȤ long ӥåȤνϤǤ INT_MIN 嵭򤹤٤ƸƤޤǡäˤʬƼ夲Ƥߤޤ
ξ硢int ϰϤ [-32768,32767] Ǥ뤳ȤϸޤǤ⤢ޤ󡣤ơINT_MAX ˤĤƤϤɤνϤ 32767 뤤 0x7FFF ȤƤơꤢޤ󡣤ȤINT_MIN Τ褦Ƥ򸫳ݤޤ

#define INT_MIN     (-32767)

ʤΤ褦ʼºݤȰ㤦򤷤ƤΤǤ礦
¾ǡˤƤϤϸޤ

#define INT_MIN     (-32768)

-32768 -, 32768 ΣĤΥȡ󤫤äƤޤơ32768 int ɽǤϰϤˤޤ󡣤ǡ long ɾޤäơ-32768 - (long) 32768 ΰ̣ˤʤäƤޤΤǤ
ˤϡƤΤ⤢ޤ

#define INT_MIN     ((int)0x8000)

㥹ȤȤäˤĤƤϡȤϷ֤ޤ0x8000 Ǥ (unsigned) 32768 ΰ̣ˤʤΤǡϤԲĤǤ

ǤϡɤС㥹ȤȤ鷺 (int) -32768 ɾΤǤ礦

#define INT_MIN     (-32767-1)

ɤΤǤ32767 INT_MAX Ǥ 0x7FFF Ǥ⤫ޤޤ󡣤ˤϰȤ黻ޤޤƤޤꤢޤʤ⤽ñ - 黻ҤǤˡ*1, *2

#define INT_MIN     (~INT_MAX)
#define INT_MIN     (1<<15)

Ǥ

#define INT_MIN     (-32767)

ϱ黻򤹤Ȥۤ⤫Фʤäˡͤ뤳Ȥ򤢤᤿Τȿ¬ޤ

Ǥϡ-32767 Ȥϴְ㤤Ǥ礦 Ȥ⡢ʤΤǤ礦
Сϴְ㤤ȹͤޤ
INT_MIN int κǾͤɽޥȵꤵƤޤ⤷ INT_MIN -32767 ȤȡϤạ̈ΤʤΤǤ礦 ơINT_MIN-1 ϤäʤΤǤ礦 뤤 ~INT_MAX 1<<15 ϲǤ礦
ξ INT_MIN-1 ˤĤƤϡư黻ΡפΤ褦ϰϳɽӥåȥѥȤͤ褦Ǥ

˴ؤ Standard C εȾȤ餷碌ȡβΩ;Ϥޤ󡣤ޤˤĤƤΥӥåȱ黻η̤ϡop1 << op2 op1 >> op2 op2 ͤǤ뤫 op1 ηΥӥåȿʾǤ礬 undefined Ǥʳˤ undefined ʾϤʤ٤ΰդ֤ͤޤ~op op int ǤСη̤ int Ǥꡢop1 & op2, op1 | op2, op1 << op2, op1 >> op2 op1, op2 Ȥ int ǤСη̤ int Ǥäơ~INT_MAX 1<<15 ̤ int ʤΤǤ1<<15 overflow Ȼפ⤷ޤ󤬡ǤϤޤ󡣥ӥåȱ黻Ǥϥӥå򤷤̤Υӥåȥѥб֤ͤΤǡoverflow ȯ褦ʤΤǤ

äǤϰ̤α黻Ϥ褯Ƥơundefined ʬϤƾʤΤǤȤ˥ӥåȥѥͤȤδطϡͤɽ 0 ˣĤΥӥåȥѥ󤬤ʳϡ˰абƤޤ K&R 1st. Standard C ޤǰӤΤǤޤӥåȥѥ󤽤ΤΤɽˡϣäˤϤʤפɽ褦ˤ (-32767-1) Ƚ񤯤ޤ󤬡ϸƤ̤ int ͤΤΤǤC89 Rationale ϤĤκ󤲤ơˤϡ̵פȤפɽӥåȥѥ¸ߤ;ϤΤʤȤ餫ˤƤޤ*3, *4

ȤǡɽǤ ~INT_MAX INT_MIN ͤǤꡢ礭 INT_MIN ϴְ㤤ȸ虜򤨤ޤ

:

*1 䤬ƸΤϡP. J. Plauger "The Standard C Library" Ǥ롣ǶνϤˤϤή limits.h ¿ʤäƤ褦Ǥ롣

ܤ limits.h ˤְ㤤ΤǤ롣int ӥåȤ long ӥåȤνϤΤΤ褦ˤʤäƤ롣

#define UINT_MAX    65535
#define USHRT_MAX   65535

Ǥ long ɾƤޤϤǤ롣

#define UINT_MAX    65535U
#define USHRT_MAX   65535U

*2 ǶνϤǤ *_MIN (-*_MAX - 1) ȤŪˤʤꡢְ㤤ϾʤʤäƤ롣ޤ˴ְ㤤롣

Visual C++ 2003 Vc7/include/limits.h, Vc7/crt/src/include/limits.h ˤϼΤ褦ʤΤ롣

#define LLONG_MIN   0x8000000000000000

0x8000000000000000 unsigned long long ɾ롣ηϺǹ̥󥯤ǤΤǡinteger promotion η̤ƱǤ롣ޥʥͤˤϷ褷Ƥʤʤäơ

#if LLONG_MAX > LLONG_MIN

ϴԤ̤ˤϤʤʤ

LCC-Win32 2003-08, 2006-03 include/limits.h LLONG_MIN ϤʤäƤ롣

#define LLONG_MIN   -9223372036854775808LL

9223372036854775808LL ϤΥȡͤǤ signed long long ϰϤ overflow Ƥ violation of constraint Ǥ롣

#define LLONG_MIN   -9223372036854775808LLU

Ȥ 9223372036854775808LLU unsigned long long ˤʤ뤬̵ unary - 黻ܤƤ⡢̤ηѤʤΤǡunsigned long long ɽǤʤͤȤʤꡢundefined Ǥ롣

Visual C++ LCC-Win32 ¾ *_MIN Ϥ٤ (-*_MAX - 1) ȤʤäƤΤǤ뤬LLONG_MIN ְäƤΤϤɤȤǤ

#define LLONG_MIN   (-LLONG_MAX - 1LL)

ȤвϤʤ

Visual C++ 2005 ǤϤϽ줿

*3 C89 Rationale 3.1.2.5 Types
   C99 Rationale 6.2.6.2 Integer types

*4 C99 ǤϡΥӥåȥѥ㳰 "trap representation" ȤưȤ⡢Ϥ˵뤳ȤˤʤäƤ롣ºݤˤɤϤΤϡΤʤ

5.1.4. <iso646.h>

ISO C 9899:1990 / Amendment 1 Ǥϡiso646.h Ȥɸإåɲäޤ &, |, ~, ^, ! ޤ黻Ҥ ISO 646 invariant character set ɽ spelling 󶡤ΤǤ|, ~, ^ trigraphs Ǥ spelling 󶡤Ƥޤtrigraphs readability ˷礱Τǡiso646.h Ϥäƣα黻Ҥȡñ̤ǥޥƤޤ
μϤƴñǡΤ褦ʤΤǽʬǤץץǥޥŸΤǡϤˤȤäƤⲿݤϤޤ*1

/* iso646.h     ISO 9899:1990 / Amendment 1 */

#ifndef _ISO646_H
#define _ISO646_H

#define and     &&
#define and_eq  &=
#define bitand  &
#define bitor   |
#define compl   ~
#define not     !
#define not_eq  !=
#define or      ||
#define or_eq   |=
#define xor     ^
#define xor_eq  ^=

#endif

:

*1 C++ Standard Ǥϡ identifier operator ϥޥǤϤʤ operater-token ȤƤ롣ϤˤȤäƤϤäʡ̵̣ʻͤǤ롣


6. ƼץץåΥƥȷ

6.1. ƥȤץץå

ƥȤϤȼ¹ˡϼ̤ǤϤϥ꡼줿ν¤٤Ƥޤ
¹Իץ C95 (C90), C99, C++98 Τ줾Ǿİۤʤޤ
° <assert.h>, <limits.h> ꤬ϡľƤƥȤƤޤ

ֹ:   OS      /                     /  ¹ԥץǿ
    ¹Իץ
    

1 : Linux       /                           / DECUS cpp
    C95:    cpp
Martin Minow ˤ DECUS cpp Υꥸʥ (1985/01) DEC γƼ亮ƥࡢUNIX, MS-DOS ΤĤνϤ˰ܿƤ뤬ΥƥȤǻȤäΤϡkmatsui ꥸʥǤ˼ä Linux / GCC ǥѥ뤷ΡTranslation limits ʤ٤򥯥ꥢ褦ޥ񤭴
2 : FreeBSD 2.2.7   / GCC V.2.7.2.1         / cpp (V.2.0)
    GO32        / DJGPP V.1.12              / cpp (V.2.0)
    WIN32       / BC 4.0                    / cpp (V.2.0)
    MS-DOS      / BC 4.0, TC 2.0            / cpp (V.2.0)
    MS-DOS      / LSI C-86 V.3.3            / cpp (V.2.0)
    OS-9/6x09   / Microware C/09            / cpp (V.2.0)
    C95:    cpp -23 (-S1 -S199409L) -W15
            gcc -ansi -Wp,-2,-W15
    C99:    cpp -23 (-S1) -S199901L -W15
    C++:    cpp -23+ -S199711L -W15
kmatsui ˤ륪ץ󥽡եȥ (1998/08)mcpp ȸƤ֡DECUS cpp ١ȤƽľΡ ϤΥСϾ嵭νϤбƤ Linux GCC ǥѥ뤷ΤȤäƥƥȤ
3 : WIN32       / Borland C++ V.5.5J        / cpp32 (2000/08)
    C95:    cpp32 -A -w
            bcc32 -A -w
    C99:    cpp32 -A -w
    C++:    cpp32 -A -w
Trigraph cpp bcc trigraph.exe ȤѴץबѰդƤ롣ֵʽפȾΤ뤿ΥХǤ롣Borland C ǤϡȤäͽѴץǥƥȤȤ trigraph.exe <backslash><newline> ˤ³ޤǽƤޤΤᡢֹ椬q.1.2 ΤۤǸˡ
4 : Linux, CygWIN / GCC V.2.95.3 (2001/03)  / cpp0
    C95:    cpp0 -D__STRICT_ANSI__ -std=iso9899:199409 -$ -pedantic -Wall
            gcc -ansi -pedantic -Wall
    C99:    cpp0 -std=c9x -$ -Wall
    C++:    g++ -E -trigraphs -$ -Wall
GCC portable ʥǤΤǡΥƥ˰ܿΤλͤϰܿԤѰդ٤Ǥ뤬ȼΥɥȤ󶡤Ƥʤcpp ΥɥȤȤƤ GNU cpp.info ¸ߤʤ
5 : Linux    / GCC V.3.2 (2002/08)          / cpp0
    C95:    cpp0 -D__STRICT_ANSI__ -std=iso9899:199409 -$ -pedantic -Wall
            gcc -std=iso9899:199409 -pedantic -Wall
    C99:    cpp0 -std=c99 -$ -Wall
    C++:    g++ -E -trigraphs -$ -Wall
kmatsui ѥ뤷Ρ--enable-c-mbchar Ȥץդ configure Ƥ롣
6 : Linux    /                              / ucpp (V.1.3)
    C95:    ucpp -wa -c90
    C99:    ucpp -wa
Thomas Pornin ˤ륪ץ󥽡եȥ (2003/01)Portable ñΥץץåLinux / GCC ǥѥ뤷ƥƥȤ
7 : WIN32        / Visual C++ 2003          / cl
    C95:    cl -Za -E -Wall -Tc
    C99:    cl -E -Wall -Tc
    C++:    cl -E -Wall -Tp
-E ץǤϥȤ <backslash><newline> ʤΤǡѥˤƥȤʻ (2003/04)
8 : WIN32       / LCC-Win32 2003-08         / lcc
    C95:    lcc -A -E
            lcc -A
    C99:    lcc -A -E
    C++:    lcc -A -E
Jacob Navia C. W. Fraser & Dave Hanson Υץ󥽡եȥǤ lcc 򸵤˽񤤤糫ȯĶ (2003/08)ץץʬΥ Dennis Ritchie Plan9 Τ˽񤤤Ρ
9 : WIN32, Linux, etc.  /                       / wave (V.1.0)
    C95:    wave
    C99:    wave --c99
    C++:    wave
Hartmut Kaiser ˤ portable ʥץ󥽡եȥCompiler-independent ʥץץå Boost preprocessor library ʤΤȤäƼƤ롣ԤѰդ WIN32 Ѥμ¹ԥץ (2004/01) ǥƥȤ
10: FreeBSD, Linux, CygWIN   / GCC 2.95, 3.2
    WIN32, MS-DOS   / Visual C 2003, BCC, etc.  / mcpp_std (V.2.4)
    C95:    mcpp_std -23 (-S1 -V199409L) -W31
            gcc -ansi -Wp,-2,-W31
    C99:    mcpp_std -23 (-S1) -V199901L -W31
    C++:    mcpp_std -23+ -V199711L -W31
mcpp V.2.4 (2004/02) Standard ⡼ɡLinux / GCC ǥѥ뤷Τǥƥȡ
11: Linux    / GCC V.3.4.3 (2004/11)        / cc1, cc1plus
    C95:    gcc -E -std=iso9899:199409 -pedantic -Wall
    C99:    gcc -E -std=c99 -$ -Wall
    C++:    g++ -E -std=c++98 -$ -Wall
12: WIN32        / Visual C++ 2005          / cl
    C95:    cl -Za -E -Wall -Tc
    C99:    cl -E -Wall -Tc
    C++:    cl -E -Wall -Tp
-E ץǤϥȤ <backslash><newline> ʤΤǡѥˤƥȤʻ (2005/09)
13: WIN32       / LCC-Win32 2006-03         / lcc
    C95:    lcc -A -E
            lcc -A
    C99:    lcc -A -E
    C++:    lcc -A -E
LCC-Win32 2006-03 (2006/03)
14: Linux    / GCC V.4.1.1 (2006/05)        / cc1, cc1plus
    C95:    gcc -E -std=iso9899:199409 -pedantic -Wall
    C99:    gcc -E -std=c99 -$ -Wall
    C++:    g++ -E -std=c++98 -$ -Wall

15: WIN32        / Visual C++ 2008          / cl
    C95:    cl -Za -E -Wall -Tc
    C99:    cl -E -Wall -Tc
    C++:    cl -E -Wall -Tp
-E ץǤϥȤ <backslash><newline> ʤΤǡѥˤƥȤʻ (2007/12)
16: Linux, WIN32, etc.  /                           / wave (V.2.0)
    C95:    wave (--c99)
    C99:    wave --c99
    C++:    wave
wave V.2.0 (2008/08) Boost C++ Library V.1.36.0 ˴ޤޤƤ륽ɮԤ Linux/GCC, Windows/Visual C++ ǥǥեȤǥѥ뤷Τѡ GCC, Visual C ΥإåեȤγեѰդƥƥȡ
17: FreeBSD, Linux, Mac OS X, CygWIN, MinGW / GCC 2.95 - 4.1
    WIN32  / Visual C 2003-2008, BCC, LCC-Win32     / mcpp (V.2.7.2)
    C95:    mcpp -23 (-S1 -V199409L) -W31
            gcc -ansi -Wp,-2,-W31,-fno-dollars-in-identifiers
    C99:    mcpp -23 (-S1) -V199901L -W31
    C++:    mcpp -23+ -V199711L -W31
mcpp V.2.7.2 (2008/11)

6.2. ɽ

                D   M   B   G   G   u   V   L   W   M   G   V   L   G   V   W   M
                E   C   C   C   C   c   C   C   a   C   C   C   C   C   C   A   C
                C   P   C   C   C   p   2   C   v   P   C   2   C   C   2   V   P
                U   P   5   2   3   p   0   0   e   P   3   0   0   4   0   E   P
                S   2   5   9   2   1   0   3   1   2   4   0   6   1   0   2   2
                C   0   C   5       3   3   0   0   4   3   5   0   1   8   0   7
                P       P   3               8                   3               2
                P       P                                                   

        max     1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17

[K&R: Processing of sources conforming to K&R and C90] (31 items)
n.2.1     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.2.2     2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.2.3     2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.6.1    10    10  10  10  10  10  10  10  10   4  10  10  10  10  10  10  10  10
n.7.2     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.10.2    6     0   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.12.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.12.4    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.12.5    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.12.7    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.13.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.13.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.13.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.13.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.13.7    6     6   6   4   6   6   6   4   6   0   6   6   4   4   6   4   6   6
n.13.8    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.13.9    2     2   2   2   2   2   2   0   2   0   2   2   0   2   2   0   2   2
n.13.10   2     2   2   2   2   2   2   0   0   2   2   2   2   0   2   2   2   2
n.13.11   2     0   2   2   2   2   2   0   0   0   2   2   2   0   2   2   2   2
n.13.12   2     0   2   2   2   2   2   2   0   0   2   2   2   0   2   2   2   2
n.15.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.15.2    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.18.1   30    30  30  30  30  30  30  30  30  30  30  30  30  30  30  30  30  30
n.18.2   20    20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
n.18.3   10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.27.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.27.2    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.29.1   10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.32.1    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
i.32.3    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
i.35.1    2     2   2   2   2   2   2   0   0   0   2   2   0   0   2   0   1   2
stotal  166   150 166 164 166 166 166 156 158 140 166 166 160 156 166 160 165 166

[C90: Processing of strictly conforming sources] (76 items)
n.1.1     6     0   6   6   6   6   6   6   6   0   6   6   6   6   6   6   6   6
n.1.2     2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.1.3     2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.2.4     2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.2.5     2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.3.1     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.3.3     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.3.4     2     0   2   0   2   2   0   2   2   2   2   2   2   2   2   2   2   2
n.4.1     6     0   6   0   6   6   6   6   0   0   6   6   6   0   6   6   6   6
n.4.2     2     0   2   0   2   2   2   2   0   0   2   2   2   0   2   2   2   2
n.5.1     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.6.2     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.6.3     2     0   2   0   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.7.1     6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.7.3     4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.8.1     8     0   8   8   8   8   8   8   8   8   8   8   8   8   8   8   2   8
n.8.2     2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.9.1    10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.10.1   10    10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
n.11.1    8     8   8   8   8   8   8   8   8   8   8   8   8   8   8   8   8   8
n.11.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.12.1    6     0   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.12.2    4     0   4   4   4   4   4   4   4   0   4   4   4   4   4   4   4   4
n.12.6    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.13.5    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.13.6    6     0   6   6   6   6   4   6   4   0   6   6   4   4   6   4   6   6
n.13.13   4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.13.14   2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.19.1    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.19.2    4     2   4   4   4   4   4   4   4   2   4   4   4   4   4   4   4   4
n.20.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.21.1    4     0   4   0   4   4   4   0   4   4   4   4   0   4   4   0   4   4
n.21.2    2     0   2   0   2   2   2   0   2   2   2   2   0   2   2   0   2   2
n.22.1    4     0   4   0   4   4   4   4   4   0   4   4   4   4   4   4   4   4
n.22.2    2     0   2   0   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.22.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   0   2
n.23.1    6     2   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.23.2    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.24.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.24.2    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.24.3    6     0   6   0   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.24.4    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.24.5    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.25.1    4     2   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.25.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.25.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.25.4    6     0   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.25.5    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.26.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.2    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.3    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.4    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.26.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.27.3    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.27.4    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   2   4
n.27.5    2     2   2   2   2   2   2   0   2   0   2   2   0   2   2   0   0   2
n.27.6    2     0   0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.28.1    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.2    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.3    4     0   4   4   4   4   2   4   4   4   4   4   4   4   4   4   4   4
n.28.4    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.5    4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.28.6    4     0   4   0   4   4   2   0   0   4   4   4   0   0   4   0   4   4
n.28.7    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.29.2    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.30.1    6     6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6   6
n.32.2    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
n.37.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.37.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.5    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.37.6    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.7    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.8    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
n.37.9    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
stotal  286   160 284 252 286 286 278 274 272 240 286 286 272 272 286 272 274 286

[C90: Processing of implementation defined portions] (1 item)
i.32.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
stotal    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2

[C90: Diagnosing of violation of syntax rule or constraint] (50 items)
e.4.3     2     2   2   1   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.7.4     2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.12.8    2     0   2   2   2   2   2   2   0   2   2   2   2   0   2   2   2   2
e.14.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.2    4     2   4   2   4   4   2   2   4   4   4   4   4   4   4   4   4   4
e.14.3    2     2   2   2   2   2   1   2   2   2   2   2   2   2   2   2   2   2
e.14.4    2     2   2   2   2   2   1   2   2   2   2   2   2   2   2   2   2   2
e.14.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.6    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.7    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.8    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.9    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.14.10   4     0   4   2   0   0   0   0   0   0   4   0   0   0   0   0   4   4
e.15.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.15.4    2     2   2   1   2   2   2   1   2   2   2   2   2   2   2   2   2   2
e.15.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.16.1    2     2   2   1   2   2   2   1   2   2   2   2   2   2   2   2   2   2
e.16.2    2     2   2   1   2   2   2   1   2   2   2   2   2   2   2   2   2   2
e.17.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.17.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.17.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.17.4    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.17.5    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.17.6    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.17.7    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.4    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.5    2     2   2   2   0   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.6    2     0   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.18.7    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.18.8    2     2   2   2   2   2   2   2   2   0   2   2   2   2   2   2   2   2
e.18.9    2     0   2   0   2   2   2   2   0   0   2   0   2   0   2   2   0   2
e.19.3    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.19.4    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.19.5    4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.19.6    2     0   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.19.7    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.23.3    2     0   2   2   2   2   2   2   0   0   2   2   2   0   2   2   0   2
e.23.4    2     2   2   2   2   2   2   2   0   0   2   2   2   0   2   2   0   2
e.24.6    2     2   2   2   2   2   2   2   0   0   2   2   2   0   2   2   0   2
e.25.6    4     0   4   0   4   4   4   4   4   4   4   4   4   4   4   4   4   4
e.27.7    2     0   2   2   2   2   2   0   2   2   2   2   0   2   2   0   2   2
e.29.3    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.29.4    2     2   2   1   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.29.5    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.31.1    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.31.2    2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
e.31.3    2     2   2   0   2   2   2   1   2   2   2   2   1   2   2   1   2   2
e.32.5    2     0   2   2   2   2   0   2   0   0   2   2   2   0   2   2   2   2
e.33.2    2     0   2   0   0   2   0   2   0   0   2   2   2   0   2   2   2   2
e.35.2    2     0   2   1   2   2   0   2   0   2   2   2   2   0   2   2   2   2
stotal  112    74 112  92 104 108  98 100  92  86 112 106 105  92 108 105 104 112

[C90: Documents on implementation defined behaviors] (13 items)
d.1.1     2     0   2   0   0   2   0   0   0   0   2   2   0   0   2   0   0   2
d.1.2     4     2   4   4   4   4   0   4   0   0   4   4   4   0   4   4   2   4
d.1.3     2     0   2   0   0   2   0   0   2   2   2   2   0   0   2   0   2   2
d.1.4     4     0   4   4   4   4   0   4   4   2   4   4   4   4   4   4   2   4
d.1.5     4     2   4   4   2   4   4   4   4   4   4   2   4   4   2   4   4   4
d.1.6     2     0   2   0   0   1   0   0   0   0   2   1   0   0   1   0   0   2
d.2.1     2     0   2   2   2   2   2   0   0   0   2   2   2   0   2   2   0   2
d.2.2     2     0   2   2   0   2   0   0   0   0   2   2   2   0   2   2   0   2
d.2.3     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.2.4     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.2.5     2     0   2   0   0   0   0   2   0   0   2   0   2   0   0   2   0   2
d.2.6     2     0   2   2   0   0   0   2   0   0   2   0   2   0   0   2   0   2
d.2.7     2     0   2   2   0   2   0   2   0   0   2   2   2   0   2   2   0   2
stotal   32     4  32  20  12  23   6  18  10   8  32  21  22   8  21  22  10  32

[C90: Degree of Standard C conformance] (171 items)
mttl90  598   390 596 530 570 585 550 550 534 476 598 581 561 530 583 561 555 598

[C99: Conformance to new features] (20 items)
n.dslcom  4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.ucn1    8     0   0   0   0   6   8   2   0   2   8   6   8   0   6   8   6   8
n.ucn2    2     0   0   0   0   0   2   0   0   0   2   2   2   0   2   2   0   2
n.ppnum   4     0   4   0   4   4   4   0   0   0   4   4   0   4   4   0   0   4
n.line    2     0   2   2   2   2   2   2   0   2   2   2   2   0   2   2   2   2
n.pragma  6     0   6   0   0   6   6   0   0   2   6   6   0   0   6   0   2   6
n.llong  10     0   0   0  10  10   8  10   0   0  10  10  10   0  10  10  10  10
n.vargs  10     0  10   0  10  10  10   0   0  10  10  10  10   2  10  10  10  10
n.stdmac  4     0   2   0   0   4   4   0   0   4   4   4   0   0   4   0   4   4
n.nularg  6     0   6   0   6   6   6   2   0   6   6   6   2   0   6   2   6   6
n.tlimit 18     0  18  14  18  18  17  18  14  18  18  18  18  12  18  18  16  18
e.ucn     4     0   0   0   0   0   2   0   0   2   4   0   2   0   0   2   2   4
e.intmax  2     0   0   0   2   2   2   0   0   0   2   1   0   0   1   0   2   2
e.pragma  2     0   2   0   0   2   2   0   0   2   2   2   0   0   2   0   2   2
e.vargs1  2     0   0   0   0   2   1   0   0   1   2   2   0   0   2   0   2   2
e.vargs2  2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.pragma  2     0   2   0   0   2   2   2   0   0   2   2   2   0   2   2   2   2
d.predef  6     0   0   0   0   6   6   0   0   0   6   6   0   0   6   0   0   6
d.ucn     2     0   0   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
d.mbiden  2     0   0   0   0   2   2   1   0   0   2   2   1   0   2   1   0   2
mttl99   98     0  58  20  56  86  88  41  18  53  98  87  61  22  87  61  70  98

[C++: Conformance to new features not in C90] (9 items)
n.dslcom  4     0   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
n.ucn1    4     0   0   0   0   4   4   2   0   2   4   4   2   0   4   2   2   4
n.cnvucn  4     0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0
n.bool    2     0   0   0   0   2   0   0   0   2   2   2   0   0   2   0   0   2
n.token1  2     0   2   0   0   2   0   0   2   2   2   2   0   2   2   0   2   2
n.token2  2     0   0   0   0   2   0   2   0   2   2   2   2   0   2   2   2   2
n.cplus   4     0   2   2   2   2   0   4   0   4   4   2   4   0   2   4   4   4
e.operat  2     0   0   0   0   2   0   0   0   2   2   2   0   0   2   0   2   2
d.tlimit  2     0   2   0   0   2   0   1   0   0   2   2   1   0   2   1   0   2
mttl++   26     0  10   6   6  20   9  13   6  18  22  20  13   6  20  13  16  22

[C90: Qualities / 1 : handling of multibyte character] (1 item)
m.36.2    7     0   2   2   0   0   0   4   0   0   7   5   2   0   5   2   0   7
stotal    7     0   2   2   0   0   0   4   0   0   7   5   2   0   5   2   0   7

[C90: Qualities / 2 : diagnosis of undefined behaviors] (29 items)
u.1.1     1     0   1   0   1   1   0   0   0   1   1   1   0   0   1   0   1   1
u.1.2     1     0   1   0   1   1   0   1   0   1   1   1   0   0   1   0   1   1
u.1.3     1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.4     1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.5     1     1   1   1   1   1   1   1   1   0   1   1   1   1   1   1   1   1
u.1.6     1     0   1   0   1   1   0   0   1   0   1   1   0   1   1   0   0   1
u.1.7     9     0   1   0   0   0   0   0   0   0   6   6   0   0   6   0   0   9
u.1.8     1     1   1   0   1   1   0   0   0   0   1   0   0   1   0   0   0   1
u.1.9     1     1   1   0   1   1   1   0   1   0   1   0   0   1   0   0   0   1
u.1.10    1     1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.11    1     1   1   1   0   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.12    1     1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.13    1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.14    1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.15    1     0   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
u.1.16    1     0   1   1   1   1   1   1   1   0   1   1   1   1   1   1   1   1
u.1.17    2     0   2   0   1   1   0   0   1   0   2   1   0   1   1   0   1   2
u.1.18    1     0   1   0   1   1   1   0   0   0   1   1   0   0   1   0   1   1
u.1.19    2     0   2   0   0   1   1   0   0   1   2   1   0   0   1   0   1   2
u.1.20    1     0   1   1   1   1   1   1   0   1   1   1   1   1   1   1   1   1
u.1.21    2     0   2   1   0   1   2   2   2   2   2   1   2   2   1   2   2   2
u.1.22    1     0   1   0   0   1   1   0   1   1   1   1   0   1   1   0   1   1
u.1.23    1     1   1   0   1   0   0   1   1   0   1   0   1   1   0   1   0   1
u.1.24    2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   2   2
u.1.25    1     0   1   0   0   1   0   0   0   0   1   1   0   0   1   0   1   1
u.1.27    1     1   1   1   0   1   1   1   1   0   1   1   1   1   1   1   1   1
u.1.28    1     1   1   1   0   1   1   1   1   0   1   1   1   1   1   1   1   1
u.2.1     1     1   1   1   1   1   0   1   0   1   1   1   1   0   1   1   1   1
u.2.2     1     0   1   1   0   1   1   0   0   0   1   1   0   0   1   0   0   1
stotal   41    10  33  16  19  26  20  18  19  16  38  30  17  21  30  17  25  41

[C90: Qualities / 3 : Diagnosis of unspecified behaviors] (2 items)
s.1.1     2     0   2   0   0   0   2   0   0   0   2   0   0   0   0   0   0   2
s.1.2     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
stotal    4     0   4   0   0   0   2   0   0   0   4   0   0   0   0   0   0   4

[C90: Qualities / 4 : Diagnosis of suspicious cases] (12 items)
w.1.1     4     4   4   0   4   4   0   0   0   0   4   4   0   0   4   0   0   4
w.1.2     4     0   4   0   0   0   0   0   0   2   4   0   0   0   0   0   2   4
w.2.1     2     0   2   1   0   0   0   0   0   0   2   2   0   0   2   0   0   2
w.2.2     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.1     1     1   1   0   0   0   0   0   0   0   1   0   0   1   0   0   0   1
w.3.3     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.4     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.5     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.6     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.7     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.8     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
w.3.9     1     0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1
stotal   19     5  19   1   4   4   0   0   0   2  19   6   0   1   6   0   2  19

[C90: Qualities / 5 : Other features] (17 items)
q.1.1     9     0   9   6   9   9   8   7   4   9   9   9   7   5   9   7   8   9
q.1.2    10     6  10   4   8  10   4   4   4   4  10  10   4   4  10   4   4  10
q.1.3     4     4   4   2   4   4   4   4   4   4   4   4   4   4   4   4   4   4
q.1.4    20    10  20  10  20  20  20  10  20  10  20  20  10  20  20  10  10  20
q.2.1     4     2   4   2   4   4   4   4   2   4   4   4   4   2   4   4   4   4
q.2.2     4     4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4
q.2.3     2     2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2   2
q.2.4     2     2   2   0   2   2   0   0   0   0   2   2   0   0   2   0   0   2
q.2.5     2     0   2   0   0   0   0   0   0   0   2   0   0   0   0   0   0   2
q.2.6     4     0   4   2   4   4   2   4   2   0   4   4   4   2   4   4   0   4
q.2.7    10     4   6   4   8   8   4   4   4   2   8   8   4   4   8   4   4   8
q.2.8    10     0   6   2   2   2   0   6   4   4   8   2   6   4   2   6   4   8
q.2.9     6     2   2   0   2   2   0   0   0   2   2   2   0   0   2   0   2   4
q.3.1    20    10   8   8  14  12   8  10  10   6   8  12  10  10  12  10   6   8
q.3.2    20    20  20  18  16  16  18  16  18  14  18  14  14  18  12  14  12  16
q.3.3    20    10  14   0  10  12   8   0   0   8  14  12   0   0  12   0  10  16
q.4.1    10     2   6   6   4   6   2   4   6   4   4   6   4   6   6   4   4   8
stotal  157    78 123  70 113 117  88  79  84  77 123 115  77  85 113  77  78 129

[C90: Qualities] (61 items)
mttl90  228    93 181  89 136 147 110 101 103  95 191 156  96 107 154  96 105 200

[C99: Qualities of new features] (3 items)
u.line    2     0   2   0   1   1   0   0   0   0   2   1   0   0   1   0   2   2
u.concat  1     0   1   0   0   1   0   0   0   0   1   1   0   0   1   0   0   1
w.tlimit  8     0   8   0   0   0   3   2   0   0   8   0   2   0   0   2   0   8
mttl99   11     0  11   0   1   2   3   2   0   0  11   2   2   0   2   2   2  11

[C++: Qualities of features not in C90] (1 item)
u.cplus   1     0   1   1   0   0   0   1   0   1   1   0   1   0   0   1   1   1
mttl++    1     0   1   1   0   0   0   1   0   1   1   0   1   0   0   1   1   1

[Overall] (265 items)
gtotal  962   483 857 646 769 840 760 708 661 643 921 846 734 665 846 734 749 930

                D   M   B   G   G   u   V   L   W   M   G   V   L   G   V   W   M
                E   C   C   C   C   c   C   C   a   C   C   C   C   C   C   A   C
                C   P   C   C   C   p   2   C   v   P   C   2   C   C   2   V   P
                U   P   5   2   3   p   0   0   e   P   3   0   0   4   0   E   P
                S   2   5   9   2   1   0   3   1   2   4   0   6   1   0   2   2
                C   0   C   5       3   3   0   0   4   3   5   0   1   8   0   7
                P       P   3               8                   3               2
                P       P                                                   

        max     1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17

6.3. ƥץץåħ

1 : Linux / / DECUS cpp

ANSI draft ΤΤΤǡȤʤäƤϵʽ٤㤯ʤäƤޤǥåϤޤޤǤɥȤϤۤȤɤޤ󡣤ʤΤäꤷץǡꤷƤޤ
portability ι⤤ΤǡĤνϤ˰ܿƤޤܤΤ褦ɤߤ䤹ǡɤǤٶˤʤޤ䤬 mcpp Υ١ˤΤϤΥǤ

3 : WIN32 / Borland C++ V.5.5J / cpp32

C90 εʽ٤Ū⤯ä shift-JIS ˤޤȤбƤޤɥȤäƤޤe_* ǤϿǥåϤƤФޤ֤˹碌ŪʤΤ¿ɤޤ
ֵʳʼפϼǡȤĥǽ⤢ޤUndefined ʬФƤϿǥåϤޤФ˽ޤʤбդȤʤäƤޤä褦Ǥ
®٤ Turbo C Ȱäơ®ۤǤϤʤʤޤǤˣѥѥΥåȤϤʤʤäƥǥåȤĤäƤȻפޤĤޤǤή³Ƥ椯ΤǤ礦

4 : Linux, CygWIN / GCC V.2.95.3 / cpp0

C90, C95 εʽ٤Ϥʤ⤯ǥåŪΤǤưϤۤܰꤷƤꡢĤƹ®Ǥ˭٤뤯餤˭٤ʥץħǤmcpp Ǥ⡢ΥץΤĤޤͤƤޤ
ĤƤϤĤˤХ⤢ޤV.2.95 ǤϥХϤۤȤɤʤʤޤ
ĤϡC99, C++98 οͤ¿̤Ǥ뤳ȡǥåޤޤ­ʤȡɥȤʤ­Ƥ뤳ȡ#pragma Ȥʤʰȿγĥǽ¿ȡpre-Standard obsolete ʻͤ¿Ƥ뤳ȡmulti-byte character encoding ؤбȾüǼѥ٥ãƤʤȡǤ
cpp.info ȤɥȤ GCC / cpp Standard C ץץΤβȤͥ줿ΤǤʬΥɥȤ CygWIN, FreeBSD, Linux Τɤˤ¸ߤʤΤϻǰǤְܿפȤΤϥץǤϤʤϤǤ
ϤĤϤ餱ɤߤˤĥץȤΩƤŤޥץåι¤äƤޤ GCC ϤΤͥƤ뤿ᡢ¿Υƥ˰ܿƤޤ

5 : Linux / GCC V.3.2 / cpp0

GCC V.3 Ǥϥץץ V.2 饽쿷ޤƱ˥ɥȤ쿷ޤToken-based ʸ§Ű줵졢pre-Standard ʻͤϤޤƤʤ⥦˥󥰤Ф褦ˤʤꡢundocumented ʻͤƤޤΤȤƤϻδԤ˲ɤƤޤץ๽¤쿷줿Ȥǡβɤ⤷䤹ʤäΤȻפޤ
ǥåɥȡC99 бmulti-byte character ؤбϤޤԽʬǤ®٤Ϥ٤ʤޤǤޤ®ۤǤ
إåե뤬ʣ include directory ΥʣˤʤäƤƤΤϡäǤޤŤץ󤬻ȤʤʤäƤ¿οץƤꡢʤʤؿʤߤޤV.3 ǤϥץץѥΤ˰βޤץץʬȥѥʬȤŪ interface ʤʣʤΤˤʤäƤΤ⡢ǰʤȤǤ

6 : Linux / / ucpp (V.1.3)

C99 бƤ뤳ȡץ󥽡 portable Ǥ뤳ȤħǤʽ٤Ϥʤ⤯ʤäƤޤUCN UTF-8 бƤ뤳ȤˤʤäƤޤϤԽʬǤǥåϤȤƤޤɥȤ⤫ʤ­Ƥޤ

7 : WIN32 / Visual C++ 2003 / cl
12 : WIN32 / Visual C++ 2005 / cl
15 : WIN32 / Visual C++ 2008 / cl

C99 λͤ 2003 ǤϤۤȤɼƤޤǤ2005 ǤϤּʤߤޤ
C90 λͤˤĤΥХĤäƤޤTranslation phase κ𤷤Ƥ뤳ȤǤ⺬ŪǤ˸ŤʬŪ˼ʤС󥢥åפ򷫤֤ƤƤ뤳Ȥޤ
ǥåϤԥȤΤ줿ΤФиޤ顼ȽǤƤޤȤ¿Τ⡢ȤˤǤɥȤϼ٤ƹ٤Ƥʬˤޤ
Translation limits 礭Ȥ #pragma Ū¿ȤȤꤨȸޤȤ #pragma setlocale ʤΤǤC90 Ǥ #pragma ԤޥŸ뤳ȡˤ⤫餺 #pragma sub-directive 桼֤̾ȤäƤΤǤ
2008 Υץץå 2005 ȤۤȤѤꤢޤ 㤤 C99 _Pragma() __pragma() Ȥ̾ͤۤʤ黻Ҥ줿Ȥ餤Ǥ źդ륷ƥإåˤϡ2005 ޤǤϾʤäΤǤ2008 ˤʤäƤʤ '$' ȤäޥƤޤޤ

8 : WIN32 / LCC-Win32 2003-08 / lcc
13 : WIN32 / LCC-Win32 2006-03 / lcc

ץץʬ Dennis Ritchie Plan9 ѤΥ Jacob Navia äΤǤǥХå­Ƥꡢ#if ɾʤɤˤʤΥХޤC95 ʹߤλͤˤбƤޤ󡣥ɥȤ­Ƥޤ
2003-08 2006-03 ȤǤϥץץ˴ؤƤϤۤȤɰ㤤Ϥޤ

9 : WIN32, Linux, etc. / / wave (V.1.0)
16: WIN32, Linux, etc. / / wave (V.2.0)

C++ STL Τ "meta-programming" ˻ȤȤŪ˺줿ΤǤȾ C++ Υ饤֥ǤǤƤơȾإåեΩäƤȤðۤʥץץåǤ"Meta-programming" μǤϺƵŪޥ¿ѤƤꡢŸǤ mcpp -@compat ץ GCC ƱͤΡִֺػߥ롼פŬϰϤ򶹤ꤹˡȤäƤޤ3.4.26 ȡˡ
̤ C/C++ ץץåȤƤȤ뤳ȤտޤƤꡢC++98, C99 бɸ֤ƤޤV.1.0 ϴ٤Τʤ㤤ΤǤV.2.0 ˲ޤV.1.0 ΤȤǡmcpp °븡ڥåȤǥƥȤ¿ΥХȤΤȤǤ˿ǥåμβɥȤν¤˾ޤޤޤǥå° testcases ˸Ԥεʤβ˸꤬ΤⵤˤʤȤǤ

11 : Linux / GCC V.3.4.3 / cc1, cc1plus
14 : Linux / GCC V.4.1.1 / cc1, cc1plus

V.3.2 ȤۤȤѤޤ󡣤ץץȤΩƤϤʤѤޤV.3.2 Ǥϥåꤷ򼨤Ƥ GCC ǤV.3.3, 3.4 ǤѤä褦ǤñΤΥץץåѻߤ̤ΥޥV.3.2 obsolete Ȥ줿ͤΰ褵ʣĤΥѥˤ٤Ƥۼ˿ʤǤΤϡϤƲȸ뤫ɤΤȤǤMulti-byte character encoding UTF-8 øŪʰ֤ͿȤ⡢multi-lingualization ¿ͤʲǽ򶹤뤳ȤˤʤΤǤϤʤǤ礦
V.4.1 ϥץץ˴ؤƤ V.3.4 礭ʰ㤤Ϥޤ

2 : FreeBSD, WIN32, MS-DOS / / mcpp (V.2.0)
10 : FreeBSD, Linux, CygWIN, WIN32, MS-DOS / / mcpp (V.2.4)
17 : FreeBSD, Linux, Mac OS X, CygWIN, MinGW, WIN32 / / mcpp (V.2.7.2)

䤬ʬǺäƼʬǥƥȤƤΤʤΤǡʽ٤ǹǤΤʥץץåΤϤǤǥå˭٤ŪΤɥȤξܺ٤ǤͭѤʥץ #pragma ̤äƤޤV.2.3 ʹߤ C99 λͤˤ⤹٤бƤޤ ΰܿɤ֤Ǥ礦
ǽޤĤĤäƤޤ󡢤ꤤޤ

6.4. ɾ

¿ΥץץåƥȤƤߤȡߤ C90 ʽ٤Ϥʤ⤤Τ¿ʤäƤƤ뤳Ȥ狼ޤƽϤȤޤޤ¿äƤޤʤmcpp ϤۤȤɤιܤʤΤǡ졹ڤޤ

n_* Υץ˴ؤƤΤƤꡢGCC 2.95 ʹ, BC (Borland C) 5.5, LCC-Win32 2003-08 ʹ, ucpp 1.3, Visual C++ 2003 ʹ, wave 2.0 ϼѾϤޤΤʤ٥ãƤޤɤνϤˤճʥХޤ

ǤäΤϡn_13_7.t (n_13_7.c) division by 0 Υ顼ˤʤäƤޤϤ Visual C ޤƤФи뤳ȤǤ&&, || 䣳黻ҤǤΡɾǤڤפȤäδŪʻͤƤʤΤǤBorland C n_13_7.c Ǥϥ˥󥰤ˤȤɤƤޤe_14_9.c division by 0 ǤƱ˥󥰤ФޤTurbo C Ǥ 0 Ǥɾ򥹥åפʬǤɤƱ顼ȤʤäƤޤBorland C Ϥοǥå򥦥˥󥰤˳ʲʤΤǤνϤΡִ֤˹碌ǥåפΰǤ

C90 λͤǤϡ# 黻Ҥˤʸ󲽤μδְäƤΤˤޤ
Amendment 1, Corrigendum 1 ɲä줿ͤϡټƤΤ GCC 2.95 ʹ, ucpp, Visual C 2003 ʹߤǤ

C99 λͤϡGCC 3.2 ʹ, ucpp ܼۤƤޤ// Ȥ¿νϤƤޤΤۤ GCC long long translation limits ˤʤ;͵ꡢޥΥŬڤ˽ޤѰޥ GCC ȼλͤΤΤäƤޤ2.95 Ǥ C99 λͤΤΤޤ3.2 Ǥ _Pragma() ޤUCN ucpp, Visual C 2005 ʹߤƤޤGCC 3.2 ʹߤʸƥ뤪ʸ UCN ƤޤWave 2.0 C99 λͤβȾƤޤ
C++98 λͤ GCC 3.2 ʹ, wave, Visual C 2005 ʹߤܼۤƤޤ
C++98 extended-character UCN ѴȤʻͤƤΤϡޤޤ

i_* νʬνǤϡ#if wide character 򰷤ʤΤ¿褦Ǥwide character ˸¤餺 #if ʸȤȤϡʤˤϤΤΤۤȤɰ̣ΤʤȤʤΤǡȤʤȤäƺ뤳ȤϤʤǤ礦̵̣ʤΤϵʤλͤ٤Ǥ
Multi-byte character ˤĤƤϡVisual C ¿ι encoding ԽʬʤбƤޤ¾νϤϼǤGCC 2.9, 3.2 ϼȾüǡѥ٥ãƤޤGCC 3.4-4.1 ǤϤ٤Ƥ encoding UTF-8 ѴƤ褦ˤʤꡢˤä¿ encoding бǤ褦ˤʤޤ encoding ˤäƤϤޤѥ٥ǤϤޤ
Shift-JIS BIG-5 ȤƥǤϡƥ tokenization # 黻Ҥˤʸ󲽤դɬפǤVisual C ϤˤޤбƤޤBorland C 5.5J shift-JIS ˤбƤޤ

e_* ФǥåǤϡGCC 2.95 ʹߤǤͥƤޤVisual C, ucpp ǤϿǥåŪФΤΡȤƤԥȤƤꤷޤ#if overflow ФǥåνФΤϾʤBC, ucpp, GCC ٿǤǤ

ʬΥɥȤǤϡGCC 3.2 ʹߤޤޤΥ٥ǡ¾Ϥɤ⤪Ǥ

u_* ФǥåǤϡGCC 3.2 ʹߤޤޤǤ¾ϤǤUndefined Ϥϲ⤷ʤɤȤΤǤϤʤȻפޤ

s_*, w_* ˤĤƤϤɤνϤۤȤн褷Ƥޤ󡣥ȤΥͥȤФ륦˥󥰤ФΤʤΤϡճǤ

֤¾γƼʼפǤϡGCC ˭٤ʥץ󡢿ǥåŪΤ®ܿȤȴФƤޤ

礹ȡGCC V.3.2 ʹߤʽ٤ι⤵Ȥɤޤ礭ʷΤʤǡǤͥƤޤmcpp ®٤ΤΡ¾ΤۤȤɤ̤ǤäƤ뤳ȤϸޤǤ⤢ޤ

ơ̤ΥƥȤäƤޤƻפΤϡƥѥץȤΤ˽פȤȤǤmcpp ϤΥץκ¹ԤƥǥХåʤƤΤǤʬʥץ뤬ʤХХ¸ߤˤʤʤդޤ󤫤顢ǥХåɤǤϤޤ
ʤˤ⤳Ūʥƥѥץ뤬źդ褦ˤʤȡƽϤʼŪ˸夹뤳ȤǤ礦ޤդˡŪʥƥѥץ뤳Ȥϡʤ⤭Ħˤ뤳ȤˤʤޤƥѥץϵʤΥ饹ȥ졼ʤΤǤ


6.5. ƥȤո

Validation Suite ˤĤƤΤո䡢ȤäƼϤΥץץΥƥԤƤޤ

http://mcpp.sourceforge.net/

"Open Discusssion Forum" ޤϥ᡼Ǥꤤޤ

ץץåξܺ٥ƥȤԤäϡ6.2 ɽڤäơ˽񤭹Ǥ꤯η׻ˤ tool/total.c 򥳥ѥ뤷ƻȤޤɽ cpp_test.old Ȥȡ

total 18 cpp_test.old cpp_test.new

Ȥȡstotal (sub-total), mtotal (mid-total), gtotal (grand-total) γ󤬽񤭹ޤ cpp_test.new ˽Ϥޤ"18" ΤȤϽϤοꤷޤ

GCC ξϡڥåȤ testsuite Ǥˤ뼫ưƥȤǤޤƼС GCC Υƥȷ̤꤯ե (gcc.sum, gcc.log) äƤȡǥåΥСˤ㤤򸡾ڥåȤ testsuite Ǥ˺Τ뤳ȤǤޤ

ޤValidation Suite mcpp γȯ SourceForge ξ嵭 mcpp project ǿʤƤޤȯ˻äƤߤ褦Ȥϡҥ᡼򤯤

mcpp-2.7.2/doc-jp/mcpp-summary.pdf0000644000175000017500000046757011114175434013727 00000000000000%PDF-1.4 % 166 0 obj << /Linearized 1 /O 168 /H [ 1388 956 ] /L 159608 /E 26965 /N 16 /T 156169 >> endobj xref 166 47 0000000016 00000 n 0000001291 00000 n 0000002344 00000 n 0000002562 00000 n 0000002753 00000 n 0000002897 00000 n 0000003445 00000 n 0000004191 00000 n 0000004439 00000 n 0000004642 00000 n 0000004790 00000 n 0000005000 00000 n 0000005229 00000 n 0000005251 00000 n 0000005880 00000 n 0000005902 00000 n 0000006516 00000 n 0000006538 00000 n 0000007138 00000 n 0000007349 00000 n 0000007586 00000 n 0000007608 00000 n 0000008205 00000 n 0000008227 00000 n 0000008911 00000 n 0000009206 00000 n 0000009503 00000 n 0000009868 00000 n 0000010290 00000 n 0000010312 00000 n 0000010900 00000 n 0000010922 00000 n 0000011605 00000 n 0000011627 00000 n 0000012168 00000 n 0000012776 00000 n 0000020906 00000 n 0000021747 00000 n 0000023491 00000 n 0000023756 00000 n 0000023953 00000 n 0000024032 00000 n 0000024225 00000 n 0000024859 00000 n 0000026552 00000 n 0000001388 00000 n 0000002322 00000 n trailer << /Size 213 /Info 164 0 R /Root 167 0 R /Prev 156158 /ID[<08bfd58c4b86c7478dc7a92f3660db74><49a19341badab25267b9aec7fc8193d1>] >> startxref 0 %%EOF 167 0 obj << /Type /Catalog /Pages 162 0 R /Metadata 165 0 R /PageLabels 160 0 R >> endobj 211 0 obj << /S 774 /L 1025 /Filter /FlateDecode /Length 212 0 R >> stream H|S[LW>3 2Ga2K_hY\]KqAݝQ6& hBҢ&y0q//&Mȋч}hԇWcR9}? JO5PI8/wwlov'5 ;~kj}~߿wv<U0^UY@]jIG ^S*K Ya0R$KBOm^>l U63.ln E޾es붭;[v urMDDw?qЁ}v=r+@YQ9 ahK' &[TRҠAL:~DaҪ-t631SOs y'vz QTF];FT1`3-RIHb, uS-Q-'RRZhc0xVEUpm1LEKCiseUELlm)*)2Ons?\ myKMp~#˄#h]* bw1KIc !rE*/qHQ~}wxq>%@ Onʱ3WK_y J_7PeQ?luH>>o?ew6׼buП+L:?Se~8WY22wr|xQm+~i˶pRޑٷ8G>d O9)[ߍI{垅a4/o[vpJ endstream endobj 212 0 obj 839 endobj 168 0 obj << /Type /Page /Parent 161 0 R /Resources 169 0 R /Contents [ 179 0 R 181 0 R 183 0 R 187 0 R 189 0 R 195 0 R 197 0 R 199 0 R ] /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 169 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 176 0 R /F2 172 0 R /F3 174 0 R /F4 184 0 R /F5 192 0 R /F6 193 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 170 0 obj << /Type /Font /Subtype /Type0 /BaseFont /Ryumin-Light-Identity-H /Encoding /Identity-H /DescendantFonts [ 207 0 R ] >> endobj 171 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 681 /Descent -207 /Flags 34 /FontBBox [ -251 -250 1009 969 ] /FontName /AFJALP+CMR10 /ItalicAngle 0 /StemV 69 /XHeight 434 /StemH 31 /CharSet (/k/m/a/t/s/u/i/at/three/period/r/o/j/p/C/nine/zero/b/l/y/e/slash/plus/nu\ mbersign/g/parenleft/eight/parenright/one/c/V/two/d/I/P/A/comma/four/fiv\ e/six/seven/M/f/n/T/z/hyphen/h/E/U/J/S/O/G/B/K/X/F/N/W/w/ampersand/R/fi/\ quoteleft/quoteright/D/L/colon/q/v/x/percent/dollar/bracketleft/bracketr\ ight/H) /FontFile3 201 0 R >> endobj 172 0 obj << /Type /Font /Subtype /Type1 /FirstChar 35 /LastChar 222 /Widths [ 833 500 833 778 0 389 389 0 778 278 333 278 500 500 500 500 500 500 500 500 500 500 500 278 0 0 0 0 0 778 750 708 722 764 681 653 785 750 361 514 778 625 917 750 778 681 0 736 556 722 750 750 1028 750 0 0 278 0 278 0 0 0 500 556 444 556 444 306 500 556 278 306 528 278 833 556 500 556 528 392 394 389 556 528 722 528 528 444 0 0 0 0 333 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 333 0 0 333 0 333 333 0 0 333 333 333 333 333 0 0 333 0 0 0 0 0 333 0 333 333 0 0 0 0 0 0 0 0 0 0 0 0 0 278 278 0 333 0 0 0 0 0 0 556 ] /Encoding /MacRomanEncoding /BaseFont /AFJALP+CMR10 /FontDescriptor 171 0 R >> endobj 173 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 32 /FontBBox [ -34 -251 988 750 ] /FontName /AFJAMA+CMR12 /ItalicAngle 0 /StemV 65 /StemH 29 /CharSet (/two/zero/eight/one/three) /FontFile3 202 0 R >> endobj 174 0 obj << /Type /Font /Subtype /Type1 /FirstChar 48 /LastChar 56 /Widths [ 490 490 490 490 0 0 0 0 490 ] /Encoding /WinAnsiEncoding /BaseFont /AFJAMA+CMR12 /FontDescriptor 173 0 R >> endobj 175 0 obj << /Type /Font /Subtype /Type0 /BaseFont /GothicBBB-Medium-Identity-H /Encoding /Identity-H /DescendantFonts [ 205 0 R ] >> endobj 176 0 obj << /Type /Font /Subtype /Type1 /FirstChar 99 /LastChar 112 /Widths [ 406 0 0 0 0 0 0 0 0 0 772 0 0 511 ] /Encoding /WinAnsiEncoding /BaseFont /AFJALO+CMR17 /FontDescriptor 177 0 R >> endobj 177 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 32 /FontBBox [ -33 -250 945 749 ] /FontName /AFJALO+CMR17 /ItalicAngle 0 /StemV 53 /StemH 26 /CharSet (/m/c/p) /FontFile3 200 0 R >> endobj 178 0 obj 549 endobj 179 0 obj << /Filter /FlateDecode /Length 178 0 R >> stream HTKk@W(>Җzn&=SӤwVv&; ;cvkB1c +!0v C|@'? > stream HT;1 WL9XG[a*$pt!i#.]A,LdG> T6/J,$-/Cp1 9~d N@N"Shv9!R |T%%HakTzӷ՞ >NԞÄsu8_,.򲪮4t!g =k31HgS2ez踽Jp@iXokqmYdtt˭/G4~. v~D2xNbĊ9>OĎǧI?L\KGpi|ZӯcEWDBXICyFkܶF2qz浐oc4aQh :ֶdtxxWubFtJ$Wd!xe{1quKڜk:izgy.KcY*yO7 4U'V6YZzfk2Hvj*t:#S+ͺ#כEV߬#Zo)> endstream endobj 182 0 obj 520 endobj 183 0 obj << /Filter /FlateDecode /Length 182 0 R >> stream HM1 +)+K%ÐKzx> J7M i)%cYH`<{>q2q^ (%p誟@A@l6C6mmO}@EWOb+^淡%uwXwuRCMݩIˊk;X@ KKcڹ\(;?i-m?:H g%Q}5fQ=6+M]ˑ}#T7h-moOG=LQĞCۅ[^N%TRMuKB ύ z 릏A 8u" O]xSDAԣTstrWATkXeU,­Kgd6~ZكcLl({~r _#bP+HzJӏhx3 D &ɈlzRmL(GTYDɰybRl|t>P04M[̶>:~4 Tb?: endstream endobj 184 0 obj << /Type /Font /Subtype /Type1 /FirstChar 99 /LastChar 112 /Widths [ 511 0 0 0 0 0 0 0 0 0 958 0 0 639 ] /Encoding /WinAnsiEncoding /BaseFont /AFJANB+CMBX10 /FontDescriptor 185 0 R >> endobj 185 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 262176 /FontBBox [ -301 -250 1164 946 ] /FontName /AFJANB+CMBX10 /ItalicAngle 0 /StemV 114 /StemH 47 /CharSet (/m/c/p) /FontFile3 208 0 R >> endobj 186 0 obj 517 endobj 187 0 obj << /Filter /FlateDecode /Length 186 0 R >> stream HTMk0WzV;3гoIKOGaS ň{3O_~\#׃> stream H|TMo0 WhJ\:ξ;Ȏu(߻GIӡ4%2D2.$$XV`[3qv$Fvi{%Z]i$//0$-?ۀ AVe4BjB9mxx:Xk<~W](F n\~MvV9wtag$9ۈܘꊮx=Z6lYZC ;J#.TB);AMe8e F!Z-GlK|׼mON՗Ϊӄ`9wVZNr* 򜔡md> endobj 191 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 32 /FontBBox [ -27 -250 1122 750 ] /FontName /AFJAND+CMR7 /ItalicAngle 0 /StemV 79 /StemH 36 /CharSet (/one/endash/four/five/seven/zero/eight/comma/nine/two/asterisk/three/six\ ) /FontFile3 209 0 R >> endobj 192 0 obj << /Type /Font /Subtype /Type1 /FirstChar 44 /LastChar 117 /Widths [ 272 0 0 0 0 490 490 490 490 490 490 490 490 490 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 529 0 0 0 0 0 630 0 0 667 0 0 0 0 0 0 0 0 0 0 0 469 0 0 502 435 0 0 0 0 0 0 0 0 0 0 502 0 0 0 354 502 ] /Encoding /WinAnsiEncoding /BaseFont /AFJANC+CMSS12 /FontDescriptor 190 0 R >> endobj 193 0 obj << /Type /Font /Subtype /Type1 /FirstChar 42 /LastChar 150 /Widths [ 569 0 323 0 0 0 569 569 569 569 569 569 569 569 569 569 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 569 ] /Encoding /WinAnsiEncoding /BaseFont /AFJAND+CMR7 /FontDescriptor 191 0 R >> endobj 194 0 obj 508 endobj 195 0 obj << /Filter /FlateDecode /Length 194 0 R >> stream Hj1 s-+[,òz[a<Nݦ4!,=YO X*`! A~}Ina }4o<%OpV|ޕJ"`yn^'_\[1Zפ (ϩ=o+I]fWi;@3'9ppiLXRjnx@q l阧|!%vi \4L˿=GE-_*1!(U;[RC/(~b7C8Q:m`-zdT>S_pE(a,HqEGY% ,˥5 x;V˴B Ʀ*@H ʧ㈘bTIXU\G25T&>)0 r  endstream endobj 196 0 obj 603 endobj 197 0 obj << /Filter /FlateDecode /Length 196 0 R >> stream H|TM1 W1)+[0ža<KKKOM[#KOOO`i?[x?0'Cy0- q6W Q8+猽' ;5__'ju8z8{S|)ٚ. GOR6_c jW#ΔLԖïښ5r/(9RLVyPss0Bb5].L;pC4ZжEvǝe$a*fbn.63<=HKK7ao`uib'hӶU?+ʺ%Wi_5]V")k[$_k"|Vēu-TW/>->kNLp4rǍXޤE"z.^Ӹ@V j 7}4{U[)&5-i٬/*m@CkP$Ң>PW..FQ"r'w]죪[78*&8ճ舒 tvlt&?OΤL>|yiI q*exʹ.ֲmBr:{Ϋ .<6> stream HSn0 +| XH=,`>}+z$hQҿPލ7E -ΐjko ޶|>81xO)F?-ı-9'ǎd.6;[Cm/}3SH n'd(~kq> stream Hbd`ab`ddutrv 24 f!CG,w/ןe+ nqH9(3=DAYS\17(391O7$#57QOL-SpQ(VJ-N-*KMX. ~ `03$0 2NϨX?^:qI";#QI+]r?hh[KV}gU.oUT mwwm:ZP?3I ?B"?-t7{Llh\6I~5]~s5-{{j{\!{K\,ݻ/\:3Zw35CKa0݁3O3/m+ 1ȟ=qւ?<.]䵊TVrpGf3l ?aʽWfg2gW|g{~'La[>u> stream HtyPTWՅFh{^ј (,# %hEeYek~;Ҵ2-a b%QG NL 4^LTTq9u:?&`2X:|`jLjp*Torpԃ] C`s<8$V}.exPS@lHPx@&r <Ud&r}C,r }dz+&\/ %g0>V1ƙ:Xfv}=1qqm<??n%K.;lbnݍemzF+ +7 W^َmVUXugp5]6n$~0'9uRrMQԸ(G[׽l5*3z_n*0 0[;`D?Z bRHP(s[ΔJq(* 2I4M"% W,75NHk(dMyg`'w/e<\RYQP`.B[e1Q YP̾9`i^O p n`PN*J ]%t3ˑҲ$Mא ‘1dV 2m؜¼0 :zk.u@t4[$~\fn5]@'5R7NT*jR B k!bTȏ&JҨvsD;]XDE6T(, Ⱦ*[#(P@( :G=JG$Q3_u9g^̯SK>R!ҋ `7:^U*yPS&y ,`%HxS3Dç!>jngpuBei]^[ cbq9}?$k^bf?}Gۉ;!}Xz}N!7>9xbgGW7a a¿`Al5b=p=6Hg`W8:&-2hN5 < RCr(Щ4f#R\ >S5 OUrEG92ù؇5Zi/L._8^;ĴϊB^ކ ~&f5JPngeijc<❰G>/VTS6Ly=]#5*EBwŀKXHWҥ!N( UߢV\<9 <bMT­Jh1\}DA9ݠ#UmnX?Oe^'}on\?zLǫiO$q!Fxju / P9 Q2RU7BF!AZԤ]Wx׃>R ShCh5uc ڮ?3FE1n\]YRiI!!W z`8 njv%M"6 ,7EK ȜWÉ,9x9g i$ ƧvcWS-&b=j6Tj蘬[ -x_gf^HDEM<ȇpX { , 0AzCK-H3g>T/IF3l%?N鶬79 -۝z#?\OmĒP{4kCxI9A _CQRx ^9^ wO5T iV<5TF-e}7 UNz{ +N!1WL$Nzp_!7?aDP ]IkRzd =*lͅ$ NN[gL7#0**kΒͺlHW`)il34FJo{ao\l ;ŨȓWzE*_>%$p*  lKݏ4tFx c:#ώJƧ|[G w/67¦[q8;5/4Z.ךZ'rs8|Nh].p?%'9؎PG7\d}l7,s}ɳS,@]TkWmmA!w#NtQ6\̔Vh#y4~'?r Ӵ+P&vl h@~ ‘<6ǡw#>)M`U+0UaTI\^We(1BWF?gɄ>=($/\O1s2@7D!0~|=M#Fk%1F8WǛ1$4 <9?cV`3(BX|SXh s~3eD$Ut X>EbP$qSWGU}[MqAeRy&f鐼ûR^ t(rQTDP]C8gZ5awaVkI=2~V`JP DD ēyO,6w聶A(@G÷jvZpk4#܌pD C0q5@>7 JvQ* z#>TH'*ϛap kE7&d\@T*xC ȠA'.#jf qFN|ZMNpk5tR`ș3!&='|0`N#$Sӈ_I(؍l2rpjYj9,SwF 5 vrs8r\%q, TGjh,ş/i<ӵ[{p~׭/0J_L,bH̑J*TLFL e#t4\#ZJ8)hLNL$J]^0@eTJfFʧ*紓>Dز9k·HEv-}ЅGUrx軌qw1cpK{EZrG$F&?Zj{>cK%Ѭ V 3Gd̵Sƹfa/F _gB(G0 :Lg޺PzM`}Ao.i W*;;$%H }?D 'N1\M.&|7%Fndy)c9Id] 09wlnz{$L"N2qB5 EzқQO!4yK!;a9Y#a4:l@ĚXK*(H`bx#7Uf̰v .h$4d7Y-w^kGKѠ7GHV*1S!+C?yy|;jbBvia$P,Rz=y'9>Vކ^/xޥϪ_Tx`%OW8Ԑ-O?w{KkSZiKLކj`F#^9;t*8A/_GZ䘤_ gͽ60I4ߍQ .MOg&}zRM'N:Fڅ̃Fl3ӥuw\Sgm7ܧO~ԝ|"o{I0jJYrii9ق=g}679ܫ9ݔjJon698rWkpU͆GQց]g#8 8ABJK>Ҵ!iZL}5}7Ch%iii U*JE(S h}@zݴQdљL~dO9g} +FZD[i18Ie92|\L#\Le2$=TC+Ƕޭ/鏰K !nO^* "@ZJD?G:ϋŀaq@q9=aZ[S|zj~R ߐb7JEkܪ 9/#?mȯlmT\P1y v +] ^B7"Vf^Ph/Rէ(8&mIWFi̪7Od#!0k /e+O>cW1W`ti+{Mۼa/' cHAm/8< Pݫ"|;>'_Ek`,ӏן,NW"L i6JT=t&b<:NOx[ЪlpЈY5&z*s jQxúݩ!LI9AW7VB!HFF1n(M/WGZyfgQB{5'u-GN[.\)Vi smtlH;#쉂(Eې󈁿cX| t6cG`jI%h8x}PS۞,lEf#i,0۬Xa%/{TxdeI ܊uH$٤&\&Y1T0rЫCO--kUJʔ p\Qu-ۀWA QneAfBw:uI !ΕMp- 9>^:dwb{n~ rlfVy*&c"&(Ȁam]]qhK#Ur{\^PZ̯Yn(TX4!WpddBXybB=k7X#GA/zӎS5!<+)pSqFIq,˛(u/ 0 :fɭpbU898j B~%| *%LiG3W1ztgtT44''c, endstream endobj 202 0 obj << /Length 770 /Subtype /Type1C >> stream  AFJAMA+CMR12 ip#bFKCopyright (C) 1997 American Mathematical Society. All Rights ReservedCMR12}-/ vTކgbCZQDn8foLM*BD?s⽿Ũ֍`kJxNj݋՛Μt5RW;6B̩v?oaCy ̛ HW`C:8F endstream endobj 203 0 obj << /Filter /FlateDecode /Length 1651 /Subtype /Type1C >> stream HD{TggdBbugܙpb"hAD@(H\V`[-*ZC"7Mcj[/m;eOs8&p*˕Af_XK/ǫ }N *s2Iʒ-S"s_SؓW'.KBrdTٖيLٖČpÜlao`: ۀc!cJL-"Z\x, #EDy3:ߗg;Umd,}CTtwQ36\lojgXxw$HAm0y&F[;UCfo~guXSM"rZJ5ZX  _ޕr'QK e,AK]m:a[vn6VaLlB^<\2Ih^^} 'eBH\JxGGj{8OPfӪׯ_Q3/^LU}?A rDڍZ1ԬoE<W*B߉V~b 8t2?XזOGֱ xMhVEh#8 g2 HvIz)HA%r  5xVkyN aVeV v'M kY; SOϣשvFrG*GS.7kaFp œx q%g4AĨ2.%.۾-4n"}X$WטT4UZ)(}b׼Oa\>ZC^`+kz'gu\>1|PwtYr,x]l'3ؼ ԭ>{` &#>raQ{0+IBcb i(EUAo#'A[ciY=c"ۂ5Dg ǯIR`pa +fK-+_oB91CiQ qC{G:EDg۪v#ozN7jh*[;\˄G2AҫK&8,,@dΈX72.~W9$4b32bM.xM!;z{BCeOYA}^a ,^xQ18ys-ߋ=kL!3*ڪO=<6_ D[z5SHFqϘK$kE5 KkOH;p"˨.4-b~'OC,8!gϐ )>> >> endobj 205 0 obj << /Type /Font /Subtype /CIDFontType0 /BaseFont /GothicBBB-Medium /FontDescriptor 204 0 R /CIDSystemInfo << /Registry (Adobe)/Ordering (Japan1)/Supplement 2 >> /DW 1000 >> endobj 206 0 obj << /Type /ExtGState /SA false /SM 0.02 /TR2 /Default >> endobj 207 0 obj << /Type /Font /Subtype /CIDFontType0 /BaseFont /Ryumin-Light /FontDescriptor 210 0 R /CIDSystemInfo << /Registry (Adobe)/Ordering (Japan1)/Supplement 2 >> /DW 1000 >> endobj 208 0 obj << /Filter /FlateDecode /Length 542 /Subtype /Type1C >> stream Hbd`ab`ddstrsvu04f!CG}2,=X+Wc#s~AeQfzFcnjQfrbobIFjnb ZRQZZT\.b`g`deXLQ7~]ڢ՝eMR*Z`;f[wf+sLYXY&S]![ž1C?А]?J_/ !XDFxώ]1=ˏntk.9vaEn$OgE <2PE~_IPO YcONN}?S v}W\Pf~37Ỉ9SnJ;[跢kWmL8=.>- ׏=c-ߵ>>.]oyW{B-NӃhi?8{߱8W20{$lyx{x : endstream endobj 209 0 obj << /Filter /FlateDecode /Length 1600 /Subtype /Type1C >> stream H{PSwssɃ Ѫvu]akKպ+Jw(VKS^A^$c !0TqJK.(Snvk7윿9w!  ="*6d=7BKQ\pBsx:~kI˕Ly[w$q}L88bBulDF<|zkwH&dְU¤Ho!$&ICV"6;`c [9Js2tV,{OJh]'THQ+4[=1ֵw7{~:<?oOTxz +^TG& eھn2M4 qrIzԟw}mO^{|{h,lc4IL_Zlswk]l sfe\Jc*dBj`*+9z[^ Nx`-R`tDJ)b، ΘLc'[5sKN7K~~anr ]!a7?I&^\^%PFo&TP8$*m:k4Ա#7j VΑvFCg6%ܣL_>> >> endobj 1 0 obj << /Type /Page /Parent 161 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F6 193 0 R /F7 73 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 3 0 obj << /Length 4381 /Filter /FlateDecode >> stream HW۪}W4Ewݫ`HrO$dƉ !wn}:!n]ڿzOOOӫ6D_cP>ϯM>== WF܈ْCd dHv<7<6tgW󻰗oUƟ gpna(6wOڬc9}==%hK#u|߻bPLM=>e>;˶ijk;3/YDw7x)+e!jm?yr0Η|EW)Nr2bpg>97Z5֨l6G9_}qA͋|4y |i27߶FF!((j%#@~ATXZ$w>j}fl 8w6͑A_ge )oJSuKp>~E3 Л<}dV900ϦN]ɶVYv (:jőw͟߷*4ߵQWcK3$~e:JI>#͕ݽmiȇT{{v+'>lrM7tF +v(:@w^=9# DŰNHvޛwl,p+D8qvWXj*}&1-)us;$/|YT tP9$W5h:jH)- ZR9| (Q@ɘM{8).d_1tx\iЋXr\`"^؊M"М:<:)rCG4(u$ժc.Vu^dPZ[M@g}}dhB׸0*n8#Ѩ9׵ThlYq/s +m>&(/G~9&+iэ!:#74⋕\VJ+c囟~FF ӻ|/4e4"9tMEhqvސ&ՙ{CU :fz u.A&:l4UnDʀmlFB)WQ2uH:?[cnm~%fߙ8jN)g3p1M=flHCDlJ'yP]¿a:Xs۞q"]GĸvX.1I2ř\^ү$3;R#YwoP.Lu-c  P^t^bm>} wY`u'^C\ICFDOmbj6_Kv.K/9l*9'K^.GRʆW}\Ɋ;n)jBƣϭH)QoƂ9 ,U\0lkS J[M*mO'˵gќoE6tQ)+s!4@@@MUa8LxI 二vE}jU肩a_xN4,LaW~6Js e.%z^=_BZ -䷩+j0-ch"z!`Wə Bmڃxw9ͷ,/n-ϜPxY﷍)B|c<2~34.D%F4XCw}TdP0Z>xltևH41DVB  ]Z<.q:jִI1BGT+ _O\)ZYց|!(Q- X>E2rGs$sS۲%Wѹ&g̳)Ѳ2BL6]%Sl^ࠣfΒ._Ϋe#r=PɁFae_TȊ!;Ou AR"R˝ꪚq9cP5[$ɰ?i3ՊnHە@Urڢr\x.?S* %f'lVcw.3@$1%Ro0c fHD'W)oĿ-~ŧDuK#3qK05Cﲣi J0gEz]$ Zu % +En~Or |kU;;a$܍J": cB:b}9c2}PSNRaFE:sZ) e¥83o);ڎ |RFhp*#ñ\ Hx@oW`ߡZ1`H }hTK }d{$\~r$'Mt ͋@|,Jn%)Rm.IzF@Ti + #/9GV챣({.É;- Tzͷr ѫ$wKN;E/U@_4<%\Ґozbjċ )(>{6ZIg`g%B'd }z{s[#8DBbyi } $n!^zHgOI (_6(/'*K@$c-3>aф&Oo<t`+z]o#DܜvYjfaj(U d)Ǽ64MpDt. <N+8.#hk5qbQL3hHP-o$bC?QL$ަ7q]Y6"XlbNg-JvD9hy( NÞ]ڳ%ȒMa$ħ!(~llRZUur4vhW^_5k P$WF5,lRZ$ʪ%i3J\iL>)R!X᭔ȕTn\Ӌ|rHH&%^5HmD۱mc4n_PpP.0 F $e8=`@ |imA #F ե(T8N;ҳ¢Bw _G9 > IA{n՘_m~a Gq{w߾mV5QӉeQ&m,h|,UsYAjƓ{eLf 6CyyIhأ' G)t{en %m4C\i'j3hx,jU"1EE5DYg|n?_6Kߓ0GSc1n!D~=]UBS&Z/ endstream endobj 4 0 obj << /Type /Page /Parent 161 0 R /Resources 5 0 R /Contents 6 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F6 193 0 R /F8 74 0 R /F9 75 0 R /F10 76 0 R /F11 77 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 6 0 obj << /Length 4334 /Filter /FlateDecode >> stream HWn}WS@@@{+ pZ^&j^gFm`C5u9uԷW=\JI7c4UT/Jl>x%*"6Xj'5B{/Wo!oy*ѷ]턪С aAk U܉}E#E:Ws{ۿ\m[Yy, M6. `[s#hR"Dg.{%DKF3mgY>/b9{cMwjOou$'g "m-X(]0{ц LA N(9IYݒ+$_OzVŶ,}ʭEW"Wϥ$CRavēm)&UL\>dbÁ#%KP[]t!SꝰBb ]C^twqM!wɔ=~;Z=dy_cSx\/Ϟ<3$FHq.BU5zXk:2mڀPA$ ɒ K MmJ=R +ac@q7oVT^1&)FSi*C*z_^DXrvp l\?*TXW6DZ=>S2 Ʃ1}M_J%QpWGt-.?.ک#Is.O,4HTыՖGHy?Y5}M( zlK8_c<亚PE *ɧl.ZHQEZtYz՛f)6/l7Foo[u rH/o־4N-HQ{-3T U(8;'o_&V.H$xN9!6}w%=۝*~=f~)]g*dU bAyD ]Ii$eoeg,E%oiY#Mdh$"bu27mu.GvoDjDH9ǿqA7!zy¼Bslkh=KFjh ӽtɖTZ#Bb@"mC]i Fލ:6C3RBBO$AY߻Ct~{$K=3IS\p~"dM e0Fol`cT $LIrt c 4VV3;5h Zߞ\ a2hvFZP,4ů2QFV"ؑjM7iGϐ=L؀cxԜ-Ȱ8@zQjHy*dpE*' /Jd3[JdHMe]%YFR;f9S%W95U rTAsE`C3N:-3kKէa,&G͉>j 0khG51 -McSN|ywS6:@7RL 1 s4Z*'ZRgBsPaPffa ᰏԫlSQ2)Sp+0ac?h!aqPN&5rZ,~ͫWWI/ (s|x݇)9 &JcZDtҐs)z)fsmduUgu6)*\3# @yq4хH0(m zP6/ȭ Zlw}3$%JCa׶$RÙ7!G[h !时c>3-X2bZ9 i-+|6mƽcwB(҈9dَUlR6bu:SĪHOy;sa{1E2CUHs^ܥK{c/ @ gaj= q&(wYJIt1*G4ښR68$E%B̬Vχx<Q.OEOѵ6^[=PTY\3Xj]œ4i7۠UPHJ}Y$FkGrؘ\r" +qLHձza'jmz]5Wnu =PդdY.e(c\+H]paJnBq`,#<#q@4gm|=NPYGӓ*^%9 h3n>DMl!$#~)&'G}×c8߽Q4OxW=ܷX0Vm/boP/T:3u-8_\27h?8hMaj߂TV;,gFٚF2~}KJx:lny}畱ŠW2*w4LMYm?󔤞 C1Pv]T\YVngAc.Wk ˰xgұ8qVTf"Ydbhe2{ RSI:z:H4I  b60v`EJò?#MGIҲ%mx. d7ЊcHU;20V r6b+1Ϙ Z dp' 5l%8tl$ v0'E󙑳viixv$pR&&&CԳ+'Οy,$K='CaB~lTPM#S@Q :|h'{p0BCmxeQDB^ ١aNOo#i]1䦮67vzlϼP|ν`/>DR,^5uU&"hI<[* x&_Ԕ@,h+_Ai'JIi4@j$a;@t6@ݖ[Z™`C}=KʛC.CVRb'v+r}zXe%1WN~a!m0s3! U$4NXm'ZGF+3 (d脀1NLqYX֦l吒'֍RczVjm%HFb@ޭKS X8^§Sۖ206e̞']d [ʋ&_lKVRT*4(KB]T8g Fԛ%';Ro#n ׈c kc&^xŗǫ˱ Ɵ]Y#) ٫S؎ԋ=UYS^{j֌FQYO[ endstream endobj 7 0 obj << /Type /Page /Parent 161 0 R /Resources 8 0 R /Contents 9 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 8 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F6 193 0 R /F8 74 0 R /F9 75 0 R /F10 76 0 R /F12 78 0 R /G1 170 0 R /G2 175 0 R >> /XObject << /Im1 79 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 9 0 obj << /Length 4775 /Filter /FlateDecode >> stream HWێ}S@f#@z `7}ERkwͷTu"%QI`xDJdWSN{r#7Ш(F_B7.lV=މxr3;N?^j\-:gj|)i[Vɚ^ZRS֊)BwCcUSoC6t-K$H^D[KK):R Aִ*5abc¦{{GWq~ @A&Pim sZ=]lT_ɗJƘ nG0&B;1M0qsQ5RRfEM_Jm7.&4"8?z j8J$r=VF%i"̧Xtnu^4Q'lVI1#R1M-&[dT eX{  I\iD ǚ0ŪV7UB^N]+\@X].zsC!aOoJnPː *BJaZŰ jgMKC4o$y7W"MIi u ǑbDInjm$ 9JתkKN/3A Mv+t'ۢYc^4n3Ɨ+ѕJYʻ2i͋ǐmY@;hE.y{+7¹rU"ƪ)74j 8ktX4 dxK9Isqo ZU盫CE.yk&6| y%q\X>pPMajڛBP5|{_Ɵj?ڧZӑ.ݥGJ#Гz4N^<PKxPdKu+LFhkE;E;1y\:`Xs ԫ,Z*YJ:*v\p{)?Oe˹P;Na QjGCLN|>-@9W]}~n/ ZaqzZ<\ pfR,X~6[Tçx- ]/A¼/ϘȌקJpئ=rߢ>dHCB S"_Z< }]0_]sI3Hu Z9awq ` 'U˵+z]s+c'Ym=hAgn(0)phvC+;^Z'b\^ k| p^KM4:wa^cL1ƶG>vG >t"T2xy/OEFA(dԤs>FZL7q,yՁ4m)^}2~mo~IpglOtq[gC%I9jVvwIRĽ;JYt,-YDZ.Q_ 3!2~A ͅU}+9891Pq^3T,JuSYHr0̡:B%b߄cS^%N-pE Z˺ӊYlxcǎ9C\Zbtq< { h|ͣsʬ9+/$Gg] | ["fV41 v=YR{mD [*q"< Vpyf#i(( go'Zp{CsK> E.dѐRS]CFQKr+-b2ܒ\ r txZMk4ʷy9̇Xc#Gs ] z)> V?sc-ʍ{TMYQ<,n,Amn"b_kq 8_'mk-E,e!mW.[ESl501:R'$Ɛ: 鸡~-/n[[]g3YBVZq1Z#aLWU˜ňdw! @,s]p 4!Lvڅt vy~s&{/#bz[u[q7鷚qP1lPi8;V1ER0E66=O$HDnn{T< c>m~TU* > .̢g(@=:{hX6%P]}+IMxy"-Qϻ_4*Θ nk'툿.3u)H Ud4ó*;*v}yCZudHTGzmPF Nwj/=bw߀u|rOh@ym#rOsY(Oo?zjOF@J4PI#vT#HLnㄺhN骇+ˍBv#gfQjLP 5f#tlq!9rZU]dT7N}j2J;0e;Arv\~ߔ}#J>w;)>*Ƅכqyx. E@XJzӸz@yb0l1]~bJXOE#8 t j‘#vdr\()bz&Ud.#d-az+RAO%=P,YhM> endobj 11 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F2 172 0 R /F4 184 0 R /F6 193 0 R /F12 78 0 R /F13 80 0 R /F14 81 0 R /F15 82 0 R /G1 170 0 R >> /XObject << /Im1 79 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 12 0 obj << /Length 6527 /Filter /FlateDecode >> stream HMsܸsJ ЍϔCbm|p0IMleId˥!gLj^o*HZoN a㵕.zRtoյ?i93=-i |ӅǷlTJ#K_+7*;MǨ#i+oPhé#}{{+[Bңǚ #'Ht޼zKW;Ë_^0]?ƸqJJR)O*zPjx/:gkcżg7a-ӸȒÄӷaˤ}N]`e~#2wv%"o^<6w u Gě6J7l2_->7trFZ<΍1T8Κ;#~[t5U.7WB*p*ȣx,^c;רɜJahձ'-[o 0tNm CZUw0ʃ> AЏkif% XiA4)#ŅWRC p~3n/>t I=!t(Up [3;(U@oM z!ĭ7bMB#ehcةUa6V:5RI:rmbV/QWmţ,eRlvXL'XQX(5#p#! ' ⒜hmI^#Nxm.)6R ȇc*A)B%ѣJci2⥮Ne{Ks ZW]` GNeڈ]C y~O I!*0(1bU;ͳnM#טN$*:c LqH׃bsE!TYlV(( x:zeJ5ShoaJh^hsB xRA .hh(Q]4'V lWEz'1^u;*H(uJc/|Yd4S7C eYp\#o=g0XY׋BF Cn,v12 *ecDL 9>~xw<.gqN(<0ǂ;Gph-Z}#:Vw?]P 32.zYh6Q\2!zfb,A*EC,CYcm[d_nCጟABbb4/SH %[Fz@-e\tZ-iM{f=&4B}jt$;ޙcf5 h@qejveDK>K]d82q?l=_;rЇak(5<Ŭ%ELIg؈%z^,MKQ7^ZYL%2`lfBXX6 \dMޠd*2%g]7㮯a\c>ON Q,9Ǜ@&g5u\Kk2^l4ltVJ8КEu:,b2JÈn e2:Av uGm(,=C-E9HmCUʏfEf:;OZNKAԍD Ϛiz^m|RՁl8 \c1 d29`w(C=f mhj6;Z3ʤ%`1S)p9 g B8U:2, ɞB.6E6͚Y۪ FX)n5ɰR=ocGB˨<)-sLL!Q-8]z󱭮ŅRwO[yTO 9gB8:e> ,qg.,x]7㮯alϩ|XAYr)7LݩPR5`d_HW6 ^ p C 9u#m(/*jt"txaaTHZAZs*{gTI)Ƹ1*̌$Uc;#wRr~wZiֈ>~ExX:2.Oq5~̊k`]jdr"kZZf8w "-hF2roԝ)4 ]&(řE4: {9`ћ614Id;QK69vMGԓ=^4vJDXӒd|C !{5[qȿ*_{?} }@M nu_d_NJ1oMīem>cgy-Iq\wBUZF؈-RI3c9f-CO5bZ.gOgvy-V1ƈ FJMofV4wrG:Dsm|M78;Ȇǭu dC9@)![Rma7f!#~&d3]L f?{*WMN z·ꉤnii( _14\<~J$g9.ԗ vn86R .i-)(?&N!8V#iJB"X7Yi53-2|ycfvzM::>])x!7/n"Ky'9 TR\DPoNH E[0-14YKb,]Xm1Jhw0 89X60ocVd˖ݛܮE֨龝K*,⣆sՓ୭vgR'HtmfW+^6ԂXy޽|M8N03TiN+~|5v4TC6g+[#8![wڃxRNgޅ\XzA-ݦY@KldTBbB9_f 5~ΡPhN |iou&7vDI{ J4T,ə!xϰ=B<77®3A B dEc{,epG*ΗEfd糥sua;Nh/xn'h+:d6`v3mg첍]n#z΁"6,83  `?ְA_q=5XrU(F(R@2OԓSHYo/j&yE^8]@5{'ꆎZc^L_Zs|]n-%'~rYNt5xs@i*'ȬG&{m;'E*;Lr'삳C+C:j޹aG_72&;q!@! ͹mD."&D7K͙E&ػ08dЕ҅'2c"fq^ݭ8,g'*"s-=4hk.~qyN[sMOG I>#}һc!wى s{8tnt[)L]4J\K&+VH#=l7==Dж6'^+UQߵ|M-o)57|ȩkS 2l'j𙵧ű<02H`/C1shO:wyɖmHb"8hκhѶL\Lw +NKK04N^=%S6O >/eUd)9Alt)ی̑ǿ{ Mwj!pWj U*xd4-j\aIJ ;& #X~`\  8;T&k=@XF=NzOeA8cM>ZE ؄OHXks]/.Isӡo7Ht11=w%~DB>IW$7(w8zxx l>=z=z`8yO8I<* a, @L~Qm&G`2U}}%ڛy(`) (1!5Dx}c!]&cUC=\Թws;U]eMUܞyI.|SYٜq́cs8UdOͤ 6l}biweiX%X멭 "mQB s+эQj%\|xw҃\6jJi!5;D(my1ӘoF,hOY`:XoOPqZӷ(xQn_ڶղpS@-z6rj5BBV8q\8\WbL`\`،Cwj9ʣ~zwLyLR\:Ie\ܛoI|OYmk@>۝,`D멭V JP:qgq<+(7?7WC")n~v霕|idxYƑ@\{9xpQz6:s[jPgTVilGA2rN86㫺.j 2$5l Y1Zb4۫=\vp?|GbߜL5'֝X}gBʪղF Z=V1(.P9$jĮ8I,&hyxF3==ـ\'߱ D='&<bxhAq@]XAus{[nF"9BVC"Nmy}f &w]d-4/$k -NUJO<3 JusRyD:S]y [(>Gɪu9=$ŖP*e#3^b%ǘ2yElh;^!)uW㐜8$"?ى8h~!Lb¼xaྣԿ}T2c<4Lpt ? x炡o)gI$ &u1&;gш5?g`l8~F\h1ְ@OgwkN SX.aez͢\--=6y#_iU . gS VB-ΆLCi"y= B YԦ ì1j-%sH*Vt*Zޫͯm]$*tp[#`Aw)x͂Yg1}sZ]u fOܗ[,S6>=QP_.4'jraSfbq|V_̢,-<:݁w`;x,o ot'tGh.v[P^i=9#I۷D$JC8s>"uJ$|C>U~~lޓlﱙMUZm/6X &1K@"-{hU&0<`^N/K͐^So̜bU>+|2 endstream endobj 13 0 obj << /Type /Page /Parent 161 0 R /Resources 14 0 R /Contents 15 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 14 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F12 78 0 R /F16 83 0 R /F17 84 0 R /T53 85 0 R /T55 86 0 R /G1 170 0 R >> /Pattern << /P1 20 0 R /P2 25 0 R /P3 28 0 R >> /ExtGState << /GS1 206 0 R >> /Properties << /MC1 30 0 R >> >> endobj 15 0 obj << /Length 3717 /Filter /FlateDecode >> stream HWYI^cA c7}Hc Pv|GA}&jLJ{ QC= ªVGMԎ([}5Q;>ui/esVj`Z3:s]p^Al $TQM{Fm3v, ua8֪QhR"R[IVwh3BX#1ӸWӸջi p]%3n%a誝h8>Jѩv2p!L9[LG*a.)k{zw8[k8َ NOu0:WusR1)iHP1tː,˾3͜3#榍'i,BijHnLe[{weilH62oOtCb*sw7W/?ܺq&gʙF8GZCAAHa;v,wHƢGZ'!1z{{uc@>2m3D?҉։e* q߰O] (ģ҉A\mKKU" jʼns .RfcSz2SҚ,{Gۋ#c{AoVgiHMp L5ITֽP͌b*.6R'm/<#ꓶChfv&1J3;bNptdVfliV&(u'f5KՉZ. CX8Nx>:qb2c։Y uaKND&:KPuRqag1 b2M ϋĆ:Q]Re̝(lQӆQ-h#BVB&Rc#h=݆)o;y:>2oxȵ˰y'U2v'prPGBWbM\oQd[8,4YppxYn*ǂ6-hc08N5$%B?X-XVCiRH ZB@Xb&)I%a +Da 0tv#;j[F0B# PYi㫐EOURaYbWbWE+e[(@r߅<bB! i`prl 4PhB CPHDjF(4\U8@QZtF+ߔ'ti_H sl 8aض}fv\,δAxWtyusޱK\xŻ+}1oΗVw01vWbWK>+a '>`;W`z .Ik׼vŴjgqW1Hts6S21ɏ*Z- Εըlt"Ӻz_,Al* 4UO|W{~qQ8G㓇\\Za93k0pBwh ?zi]Kꖘ4;0wRO2RE]\p]QqCqNaR$gg>lE~]C5D V4YObXdðƦ?٠dggZXI9Oψ#-rXH@ň;pZ}^gP$1-p/yxb\_7R67ĥva,r0:wV-n9b1j]IVuO6sfqhN{+'yaNfzF C;De?[zA!.S*RUp3I&]qifc̼MT oND64w草ԣpd,=_p qCA ,Q cu@MlG ηb2A{ƹt["KY,ŷTYi~`Ȇ tF~Fzȭ1u+^gUB8` 8.э NE"! G "*:s%!N; ]ꃡn^n烒-L> :h8@E*<{swy-#8$ ׼3-twk|RR3XUy! !4~b;Kм )Gȶ:]dH:'y;{X=\`j^EkJc-Vº@2[GJ[yTx8\fRQʏ7ׅx %nzUUvkk9sT{nLii'K݀oSd h!m& I7}\?^~zK~e֌7)Cy @CnB ^rg׼Rlل釧p*zF0Pm*IU$ORIu$^ Al]5ē8'4Z1 > stream endstream endobj 17 0 obj [ /Indexed /DeviceRGB 1 16 0 R ] endobj 18 0 obj << /Type /XObject /Subtype /Image /Width 64 /Height 64 /BitsPerComponent 8 /ColorSpace 17 0 R /Length 53 /Filter /FlateDecode >> stream Hϱ ð9!yȘIM{w~~~~~~~~~~~~~` endstream endobj 19 0 obj << /ProcSet [ /PDF /ImageC /ImageI ] /XObject << /Im3 18 0 R >> /ExtGState << /GS1 206 0 R >> /ColorSpace << /Cs9 17 0 R >> >> endobj 20 0 obj << /Type /Pattern /Matrix [ 0.72 0 0 -0.72 20.07899 759.03999 ] /PatternType 1 /Resources 19 0 R /PaintType 1 /TilingType 1 /BBox [ 0 0 64 64 ] /XStep 64 /YStep 64 /Length 44 /Filter /FlateDecode >> stream Hw6TH/*23Q0B]0 $s=s\ _ endstream endobj 21 0 obj << /Length 7 >> stream endstream endobj 22 0 obj [ /Indexed /DeviceRGB 1 21 0 R ] endobj 23 0 obj << /Type /XObject /Subtype /Image /Width 64 /Height 64 /BitsPerComponent 8 /ColorSpace 22 0 R /Length 56 /Filter /FlateDecode >> stream H 0K: =m?????????????+ endstream endobj 24 0 obj << /ProcSet [ /PDF /ImageC /ImageI ] /XObject << /Im2 23 0 R >> /ExtGState << /GS1 206 0 R >> /ColorSpace << /Cs11 22 0 R >> >> endobj 25 0 obj << /Type /Pattern /Matrix [ 0.72 0 0 -0.72 20.07899 759.03999 ] /PatternType 1 /Resources 24 0 R /PaintType 1 /TilingType 1 /BBox [ 0 0 64 64 ] /XStep 64 /YStep 64 /Length 44 /Filter /FlateDecode >> stream Hw6TH/*23Q0B]0 $s=s\ ^ endstream endobj 26 0 obj << /Type /XObject /Subtype /Image /Width 64 /Height 64 /BitsPerComponent 8 /ColorSpace 17 0 R /Length 59 /Filter /FlateDecode >> stream H 0 xKWK^2{K^^[>1# endstream endobj 27 0 obj << /ProcSet [ /PDF /ImageC /ImageI ] /XObject << /Im4 26 0 R >> /ExtGState << /GS1 206 0 R >> /ColorSpace << /Cs9 17 0 R >> >> endobj 28 0 obj << /Type /Pattern /Matrix [ 0.72 0 0 -0.72 20.07899 759.03999 ] /PatternType 1 /Resources 27 0 R /PaintType 1 /TilingType 1 /BBox [ 0 0 64 64 ] /XStep 64 /YStep 64 /Length 44 /Filter /FlateDecode >> stream Hw6TH/*23Q0B]0 $s=sM\ ` endstream endobj 29 0 obj << /Length 795 >> stream preprocessors.xls endstream endobj 30 0 obj << /MetaData 29 0 R /Title (preprocessors.xls) /Creator (PScript5.dll Version 5.2.2) /Author (psycho) >> endobj 31 0 obj << /Type /Page /Parent 161 0 R /Resources 32 0 R /Contents 33 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 32 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F7 73 0 R /F10 76 0 R /F11 77 0 R /F12 78 0 R /F18 121 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> /Properties << /MC2 35 0 R >> >> endobj 33 0 obj << /Length 3869 /Filter /FlateDecode >> stream HWio>b 2}$9,xëD UwԌ(- U]ի˫}SMzoWv+|kWF5ÿtkM V8]j=_]1Uxʚe?+Qpfz ƱCnڋCo>ߞ۟ 6>yj3lᘱEoBM{oٞJӖ?Ov~-dEoa[yۏ ;{#C!}Ywnog^M a/ݜeM=_vF?$̱S {rq.`cˋ/oafzo+uZa?AI7^V/DtyoZ| B,-ƨ4r \Y}Ɣ*PmqMZ2٘tL-ϙ*&*ܷ>- ƺ{Դ6kN1 Һpy7N%gKJ;q /2Pue-)%qѰ՚J +ŤýqhSMdkÙ>dWUYs=p#10mt[LupWؒpYpD(P)4J֥bqW5,;W{jc*=sUv5<7%hqvOwc0u 6cũ(z\lc%NWë&^<jĴSD&B,hiYESB^D! 0E/KҚAL[UX1, u-b~f_ BoM/Z"{T;>-C ƣC?///dR>^+c[P"U |ݣ|(PDʬ4̩X*(s.BK}eG+XLi~&SqE*QK$ӡv4. fGrYb1{pw380qF gx 4|>wIOu f:&QAܱ@mKV <],)VI(G߆ V!+TahV̺aܫٱ-wfK <Fyz id^ְ{h">BDzaњxXhqU%؜Zu.m:W /@"۬yIf@ q'2?91~+C0ć/ƀwndKǐehvY[]f @v &J9.]ŵ^*$RH@(g=9*\@MQN ҒTb? DKPݰYhv ٯ|c a k L^>Cm0_% z\-Ys5_6(X}~B̅IԸ]/Ft/e$=QA4j88NV} (u=ГOC0SV 6' "%V3q G#83R:nD12Iָ2mh=j='E}6sWW4R oI?RTR4$ɻaЃu|GHs"ЇC6 4S*u+ #sB>)LǑb4GyD!1sōI]*氇֓aGWFC>Yxyn:_pMazn:e3G\n/sXVw5}(`oo6"R3Ftn":´jTR2ˈ)dx B\V1F6dr1|a,Ҟr.0wӿq/ 5v@DUus1!Nb™{E=ltdP6A[-B ;;F)pBnG.oWki;4\U9'w\QQE +7?Y1P37Bξ]oo E7Hmt(NN)'INnkuhK/U6bYRH jwЇC3h\DΆ쟶%\` !dY󽼺l6mx4uz,T` h>NH0?Գ[';#{`@pxi IIk!_a1Z2m ˹(~-#5ʍ*4$ l̓(fŒұU<٥7MsM@5UjQ*lsaqeժ:Gup/5a9}T{:xPHKR/ ;<exv:r=Xb}xYY4>͙RM>߱ETi*A#f>0a`"9m(d=`(R(eQ< J =Jej=_KW.#!L ʎ1AMVs6)~_4.fju%#bLnan0h SsmV$-jjMm$МרH2Ub" |{ !;PiS[sUcVQ)op&US" GغkQ61#cʘ\(sƱ2£)OeԬbŁ$AC 4E7vO2U4kw|FOTԟ~=kPhѫxay;ZSyGr^d'dQl0nGkjRwp(G؉F ::߼K1 >ӊRmaLṜLpn79yk:2&-uz as!aXlkg[fUksBG}vu>p 6 >ؑovK,fܠNQKmYbq$8vKR:aofqzI%c U`muz~-8N;U&g؅ 25cXyjo)~%v˥#(εNrK*ؖWݬ~ޯ".ZV`c86>+)xQu KT=GDbKѻ9ʧxm^fqzCcL&;Wy VJГҪ}v>Ga]-BjFO$ [lZk䓚7>wRTr|$23^Oh"izhFuFy={q6̔b:YzO^mQYMm г3)Qo@W8vv/= (Aa OG_ D,=_BHSNSk꼫h V62 ^a2EsOPұ},lֶޯNJԢn.nl2\n"$ݲ0 *3\R``$% | endstream endobj 34 0 obj << /Length 874 >> stream dvips(k) 5.94a p1.6a1 Copyright 2004 ASCII Corp.(www-ptex@ascii.co.jp) example1.dvi endstream endobj 35 0 obj << /MetaData 34 0 R /Title (example1.dvi) /Creator (dvips\(k\) 5.94a p1.6a1 Copyright 2004 ASCII Corp.\(www-ptex@ascii.co.jp\ \)) /Author (psycho psycho) >> endobj 36 0 obj << /Type /Page /Parent 161 0 R /Resources 37 0 R /Contents 38 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 37 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F10 76 0 R /F12 78 0 R /F18 121 0 R /F19 122 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> /Properties << /MC3 40 0 R >> >> endobj 38 0 obj << /Length 3863 /Filter /FlateDecode >> stream HWn[G}W˥5{_!U_ߟ>">RC^%amվ)):=A]2ypF6-߽>=/ Ā\JjB,os\u:)EE_BDž`:rQC_Z7p.[6oWmv2KޒxhX>!=XGVvT{t9!VzbR4!ZvNY_:YxZ}]7x$&/_R塬!&mh RHgмqЕKWGJ[9XalGMPe5)>s2xvYms 4g=oe-upޞ7/"mc2kZ hόv%C.κ<8rtC ]8U=8xR{wHߝz/{O9 X2z/=e0QXV 綹V IJuEҳC$t~6~\ eQFX5^֦kgՃ@kjs6,y|5dž0y -%WsNs>Sr ڑbUgkV^هUwl3^Î>nbTvy)yT7O5qdf8qb Bi@ džn:pGy8K7ߌ@E"lk|T3@ְr;X{s@Kv VЬ=iY9\WeFf:=]907 c1rƾ܋Nwo ȜJz=)LH MfBœ|[/9M+L&Z1&쥇mX{aۼRLfFk5S5$_r"f.rmz46 p&AĶ#o0U{BFݢ$].Pa^QINbc?cr?Ws(A.긠! W>M 0AG0!)V0a{5Uk눂r1*J'~7Dln Y!bGZQٙ:3`PSLi .u22S(1]lrl`7̂y sYNYZ&NlkgQc<-<y s|:90WKǠ▢ ̀Qd rm0dRPcƋ%v`!OBF'du6,= 7u\<Գ9HHEA ՖĨw@~~PeB)߼85BљGyħBYVtd9Ѯ)-XWkN[5ϧCrW'EUSl̛ȃ};&#VvҾΜ0.u:h9QpGH2 1\߲GoDnf-jS٤m(:j.2ϖaBxshgL>v|tsbF(t厲y]&L!%QȳBTO11{wmtdF2fJc ])E S&pƣ2DK@xO `͏9qLnfk˺@,c/gF.@&FЄ_~ߺLLqIh>gccFDFPˇrLkiKNQk\V_.| I6e2hGaVI}`%^;x:~L4#5yT,Ņ,eYf"k(5*f > ĩlUL3_Vd39:}9Ƚ:iu 4;z^v';QpkNOoT%=l>c)i2☇Ǐ^iS+Gkw61QJ̈́K# yyaxȠ=8k115 Jٻ??KL=? L{ t3U}tVŶ/:u l踢K &;ڇec0("nN/^]s?Sٱ-'lf+f rKsi"Ɵs#- endstream endobj 39 0 obj << /Length 862 >> stream dvips(k) 5.94a p1.6a1 Copyright 2004 ASCII Corp.(www-ptex@ascii.co.jp) diag.dvi endstream endobj 40 0 obj << /MetaData 39 0 R /Title (diag.dvi) /Creator (dvips\(k\) 5.94a p1.6a1 Copyright 2004 ASCII Corp.\(www-ptex@ascii.co.jp\ \)) /Author (psycho psycho) >> endobj 41 0 obj << /Type /Page /Parent 161 0 R /Resources 42 0 R /Contents 43 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 42 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F10 76 0 R /F11 77 0 R /F12 78 0 R /F18 121 0 R /F20 123 0 R /F21 124 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> /Properties << /MC4 45 0 R >> >> endobj 43 0 obj << /Length 3801 /Filter /FlateDecode >> stream HWioW,q; lI Ab,K[yݳ;p suWUݵm׾i7z훣G Q`J˷;I_\ Gqn ^~TtM?4\BpG VvR/|t/˥npw].uUu]wqyHHfBc;9ŕK :,\ݺo>{Kƃz?lZH(r͕vCͿ} Vߪ5`T:3PK+?uw7r^ۿξ_tm '(wVJgX湄]%Q2d@\*$`f׮?_7h 4\ַ_ﺪ}j߬v{UB[Q\n_&`t<_x~߬J/%$jh(P1L ߤ7~H7_UJ ѢSݽ\t).JNYySd]{N%::+TK9U WU=BY(D%OƓJ_tGE9OYmZ00`iӔV 3e[+ -WsdS`RHq2: CƈsH5WJ*CR𬣗*x-!y6>'|~Ho>oik'N)<ַ&våNU`"n#$?Zҳռ55pCԩ|VM%m~.J4+ޣ)0IEY:20&x@\r_5iݐm@'o=Qǁ](# u򒩞Bh|] ˆt"j|@vSyّgdi4ӣ;n>$pB fM]r䁪N@Ab"M l)5Vch6Vj>ֲ˜3MbXSi=_v&)?8R&X$ (;M`;WNF #%OM,^=BsxgF:}J)na$* dszkWų#l[=be߀΍e!~5-%+ E9 l:!AɤR)Gޜ)-PLg ߋ6G#H85CB@61BGXL@mq'iOx@nMJ//ׯܰfvi1ɱ:/:i #TcXGJGCY2ў0 !@h@a~C|rzcZ7j&_0Gj/kRZYZq[fb N-(QKg+zIW=D\&J:m3U*&3[.IJzUr *ci*^/K=;WtMs5a|s4CcC\#DŽgɔ|dNE3OU۶} ($ g 7h ERV6\y>Kΐ<z,-AF: WcWΐ\;xCkzRWW4iP5Wf{|qַeɋpN4 At/´HtjL 6v}SS)ƨ$CX#TcT{)0vN`::&==)9CvrKHGhaaXD O~븭ϊDc꺨}Bub!VqnE.]CAo Mt|}x(}ɯ%Cy|s0h:+Gpu>ƍa8 xRy̗D0kD)ZZc|ZX2 V&?$ޮs7'Vr0k|>=Lkvu۰)|]X _aU^.n/x "]̘ImTw])MUHI]/We$[ (e 7YxP#쓏Sn^kIXHnC%e V~ RCw}TmM̌շW^l+002 YG?eFqn,t@7b#>\7B-O;-J8hKFwYc endstream endobj 44 0 obj << /Length 867 >> stream dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp) example2.dvi endstream endobj 45 0 obj << /MetaData 44 0 R /Title (example2.dvi) /Creator (dvips\(k\) p1.7a Copyright 2005 ASCII Corp.\(www-ptex@ascii.co.jp\)) /Author (psycho psycho) >> endobj 46 0 obj << /Type /Page /Parent 161 0 R /Resources 47 0 R /Contents 48 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 47 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F10 76 0 R /F11 77 0 R /F12 78 0 R /F18 121 0 R /F21 124 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> /Properties << /MC5 50 0 R >> >> endobj 48 0 obj << /Length 3985 /Filter /FlateDecode >> stream HWnE^A~aiK Lb%/@(l`7/Ωkw 06in-Nzڶk_l~~>|ݽ}u?ʰ")FYZJvwp!v.^^w_.D)4xxEZ=|zABEY}n}׏{UХ/_?) x>F:*j~YΓgyvZ /v߾/oC,CЫp7?&]˄P(%#.!T rإyV5|3S(_H=L p}{#+R'BQhp|WY+)O+!jk~YcD0u'*] ⯪"K%?-FQTR"ᮇ!AuJHէ4HH3\&ߩWR "+9+4\+K(d#ѾJUgIdE06w=WHE<8iR2g5OgKy:S !mRԶisf7|P'M}MáM6Q2QP fI粦nPn1ʄʷ$*mhLg10'hmӻRoFQsfD[N,JlXkgAJмrytJ֥:zzb+YtdKX+FN҃aS-\RB tD Atveq:?E Gij76d=(%96j$hÀ~| _Ymq!g9l8G&5L 8)q9:(+JHAN#zՒK:Y#5jy+Ԥc!C7 0z7mQ-w3$!YFɍ|1 !JZ^W̡ԈPoXAWM`am g5.,MmdiλLuLu0 ч՘w4PС/z3K)Lw>'״Ys(jo:(bu3J:b c˾O̽SKK'ȘvN3zF9D>S\v,7CQk g৷ Ode  )֨6TCh)bae7̑JPd\Ȇh$O ," na5[E@|B5D =c2r{@\L!OfVx%-k=mT<#Yo*G=zafcD=,?]CpG?.)49J͹s[JkE %XR2 o?$qA)4~)U4 oF݊MhqQI*u3ޢ R:('IZ_l,Y?Ð6cк1ila IQ\+@! td.Ld.P c a*9NsyB0Ty/"& 1͌V2j?5ffhS,|>V>rwojTK81D5̾oB+ì?'eҫ Ow_ʲ+ ,SrJ7CUT<(DL%̋09C)9b%&&Dڙ; ZaJ` 0|s  ExQ-QQlolx mɢA>Oiꃠ>A./voPL=Y=K(-|tuT er-e󴽜Ro^q&h%.b`X ۋ-j4wlKx2c,q֝U^v'B>'m{&Ynu4Upm䆧u>`aÎ,f{VkُQ!r<˦li&)!8m2k,~o="%>e[K!ED`*ݷoH[0i)zS%Nb68!1\rǽtt ׽rE{JLV :h _dm 'm;֣hESvXN0IH`fT>C\<,DQj?qnL.C4L&18[r @p:cϕ{_tCߴo?t3h{q^ aLPtd Ԭ:n -/V:RtnZ=|zX6s'v5f#pdT1g\V[.[CficsYGXM ָ\:-I>׬eOx} v¿gcH3=j*%$7QW8,4L)ƨpp1@S_/p#[#“džTES$"ufl{:I'tAXqCH)ug24Ad$#~?ЎpyP9fR{ ߪ9GA-#E8?|` endstream endobj 49 0 obj << /Length 867 >> stream dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp) example3.dvi endstream endobj 50 0 obj << /MetaData 49 0 R /Title (example3.dvi) /Creator (dvips\(k\) p1.7a Copyright 2005 ASCII Corp.\(www-ptex@ascii.co.jp\)) /Author (psycho psycho) >> endobj 51 0 obj << /Type /Page /Parent 163 0 R /Resources 52 0 R /Contents 53 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 52 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F10 76 0 R /F11 77 0 R /F12 78 0 R /F18 121 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> /Properties << /MC6 55 0 R /MC7 57 0 R >> >> endobj 53 0 obj << /Length 1869 /Filter /FlateDecode >> stream HWnF}W Y@}704ނڇ&֖Aӟtf/I왙3gf.nim߭^>'ϞlWgϙ][i׀#lm8z{k@5~Oͻv+^00na0}z}մվ7Ҳfobz{5g++S,nfiGX{m_mG[І!4t9]uF*}ũf i&% {J9A" θ&(\1 B+A'4g:R:ܢM !Us .\!G[es|w>{e))c>)M'Q_A0̘qDބԠAWk'b؊y,>3acT;kBH=:Xl*s#u*/atmBi;? h1}sݘtPR,B+TBR0;GNLSG"3XL1I{]!~yV!>‡8XmLН&>2䁡ౙiY!k_%- ,̰Y .CMtKQew96ج *0]]_WO-&c;ł5i:̐l?)Qzo0,x3㣫]^4Pz}pٙNʼnJc@3 H燱 a]`qy%obxBu| $OJ[D|z 9`l.44`qzhf0?iTZBҤF"0#/!G0)@`CsL(FRiLkfanH7S?Ǐ ض+:zZIt0k/mD 7Z5ْEQá'ZUK%NXKz8%NF)\G]g*?췞UB,Qg j-ګ:dA<[kkےf){Lj::P`p7^o#).Jh&Ah(Վ ZAT.PR &Yf2B>&̪{ˆ')qF#sWxEn 8xKҊ4t V>.M? ݹZԔw1͘?v endstream endobj 54 0 obj << /Length 867 >> stream dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp) example4.dvi endstream endobj 55 0 obj << /MetaData 54 0 R /Title (example4.dvi) /Creator (dvips\(k\) p1.7a Copyright 2005 ASCII Corp.\(www-ptex@ascii.co.jp\)) /Author (psycho psycho) >> endobj 56 0 obj << /Length 867 >> stream dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp) example5.dvi endstream endobj 57 0 obj << /MetaData 56 0 R /Title (example5.dvi) /Creator (dvips\(k\) p1.7a Copyright 2005 ASCII Corp.\(www-ptex@ascii.co.jp\)) /Author (psycho psycho) >> endobj 58 0 obj << /Type /Page /Parent 163 0 R /Resources 59 0 R /Contents 60 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 59 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F7 73 0 R /F10 76 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 60 0 obj << /Length 3878 /Filter /FlateDecode >> stream HWˎ+x$ Loֻ `+_< >S  #3_R͕&*+222/o~ɜ^7)^o7t1(K__96ijՏpy*95b1w Ky;kɥIv{8\JL9r}a䋡drђ+\Wgxlgt'ߤ4pzv0teij0Q)isO-%^Q}z٦Fz r=i$ Z/ɦ142 ~+ݾ߿{w v0>!c-]q:q"O!PS=^Xs60YP2Ipx筩uR)h -MEMxrԽbqh|o56Ϙ(yϿ~iUFm_FkKq%= 6dt Kp,4i- %oB&%b&JHxD"|K=l7AQ3q|erW8A*C_5$P_g%ՕzsķDѸ&SȆ?\.t~2Z̭B6Tc[R1bz,Ҝ&eߓW7(K^-GqPwjO#g4΄">27Ek]ջ$h&gk{)֟}\ET6m~ X85CU성FHbn˃əϸvAM*wOܛFRxEm3^7qlQGtCʅ'Є;K Ȓ3ڣs|gނl16ca]!fa>T b1eT &s~Zr3"mz(2V{r˘*Nx[9N&NNaUBʉU8tɻm] _&\u2kW+j~ rw0ՌْU&ž>4crL],(|p~(>0"4BN`E fFRX^1^l]ttDB@zYQBllnm=rU8vM8V#LPm|- ɳԕBǠ_);_T5I9'E.A\|Bug`6dPKKó4>/=RS mZ$yul{y}5&1Gx~cC+c99lq&vmpFea < miէF'U+ ZS\]=ρW~)ӔWՔF;AAOf9gwwB,K$Jӽ26QZq<("7cȌ3Ҕ*mXpӶc{^n.*1 @ pVjo<6FMi5E|#~3$!,ojѭ%$ e%IН)Vy C> QnL}YwYbgϹՀx4 參V`J< UvhZ ]*Wc 58@.{&;*hP lP}Xmz!#ZB4*Ga0eu^H IRue0U䈕8l0gd2a$s޶lD%4E~묊w_Wjk |kx[+?XgB6M+UTm8q90ꀦI/v[#S]~aێz7[xFu2NXvD|fH'43ߓcԴw,8<ܼƙ.I[6(%b |ox%j́s/2dkfFX;{ *t{ᱷU6cbg^@mht< JJvXb(M؀*b1Aۘ)b\a4ր\a,ep܃&w]/,(Kl'ea%DoaZk.yB]uYT{8H-R|\vq ]xr)BgNN0nQKJZ~uBKJ!m h `sOsrқU&tqP'Hί ucoUwNE`āL,./Es ٘Tq+wˊ &]Lt9'wU!VW6]6mdz T,%j"]m[oEHGщl9+=*9y2VȲe2|'X}@8'_%px~}]@}N zu۾+Ԭ3DM1Ub?rzs[?:%5OF_)]gȞ4q7k8 cr6VN``V/"dtr3[L#|H_ڎ <ί^ endstream endobj 61 0 obj << /Type /Page /Parent 163 0 R /Resources 62 0 R /Contents 63 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 62 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F10 76 0 R /F11 77 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 63 0 obj << /Length 3661 /Filter /FlateDecode >> stream HWˮ+f9R~- Y4DrXF~?j9c!]]uS~}G}ҧ]6)xzN>קOSRZ*;/zhTYN-#?Iʆ 'erF+_ˋ5wa;UY=l[8~02SQc,Mh9Ha/e׿ɞ:gT}|& Q%OTd5ʧ̺̇?$1 RWs˗% \qQRT%b^o<(n+ .Yg8.̐ ;5һ7GPL')/E;—#|9j^{uonMtZyqm-P!bys-߰ak`2kgA&>sp C8)yT WwXE*SўUP)"(z&k #MzV ZJ!ju҃5'< b+ 2u$p&3]\JKbvٞ dP ]ƇYe4S8_#eX ӤBY8]pcR輸T+a%I 79H:Z y:yk&j>~0/7 {y1t9Gmj,6 n90GUg1hfRA%yGt%ǝ :^p\>}#kg`}^YLm&dbJF7$FALR@^_<^L MRLY"N㤭/:A*GedIspV-;ʕʰx3 FՎ"}U~!'gmdgƝT̮W"/Ɨ= a4T9oB`cO斈XGީxL p[flvlnY->(xCی7,nb@E~^^̐;w~<#)7d^ hw4B[t/k֔|`-v@T2-FoF,{U+HG GŨZJx?1&hn7Mvhu)[8@we BzP3؄,:x Eۓ6 B"HoS,Dݞhy\?Gw ~KDr+#(Y Ca1u%\g_\X2~<7`{̳ Dt3-h0f-S }zՆ{ӭĈ`4iYxRMEyeZG }QMm=_X͜*vD 2h P07c'Ydi̠!65բw|ob>2֥3`F[m~c5(2t%oYWrg'g d Vuu\N[-h*Ii}&VvsQڈ&dNFO:b⪮)]sKij@)-' BE$!UYub;#+DСiЊ"nZCcm /y $ _Nst4' S4Z#"RPZpuُml:$rvx#i(61Q6 ICbxW=&6t{5]hċYs-/jFig<ݧ:tGNyzr79 ȭVnQ,J&l/ 7s8ZQC[TI8bvd +7ɛ;=,ٝW^%q`Ax'h_ 4J)!_%n`l)tYPY[OXy&['1fŢ,Qw9D-=s;PH;΄JD,O٭;WzwN&oàmg˧JL V5a3kD+TQJU7:_k!bg|_DѨzԗg"!DVn l*"^=mI6YȨv__־l':}|Zp9-Xu] .sՎbfe bV(;X<6f66#86}zҗ [0QkхJu@ !8"0O}CiU#mk.5)fm#8@u3cjŦc  U5X󲾼.jRϗp,/  :eZq`zpy#U؇9+BDESfS{5¸!16Rz؟y"*F?yiV'5c ּI@k^wɅO G}ԳLai&)cd;~._V*pc#wDNZUPEyAIf+V?\Y<&GQV> endobj 65 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F10 76 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 66 0 obj << /Length 3979 /Filter /FlateDecode >> stream HWɎWBr_a> d$E4 _Dd4%@`ЕdFx/OMe~ʝe Ó:w҇_>?N){x)ߧʆYؿі1`yPha|3y?(;eUQ>)*w0z~qYwx  {f&s hqVR 7-*Y ༔b{~V'OT,ڜkJv`={7Y<5`W  c=wもKok_U~@ӛ>}WB 5|;:)gvƷ?˗wαǏ'tXQ?N'tAl/XYR"Ad UQvz;%npT O@[tj 'Oy,p3[\IpA ǟNxrX/M?8>Zؙ;vtt_ʁS㳫jl;kiE󁋍"4s=[A/EAaAJoqt 4>|8c DBN A7j xHRyQ Zh '6 Ov)Tf`̓)b ,7K&dccb7IkЖSQŬANrmh{gfV uHnc!VX[7S)G}mBi&;f@K/=n &k֢3l5skfsZ\ZݫPib^.V'>KuPuWnbFkc] [S=QRlluoCmGVG@qjRط,>gЙtt6M|t˽#߽W{e9煤fȾ .JiJ5#H=}fc8߹_->:G&f(Z;o-GY1-y-/7궶nT2gq_Ϭiȥ˫J(F 801i݁`k+8w8*y%H oUߞx*L5’_E'oԀ+CRͼa&Ҥ]vQ ]0 C&=R6BM6]&,oc4 /S]&~ =K:"ӚraeF; j6a%J?WQcN$Ps߆]m=Է={u~]_#`a}!+4F㪮do8%zݢ`'0`E2<ʣJ0 }+%cBޯ$#¦)2 Do '0?qxA@y>ܨ50z٭Ω2WQI.q&bw{TYQӸ4Յ?MOqF)ЪM䵔]5N\gY @Պc$n{N)xn_`iF9M} w GPq@0[rpw=~#!Rڜx`Iz.0Z NIOk9X` `b3+H!$Fcı?.f^5Ԣ_Ap݅։d~%v Y>O:evqQrSr"jBҧ`:vq-,\%%lj}mlUU"SE\;}IoLqOz&1s2z?WfBĠ`H\+Y"ʺ$:7='ҲM[-zWR wxCcuo>ˬ FS X~ș8hC҅ 7;FxcN <\a[jym}zj|S&5|S/f(pmP}ĩY#bc6TM4ǽעLȂMBamv蕻[g(e->7\Ns δ6t2{Pkb04;BFA\褶0,u]+Hr#[zof/mUgI9A! l(>; a?F|PTIK*k&PJ<,@({!^C@~8U~Wfv Y@(3ϣSO97"c +Xs:wB^q%m`źjK'L&$ }1#aۙ{|8KSӮ-GKn%-Sgn ޱ#0 Ǫ :)y7@PXiG(E=3-[/-_OU.@"!+?|]N'a:Aa[rPD5ZT;(f`2qUxOT7e|>vTH` =e6?eF(6u-Ə1iZ9tMp- =,/Pi>n\4owi4,Aep>Y\4)%жPY$Bm&iHmbn3̤qdŶ̪W9eěl 8ײ=ݤDF+&Y5El%Dtdu;ZM$DЌIq(nQ`FYlם ˺I^{2}j?n3P]ֱB:kC [p0NIf_#<*OԈ5%< E>ޮzyde㮠5  K;jZ~GS cʀ ۼuvpeL({H3 jo=O6>Z irג]ZQ eFCɇw2=~ZXs٩{3 b ")==#S11wo!u1Y&Án7zx\ QJR8ݧuK6(׸k3 >͑kS8VGjېM,:/ 0 l9'tpgˇL^ܚnXר!cEdqdyWPeCj,i ;$a;'lE@4N < Yn({IP oJ@Գ;JVeeh j + 9OӖڿ[ Gp54.q=]±gXQ\戸#LzCWrV|2!eΞRI2\ڵ{w8A%~.nz] Qfy6a ̓MLiI.Ǒ+-dV;;e:g4B/iuȌMCI$ ^uL`ʭ(uVϘȀ{.LUB2zU2<c0t Y3`Q^moG>/ߢᴸQ7meXv0r rq缊A;K=fњ8Dnq8۽~ gײA/p5ݬWl^= ĸzq}>᬴2u7yq֨== .ؑ,xum*iL5Slom&Wyϱcpj޴b #@(`;`Q]/,karaz0|8ڎj#UH /ڪ̊vYo"oܗ0+HDGsM֡bnk*~~/Ǐ缚q68Q@ã ?~ endstream endobj 67 0 obj << /Type /Page /Parent 163 0 R /Resources 68 0 R /Contents 69 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 68 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F4 184 0 R /F5 192 0 R /F10 76 0 R /F22 125 0 R /G1 170 0 R /G2 175 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 69 0 obj << /Length 3547 /Filter /FlateDecode >> stream HWێ}߯G2P} Ak" x!H6ߒSUr-j9p/O]nr0|ͮu<=rN|^>|SR֟z}cq䪭ϦqUOkLW곋U '^_b(UذQ^ ISiU;;sQ}G:κ o%);z$p 7F)M;:*Bb}lBVn9+$7z딐 =x叵OO?g_{(UFlcmi?X8LxQO6V Xb7|ڳvV.Rƃ2s}*j: )\Pu*Ǵ mcҼiߚX#XqklcK4Ru}WcX&^ $AvmO霢nYi##:Ba@ +ǣC -kbx;F١E0j`làޫn#&Enu2Ql ƴ !bFBc{@ rsl܊o?B,*oVXz7PsMiP G} !`m&=qZM0ӢAZL['xԦQinіGIm8S E+4+/40ˮsN1Ԫ4D5Q4%IXӇgxt-u$x$Oҕmǁ TR] VEq7%k`n`br-7-7INn:䍧OdDV'fcp'v%GM U7E[~{J:*NWk>&gMj2Q*(fBTEtCIbUEcR [/=H/\`KW+ Ok/FԎXݮQMt؋N:`LcQJ./d: e!Cz R0wD0A֒C> |jp2@Z3겦0Ȇ]lU|zvIC;vN~vP km5hFd2B;zVݫN'LnK]|\|&]<ݶf z R.Q,Ml"77Kׁ`|IV=Fq3؟VGӊ"L;=Js=G4 X~Å'sY2GD.5Z #,rN"l\e5B7:3 ez_IE+9oJYS!%6{fl2&]a}۳]vkM o/G-d~*O>9}k<\ǪM/ēc b"4Z:n`Rg^v.&"pƷf]!&UUWqv_1!lȦ|HЉ(PHg;Queb^lC+GGseYEJ[!qΪ6,:9RFF6icпdrd(Ԅʩ8#Aۏ}O1퐆FT4 8RvT7 6"뀛]TZz #3e2R=ͫkz*mV) *&Qo&ݳ%Yx(jIx׽lqm#\㪦_*Ɩl-dE l& lj) 8ȈM+ײ UyLntq$;!<\2lQ'reڅtPU7&'2;k:Kf7lՅt[} ƖQ)N\tHŦ{[tmUxBN@YuFUku8Mt)'Ga;n$UY[@&-8oB@;+*_h9 Mga'XLo5'_JkQ8 N_N?'<θ֐ V[,DtFV] 9u|)^F:3ףN?ogLFug8 ^,KHVFYO;mܓ u~|F*C5Ҧ z֞RDέ!+7 Jӭ8V:LS<,~_2I^y֠<P)LVb$h" &\ f_ ҀGSܢO$+ce!4,2o0 `Myt+Y3c%=d7w7TfT*`pJTJyLgdxZLW[Si?j*==gT`v{۳=.J/rPǼOc<3)'ω4n[&>n*pxlV添Y1@ZUBie^)++oOkV 4,2 ChZ BPn4IGѨi6эۨ8v#&!?0[6J#3DA6Lتkr*a=s=8,ӕ!@ނW̠+ĺ endstream endobj 70 0 obj << /Type /Page /Parent 163 0 R /Resources 71 0 R /Contents 72 0 R /MediaBox [ 0 0 595 842 ] /CropBox [ 0 0 595 842 ] /Rotate 0 >> endobj 71 0 obj << /ProcSet [ /PDF /Text ] /Font << /F2 172 0 R /F11 77 0 R /G1 170 0 R >> /ExtGState << /GS1 206 0 R >> >> endobj 72 0 obj << /Length 1203 /Filter /FlateDecode >> stream HWnF}Wq5{!dQ@EZhiH$AJVЇ~{gvG2%@DC6gΙM/J*-&SѣJq` f Ra"I0+9Mf}EN]!\iX+"zm*CM[x= LR4 ROV1}Ů05$1(GنkV7<4:=.*۝y_>}Ƒ1~ .JiÑ,L4Jz$Sy7Տ4m -E͆vۗͫjThmh;OJ!~l x8K.1:(A9r;7Te<<i =Ht&FIX+<3X* iD&s-y)>@!̗p r٢0F +),H!FK_1!G² S0SKwQ1F"ahuW)0#69#"T$^53 ɓlf!ZU4v[ןj-J^lf,6͌7$6þ,$ e.@~@Q$Fy~8V UhζӸMMٙg9c:}V",KlRq+RLŤx ,w)*DB7J06OSHg ݴ "qThIͭդW1(@P~RB}ksR@=D^2. m.YOi eCݤ`!+!/!aAvފ74-_ EPVZbMtm7YK@fPNj?7/^Ho# RRy6g7c endstream endobj 73 0 obj << /Type /Font /Subtype /Type1 /FirstChar 99 /LastChar 112 /Widths [ 489 0 0 0 0 0 0 0 0 0 867 0 0 561 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBBC+CMSSBX10 /FontDescriptor 134 0 R >> endobj 74 0 obj << /Type /Font /Subtype /Type1 /FirstChar 75 /LastChar 82 /Widths [ 849 0 0 0 0 0 0 759 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBCD+CMMI10 /FontDescriptor 150 0 R >> endobj 75 0 obj << /Type /Font /Subtype /Type1 /FirstChar 115 /LastChar 116 /Widths [ 539 432 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBCE+CMMI7 /FontDescriptor 148 0 R >> endobj 76 0 obj << /Type /Font /Subtype /Type1 /FirstChar 30 /LastChar 146 /Widths [ 536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 278 0 0 500 500 500 500 500 500 500 500 0 0 0 0 0 0 0 0 0 0 639 0 0 0 667 0 0 0 0 0 0 0 0 0 0 0 556 0 0 667 0 0 0 0 0 0 0 0 0 0 0 517 444 517 444 0 500 0 239 0 0 239 0 517 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 278 278 ] /Encoding 154 0 R /BaseFont /AFJBDF+CMSS10 /FontDescriptor 146 0 R >> endobj 77 0 obj << /Type /Font /Subtype /Type1 /FirstChar 35 /LastChar 126 /Widths [ 525 0 0 0 0 525 525 0 525 525 525 525 525 525 0 525 525 525 0 0 0 0 0 525 0 525 0 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 0 525 525 525 525 525 525 0 0 525 0 0 0 0 525 0 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 525 0 525 0 0 0 525 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBEF+CMTT10 /FontDescriptor 144 0 R >> endobj 78 0 obj << /Type /Font /Subtype /Type1 /FirstChar 46 /LastChar 222 /Widths [ 285 0 0 514 514 514 514 514 514 514 0 0 285 0 0 0 0 0 0 0 0 742 0 0 0 806 0 0 0 0 0 0 0 0 0 0 0 571 0 0 771 0 0 0 0 0 0 0 0 0 0 0 571 457 571 457 0 514 0 285 0 0 285 0 571 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 343 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 343 0 0 343 0 343 343 0 0 343 343 343 343 343 0 0 343 0 0 0 0 0 343 0 343 343 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 343 0 0 0 0 0 0 571 ] /Encoding /MacRomanEncoding /BaseFont /AFJBFG+CMR9 /FontDescriptor 142 0 R >> endobj 79 0 obj << /Type /XObject /Subtype /Image /Width 1 /Height 1 /BitsPerComponent 1 /ImageMask true /Length 5 /Filter /CCITTFaxDecode /DecodeParms << /K -1 /Columns 1 >> >> stream P endstream endobj 80 0 obj << /Type /Font /Subtype /Type1 /FirstChar 42 /LastChar 57 /Widths [ 611 0 0 0 0 0 611 611 611 611 611 611 611 611 611 611 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBIG+CMR6 /FontDescriptor 140 0 R >> endobj 81 0 obj << /Type /Font /Subtype /Type1 /FirstChar 40 /LastChar 121 /Widths [ 413 413 0 826 295 354 295 531 531 531 531 531 531 531 531 531 531 531 295 0 0 0 0 0 0 796 752 767 811 723 693 834 796 383 545 825 664 973 796 826 723 0 782 590 767 796 796 1091 796 0 0 0 0 0 0 0 0 531 590 472 590 472 325 531 590 295 0 0 295 885 590 531 590 0 414 419 413 590 561 767 561 561 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBIH+CMR8 /FontDescriptor 138 0 R >> endobj 82 0 obj << /Type /Font /Subtype /Type1 /FirstChar 99 /LastChar 112 /Widths [ 544 0 0 0 0 0 0 0 0 0 1021 0 0 681 ] /Encoding /WinAnsiEncoding /BaseFont /AFJBII+CMBX8 /FontDescriptor 136 0 R >> endobj 83 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Courier-Bold >> endobj 84 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Helvetica >> endobj 85 0 obj << /Name /T53 /Type /Font /Subtype /Type3 /Resources 87 0 R /FontBBox [ 4 -57 67 6 ] /FontMatrix [ 0.01408 0 0 -0.01408 0 0 ] /FirstChar 0 /LastChar 1 /Encoding 88 0 R /CharProcs 89 0 R /Widths [ 71 71 ] /ToUnicode 90 0 R >> endobj 86 0 obj << /Name /T55 /Type /Font /Subtype /Type3 /Resources 93 0 R /FontBBox [ 0 -62 74 10 ] /FontMatrix [ 0.01334 0 0 -0.01334 0 0 ] /FirstChar 0 /LastChar 23 /Encoding 94 0 R /CharProcs 95 0 R /Widths [ 52 38 38 23 75 75 75 47 38 50 46 45 75 75 38 47 75 75 75 23 38 38 75 75 ] /ToUnicode 96 0 R >> endobj 87 0 obj << /ProcSet [ /PDF /ImageB ] >> endobj 88 0 obj << /Type /Encoding /Differences [ 0 /uni6E80 /uni70B9 ] >> endobj 89 0 obj << /uni6E80 91 0 R /uni70B9 92 0 R >> endobj 90 0 obj << /Filter /FlateDecode /Length 229 >> stream HTMo 7I/)ЮMK;'CZ9_Q~]:F3I#qqJԣ -Sıua3H ܝ7;$놤l!.)`Qpi uɫu78!d tWEyWv =%b'o|{cwkN endstream endobj 91 0 obj << /Length 263 /Filter /FlateDecode >> stream HJ0=``Xe1*؃'@=zpB`}^ iga򑟙YzzvY>'!YpGXlpt I~7/"z -ư'Q&&[wu7_l]ΐka[IvDUX< q?;[T+k٘ݨ QI6Һ(ӫCkC:c0pYiE4D5XORoR!i"`41$ endstream endobj 92 0 obj << /Length 216 /Filter /FlateDecode >> stream Hѽ 0[Z`A'@Gk|:YPr^P'+^_ϱ ;EUu;(vz(\maXBbU|9d 1g-BDml_|o_!:yM>q>jRe&f™Eute*XZz,,/c)x {+^πI x0> endobj 94 0 obj << /Type /Encoding /Differences [ 0 /uni0043 /uni0039 /uni0030 /uni0020 /uni6E96 /uni62E0 /uni5EA6 /uniFF11 /uniFF08 /uni004B /uni0026 /uni0052 /uni4ED5 /uni69D8 /uniFF09 /uniFF12 /uni65B0 /uni898F /uni5B9A /uni002C /uni002B /uni0038 /uni54C1 /uni8CEA ] >> endobj 95 0 obj << /uni0043 97 0 R /uni0039 98 0 R /uni0030 99 0 R /uni0020 100 0 R /uni6E96 101 0 R /uni62E0 102 0 R /uni5EA6 103 0 R /uniFF11 104 0 R /uniFF08 105 0 R /uni004B 106 0 R /uni0026 107 0 R /uni0052 108 0 R /uni4ED5 109 0 R /uni69D8 110 0 R /uniFF09 111 0 R /uniFF12 112 0 R /uni65B0 113 0 R /uni898F 114 0 R /uni5B9A 115 0 R /uni002C 116 0 R /uni002B 117 0 R /uni0038 118 0 R /uni54C1 119 0 R /uni8CEA 120 0 R >> endobj 96 0 obj << /Filter /FlateDecode /Length 347 >> stream HTMo0 7@BH-RNF=/vP'MXv=,Iq~НyZpˠA jYWVck tۼxens^ NR>E/.|~j>ּ#Bu ļSiV_(qKνnmS(M*ǂ9)cq3Ȉ%qp ֖=9,cb8mvŎkamOgrKϋ|OLk3i#?I3MպQw[Z_4o @O+ܡ endstream endobj 97 0 obj << /Length 220 /Filter /FlateDecode >> stream H= @W,i> stream Ht1j@P  I^ "T>2M\f ]nt[,3r2c>̷\bJ|/iKq.GٛOZV?bNu% T=FR uuIhxJ7Bw(/#j wǓB|42@;u׀k&)s@ SEo#) endstream endobj 99 0 obj << /Length 182 /Filter /FlateDecode >> stream H2P0P0Q55R062S @$KrW06P05w pV0U()*Mtg`?C?!P oB1;*f&@ p;Be@w!v~r 0z2 endstream endobj 100 0 obj << /Length 67 /Filter /FlateDecode >> stream H22V0CC L1*2su bɹ\N\ \ )Dy*rypr 0 endstream endobj 101 0 obj << /Length 334 /Filter /FlateDecode >> stream HбJ@B-y$-jBi*APGE"}ňB>BSd™]bq~õES=)-vǼM }ZC^ Ss3pxc;90C#`71 Gf%_:0M-ǵ\S7)EAB;ET'XiJYb"w^K`2!SĻ5w$uO%TVaYb53Ȁ EmF 4P* 70w-bTIYB,KD<lP6 {I.؏y endstream endobj 102 0 obj << /Length 347 /Filter /FlateDecode >> stream HJ0@  ml]AГgQ=eCp> stream HѱN0`H^ 4 l Hd@F.S<B$Fc])ϝSKHPK8YZƔ1a?`1 x(>ePkb]ѢU@K 50C}g@Q/;'\qMNP'B+47(Ƣ)LE|nnBGwj|oȗȃBoNh endstream endobj 104 0 obj << /Length 128 /Filter /FlateDecode >> stream H21W0PT55R0P5TH1*2E Ar ɹ\N\ F\ \N @W4Ӆ0gb? F,t `Hr endstream endobj 105 0 obj << /Length 174 /Filter /FlateDecode >> stream H= @F4!s,Q-> stream H$1 0C-9 &TE;:yutP"#xvr /PŘ7$/Kp†TpyiOưG)4wg&gk9-c B[[ mS_Ů[+~EWtNW|'T^B|7q]ZT $>R0D j1K:ż.B rݖ_4iIv}g endstream endobj 107 0 obj << /Length 265 /Filter /FlateDecode >> stream H=J1, $Y2VV@--+3Ŕ{Ŗ{=]6_}$4؊ےZtYysOӆkc-禚P><1%ͅyz|攀5x%ޱP;Of1Ul).;SDa!9^jq43cq1 +>PGqxuᏥ?}~⮈Qr\7|@u/ER^FQh3t0 endstream endobj 108 0 obj << /Length 188 /Filter /FlateDecode >> stream H10 0U#H\D$802`&9BU*"=VmcFhhhQ^iǞ Z=QCx]ۀR!&#HQp\0} 9G2$KL 278OҢ\$"e3?mQx9GG5`D endstream endobj 109 0 obj << /Length 238 /Filter /FlateDecode >> stream Hѱn@ `"H^x@D%L(Hds;9eb#Q b9 ](tBա[-Y-`~!> stream HtAJ@,foUl v!Z @^` #$8kڗpOԎpWE_䰏=\᧑:=SþHvO _&RN$}}o29 -_/^U Go->e=cQ+zodyҲ#o BQƛ(;?J"f,l F%–-i5vŘa?GkH_Mi>yj ragxʑQnLYWG49Iލ.(Y* #8209xárw[$)U2;Aą ~-y8G}, endstream endobj 111 0 obj << /Length 172 /Filter /FlateDecode >> stream H2P0P0Q53T02R0WH1*2 -R ɹ\N\ \ f@)YKW4Ӆk?r`F! }ztd2aQY0 n8Į`{An:S^zՓ+ / endstream endobj 112 0 obj << /Length 229 /Filter /FlateDecode >> stream HT@,iqr!zp)ഴPWXJ+{s] L ?3;SC 9$u U皲')ů<g)Kxݯ(=P{W'PBNKEa;RY޷/:DUPf;( i⬉&r`ZN"} endstream endobj 113 0 obj << /Length 342 /Filter /FlateDecode >> stream HѱN0PGj@6NZȀ c?ҀБT,wN\Q/ۧ;_|&2HƧr$~<ĭㄇw2xx%!7!/o<+Vv}PN; aAl >$Í1=H^[lT;(G CsjX i0~e1l 7 ON[E 3 C-bCzRbEk!kmzZ7SL ~5@!|#r1'4\mӴ9lA9+8^2GKs endstream endobj 114 0 obj << /Length 298 /Filter /FlateDecode >> stream HұN0T |/P%UE=Z*  &@17:06݌d帋c$?w!)g9)h8+sg<{gb^t.Ci͏`"no/D/Еq\U$ى"UD:nD)>S6}X% MBcĀ-ZAYbFLSdX?+7KF /qU*cdl;EkDo}:]]#  #A!Nħ endstream endobj 115 0 obj << /Length 295 /Filter /FlateDecode >> stream H;N@X)"Mr,ҰR HPqBIEr 9F)(qDca_R֧gw>!pSdoi fqhsxrccHQNw08ˋS(v:I>cHJrxt*nWpKGI3C<+mfԑy4~f@CK j'cɨ4P6 ߾FGO (" Y%vA+>n\fKsa.9[D6|pi`#`dH endstream endobj 116 0 obj << /Length 122 /Filter /FlateDecode >> stream H22V0P0S54P04STH1*r@PR$ɥ`h`hɥ`ȥPRT @h`?Փ+ m) endstream endobj 117 0 obj << /Length 99 /Filter /FlateDecode >> stream H2P0P0R51U06QеTH1*26(,s<=͸ =}JJS<]O)f@`z endstream endobj 118 0 obj << /Length 217 /Filter /FlateDecode >> stream HDϱj0`[(v" xS혡r4j{v8 _6|^1r}_'3hRʦz՛G^R'BrD^H6 zY @w/EN:cl*E諹+\ю8$呫nRxu3\ɆaznY(ÔX2窟`Aۖ^OH endstream endobj 119 0 obj << /Length 192 /Filter /FlateDecode >> stream H27U0PP5T0"CB.3C)PL!9ɓK?\̐KC̔K)YU()*Mt?? P*ƣ~??P;PЖy mi`tTJCpzrrP endstream endobj 120 0 obj << /Length 320 /Filter /FlateDecode >> stream HOJ@)]fJZIB*+.]( Re`4M0ߛZADʄM雡eMn.Z}#w/+ί:=2Yɾ<67w<7"|F R*BEJR_XN lE4ڄ MR;HP0b7b _XT_| Q sRe܅ϖO,`0h endstream endobj 121 0 obj << /Type /Font /Subtype /Type1 /FirstChar 34 /LastChar 121 /Widths [ 525 525 0 0 525 0 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 0 525 525 525 525 525 525 525 0 525 0 0 0 0 525 0 525 525 525 525 525 525 525 525 525 0 525 525 525 525 525 525 0 525 525 525 525 525 525 525 525 ] /Encoding /WinAnsiEncoding /BaseFont /AFJDAA+CMTT10 /FontDescriptor 152 0 R >> endobj 122 0 obj << /Type /Font /Subtype /Type1 /FirstChar 99 /LastChar 112 /Widths [ 526 0 0 0 0 0 0 0 0 0 986 0 0 657 ] /Encoding /WinAnsiEncoding /BaseFont /AFJDDA+CMBX9 /FontDescriptor 132 0 R >> endobj 123 0 obj << /Type /Font /Subtype /Type1 /FirstChar 1 /LastChar 1 /Widths [ 514 ] /Encoding 155 0 R /BaseFont /AFJDGA+CMSY9 /FontDescriptor 130 0 R /ToUnicode 156 0 R >> endobj 124 0 obj << /Type /Font /Subtype /Type1 /FirstChar 1 /LastChar 1 /Widths [ 500 ] /Encoding 157 0 R /BaseFont /AFJDHA+CMSY10 /FontDescriptor 128 0 R /ToUnicode 158 0 R >> endobj 125 0 obj << /Type /Font /Subtype /Type1 /FirstChar 40 /LastChar 150 /Widths [ 409 409 0 767 0 358 307 511 511 511 511 511 511 0 0 0 511 511 307 0 0 0 0 0 0 743 0 716 0 678 0 0 0 386 0 0 627 0 0 767 678 0 0 562 716 0 0 0 0 0 0 0 0 0 0 0 0 511 460 460 511 460 0 460 511 307 0 0 256 818 562 511 0 0 422 409 332 537 0 0 0 486 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 511 ] /Encoding /WinAnsiEncoding /BaseFont /AFJEHL+CMTI10 /FontDescriptor 126 0 R >> endobj 126 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 681 /Descent -206 /Flags 98 /FontBBox [ -163 -250 1146 969 ] /FontName /AFJEHL+CMTI10 /ItalicAngle -14.03999 /StemV 68 /StemH 31 /CharSet (/I/S/O/slash/E/C/nine/eight/colon/one/zero/parenleft/parenright/P/r/o/hy\ phen/g/a/m/i/n/L/u/e/s/endash/b/d/period/T/c/h/l/A/t/y/two/four/plus/thr\ ee) /FontFile3 127 0 R >> endobj 127 0 obj << /Filter /FlateDecode /Length 4635 /Subtype /Type1C >> stream HlTiPTW}#b@qskQ\bRATb) 6"jQQA[znzDZA  q%jܒhjTiRIe&cniy}99Ǣ0cWa~juӌ1Q1P̈&NfL(`C ab\$y%̼yCpxoA~EB"{o &X ?Da 6 fc< {ű8&K29đ zpċQܨ*bh3w }+=_,Lx₉11''mt)6gקEus)Se};Iב[8\0'0E] he-]o*9JXJ(m|9tzs&/eZm9Ġzyj-F`+ɎH4ci5 j! La\[!cC D aNxA P jxCZnS.KUF:5pW[ @'k]Wб8YWƁYx,f ZI Hiͫ21ju:R>:vxC.9:*>T擴δѱ ILUNZk8zKjd@o$Na48 '܀78OK!"u.ˢw,d@ $o} ߺIww.~BO4D(7a=a`;}x4tVU=8%bvI֪՚LG4%Τ0IHX.:hX PVPjDn`ez.Xzz/z6G 'hY/i3;Yk]{z6o~ Ow|p$HOQnFMt0O!taMnɒ3$Wֵ|7e譥IҼyق$ET@l;Fn435-. /5nh&TݗN9Rq`R&#YϏ! w ^? Q:1j\^Jb R99mLlT4Vl7f|؟5 a`_UsgK)hK:;/v !8bkhid% %UZg_*U(9ma~((p‹`6amf r5k$zڠGL5-ݲ_*)d lK)Kۍb"J4uq  %RRo9l v8A^wBTGs!=h oD[eGvfgR)otՑ^C?}?L/L%O8MCo)(%6hȿ b-=&INQ)WI/D )7Py"qAQaQEcUk{t(_/kC@$ hH(PLi`Un%tFEV5h8Mϟ8/<7Zέ:,){천8khlWibdD=MBQ)a,)X`-IxFZ;i*ZP$HueLZ\79Kavu*( ! h+2jLn#7$+\^@wI&@~cX-C :|#=!gg)%\4zeRѻ|R'A"Ň;;:}Ŧ^liN)ݳ KU87}fWga۸mKV3Y&"d| M }7G P)\kM%=Co9r v[xgsϼ< n*S1i$}pq-̓ӔϬD@Mx=tjJ U"B^ /TJsr4wfl0i%HSMZ&,/**ޠ%u̘9/j$[ՔK}]q5jJCbvB({e"fQ/,"_3B.wb HB]5԰ujD6UgX➕m底=p0=(>IÒ'FT ,䨘eRtb ~3>] aP.&EZ1()o|(C] =xvkLGBf- Iz[i]si g:0^$;7h;[`zJFA2@ڡonBb'EA|K *!w$gqy'gejm_zI?)xar9{>b+"R@ƺ۸wWA5>TEmkJScb|LѨGVSVRTk"C ͼ^ϳE<[?Sj^CRrw߹Yk6,!oͶ+/j,FoocV3Hr{30WJEIa41wwU6EW&;It/ ~?ƞYL!-;gBԴY-y͝rNwUvw6IWK5m_sb%'/0sެU z5Zͪ^ ƂBBp)y]r\ml#QYn\Ce~BwRߖѵ'L_5aR U֧o<٧wKc؋]¯Z(Ug̐>y!q?},:kj4p[Mcw0J_{ٴŽl-pd`ù<)<> endobj 129 0 obj << /Length 354 /Subtype /Type1C >> stream AFJDHA+CMSY10'J_  nT58; RXasteriskmathCopyright (C) 1997 American Mathematical Society. All Rights ReservedCMSY10qyqpq~}%"}~.4r{~~~3~~}{{!H!G{{}8|u?Cy endstream endobj 130 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 68 /FontBBox [ -30 -958 1146 777 ] /FontName /AFJDGA+CMSY9 /ItalicAngle -14.035 /StemV 87 /StemH 43 /CharSet (/asteriskmath) /FontFile3 131 0 R >> endobj 131 0 obj << /Length 357 /Subtype /Type1C >> stream  AFJDGA+CMSY9(J_  mRz47: RWasteriskmathCopyright (C) 1997 American Mathematical Society. All Rights ReservedCMSY9Pz:}}0;{x|y)~}}}|z!JI{z|}}:~~߈U~:Ou?Cy endstream endobj 132 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 262176 /FontBBox [ -58 -250 1195 750 ] /FontName /AFJDDA+CMBX9 /ItalicAngle 0 /StemV 117 /StemH 49 /CharSet (/m/c/p) /FontFile3 133 0 R >> endobj 133 0 obj << /Filter /FlateDecode /Length 532 /Subtype /Type1C >> stream Hbd`ab`ddutrqqvu f!CG,w MenE9(3=DAYS\17(391O7$#57QOL-SpQ(VJ-N-*KM. ~ `031r3g*`umK~w.;fJUv.]|Ύ.ZUkW]o!n~3zjÞKY7}['|;w,bQ\.ˌ#|r*䞖K2i۱5GݣN,ejwu=ٿ3?q|r{sIg%| @M.}oUQ>lquϓn0$ ^ֶ ɬ;fn(Ӂf |^!_`ȻDzF$R W?ߓ|;vJ<{ýy w<=<|X endstream endobj 134 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 262176 /FontBBox [ -71 -250 1099 780 ] /FontName /AFJBBC+CMSSBX10 /ItalicAngle 0 /StemV 136 /StemH 94 /CharSet (/m/c/p) /FontFile3 135 0 R >> endobj 135 0 obj << /Filter /FlateDecode /Length 519 /Subtype /Type1C >> stream Hbd`ab`ddptrrrv v04f!CGw߯?~W) !&FF7?ʢ gMCKKsԢ<Ē 'G!8?93RO1'G!X!(8,5n'01PX1o*/5~&2?bNk9Csjc{gwc\MULrw&xfYuzS{NzxԔr sJswe{֞_>gUk9xw[MO[T]B<^W%JW$vg甔gpte[2;I.-!M { r6NN{!V&{9R| e ~-nv' M;uϔ=d=Š37N͔K:q?zXN[hǞ\ݿE~TNR/_<{\)҅?6wtvΕ y8_r}.3 F endstream endobj 136 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 262176 /FontBBox [ -59 -250 1235 750 ] /FontName /AFJBII+CMBX8 /ItalicAngle 0 /StemV 122 /StemH 52 /CharSet (/m/c/p) /FontFile3 137 0 R >> endobj 137 0 obj << /Filter /FlateDecode /Length 534 /Subtype /Type1C >> stream Hbd`ab`ddutrvu f!CG,w MenE9(3=DAYS\17(391O7$#57QOL-SpQ(VJ-N-*KM. ~ `031r3gIDˮ,|]s+:+[<=kvWv;wI;ۻ:;:kjW߸rwU~[w{'/"w`ͬ3ӽϭ@SA/E8-W )Y1]7oui|Gͬ&u>wp]FMk;UE<;0 VY]z]Y[ ~+z~wgKݿuw/A$hiPpMv.^ ͛1]~NGwCԟV4<]0gKҷxf-pO<_̟N3O=~.r +pǽu*we<=<|( endstream endobj 138 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 680 /Descent -206 /Flags 34 /FontBBox [ -36 -250 1070 750 ] /FontName /AFJBIH+CMR8 /ItalicAngle 0 /StemV 76 /XHeight 434 /StemH 33 /CharSet (/D/E/C/U/S/c/p/colon/M/a/r/t/i/n/o/w/L/u/x/slash/G/two/period/zero/V/F/e\ /B/seven/comma/W/I/N/three/l/d/four/five/plus/nine/y/g/one/T/h/m/s/P/b/h\ yphen/f/eight/J/v/R/H/K/parenleft/parenright/six/O/X/A) /FontFile3 139 0 R >> endobj 139 0 obj << /Filter /FlateDecode /Length 6237 /Subtype /Type1C >> stream HdUiTgE@ªv1.EEA!did֬H4E@FQ'CѼ)3srΜ|?}C$·ee\$q bVJ6I =@MMyMyL7.a><*2WY ,^v* Zv0##NIs;x2bGlLavC *r2`Ȍ~C')RRӐR-gAx%<$$R\(h)wmK*`zwh:ETYY"Pd<;q(>dTW Qde%'<]+`3 حb2( )dީ`e`䱐c"JvjhC$q迠>zɆ0M42,TZmTki3_͸jI&'ĥ ƿnQJO*,R(팡hyxE8xy^+BY{jOw_;OwMTχaRP*MG=Mς^EŃ*frVmNA6rfqC| mtz|>cFV+3ok:PT}UoE~ 5(TFlH;SWi:ZWg%/r8> )w''Py$ ޓ]r=$z#O9mX&3bD&vnh^@Ыip9.'~ցr V؜Jٽg)TdOAq/VIJN'b$Wu}RL#_^Lq Wig˰MW}2h)0:h!Af`.׾Ćn_I}Y~xdMќg0]-Cty"TIe5yxi0w)<4 qr]MMy5}cc*A g<x&QǜLwW_y(SCaxPFf8{ +=OQ"JNY\p(W]p \bf#<::P`xqa!h? ta ~!ot=&|yOWJBҨ,#bmΙRp[idݔ/׭nk _o $V`QTua̅,.FĄ$n0,! Rlh |{4IHVք:AZœ/HUESYa~O9=F:|eYN 3da"/Q$ǧ8AXRԡu\/2).:WƱ*ef0@[ (:87}eH1bE'YܪW`G 9#pE :>3vdFt?3я}[&Sr [ #ۇ،@ʡܠ4)$2s`m{B9i`DSm\mMvu̥+]޶iZπ DD@& ܙ3`1k`PKĨPcIui5;=e ?s}bM<[$Ͷ%l%6dj49\2w D?MK!`4L1\5<"~7 -$ρ@@7=WiFTk=t}qސtXO  2 $x2{Εxt8MFqU?wg?A]Xq,ll!kQy¬8/n6 E5k/(ۙbt;o/tPb -lgeDE-|l+.+dR.1tB$2:4-,糵ڃ7Y Ts 'K>vܺ['VP9.;ďS,V 7)3N|/(ʄjScBœ&g^ɋpJ׋z]#j/󖚎((앟Pvo<ʦN \Uh%c]y tw g1)s0Zku/lg9:| P?mc[[0oGm5Y$Sbʮeh+)/.`!]j'Уwf"`j>1isR*!3m?G$pӗ Ij,ɒ'}vv5^B+5p[C/VDǦd cI j1iƇQJ(b9G?BHl>|m3XJKDoTL2مPCit/ DYWQE![y(I p/V?W,%}<9`*}^ݮT[-ȷaJ6XM|դi_1#?fsj^d!GDduvpX2og\?԰," [|ڎ$%iF"26B0,y,T0?aL^DH1:2?GiRU1 o`,>ݣIT.$˥HLF;sp ]'6{d 5o/ %ÒŌGݴF8JG/5/LwpEzVj5y1{QS౏Ͻ)NJ"YNiKb ~t"IuHs]@ ?'ҕ{,TrmntzhCUjAl~x>5iVs7`q7(wm>x,\gtJf&gWh ŜH_j>^p齍=G:-Чmnc$|9Y*I%,5,Tc&_GnbbpNAe=p;jO8oU0S3Ibjqa=WPڄk̪C]36UdqV#%PBK%L1W>Ad90d AR8 6{ք(VBNCi[]Xu{T!Oɓ-4 ^/of,ƺuAgiZIPu%"nֿ#xGNvxuA4|SrRVed}K*pNn9B]Juz_Y^ȉ}Iw-ݮc.`EҌB}N%2VyX! {TgUJ}٠ 3`j-mC > eIlAÑqtARA_T(/nsQ hm&mcC9ɴÉ"p?X[/L,+9dHKX-3ҷkfxױ1cc'^Qژʏ6ÞF`٭$|Ow'8>͙9>V>\cj;P?~ v, B2}bXP dQ;̶)T8y._9ܘf7 $r_kloK)en,̱]u]<`*/&;F":>y`jusu;7,*pJ BxkxIx y ) B^ ȋ)ξRmukzjt$z6Oםy{/Z&ZPiGH'Mԙ~A/c(ʍ'/rR鴜Tau8k`eM/68'˽sq'(j*dt bAl=(FaHGEHu [7<%<<^r7(3ڛB0ĎA8ל]Lnjtq4i_9q. e7s_-kr&&gL@qM S0! .Wr@znq m,2:&z0ԅ;06BM %B5cٓwnM ѲyW<'Myq7N.2*N\wYxvvXog9+~KinmӶѥ#3uk,LW4 $R)4v R6fR?K䚪Ҧ22WMefs]K`|<|wfߐƢe +gtQIImST/Ph'aO&1ԬUX^ ؞jxÑ?& hpw.i26}' |s9}F1;TI^9`B"6L#ּ’\{m[h|7[?=y{Yv>oK 4)Q~݇4-M(?w/],d7ІQP􅋺[=qZTڮ2Lkpz"|'vad"aZEawqwa4&D`JߐMϐsv[F{'3cL"E<:8MN G.tF|unL]r3ob}-x7q*}7Utzͦn;ߖ7Pb%?JG%on_Sw= ųl^@M 76(]M.Bÿ*l1' D!K[**4JehtMpĤ܂%ThEjJlR|m$.l/RMJLR\矾cW`l/ >t~oFP4L)~i,:pSN>O="g`)W%-%a6 q& @A1]`3|Ɖ4 t߯-n0y 01WdR=▷UT rKҠhl*r0x%#aaВinj[]TX/uF#^dP1(HY.7!U$xqEMZ+ŲAU Z $=`GB-թI00JE Bpn_rFI^#WP" (Zm(Ed%z_bU*ayA^ANA?hf<R9 ;3BIcGW /a[lּr M2ڍM749O/7h%G6.36v1P(i_lV%":IP0@&NeU*=%?b`V^Jk:U줭R_QU.䧏]ۮWa3!!Cv XCBV4 ݡ+Dr| endstream endobj 140 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 32 /FontBBox [ -20 -250 1193 750 ] /FontName /AFJBIG+CMR6 /ItalicAngle 0 /StemV 83 /StemH 39 /CharSet (/asterisk/one/two/three/four/five/six/seven/eight/nine/zero) /FontFile3 141 0 R >> endobj 141 0 obj << /Filter /FlateDecode /Length 1511 /Subtype /Type1C >> stream HyPSgP){.P(A@Qb`*B1$_ l0Ęk2ZZm蔢-ȸt|?ϝsܙC< VǭI_.9jRMpA|gUaF !='ܜy˖-VdfvK wd)d~'MQff-˓&OnYu<7 ixb^#7 g4 <^Ðl؆g&afPabmlk͚ChMN542xV„*]>4fY g W2KFQ I8|PTUk5410k 3:h{%v?㻉 4!9 ؀#&a;>,6bשН7unna-M1+D?y[[F>v~BH$&A9\츉?U❨t6.^w鯰tla8 }7IdȠ)O().G'N~}D. X8)LFF-J=k8~z1:p6g{(fM"˱BX^n4Q\(X}%1hA 0F%5W>vʫjݙ/x=x2rOq1w?P en8ךofzAҍy XcQ.7KPj#8ިrŭP` 0Ÿv [.2Vw]+6ַ[5z{\co!FWT+ӡ-\N5W+H_hrR5k魛ꚷr}֠b_GZk]H->!]ʔlV޶t:.U{TkmyC["Su> endobj 143 0 obj << /Filter /FlateDecode /Length 2462 /Subtype /Type1C >> stream H|{PSW5&vr{*kZX*X,+]eyD"A3<@<@0uDTk>V]::Ea{t̜ٙ!S$" $u1kT;oŕM3L/ML!Դ܌eҀe^]H Qd*A#561.3wJ+,N@$<b`b!A,%b=AL! b-AˉbL$M-Z+J=)ff !|Mm^}V=}^r髗9S@ |P;)vugJIȹ-sh"tp TpT|I*C]/'Ewa8OyI?\{` *1jKByne([j`̿8<..&?[Z:=-*+]#qE7D6!1S#f'I A5.r~pb7Y^uKݲc|Ś@pϱoco]v{݅ 6~EauWNdZ/6;Q'QeqJ4݌FTJL: :xBw5{Qd*(f&*h]+Y@5L dY?/]zR%tgvѺfEE.ŝgwz9MTtl檊r`K5;gY«T($U)L[j\ma;{ƴXVf>f̵1䄽\c><&|Cמo;7;ri>]pӤ7洷75v4~jlAd ކ9aTf}Ci*D!]lSEM<]HlKw.<&ri]/hK-p67T>'n8z\}[u@$+ev~ a2B%-6|HLSmQ'3e,jjۦ'VqM47!}Y K 26O'[x^xlk3ޅi@JM. ua8]<<^gf}=cEU6Nix򮅿d=2!;Pu)CdEJNEUsRX:AKc`=lҎ(1b^B}vwEL *,,5 KYm}ܚ|%Yi(Jϝݨ4D7;>Ts][6j-SJr8G*՘u5l}cY9{|B^|}6_] gW,n`5f}Ӏj~aȲMǓa)SP"cTԒ.+1ˋXc2G*:TmuAQ47W|,ܿY[l@?9!ί,2*ZupAD0*ꚥ4kz/w󟧎00RC_fHgswB1Bdu\oHUÛLbqI[#b *qrgu:Y*ZҹƿvɆ[خ~~ˎkIPLi>\ !nB;~sx| HA|qF_]\d(-7q=mݙ>€la塵5sR >| JȎsg4*eք\6J0 χok@LN(R5m]2kaK=}l5~pY9Z6knn-CDW tuhԳ٪[8\-*Z.~)[)޻cAv[;ȯbjI3;ԟ[!&%p5߳{'0#;i2${+-/I)_+* -{FW߽ؿ^،(FuXͺ˕K@90 ?DhoLl_;hck֜zU-Hk< rYmrnǟ߯7e5.IB<~0+?^6{4I8W20\u{Dyx:Eҫf(m endstream endobj 144 0 obj << /Type /FontDescriptor /Ascent 615 /CapHeight 615 /Descent -230 /Flags 32 /FontBBox [ -4 -235 731 800 ] /FontName /AFJBEF+CMTT10 /ItalicAngle 0 /StemV 69 /XHeight 434 /StemH 61 /CharSet (/less/b/a/c/k/s/l/h/greater/n/e/w/i/underscore/P/r/g/m/parenleft/parenri\ ght/V/A/R/I/N/T/B/O/L/d/o/period/M/C/zero/numbersign/f/comma/u/S/H/E/D/p\ lus/W/t/four/p/at/G/two/three/U/F/K/Z/colon/slash/j/z/x/question/v/ascii\ tilde/hyphen) /FontFile3 145 0 R >> endobj 145 0 obj << /Filter /FlateDecode /Length 5332 /Subtype /Type1C >> stream HlT PfAmMlm;a8KV .p /y1]ϕH ^]~ZJWd[pٲVU q;R"vd();2Arze\<#UQ(Z-:$cb s1:a2 ػc'≭'MtcN6qcr VtS#,Lz9vt rMs}۸{{4#"J$ =ZUÌ҅RNwNRԷ޾}>W|W~w$`p+-[Y Nφ0 '8ZɒKRM#f]IBaًd6CDOyr%tvsOEW>$7a /"%&VE|FX?Aon?ӏxz)6"?0!]YiaOt.p-w'˛>QTB݁R>D- B,-`t:* /2fX1+1v a&YY JSX b^8X/ZA"bLZgth+p$RVUWH} eBȗ-1%k穣)IrUrC}==C ~Wo}IU7jf]SHk`?Ji˹B:۸ZmEp9b9}%"rFk6&v< W+D"M&\Jt\*-}."<6rĭ<0VVVW,*CKZ0`Axl9 ]bv^9tQG /DT_AdYhڤ lKtrM.F&϶=!}m&)Q;NM\:}%[ap:Zͫ% 8젳oKyXSEjHM "a:x<}y $bn2'KqTR4Ԫ\ $웿naP=Vw_,a_;ȀY5H./*fJ\%q2D!KK 7xj. K-cձK|l|vO>mʙM/%dž߰C]4Zmѐ? A,%Ka>c0to+ZC ZjR$jVPSl?XSQ %rhn#M;]o072KX} Y+C70w+|XH%:9| h?xh,dqWTn|(N5CʍW 7*N@?beGHj,]|fvR[Tyg+(>Dꋢ#2s1ꫦzBq(Jês'E3`f%VgR:wJ]?vK' ta/}͚â2ps.' Ql]P_D$_AwJxsZ1z2"!V0dV+6D;mٛfB7e4pgV<3w+LDl15KS;RNdS]4+VH9J,,q9~LMYO õ׮?[<.ABX/1S<{ΘNgӀt}j>D~e)~Cf4q7vK /\N-K 5'F$0MČmn}}Q򇋶c6N&=\d?a ݰ۫ >*X.ys7~ΖKr}uIf֤/֊btYJ}m-[٢dyVzre;KHOΌ iZ.}Z|ߘر)H Mԩ(Wͦd#CnsC x^tӇ liu!@ nϚ('=HmjYlRV:K)VP7v18a#Yn(GnzAJ+@=TbzumREq9^}kb0016?F C W&fQI(l DqVr 2E\|ҮO)>c0b59 I E'ƁPW)<sGN}]jݦ⦚^[nS 5|>e>CWhQ0T WgxyKrP"HG} *}TJC/UB7_?%9Qۢx4a8̔z(7du5kQB55fC9-Z`j ZZP;EJJB4m EIl\+Jk4G"U(C?ХO(̤(dވA7EaB}2QfnZ 2&BV F'^pw܂ i'uv1ZQvHd8-m9B`7} ` endstream endobj 146 0 obj << /Type /FontDescriptor /Ascent 698 /CapHeight 0 /Descent -207 /Flags 32 /FontBBox [ -61 -250 999 759 ] /FontName /AFJBDF+CMSS10 /ItalicAngle 0 /StemV 78 /StemH 61 /CharSet (/three/period/one/two/five/six/g/l/i/b/c/S/G/C/quoteleft/d/e/fi/n/quoter\ ight/four/seven/eight/V) /FontFile3 147 0 R >> endobj 147 0 obj << /Filter /FlateDecode /Length 1937 /Subtype /Type1C >> stream HLUkPYIQt]aFE! D^ @x(D"8q  ΢"(`PDEuJ9*L^Fѱj~ܺu99ysq q\?G: 9Ts;څV ROtޅއ#X#8^"ٔ&ZΥ dí n6kj`4 i`>g/x2B0 Ώ[Qե+DZjT6t}0EI!RnL gbFe0)9UQ)$rDnh-.|J5 aQߏAv 2&|xa]2Um1C$S-_(Daջ~eD~'%k/^ny8$1h?g:zf}>`S%.]#>4I+ih䍢JCeh8e;i4ۼFeZ' tVsx"ަv70Nkɮf^I-,ල?[S(l9%5^$hTkM34A a()Я^h]d80YH['~=7B~O*xds7T|8_uCP'S=Ḫn\{>B l^bȎ+=rpݙt84 Mw'] .jCS\R<4 Y@8X]?X%D̍%_k-Xw:=!L^\QL;Jg" },kDR`][6d~Rd!>`w6PFu;՟xStK!/_G#egW`y)E-16M1ukW)0hov=G[jVi(.o=ܜr(^#sN>Nd(ԉfeTnEd FWv>}N- Ǫ=2&G{:ƖC RPQ cJt2iBaT{jޣsϓKe4` p3yRF9P^gPp@zX4R=9/eu@AO6+ѫݾD袞%Df;;Ӏ\ cL?'$;Ih 7xVWKTewp|z?7}LAUx%DUHQie[0Iɺ=r)l4#9YCctp endstream endobj 148 0 obj << /Type /FontDescriptor /Ascent 0 /CapHeight 0 /Descent 0 /Flags 96 /FontBBox [ 0 -250 1171 750 ] /FontName /AFJBCE+CMMI7 /ItalicAngle -14.03999 /StemV 81 /StemH 32 /CharSet (/s/t) /FontFile3 149 0 R >> endobj 149 0 obj << /Length 474 /Subtype /Type1C >> stream  AFJBCE+CMMI7%J  $(MFKCopyright (C) 1997 American Mathematical Society. All Rights ReservedCMMI7TMUV0#ۯ.?C q{vwtCN0olfswYzearudZcRtyvnnt_OfL&frfyi B~z,(}wr|zqr_B%x~u}x> endobj 151 0 obj << /Filter /FlateDecode /Length 663 /Subtype /Type1C >> stream HdO_LqC@ FKg]݃mZzhnmp.]̥gIPIE 1C:@ǿ Eaҵ\mi/M|s#\m=}||? ) zckuSyft4H(,+veYNN _,0zDFm fgx*Atz6"at8C(i٬+w UUJAհ -r-(",qRcY$$h/+/SH"EfXsSV Moh1@y}KzGhw(P ;`|¦ @fd`Ie}H(X:`>I>8}g5IԜ|InZФF= o [vU@ ;??їb[Ø k[K;Vگ㞲`@~ՊtPYm=An!ۆr=&Q{J&rYg Pؤ h> endobj 153 0 obj << /Filter /FlateDecode /Length 6268 /Subtype /Type1C >> stream H|{PSwo<ˋphZw: +VjT^ "L.G$ ShyqbӢ]kq\)q33a6l QP؞=}f#+ lمms g+fm TȒ9^˃>Z/K=v(Gv(ۤzEd&(>{#+<>;^0!͛Jcf a,Bjlp7ifeOOl}ll2w`jE΢&V3-'_rsr8W<tcjU.S+]5?Uw2p&};bU_ZO7O SZRya;V-BbuF>7ᚤ"I~јU5yݒNmp8xO)6~>k~̘R`\ o`P}\)IL/J(X?b)#&@KgTjHES_MOS5 b#wxJ~ .>jpuGc8ч;޾l^+eLZjc3$f-2_|L$-y,zA])*+۽CgH?=9o㒛=^bY,S_T Ij*MfN rDs:qz{i"q_%G=%DԐ-ڛ*DL4L_'ӺRe Yg:(:#o]g:*lSʢ _TOuG8[o]Yt'` eD!h+l7 !BRTOl :\K/ݝ-CCF< +,Tqx`V3-XEů<hMo?Ww<aA6i{T>1 odVqBUHv2<t t9$e3(TO|_}) K#16tݤj.QCo$f{^} -g>Lk9ˇ/Ǯo!!rBNKc5T_mA443NɒբJ%NA+5z>hVWg$;򍲜\ew,dzn81Q>  >gU`s(O2lF^DDvg_^+h^$1幇gww%tO./MQPjSεK<~˧~;ɞ{̴wQ9=V8-zxG]pz@a*ݩ Gk=rIоYy;vm&W\ُL X}6s[pĺ_AFk Ms..9l\45j d˜%IKiyĩ| ķ7ԕqX7quu+{Wuu}CZXA` A0yRުumXZxǞKՙ 999NKߟ9u#[D~u׵ܪZ)d6j 1Ks~ : 1Urw/ɉIΗt^Z:i{6+7*뒏sC;jE-SUV]nSZC٠m2s9yI\ڬ.MZJdrs]5%"m~q=}D4Ks7d{9 :[rd'a0 _ks@kl>.%  ]\o> m4@B{<(ǃZ+c٨$߆wV%6CL 0oc6I^{-,H >qy5?e 1CHkߠ'dHxyv@} XA2k2^OHEB&m@OCmABtwA `/: ܂tdiۦfR8xQ`sz7g+)YokI %@Qϓ*M;, `$ϙKI4rZC}8?AR+SC(3F ٸYn&d73]}:Ym5(ӋeU.9]|Vהה%`J YF'Х+4rK̾-GAY#yPEe1 |ETruXKxh .Z$SfC&P-8Éџ8D]gїUG{ٛyk '-B&N?_'n6R^l\Z[pm/^|iv%:z*7CW%;w+P{%JDfm.s"n븵;::>2-8-5{+v2 /oȭ۷^ST=֚zLqow©K>li\kb5aϘǪj Ri15e~l`4Dtqfn '1еfbGG; ?x$nՏ4'O0nhC {$y˿ŁZجk"ta: bWV QIm<1D={CDs$'TgFPЫEqf%9x9V-rxDj=_T 2 pqh*3 u Sɻ#{%_RvrJti$(kBeD P' 9x{0P3&V C u:g~3[?XJ~yJ:Aկ8@b^!nSxHDVa!f-[g/vP(%&v0K&ჩv || Zlz.ңf-1|(uZ4jen8IvcZd $Pn7}s Zj'?:k,bvoit5::OXOǸh1b26j = L xvAD! O4YP7@$#3&OKgm4qD;s:ƠT ii $w䄜|W#pPZM?͑ς ]P+Lz,~Vs+t~?n>x4?-[AN?dYuZY_W\}~wҸ"E`SүӢNˎ%(:%ij>EV*,s>,VyᷪģT$‚ I :"hCʺOKh6]CZH|X^t[$R@Ԕc4X~ Z:_ʹCh"/&KLUZrc.4O^YReWiUZ̜fcc `SL34OZhzF~y3m}&7igwDU3|_ uP\`> endobj 155 0 obj << /Type /Encoding /Differences [ 1 /asteriskmath ] >> endobj 156 0 obj << /Filter /FlateDecode /Length 215 >> stream HTPN0 Đ& KR8D\Hԉtߓ!?~zϖ'@q&=9%l8yyMö${y$𬛇İ3RB^L|53?E]{[K4Є6?U\GeX6VȻ;[T{2p{Sbū`h endstream endobj 157 0 obj << /Type /Encoding /Differences [ 1 /asteriskmath ] >> endobj 158 0 obj << /Filter /FlateDecode /Length 215 >> stream HTPN0 Đ& KR8D\Hԉtߓ!?~zϖ'@q&=9%l8yyMö${y$CsyfiE}|fbXc)A]G!O/&AVy"ڭ%lhBh*2,nZNݝ-r=]szqP=)1UJ0h endstream endobj 159 0 obj << /S /D >> endobj 160 0 obj << /Nums [ 0 159 0 R ] >> endobj 161 0 obj << /Type /Pages /Kids [ 168 0 R 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 31 0 R 36 0 R 41 0 R 46 0 R ] /Count 10 /Parent 162 0 R >> endobj 162 0 obj << /Type /Pages /Kids [ 161 0 R 163 0 R ] /Count 16 >> endobj 163 0 obj << /Type /Pages /Kids [ 51 0 R 58 0 R 61 0 R 64 0 R 67 0 R 70 0 R ] /Count 6 /Parent 162 0 R >> endobj 164 0 obj << /CreationDate (D:20081129171938+09'00') /ModDate (D:20081129171938+09'00') /Producer (Acrobat Distiller 5.0.5 \(Windows\)) /Creator (dvips\(k\) p1.7a Copyright 2005 ASCII Corp.\(www-ptex@ascii.co.jp\) bas\ ed on dvips\(k\) 5.95b Copyright 2005 Radical Eye Software \(www.radical\ eye.com\)) /Title (mcpp-summary.dvi) >> endobj 165 0 obj << /Type /Metadata /Subtype /XML /Length 1121 >> stream dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp) based on dvips(k) 5.95b Copyright 2005 Radical Eye Software (www.radicaleye.com) mcpp-summary.dvi endstream endobj xref 0 166 0000000000 65535 f 0000026813 00000 n 0000026965 00000 n 0000027141 00000 n 0000031596 00000 n 0000031748 00000 n 0000031959 00000 n 0000036367 00000 n 0000036519 00000 n 0000036766 00000 n 0000041615 00000 n 0000041770 00000 n 0000041996 00000 n 0000048598 00000 n 0000048753 00000 n 0000049023 00000 n 0000052815 00000 n 0000052873 00000 n 0000052924 00000 n 0000053142 00000 n 0000053291 00000 n 0000053571 00000 n 0000053629 00000 n 0000053680 00000 n 0000053901 00000 n 0000054051 00000 n 0000054331 00000 n 0000054555 00000 n 0000054704 00000 n 0000054984 00000 n 0000055832 00000 n 0000055956 00000 n 0000056111 00000 n 0000056356 00000 n 0000060300 00000 n 0000061227 00000 n 0000061403 00000 n 0000061558 00000 n 0000061793 00000 n 0000065731 00000 n 0000066646 00000 n 0000066818 00000 n 0000066973 00000 n 0000067221 00000 n 0000071097 00000 n 0000072017 00000 n 0000072184 00000 n 0000072339 00000 n 0000072574 00000 n 0000076634 00000 n 0000077554 00000 n 0000077721 00000 n 0000077876 00000 n 0000078098 00000 n 0000080042 00000 n 0000080962 00000 n 0000081129 00000 n 0000082049 00000 n 0000082216 00000 n 0000082371 00000 n 0000082548 00000 n 0000086501 00000 n 0000086656 00000 n 0000086821 00000 n 0000090557 00000 n 0000090712 00000 n 0000090877 00000 n 0000094931 00000 n 0000095086 00000 n 0000095265 00000 n 0000098887 00000 n 0000099042 00000 n 0000099171 00000 n 0000100449 00000 n 0000100661 00000 n 0000100856 00000 n 0000101040 00000 n 0000101493 00000 n 0000101987 00000 n 0000102596 00000 n 0000102799 00000 n 0000103026 00000 n 0000103495 00000 n 0000103705 00000 n 0000103812 00000 n 0000103916 00000 n 0000104171 00000 n 0000104495 00000 n 0000104546 00000 n 0000104625 00000 n 0000104683 00000 n 0000104986 00000 n 0000105324 00000 n 0000105615 00000 n 0000105666 00000 n 0000105946 00000 n 0000106399 00000 n 0000106820 00000 n 0000107115 00000 n 0000107395 00000 n 0000107652 00000 n 0000107794 00000 n 0000108204 00000 n 0000108627 00000 n 0000109019 00000 n 0000109223 00000 n 0000109473 00000 n 0000109776 00000 n 0000110117 00000 n 0000110381 00000 n 0000110695 00000 n 0000111158 00000 n 0000111406 00000 n 0000111711 00000 n 0000112129 00000 n 0000112503 00000 n 0000112874 00000 n 0000113072 00000 n 0000113246 00000 n 0000113539 00000 n 0000113807 00000 n 0000114203 00000 n 0000114709 00000 n 0000114919 00000 n 0000115107 00000 n 0000115296 00000 n 0000115781 00000 n 0000116172 00000 n 0000120900 00000 n 0000121144 00000 n 0000121569 00000 n 0000121812 00000 n 0000122240 00000 n 0000122475 00000 n 0000123099 00000 n 0000123337 00000 n 0000123948 00000 n 0000124183 00000 n 0000124809 00000 n 0000125255 00000 n 0000131585 00000 n 0000131867 00000 n 0000133471 00000 n 0000133775 00000 n 0000136330 00000 n 0000136808 00000 n 0000142233 00000 n 0000142559 00000 n 0000144589 00000 n 0000144823 00000 n 0000145368 00000 n 0000145605 00000 n 0000146360 00000 n 0000146895 00000 n 0000153256 00000 n 0000153456 00000 n 0000153532 00000 n 0000153822 00000 n 0000153898 00000 n 0000154188 00000 n 0000154220 00000 n 0000154266 00000 n 0000154413 00000 n 0000154490 00000 n 0000154609 00000 n 0000154952 00000 n trailer << /Size 166 /ID[<08bfd58c4b86c7478dc7a92f3660db74><49a19341badab25267b9aec7fc8193d1>] >> startxref 173 %%EOF mcpp-2.7.2/doc-jp/LICENSE0000644000175000017500000000266410762207433011577 00000000000000/*- * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui * All rights reserved. * * This software including the files in this directory is provided under * the following license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ mcpp-2.7.2/mcpp-gcc.10000644000175000017500000001176110763023741011166 00000000000000.TH MCPP "1" "Mar 2008" "alternative CPP" "Commands for GCC" .SH NAME mcpp \- Matsui CPP, an alternative C preprocessor .SH SYNOPSIS mcpp [\fIoptions\fP] [\fI\fP [\fI\fP]] .SH DESCRIPTION \fBmcpp\fR is a C/C++ preprocessor with the highest conformance which implements C90, C99 and C++98. \fBmcpp\fR has plentiful diagnostics and many #pragmas. It is useful to check portability of your program, and also useful to debug complicated macro. This is a man-page for \fBmcpp\fR of GCC-specific-build. .SH OPTIONS \fBmcpp\fR expects two file names as arguments, \fI\fR and \&\fI\fR. If not specified, \fI\fR defaults to standard input and \fI\fR defaults to standard output. .PP It takes the following options. .PP Commonly used options: .IP \fB-@MODE Specify preprocessing mode. MODE should be one of these 4: .IP " \fB-@std" Standard conforming mode. (default) .IP " \fB-@poststd, -@post" special 'post-Standard' mode. .IP " \fB-@kr" K&R 1st mode. .IP " \fB-@oldprep, -@old" "old_preprocessor" mode (i.e. "Reiser model" cpp). .IP \fB-b Output #line lines in C source style (default: GCC style). .IP \fB-C Output also comments. .IP "\fB-D [=]" Define as (default:1). .IP "\fB-D [=]" Define as . .IP "\fB-e " Change the default multi-byte character encoding to one of: euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8. .IP \fB-finput-charset= Same as -e . (Do not insert spaces around '='). .IP "\fB-I " Add to the #include search list. .IP \fB-I- Unset system or site specific include directories. .IP "\fB-include " Include the prior to the main input file. .IP \fB-j Do not output the source line in diagnostics. .IP "\fB-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file" Output source file dependency line for makefile. .IP \fB-N Don't predefine any non-standard macros. .IP \fB-nostdinc Unset system or site specific include directories. .IP "\fB-o " Output to . .IP \fB-P Don't output #line lines. .IP \fB-Q Output diagnostics to "mcpp.err" (default:stderr). .IP "\fB-U " Undefine . .IP \fB-undef Same as -N. .IP \fB-v Show version of \fBmcpp\fR. .IP "\fB-W " Set warning level to (OR of {0,1,2,4,8,16}, default:1). .IP \fB-w Same as -W0. .IP \fB-z Don't output the included file, only defining macros. .PP Options available with -@std (default) or -@poststd options: .IP \fB-+ Process C++ source. .IP \fB-2 Enable digraphs. .IP \fB-digraphs Enable digraphs. .IP "\fB-h " Re-define the pre-defined macro __STDC_HOSTED__ as . .IP \fB-lang-c89 Same as -S1. .IP \fB-lang-c++ Same as -+. .IP "\fB-pedantic, -pedantic-errors" Same as -W7. .IP "\fB-S " Redefine __STDC__ to , undefine old style macros. .IP \fB-std= Specify the standard to which the code should conform. may be one of: c90, c99, iso9899:1990, iso14882, etc. .br iso9899:, iso14882: : Same as -V (long in decimals). .IP "\fB-V " Redefine __STDC_VERSION__ or __cplusplus to . .br C with -V199901L specifies C99 mode. .br C++ with -V199901L specifies C99 compatible mode. .IP "\fB-x c++" Same as -+. .PP Options available with only -@std (default) option: .IP \fB-@compat Expand recursive macro more than Standard. .IP \fB-3 Enable trigraphs. .IP \fB-trigraphs Enable trigraphs. .IP \fB-K Embed macro annotations into comments. .PP Options available with -@std (default), -@kr or -@oldprep options: .IP \fB-lang-asm Same as -x assembler-with-cpp. .IP "\fB-x assembler-with-cpp" Process "assembler" source. .PP Option available on Mac OS X / Apple-GCC: .IP "\fB-arch " Change the target to (one of i386, x86_64, ppc and ppc64). .PP Option available on CygWIN: .IP \fB-mno-cygwin Change include directory and predefined macros for msvcrt.dll rather than cygwin1.dll. .SH PRAGMA \fBmcpp\fR has the following #pragma directives. .IP "#pragma once" Read the header file only once even if multiply #included. .IP "#pragma __setlocale( ""encoding"")" Specify the multibyte character encoding to "encoding". See -e option for the encodings. .IP "#pragma MCPP put_defines" Putout all the macro definitions currently valid. .IP "#pragma MCPP debug " Start to putout debugging informations. should be one or more of: token expand macro_call path if expression memory getc .IP "#pragma MCPP end_debug " Stop to putout debugging informations. are the same with 'debug'. No argument specifies all arguments. .IP "#pragma MCPP push_macro( ""MACRO"")" Save the macro definition to the stack. .IP "#pragma MCPP pop_macro( ""MACRO"")" Retrieve the macro definition from the stack. .IP "#pragma MCPP preprocess" "Pre-preprocess" the following header files for \fBmcpp\fR. .IP "#pragma MCPP warning any message" Putout warning "any message". .SH "VERSION" MCPP V.2.7 (2008/03) for GCC .SH "SEE ALSO" The full documentation for \fBmcpp\fR are maintained as html files. Please see mcpp-manual.html.