pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:4776:    *!    *! This define contains the directory path of the source file.    */    PIKEFUN string macro___DIR__()    {    struct CPP_struct *this = THIS;    push_text(" %q ");    ref_push_string(this->current_file);    /* FIXME: This isn't safe if the master hasn't been compiled yet. */    APPLY_MASTER("dirname", 1); +  if ((TYPEOF(Pike_sp[-1]) == PIKE_T_STRING) && +  !Pike_sp[-1].u.string->len) { +  /* Convert empty directory to ".". +  * +  * This is so that the user won't run into surprises +  * when eg concating __DIR__ with "/foo.txt". +  */ +  pop_stack(); +  push_text("."); +  }    f_sprintf(2);    }       /*! @decl constant __TIME__    *!    *! This define contains the current time at the time of compilation,    *! e.g. "12:20:51".    */    PIKEFUN string macro___TIME__()    {