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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/include/mksh/defs.h
          +++ new/usr/src/cmd/make/include/mksh/defs.h
↓ open down ↓ 35 lines elided ↑ open up ↑
  36   36  #include <stdio.h>
  37   37  #include <stdlib.h>             /* wchar_t */
  38   38  #include <string.h>             /* strcmp() */
  39   39  #include <nl_types.h>           /* catgets() */
  40   40  #include <sys/param.h>          /* MAXPATHLEN */
  41   41  #include <sys/types.h>          /* time_t, caddr_t */
  42   42  #include <vroot/vroot.h>        /* pathpt */
  43   43  #include <sys/time.h>           /* timestruc_t */
  44   44  #include <errno.h>              /* errno */
  45   45  
  46      -#if defined (HP_UX) || defined (linux)
  47      -#define  MAXNAMELEN           256
  48      -#define  RW_NO_OVERLOAD_WCHAR 1  /* Rogue Wave, belongs in <rw/compiler.h> */
  49      -#else
  50   46  #include <wctype.h>
  51   47  #include <widec.h>
  52      -#endif
  53   48  
  54      -#if defined (linux)
  55      -/*
  56      - * Definition of wchar functions.
  57      - */
  58      -#       include <wctype.h>
  59      -#       include <wchar.h>
  60      -#       define wsdup(x) wcsdup(x)
  61      -#       define wschr(x,y) wcschr(x,y)
  62      -#       define wscat(x,y) wcscat(x,y)
  63      -#       define wsrchr(x,y) wcsrchr(x,y)
  64      -#       define wslen(x) wcslen(x)
  65      -#       define wscpy(x,y) wcscpy(x,y)
  66      -#       define wsncpy(x,y,z) wcsncpy(x,y,z)
  67      -#       define wscmp(x,y) wcscmp(x,y)
  68      -#       define wsncmp(x,y,z) wcsncmp(x,y,z)
  69      -#endif
  70   49  
  71   50  /*
  72   51   * A type and some utilities for boolean values
  73   52   */
  74   53  
  75   54  #define false   BOOLEAN_false
  76   55  #define true    BOOLEAN_true
  77   56  
  78   57  typedef enum {
  79   58          false =         0,
↓ open down ↓ 1 lines elided ↑ open up ↑
  81   60          failed =        0,
  82   61          succeeded =     1
  83   62  } Boolean;
  84   63  #define BOOLEAN(expr)           ((expr) ? true : false)
  85   64  
  86   65  /*
  87   66   * Some random constants (in an enum so dbx knows their values)
  88   67   */
  89   68  enum {
  90   69          update_delay = 30,              /* time between rstat checks */
  91      -#ifdef sun386
  92      -        ar_member_name_len = 14,
  93      -#else
  94   70          ar_member_name_len = 1024,
  95      -#endif
  96      -
  97   71          hashsize = 2048                 /* size of hash table */
  98   72  };
  99   73  
 100   74  
 101   75  /*
 102   76   * Symbols that defines all the different char constants make uses
 103   77   */
 104   78  enum {
 105   79          ampersand_char =        '&',
 106   80          asterisk_char =         '*',
↓ open down ↓ 280 lines elided ↑ open up ↑
 387  361          two_colon,
 388  362          equal_seen,
 389  363          conditional_seen,
 390  364          none_seen
 391  365  } Separator;
 392  366  
 393  367  /*
 394  368   * Magic values for the timestamp stored with each name object
 395  369   */
 396  370  
 397      -#if defined (linux)
 398      -typedef struct timespec timestruc_t;
 399      -#endif
 400  371  
 401  372  extern const timestruc_t file_no_time;
 402  373  extern const timestruc_t file_doesnt_exist;
 403  374  extern const timestruc_t file_is_dir;
 404  375  extern const timestruc_t file_min_time;
 405  376  extern const timestruc_t file_max_time;
 406  377  
 407  378  /*
 408  379   * Each Name has a list of properties
 409  380   * The properties are used to store information that only
↓ open down ↓ 44 lines elided ↑ open up ↑
 454  425          Boolean                 read_only:1;
 455  426          /*
 456  427          * This macro is defined conditionally
 457  428          */
 458  429          Boolean                 is_conditional:1;
 459  430          /*
 460  431          * The list for $? is stored as a structured list that
 461  432          * is translated into a string iff it is referenced.
 462  433          * This is why  some macro values need a daemon. 
 463  434          */
 464      -#if defined(HP_UX) || defined(linux)
 465      -        Daemon                  daemon;
 466      -#else
 467  435          Daemon                  daemon:2;
 468      -#endif
 469  436  };
 470  437  
 471  438  struct _Macro_list {
 472  439          struct _Macro_list      *next;
 473  440          char                    *macro_name; 
 474  441          char                    *value; 
 475  442  };
 476  443  
 477  444  enum sccs_stat {
 478  445          DONT_KNOW_SCCS = 0,
↓ open down ↓ 5 lines elided ↑ open up ↑
 484  451          struct _Property        *prop;          /* List of properties */
 485  452          char                    *string_mb;     /* Multi-byte name string */
 486  453          struct {
 487  454                  unsigned int            length;
 488  455          }                       hash;
 489  456          struct {
 490  457                  timestruc_t             time;           /* Modification */
 491  458                  int                     stat_errno;     /* error from "stat" */
 492  459                  off_t                   size;           /* Of file */
 493  460                  mode_t                  mode;           /* Of file */
 494      -#if defined(HP_UX) || defined(linux)
 495      -                Boolean                 is_file;
 496      -                Boolean                 is_dir;
 497      -                Boolean                 is_sym_link;
 498      -                Boolean                 is_precious;
 499      -                enum sccs_stat          has_sccs;
 500      -#else
 501  461                  Boolean                 is_file:1;
 502  462                  Boolean                 is_dir:1;
 503  463                  Boolean                 is_sym_link:1;
 504  464                  Boolean                 is_precious:1;
 505  465  #ifdef NSE
 506  466                  Boolean                 is_derived_src:1;
 507  467  #endif
 508  468                  enum sccs_stat          has_sccs:2;
 509      -#endif
 510  469          }                       stat;
 511  470          /*
 512  471           * Count instances of :: definitions for this target
 513  472           */
 514  473          short                   colon_splits;
 515  474          /*
 516  475           * We only clear the automatic depes once per target per report
 517  476           */
 518  477          short                   temp_file_number;
 519  478          /*
↓ open down ↓ 15 lines elided ↑ open up ↑
 535  494           * This target is a directory that has been read
 536  495           */
 537  496          Boolean                 has_read_dir:1;
 538  497          /*
 539  498           * This name is a macro that is now being expanded
 540  499           */
 541  500          Boolean                 being_expanded:1;
 542  501          /*
 543  502           * This name is a magic name that the reader must know about
 544  503           */
 545      -#if defined(HP_UX) || defined(linux)
 546      -        Special                 special_reader;
 547      -        Doname                  state;
 548      -        Separator               colons;
 549      -#else
 550  504          Special                 special_reader:5;
 551  505          Doname                  state:3;
 552  506          Separator               colons:3;
 553      -#endif
 554  507          Boolean                 has_depe_list_expanded:1;
 555  508          Boolean                 suffix_scan_done:1;
 556  509          Boolean                 has_complained:1;       /* For sccs */
 557  510          /*
 558  511           * This target has been built during this make run
 559  512           */
 560  513          Boolean                 ran_command:1;
 561  514          Boolean                 with_squiggle:1;        /* for .SUFFIXES */
 562  515          Boolean                 without_squiggle:1;     /* for .SUFFIXES */
 563  516          Boolean                 has_read_suffixes:1;    /* Suffix list cached*/
↓ open down ↓ 194 lines elided ↑ open up ↑
 758  711          struct STime            time;
 759  712          struct Vpath_alias      vpath_alias;
 760  713          struct Long_member_name long_member_name;
 761  714          struct _Macro_appendix  macro_appendix;
 762  715          struct _Env_mem         env_mem;
 763  716  };
 764  717  
 765  718  #define PROPERTY_HEAD_SIZE (sizeof (struct _Property)-sizeof (union Body))
 766  719  struct _Property {
 767  720          struct _Property        *next;
 768      -#if defined(HP_UX) || defined(linux)
 769      -        Property_id             type;
 770      -#else
 771  721          Property_id             type:4;
 772      -#endif
 773  722          union Body              body;
 774  723  };
 775  724  
 776  725  /* Structure for dynamic "ascii" arrays */ 
 777  726  struct ASCII_Dyn_Array {
 778  727          char                    *start;
 779  728          size_t                  size;
 780  729  };
 781  730  
 782  731  struct _Envvar {
↓ open down ↓ 249 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX