pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:5153:    *! not just Microsoft Windows NT, as the name implies.    */      /*! @decl constant __amigaos__    *!    *! This define is defined when the Pike is running on Amiga OS.    */      /*! @endnamespace */    +  /*! @decl void create(string|void current_file, @ +  *! int|string|void charset, object|void handler, @ +  *! void|int compat_major, void|int compat_minor, @ +  *! void|int picky_cpp) +  *! @decl void create(mapping(string:mixed) options) +  *! +  *! Initialize the preprocessor. +  *! +  *! @param options +  *! If the first argument is a mapping, no other arguments may follow. +  *! Instead, they have to be given as members of the mapping (if wanted). +  *! The following members are then recognized: +  *! +  *! @mapping +  *! @member string "current_file" +  *! Name of the current file. It is used for generating +  *! #line directives and for locating include files. +  *! @member int|string "charset" +  *! Charset to use when processing @expr{data@}. +  *! @member object "handler" +  *! Compilation handler. +  *! @member int "compat_major" +  *! Sets the major pike version used for compat handling. +  *! @member int "compat_minor" +  *! Sets the minor pike version used for compat handling. +  *! @member int "picky_cpp" +  *! Generate more warnings. +  *! @member int "keep_comments" +  *! This option keeps @[cpp()] from removing comments. +  *! Useful in combination with the prefix feature below. +  *! @member string "prefix" +  *! If a prefix is given, only prefixed directives will be +  *! processed. For example, if the prefix is @expr{"foo"@}, then +  *! @expr{#foo_ifdef COND@} and @expr{foo___LINE__@} would be +  *! processed, @expr{#ifdef COND@} and @expr{__LINE__@} would not. +  *! @endmapping +  *! +  *! @param current_file +  *! If the @[current_file] argument has not been specified, +  *! it will default to @expr{"-"@}. +  *! +  *! @param charset +  *! Turn on automatic character set detection if @expr{1}, otherwise +  *! specifies the character set used by the input. +  *! Defaults to @expr{"ISO-10646"@}. +  *! +  *! @seealso +  *! @[compile()] +  */    PIKEFUN void create(mapping|string|void opts_or_file,    int|string|void charset_sv,    object|void handler,    int|void compat_major_sv,    int|void compat_minor_sv,    int|void picky_cpp_sv)    flags ID_PROTECTED;    {    struct CPP_struct *this = THIS;   
pike.git/src/cpp.cmod:5251:    }    }       if(compat_major)    cpp_change_compat(this, compat_major, compat_minor);       this->picky_cpp = picky_cpp;    pop_n_elems(args);    }    +  /*! @decl void define_ansi_macros() +  *! +  *! Adds some cpp macros defined by the ANSI-C standards, +  *! such as @[__FILE__], @[__LINE__], etc. +  *! +  *! @seealso +  *! @[define_pike_macros()] +  */    PIKEFUN void define_ansi_macros()    {    struct CPP_struct *this = THIS;       /* These attempt to be compatible with the C standard. */    do_magic_define(this,"__LINE__",insert_current_line);    do_magic_define(this,"__FILE__",insert_current_file_as_string);    do_magic_define(this,"__DATE__",insert_current_date_as_string);    do_magic_define(this,"__TIME__",insert_current_time_as_string);       /* These are from the 201x C standard. */    do_magic_define(this,"_Pragma",insert_pragma)->args = 1;    simple_add_define(this, "static_assert", "_Static_assert");    }    -  +  /*! @decl void define_pike_macros() +  *! +  *! Adds some pike-specific cpp macros, +  *! such as @[__DIR__], @[__VERSION__], [__PIKE__], etc. +  *! +  *! @seealso +  *! @[define_ansi_macros()] +  */    PIKEFUN void define_pike_macros()    {    struct CPP_struct *this = THIS;       /* These are Pike extensions. */    do_magic_define(this,"__DIR__",insert_current_dir_as_string);    do_magic_define(this,"__VERSION__",insert_current_version);    do_magic_define(this,"__MAJOR__",insert_current_major);    do_magic_define(this,"__MINOR__",insert_current_minor);