Print this page
make: unifdef for other OSes (undefined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/lib/mksh/misc.cc
          +++ new/usr/src/cmd/make/lib/mksh/misc.cc
↓ open down ↓ 43 lines elided ↑ open up ↑
  44   44  #include <mksh/i18n.h>          /* get_char_semantics_value() */
  45   45  #include <mksh/misc.h>
  46   46  #include <mksdmsi18n/mksdmsi18n.h>
  47   47  #include <stdarg.h>             /* va_list, va_start(), va_end() */
  48   48  #include <stdlib.h>             /* mbstowcs() */
  49   49  #include <sys/signal.h>         /* SIG_DFL */
  50   50  #include <sys/wait.h>           /* wait() */
  51   51  
  52   52  #include <string.h>             /* strerror() */
  53   53  
  54      -#if defined (HP_UX) || defined (linux)
  55      -#include <unistd.h>
  56      -#endif
  57   54  
  58   55  /*
  59   56   * Defined macros
  60   57   */
  61   58  
  62   59  /*
  63   60   * typedefs & structs
  64   61   */
  65   62  
  66   63  /*
↓ open down ↓ 275 lines elided ↑ open up ↑
 342  339   *      Parameters:
 343  340   *              errnum          The number of the error we want to describe
 344  341   *
 345  342   *      Global variables used:
 346  343   *              sys_errlist     A vector of error messages
 347  344   *              sys_nerr        The size of sys_errlist
 348  345   */
 349  346  char *
 350  347  errmsg(int errnum)
 351  348  {
 352      -#ifdef linux
 353      -        return strerror(errnum);
 354      -#else // linux
 355  349  
 356  350          extern int              sys_nerr;
 357      -#ifdef SUN4_x
 358      -        extern char             *sys_errlist[];
 359      -#endif
 360  351          char                    *errbuf;
 361  352  
 362  353          if ((errnum < 0) || (errnum > sys_nerr)) {
 363  354                  errbuf = getmem(6+1+11+1);
 364  355                  (void) sprintf(errbuf, catgets(libmksdmsi18n_catd, 1, 127, "Error %d"), errnum);
 365  356                  return errbuf;
 366  357          } else {
 367      -#ifdef SUN4_x
 368      -                return(sys_errlist[errnum]);
 369      -#endif
 370  358                  return strerror(errnum);
 371  359  
 372  360          }
 373      -#endif // linux
 374  361  }
 375  362  
 376  363  static char static_buf[MAXPATHLEN*3];
 377  364  
 378  365  /*
 379  366   *      fatal_mksh(format, args...)
 380  367   *
 381  368   *      Print a message and die
 382  369   *
 383  370   *      Parameters:
↓ open down ↓ 743 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX