pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:1260:    *! // Code for C.    *! #else    *! // Code for D.    *! #endif    *! @endcode    *!    *! @seealso    *! @[#if], @[#ifdef], @[#else], @[defined()], @[constant()]    */    + /*! @directive #elifdef +  *! @directive #elseifdef +  *! +  *! These work as a combined @[#else] and @[#ifdef] without +  *! adding an extra level of nesting. +  *! +  *! @example +  *! +  *! The following two are equivalent: +  *! +  *! @code +  *! #ifdef A +  *! // Code for A. +  *! #else +  *! #ifdef B +  *! // Code for B. +  *! #else +  *! #ifdef C +  *! // Code for C. +  *! #else +  *! // Code for D. +  *! #endif +  *! #endif +  *! #endif +  *! @endcode +  *! +  *! And +  *! +  *! @code +  *! #ifdef A +  *! // Code for A. +  *! #elifdef B +  *! // Code for B. +  *! #elseifdef C +  *! // Code for C. +  *! #else +  *! // Code for D. +  *! #endif +  *! @endcode +  *! +  *! @seealso +  *! @[#if], @[#ifdef], @[#else], @[defined()], @[constant()] +  */ +  + /*! @directive #elifndef +  *! @directive #elseifndef +  *! +  *! These work as a combined @[#else] and @[#ifndef] without +  *! adding an extra level of nesting. +  *! +  *! @example +  *! +  *! The following two are equivalent: +  *! +  *! @code +  *! #ifndef A +  *! // Code for not A. +  *! #else +  *! #ifndef B +  *! // Code for not B. +  *! #else +  *! #ifdef C +  *! // Code for not C. +  *! #else +  *! // Code for ABC. +  *! #endif +  *! #endif +  *! #endif +  *! @endcode +  *! +  *! And +  *! +  *! @code +  *! #ifndef A +  *! // Code for not A. +  *! #elifndef B +  *! // Code for not B. +  *! #elseifndef C +  *! // Code for not C. +  *! #else +  *! // Code for ABC. +  *! #endif +  *! @endcode +  *! +  *! @seealso +  *! @[#if], @[#ifdef], @[#else], @[defined()], @[constant()] +  */ +     /*! @directive #error    *!    *! Throw an error during preprocessing.    *!    *! This directive causes a cpp error. It can be used to notify    *! the user that certain functions are missing and similar things.    *!    *! @note    *! Note that this directive will cause @[cpp()] to throw    *! an error at the end of preprocessing, which will cause
pike.git/src/cpp.cmod:2736:    { 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'r', 'e', 'c', 'u', 'r' };   static const char line_[] = { 'l', 'i', 'n', 'e' };   static const char string_[] = { 's', 't', 'r', 'i', 'n', 'g' };   static const char include_[] = { 'i', 'n', 'c', 'l', 'u', 'd', 'e' };   static const char if_[] = { 'i', 'f' };   static const char ifdef_[] = { 'i', 'f', 'd', 'e', 'f' };   static const char ifndef_[] = { 'i', 'f', 'n', 'd', 'e', 'f' };   static const char endif_[] = { 'e', 'n', 'd', 'i', 'f' };   static const char else_[] = { 'e', 'l', 's', 'e' };   static const char elseif_[] = { 'e', 'l', 's', 'e', 'i', 'f' }; + static const char elseifdef_[] = { 'e', 'l', 's', 'e', 'i', 'f', 'd', 'e', 'f' }; + static const char elseifndef_[] = { 'e', 'l', 's', 'e', 'i', 'f', 'n', 'd', 'e', 'f' };   static const char elif_[] = { 'e', 'l', 'i', 'f' }; -  + static const char elifdef_[] = { 'e', 'l', 'i', 'f', 'd', 'e', 'f' }; + static const char elifndef_[] = { 'e', 'l', 'i', 'f', 'n', 'd', 'e', 'f' };   static const char define_[] = { 'd', 'e', 'f', 'i', 'n', 'e' };   static const char undef_[] = { 'u', 'n', 'd', 'e', 'f' };   static const char undefine_[] = { 'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e' };   static const char charset_[] = { 'c', 'h', 'a', 'r', 's', 'e', 't' };   static const char pragma_[] = { 'p', 'r', 'a', 'g', 'm', 'a' };   static const char pike_[] = { 'p', 'i', 'k', 'e' };   static const char require_[] = { 'r', 'e', 'q', 'u', 'i', 'r', 'e' };   static const char lsh_[] = { '<', '<' };   static const char rsh_[] = { '>', '>' };   
pike.git/src/cpp.cmod:4228:    calc(this,MKPCHARP_STR(tmp.s),tmp.s->len,0,0);    free_string_builder(&tmp);    if(!SAFE_IS_ZERO(Pike_sp-1)) flags&=~CPP_NO_OUTPUT;    pop_stack();    } else {    FIND_EOL();    flags |= CPP_NO_OUTPUT | CPP_REALLY_NO_OUTPUT;    }    break;    } +  if(GOBBLE_WORD(elifdef_) || GOBBLE_WORD(elseifdef_)) +  { +  if(!(flags & CPP_EXPECT_ELSE)) +  cpp_error(this, "Unmatched #elifdef."); +  +  flags|=CPP_EXPECT_ENDIF; +  +  if((flags & (CPP_NO_OUTPUT | CPP_REALLY_NO_OUTPUT)) == CPP_NO_OUTPUT) +  { +  INT32 nflags; +  struct pike_string *s; +  SKIPSPACE(); +  +  s = GOBBLE_IDENTIFIER(); +  if(!s) +  cpp_error(this, "#elifdef what?"); +  +  flags |= CPP_EXPECT_ELSE | CPP_NO_OUTPUT; +  if (s) { +  if(FIND_DEFINE(s)) +  flags &= ~CPP_NO_OUTPUT; +  free_string (s);    } -  +  } else { +  FIND_EOL(); +  flags |= CPP_NO_OUTPUT | CPP_REALLY_NO_OUTPUT; +  } +  break; +  } +  if(GOBBLE_WORD(elifndef_) || GOBBLE_WORD(elseifndef_)) +  { +  if(!(flags & CPP_EXPECT_ELSE)) +  cpp_error(this, "Unmatched #elifndef."); +  +  flags|=CPP_EXPECT_ENDIF; +  +  if((flags & (CPP_NO_OUTPUT | CPP_REALLY_NO_OUTPUT)) == CPP_NO_OUTPUT) +  { +  INT32 nflags; +  struct pike_string *s; +  SKIPSPACE(); +  +  s = GOBBLE_IDENTIFIER(); +  if(!s) +  cpp_error(this, "#elifndef what?"); +  +  flags |= CPP_EXPECT_ELSE | CPP_NO_OUTPUT; +  if (s) { +  if(!FIND_DEFINE(s)) +  flags &= ~CPP_NO_OUTPUT; +  free_string (s); +  } +  } else { +  FIND_EOL(); +  flags |= CPP_NO_OUTPUT | CPP_REALLY_NO_OUTPUT; +  } +  break; +  } +  }    goto unknown_preprocessor_directive;       case 'd': /* define */    {       if(GOBBLE_WORD(define_))    {    struct string_builder str;    INT32 argno=-1;    ptrdiff_t tmp3;