Changeset 3138 in kBuild for vendor/gnumake/current/makeint.h
- Timestamp:
- Mar 12, 2018 7:32:29 PM (7 years ago)
- File:
-
- 1 moved
-
vendor/gnumake/current/makeint.h (moved) (moved from vendor/gnumake/current/make.h ) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/makeint.h
r3137 r3138 1 1 /* Miscellaneous global declarations and portability cruft for GNU Make. 2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 4 2010 Free Software Foundation, Inc. 2 Copyright (C) 1988-2016 Free Software Foundation, Inc. 5 3 This file is part of GNU Make. 6 4 … … 19 17 /* We use <config.h> instead of "config.h" so that a compilation 20 18 using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h 21 (which it would do because make .h was found in $srcdir). */19 (which it would do because makeint.h was found in $srcdir). */ 22 20 #include <config.h> 23 21 #undef HAVE_CONFIG_H … … 44 42 #endif 45 43 44 /* Disable assert() unless we're a maintainer. 45 Some asserts are compute-intensive. */ 46 #ifndef MAKE_MAINTAINER_MODE 47 # define NDEBUG 1 48 #endif 49 50 /* Include the externally-visible content. 51 Be sure to use the local one, and not one installed on the system. 52 Define GMK_BUILDING_MAKE for proper selection of dllexport/dllimport 53 declarations for MS-Windows. */ 54 #ifdef WINDOWS32 55 # define GMK_BUILDING_MAKE 56 #endif 57 #include "gnumake.h" 46 58 47 59 #ifdef CRAY … … 61 73 #include <stdio.h> 62 74 #include <ctype.h> 75 63 76 #ifdef HAVE_SYS_TIMEB_H 64 /* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs 65 unless <sys/timeb.h> has been included first. Does every system have a 66 <sys/timeb.h>? If any does not, configure should check for it. */ 77 /* SCO 3.2 "devsys 4.2" has a prototype for 'ftime' in <time.h> that bombs 78 unless <sys/timeb.h> has been included first. */ 67 79 # include <sys/timeb.h> 68 80 #endif 69 70 81 #if TIME_WITH_SYS_TIME 71 82 # include <sys/time.h> … … 85 96 #endif 86 97 87 #ifndef isblank 88 # define isblank(c) ((c) == ' ' || (c) == '\t') 98 #ifdef __VMS 99 /* In strict ANSI mode, VMS compilers should not be defining the 100 VMS macro. Define it here instead of a bulk edit for the correct code. 101 */ 102 # ifndef VMS 103 # define VMS 104 # endif 89 105 #endif 90 106 … … 92 108 # include <unistd.h> 93 109 /* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get 94 POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */110 POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */ 95 111 # if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS) 96 112 # define POSIX 1 … … 117 133 #ifndef HAVE_SA_RESTART 118 134 # define SA_RESTART 0 135 #endif 136 137 #ifdef HAVE_VFORK_H 138 # include <vfork.h> 119 139 #endif 120 140 … … 149 169 #endif 150 170 151 /* Nonzero if the integer type T is signed. */ 152 #define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0) 171 #ifndef USHRT_MAX 172 # define USHRT_MAX 65535 173 #endif 174 175 /* Nonzero if the integer type T is signed. 176 Use <= to avoid GCC warnings about always-false expressions. */ 177 #define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0) 153 178 154 179 /* The minimum and maximum values for the integer type T. … … 179 204 180 205 #ifdef VMS 206 # include <fcntl.h> 181 207 # include <types.h> 182 208 # include <unixlib.h> … … 185 211 /* Needed to use alloca on VMS. */ 186 212 # include <builtins.h> 213 214 extern int vms_use_mcr_command; 215 extern int vms_always_use_cmd_file; 216 extern int vms_gnv_shell; 217 extern int vms_comma_separator; 218 extern int vms_legacy_behavior; 219 extern int vms_unix_simulation; 187 220 #endif 188 221 … … 192 225 # define __attribute__(x) 193 226 # endif 194 /* The __-protected variants of `format' and `printf' attributes227 /* The __-protected variants of 'format' and 'printf' attributes 195 228 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ 196 229 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) … … 250 283 # include <inttypes.h> 251 284 #endif 285 #if HAVE_STDINT_H 286 # include <stdint.h> 287 #endif 252 288 #define FILE_TIMESTAMP uintmax_t 253 289 … … 263 299 POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that 264 300 only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless 265 it's important to use the locale's definition of `digit' even when the301 it's important to use the locale's definition of 'digit' even when the 266 302 host does not conform to POSIX. */ 267 303 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) … … 306 342 #define S_(msg1,msg2,num) ngettext (msg1,msg2,num) 307 343 308 /* Handle other OSs. */309 #ifndef PATH_SEPARATOR_CHAR310 # if defined(HAVE_DOS_PATHS)311 # define PATH_SEPARATOR_CHAR ';'312 # elif defined(VMS)313 # define PATH_SEPARATOR_CHAR ','314 # else315 # define PATH_SEPARATOR_CHAR ':'316 # endif317 #endif318 319 344 /* This is needed for getcwd() and chdir(), on some W32 systems. */ 320 345 #if defined(HAVE_DIRECT_H) … … 327 352 # define pipe(_p) _pipe((_p), 512, O_BINARY) 328 353 # define kill(_pid,_sig) w32_kill((_pid),(_sig)) 354 /* MSVC and Watcom C don't have ftruncate. */ 355 # if defined(_MSC_VER) || defined(__WATCOMC__) 356 # define ftruncate(_fd,_len) _chsize(_fd,_len) 357 # endif 358 /* MinGW64 doesn't have _S_ISDIR. */ 359 # ifndef _S_ISDIR 360 # define _S_ISDIR(m) S_ISDIR(m) 361 # endif 329 362 330 363 void sync_Path_environment (void); 331 364 int w32_kill (pid_t pid, int sig); 332 char *end_of_token_w32 (const char *s, char stopchar);333 365 int find_and_set_default_shell (const char *token); 334 366 … … 338 370 /* is default_shell unixy? */ 339 371 extern int unixy_shell; 372 373 /* We don't have a preferred fixed value for LOCALEDIR. */ 374 # ifndef LOCALEDIR 375 # define LOCALEDIR NULL 376 # endif 377 378 /* Include only the minimal stuff from windows.h. */ 379 # define WIN32_LEAN_AND_MEAN 340 380 #endif /* WINDOWS32 */ 381 382 #define ANY_SET(_v,_m) (((_v)&(_m)) != 0) 383 #define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m))) 384 385 #define MAP_NUL 0x0001 386 #define MAP_BLANK 0x0002 387 #define MAP_NEWLINE 0x0004 388 #define MAP_COMMENT 0x0008 389 #define MAP_SEMI 0x0010 390 #define MAP_EQUALS 0x0020 391 #define MAP_COLON 0x0040 392 #define MAP_PERCENT 0x0080 393 #define MAP_PIPE 0x0100 394 #define MAP_DOT 0x0200 395 #define MAP_COMMA 0x0400 396 397 /* These are the valid characters for a user-defined function. */ 398 #define MAP_USERFUNC 0x2000 399 /* This means not only a '$', but skip the variable reference. */ 400 #define MAP_VARIABLE 0x4000 401 /* The set of characters which are directory separators is OS-specific. */ 402 #define MAP_DIRSEP 0x8000 403 404 #ifdef VMS 405 # define MAP_VMSCOMMA MAP_COMMA 406 #else 407 # define MAP_VMSCOMMA 0x0000 408 #endif 409 410 #define MAP_SPACE (MAP_BLANK|MAP_NEWLINE) 411 412 /* Handle other OSs. 413 To overcome an issue parsing paths in a DOS/Windows environment when 414 built in a unix based environment, override the PATH_SEPARATOR_CHAR 415 definition unless being built for Cygwin. */ 416 #if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__) 417 # undef PATH_SEPARATOR_CHAR 418 # define PATH_SEPARATOR_CHAR ';' 419 # define MAP_PATHSEP MAP_SEMI 420 #elif !defined(PATH_SEPARATOR_CHAR) 421 # if defined (VMS) 422 # define PATH_SEPARATOR_CHAR (vms_comma_separator ? ',' : ':') 423 # define MAP_PATHSEP (vms_comma_separator ? MAP_COMMA : MAP_SEMI) 424 # else 425 # define PATH_SEPARATOR_CHAR ':' 426 # define MAP_PATHSEP MAP_COLON 427 # endif 428 #elif PATH_SEPARATOR_CHAR == ':' 429 # define MAP_PATHSEP MAP_COLON 430 #elif PATH_SEPARATOR_CHAR == ';' 431 # define MAP_PATHSEP MAP_SEMI 432 #elif PATH_SEPARATOR_CHAR == ',' 433 # define MAP_PATHSEP MAP_COMMA 434 #else 435 # error "Unknown PATH_SEPARATOR_CHAR" 436 #endif 437 438 #define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m)) 439 440 #define ISBLANK(c) STOP_SET((c),MAP_BLANK) 441 #define ISSPACE(c) STOP_SET((c),MAP_SPACE) 442 #define NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s) 443 #define END_OF_TOKEN(s) while (! STOP_SET (*(s), MAP_SPACE|MAP_NUL)) ++(s) 341 444 342 445 #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) … … 345 448 #ifdef SET_STACK_SIZE 346 449 # include <sys/resource.h> 347 struct rlimit stack_limit; 348 #endif 349 350 struct floc 450 extern struct rlimit stack_limit; 451 #endif 452 453 #include <glob.h> 454 455 #define NILF ((floc *)0) 456 457 #define CSTRLEN(_s) (sizeof (_s)-1) 458 #define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s) 459 460 /* The number of bytes needed to represent the largest integer as a string. */ 461 #define INTSTR_LENGTH CSTRLEN ("18446744073709551616") 462 463 #define DEFAULT_TTYNAME "true" 464 #ifdef HAVE_TTYNAME 465 # define TTYNAME(_f) ttyname (_f) 466 #else 467 # define TTYNAME(_f) DEFAULT_TTYNAME 468 #endif 469 470 471 472 473 /* Specify the location of elements read from makefiles. */ 474 typedef struct 351 475 { 352 476 const char *filenm; 353 477 unsigned long lineno; 354 }; 355 #define NILF ((struct floc *)0) 356 357 #define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1) 358 359 360 361 /* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use 362 variadic versions of these functions. */ 363 364 #if HAVE_STDARG_H || HAVE_VARARGS_H 365 # if HAVE_VPRINTF || HAVE_DOPRNT 366 # define USE_VARIADIC 1 367 # endif 368 #endif 369 370 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 478 unsigned long offset; 479 } floc; 480 371 481 const char *concat (unsigned int, ...); 372 void message (int prefix, const char *fmt, ...) 373 __attribute__ ((__format__ (__printf__, 2, 3))); 374 void error (const struct floc *flocp, const char *fmt, ...) 375 __attribute__ ((__format__ (__printf__, 2, 3))); 376 void fatal (const struct floc *flocp, const char *fmt, ...) 377 __attribute__ ((noreturn, __format__ (__printf__, 2, 3))); 378 #else 379 const char *concat (); 380 void message (); 381 void error (); 382 void fatal (); 383 #endif 482 void message (int prefix, size_t length, const char *fmt, ...) 483 __attribute__ ((__format__ (__printf__, 3, 4))); 484 void error (const floc *flocp, size_t length, const char *fmt, ...) 485 __attribute__ ((__format__ (__printf__, 3, 4))); 486 void fatal (const floc *flocp, size_t length, const char *fmt, ...) 487 __attribute__ ((noreturn, __format__ (__printf__, 3, 4))); 488 489 #define O(_t,_a,_f) _t((_a), 0, (_f)) 490 #define OS(_t,_a,_f,_s) _t((_a), strlen (_s), (_f), (_s)) 491 #define OSS(_t,_a,_f,_s1,_s2) _t((_a), strlen (_s1) + strlen (_s2), \ 492 (_f), (_s1), (_s2)) 493 #define OSSS(_t,_a,_f,_s1,_s2,_s3) _t((_a), strlen (_s1) + strlen (_s2) + strlen (_s3), \ 494 (_f), (_s1), (_s2), (_s3)) 495 #define ON(_t,_a,_f,_n) _t((_a), INTSTR_LENGTH, (_f), (_n)) 496 #define ONN(_t,_a,_f,_n1,_n2) _t((_a), INTSTR_LENGTH*2, (_f), (_n1), (_n2)) 497 498 #define OSN(_t,_a,_f,_s,_n) _t((_a), strlen (_s) + INTSTR_LENGTH, \ 499 (_f), (_s), (_n)) 500 #define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \ 501 (_f), (_n), (_s)) 502 503 #define OUT_OF_MEM() O (fatal, NILF, _("virtual memory exhausted")) 384 504 385 505 void die (int) __attribute__ ((noreturn)); 386 void log_working_directory (int);387 506 void pfatal_with_name (const char *) __attribute__ ((noreturn)); 388 507 void perror_with_name (const char *, const char *); 508 #define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s)) 389 509 void *xmalloc (unsigned int); 390 510 void *xcalloc (unsigned int); … … 401 521 char *find_percent (char *); 402 522 const char *find_percent_cached (const char **); 403 FILE *open_tmpfile (char **, const char *);404 523 405 524 #ifndef NO_ARCHIVES … … 410 529 411 530 typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated, 412 long int hdrpos, long int datapos, 413 long int size, long int date, int uid, 414 int gid, int mode, const void *arg); 531 long int hdrpos, long int datapos, 532 long int size, long int date, int uid, 533 int gid, unsigned int mode, 534 const void *arg); 415 535 416 536 long int ar_scan (const char *archive, ar_member_func_t function, const void *arg); … … 426 546 void file_impossible (const char *); 427 547 const char *dir_name (const char *); 548 void print_dir_data_base (void); 549 void dir_setup_glob (glob_t *); 428 550 void hash_init_directories (void); 429 551 430 552 void define_default_variables (void); 553 void undefine_default_variables (void); 431 554 void set_default_suffixes (void); 432 555 void install_default_suffix_rules (void); … … 445 568 void child_access (void); 446 569 447 void close_stdout (void);448 449 570 char *strip_whitespace (const char **begpp, const char **endpp); 571 572 void show_goal_error (void); 450 573 451 574 /* String caching */ … … 454 577 int strcache_iscached (const char *str); 455 578 const char *strcache_add (const char *str); 456 const char *strcache_add_len (const char *str, int len); 457 int strcache_setbufsize (int size); 458 459 #ifdef HAVE_VFORK_H 460 # include <vfork.h> 461 #endif 579 const char *strcache_add_len (const char *str, unsigned int len); 580 581 /* Guile support */ 582 int guile_gmake_setup (const floc *flocp); 583 584 /* Loadable object support. Sets to the strcached name of the loaded file. */ 585 typedef int (*load_func_t)(const floc *flocp); 586 int load_file (const floc *flocp, const char **filename, int noerror); 587 void unload_file (const char *name); 462 588 463 589 /* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, … … 471 597 # endif 472 598 599 # ifdef HAVE_GETCWD 600 # if !defined(VMS) && !defined(__DECC) 601 char *getcwd (); 602 # endif 603 # else 604 char *getwd (); 605 # define getcwd(buf, len) getwd (buf) 606 # endif 607 473 608 #endif /* Not GNU C library or POSIX. */ 474 475 #ifdef HAVE_GETCWD476 # if !defined(VMS) && !defined(__DECC)477 char *getcwd ();478 # endif479 #else480 char *getwd ();481 # define getcwd(buf, len) getwd (buf)482 #endif483 609 484 610 #if !HAVE_STRCASECMP … … 504 630 #endif 505 631 506 extern const struct floc *reading_file; 507 extern const struct floc **expanding_var; 508 632 #define OUTPUT_SYNC_NONE 0 633 #define OUTPUT_SYNC_LINE 1 634 #define OUTPUT_SYNC_TARGET 2 635 #define OUTPUT_SYNC_RECURSE 3 636 637 /* Non-GNU systems may not declare this in unistd.h. */ 509 638 extern char **environ; 639 640 extern const floc *reading_file; 641 extern const floc **expanding_var; 642 643 extern unsigned short stopchar_map[]; 510 644 511 645 extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; … … 513 647 extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag; 514 648 extern int print_version_flag, print_directory_flag, check_symlink_flag; 515 extern int warn_undefined_variables_flag, posix_pedantic, not_parallel; 516 extern int second_expansion, clock_skew_detected, rebuilding_makefiles; 517 extern int one_shell; 649 extern int warn_undefined_variables_flag, trace_flag, posix_pedantic; 650 extern int not_parallel, second_expansion, clock_skew_detected; 651 extern int rebuilding_makefiles, one_shell, output_sync, verify_flag; 652 653 extern const char *default_shell; 518 654 519 655 /* can we run commands via 'sh -c xxx' or must we use batch files? */ … … 526 662 527 663 extern unsigned int job_slots; 528 extern int job_fds[2];529 extern int job_rfd;530 664 #ifndef NO_FLOAT 531 665 extern double max_load_average; … … 534 668 #endif 535 669 670 #ifdef WINDOWS32 536 671 extern char *program; 672 #else 673 extern const char *program; 674 #endif 675 676 #ifdef VMS 677 const char *vms_command (const char *argv0); 678 const char *vms_progname (const char *argv0); 679 680 void vms_exit (int); 681 # define _exit(foo) vms_exit(foo) 682 # define exit(foo) vms_exit(foo) 683 684 extern char *program_name; 685 686 void 687 set_program_name (const char *arv0); 688 689 int 690 need_vms_symbol (void); 691 692 int 693 create_foreign_command (const char *command, const char *image); 694 695 int 696 vms_export_dcl_symbol (const char *name, const char *value); 697 698 int 699 vms_putenv_symbol (const char *string); 700 701 void 702 vms_restore_symbol (const char *string); 703 704 #endif 705 706 void remote_setup (void); 707 void remote_cleanup (void); 708 int start_remote_job_p (int); 709 int start_remote_job (char **, char **, int, int *, int *, int *); 710 int remote_status (int *, int *, int *, int); 711 void block_remote_children (void); 712 void unblock_remote_children (void); 713 int remote_kill (int id, int sig); 714 void print_variable_data_base (void); 715 void print_vpath_data_base (void); 716 537 717 extern char *starting_directory; 538 718 extern unsigned int makelevel; … … 551 731 #endif 552 732 553 #ifdef VMS 554 # define MAKE_SUCCESS 1 555 # define MAKE_TROUBLE 2 556 # define MAKE_FAILURE 3 557 #else 558 # define MAKE_SUCCESS 0 559 # define MAKE_TROUBLE 1 560 # define MAKE_FAILURE 2 561 #endif 733 734 #define MAKE_SUCCESS 0 735 #define MAKE_TROUBLE 1 736 #define MAKE_FAILURE 2 562 737 563 738 /* Set up heap debugging library dmalloc. */
Note:
See TracChangeset
for help on using the changeset viewer.

