Beispiel #1
0
/*-------------------------------------------------------------------------
 * Function:    out_error
 *
 * Purpose:     Prints an error message followed by an object.
 *
 * Return:      void
 *
 * Programmer:  Robb Matzke
 *              [email protected]
 *              Dec 11 1996
 *
 * Modifications:
 *
 *      Robb Matzke, 3 Feb 1997
 *      Changed prefix name from `error' to `***ERROR***' to make it
 *      stand out more.
 *
 *-------------------------------------------------------------------------
 */
void
out_error (const char *mesg, obj_t obj) {

   if (!ErrorDisable) {
      out_reset (OUT_STDERR);
      out_push (OUT_STDERR, "***ERROR***");
      out_putw (OUT_STDERR, mesg);
      obj_print (obj, OUT_STDERR);
      out_pop (OUT_STDERR);
      out_nl (OUT_STDERR);
   }
}
Beispiel #2
0
Datei: glue.c Projekt: Rayerd/dmd
void obj_start(char *srcfile)
{
    //printf("obj_start()\n");

    rtlsym_reset();
    slist_reset();
    clearStringTab();

    obj_init(&objbuf, srcfile, NULL);

    el_reset();
    cg87_reset();
    out_reset();
}
Beispiel #3
0
void obj_start(char *srcfile)
{
    //printf("obj_start()\n");

    rtlsym_reset();
    clearStringTab();

#if TARGET_WINDOS
    // Produce Ms COFF files for 64 bit code, OMF for 32 bit code
    assert(objbuf.size() == 0);
    objmod = global.params.mscoff ? MsCoffObj::init(&objbuf, srcfile, NULL)
                                  :       Obj::init(&objbuf, srcfile, NULL);
#else
    objmod = Obj::init(&objbuf, srcfile, NULL);
#endif

    el_reset();
    cg87_reset();
    out_reset();
}
Beispiel #4
0
/*-------------------------------------------------------------------------
 * Function:    out_errorn
 *
 * Purpose:     Print an error message to the standard error stream,
 *              followed by a linefeed.
 *
 * Return:      void
 *
 * Programmer:  Robb Matzke
 *              [email protected]
 *              Dec 11 1996
 *
 * Modifications:
 *
 *      Robb Matzke, 3 Feb 1997
 *      Changed prefix name from `error' to `***ERROR***' to make it
 *      stand out more.
 *
 *-------------------------------------------------------------------------
 */
void
out_errorn (const char *fmt, ...) {

   char         buf[4096];
   va_list      ap;

   if (!ErrorDisable) {
      va_start (ap, fmt);
      vsprintf (buf, fmt, ap);
      va_end (ap);

      if (OUT_STDERR && OUT_STDERR->f) {
         out_reset (OUT_STDERR);
         out_push (OUT_STDERR, "***ERROR***");
         out_putw (OUT_STDERR, buf);
         out_pop (OUT_STDERR);
         out_nl (OUT_STDERR);
      } else {
         fputs (buf, stderr);
         fputc ('\n', stderr);
      }
   }
}