Changeset 903 for trunk/src/gmakenew/make.h
- Timestamp:
- May 23, 2007, 7:31:19 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmakenew/make.h
r803 r903 39 39 #endif 40 40 41 42 /* Use prototypes if available. */43 #if defined (__cplusplus) || defined (__STDC__) || defined WINDOWS32 /* bird: protos on windows */44 # undef PARAMS45 # define PARAMS(protos) protos46 #else /* Not C++ or ANSI C. */47 # undef PARAMS48 # define PARAMS(protos) ()49 #endif /* C++ or ANSI C. */50 41 51 42 /* Specify we want GNU source code. This must be defined before any … … 151 142 # define NEED_GET_PATH_MAX 1 152 143 # define GET_PATH_MAX (get_path_max ()) 153 # define PATH_VAR(var) char *var = (char *)alloca (GET_PATH_MAX)154 extern unsigned int get_path_max PARAMS ((void));144 # define PATH_VAR(var) char *var = alloca (GET_PATH_MAX) 145 unsigned int get_path_max (void); 155 146 #endif 156 147 … … 228 219 # include <stdlib.h> 229 220 # else 230 extern char *malloc PARAMS ((int));231 extern char *realloc PARAMS ((char *, int));232 extern void free PARAMS ((char *));233 234 extern void abort PARAMS ((void)) __attribute__ ((noreturn));235 extern void exit PARAMS ((int)) __attribute__ ((noreturn));221 void *malloc (int); 222 void *realloc (void *, int); 223 void free (void *); 224 225 void abort (void) __attribute__ ((noreturn)); 226 void exit (int) __attribute__ ((noreturn)); 236 227 # endif /* HAVE_STDLIB_H. */ 237 228 … … 243 234 #endif 244 235 #ifndef EXIT_FAILURE 245 # define EXIT_FAILURE 0 246 #endif 247 248 #ifdef ANSI_STRING 249 250 # ifndef bcmp 251 # define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) 252 # endif 253 # ifndef bzero 254 # define bzero(s, n) memset ((s), 0, (n)) 255 # endif 256 # if defined(HAVE_MEMMOVE) && !defined(bcopy) 257 # define bcopy(s, d, n) memmove ((d), (s), (n)) 258 # endif 259 260 #else /* Not ANSI_STRING. */ 261 262 # ifndef HAVE_STRCHR 263 # define strchr(s, c) index((s), (c)) 264 # define strrchr(s, c) rindex((s), (c)) 265 # endif 266 267 # ifndef bcmp 268 extern int bcmp PARAMS ((const char *, const char *, int)); 269 # endif 270 # ifndef bzero 271 extern void bzero PARAMS ((char *, int)); 272 #endif 273 # ifndef bcopy 274 extern void bcopy PARAMS ((const char *b1, char *b2, int)); 275 # endif 236 # define EXIT_FAILURE 1 237 #endif 238 239 #ifndef ANSI_STRING 276 240 277 241 /* SCO Xenix has a buggy macro definition in <string.h>. */ 278 242 #undef strerror 279 243 #if !defined(__DECC) 280 extern char *strerror PARAMS ((int errnum));244 char *strerror (int errnum); 281 245 #endif 282 246 … … 290 254 291 255 #if !defined(HAVE_STRSIGNAL) 292 extern char *strsignal PARAMS ((int signum));256 char *strsignal (int signum); 293 257 #endif 294 258 … … 309 273 (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) 310 274 # ifdef HAVE_CASE_INSENSITIVE_FS 311 /* This is only used on Windows/DOS platforms, so we assume strcmpi(). */312 275 # define strieq(a, b) \ 313 276 ((a) == (b) \ 314 277 || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \ 315 && (*(a) == '\0' || !strc mpi((a) + 1, (b) + 1))))278 && (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1)))) 316 279 # else 317 280 # define strieq(a, b) streq(a, b) … … 323 286 #endif 324 287 #define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) 325 #ifdef VMS326 extern int strcmpi (const char *,const char *);327 #endif328 288 329 289 #if defined(__GNUC__) || defined(ENUM_BITFIELDS) … … 348 308 349 309 /* Handle other OSs. */ 350 #if defined(HAVE_DOS_PATHS) 351 # define PATH_SEPARATOR_CHAR ';' 352 #elif defined(VMS) 353 # define PATH_SEPARATOR_CHAR ',' 354 #else 355 # define PATH_SEPARATOR_CHAR ':' 356 #endif 357 358 /* This is needed for getcwd() and chdir(). */ 359 #if defined(_MSC_VER) || defined(__BORLANDC__) 310 #ifndef PATH_SEPARATOR_CHAR 311 # if defined(HAVE_DOS_PATHS) 312 # define PATH_SEPARATOR_CHAR ';' 313 # elif defined(VMS) 314 # define PATH_SEPARATOR_CHAR ',' 315 # else 316 # define PATH_SEPARATOR_CHAR ':' 317 # endif 318 #endif 319 320 /* This is needed for getcwd() and chdir(), on some W32 systems. */ 321 #if defined(HAVE_DIRECT_H) 360 322 # include <direct.h> 361 323 #endif … … 364 326 # include <fcntl.h> 365 327 # include <malloc.h> 366 # define pipe( p) _pipe(p, 512, O_BINARY)367 # define kill( pid,sig) w32_kill(pid,sig)368 369 extern void sync_Path_environment(void);370 extern int kill(int pid, int sig); 371 extern char *end_of_token_w32(char *s, char stopchar);372 extern int find_and_set_default_shell(char *token);328 # define pipe(_p) _pipe((_p), 512, O_BINARY) 329 # define kill(_pid,_sig) w32_kill((_pid),(_sig)) 330 331 void sync_Path_environment (void); 332 int w32_kill (int pid, int sig); /* bird kill -> w32_kill - macro acquired () on the args. */ 333 char *end_of_token_w32 (const char *s, char stopchar); 334 int find_and_set_default_shell (const char *token); 373 335 374 336 /* indicates whether or not we have Bourne shell */ … … 400 362 401 363 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 402 externvoid message (int prefix, const char *fmt, ...)403 404 externvoid error (const struct floc *flocp, const char *fmt, ...)405 406 externvoid fatal (const struct floc *flocp, const char *fmt, ...)364 void message (int prefix, const char *fmt, ...) 365 __attribute__ ((__format__ (__printf__, 2, 3))); 366 void error (const struct floc *flocp, const char *fmt, ...) 367 __attribute__ ((__format__ (__printf__, 2, 3))); 368 void fatal (const struct floc *flocp, const char *fmt, ...) 407 369 __attribute__ ((noreturn, __format__ (__printf__, 2, 3))); 408 370 #else 409 externvoid message ();410 externvoid error ();411 externvoid fatal ();412 #endif 413 414 extern void die PARAMS ((int)) __attribute__ ((noreturn));415 extern void log_working_directory PARAMS ((int));416 extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn));417 extern void perror_with_name PARAMS ((const char *, const char *));418 extern char *savestring PARAMS ((const char *, unsigned int));419 extern char *concat PARAMS ((const char *, const char *, const char *));420 extern char *xmalloc PARAMS ((unsigned int));421 extern char *xrealloc PARAMS ((char *, unsigned int));422 extern char *xstrdup PARAMS ((const char *));423 extern char *find_next_token PARAMS ((char **, unsigned int *));424 extern char *next_token PARAMS ((const char *));425 extern char *end_of_token PARAMS ((const char *));426 extern void collapse_continuations PARAMS ((char *));371 void message (); 372 void error (); 373 void fatal (); 374 #endif 375 376 void die (int) __attribute__ ((noreturn)); 377 void log_working_directory (int); 378 void pfatal_with_name (const char *) __attribute__ ((noreturn)); 379 void perror_with_name (const char *, const char *); 380 char *savestring (const char *, unsigned int); 381 char *concat (const char *, const char *, const char *); 382 void *xmalloc (unsigned int); 383 void *xrealloc (void *, unsigned int); 384 char *xstrdup (const char *); 385 char *find_next_token (const char **, unsigned int *); 386 char *next_token (const char *); 387 char *end_of_token (const char *); 388 void collapse_continuations (char *); 427 389 #ifdef CONFIG_WITH_OPTIMIZATION_HACKS /* memchr is usually compiler intrinsic, thus faster. */ 428 #define lindex(s, limit, c) ((char *)memchr((s), (c), (limit) - (s))) 429 #else 430 extern char *lindex PARAMS ((const char *, const char *, int)); 431 #endif 432 extern int alpha_compare PARAMS ((const void *, const void *)); 433 extern void print_spaces PARAMS ((unsigned int)); 434 extern char *find_percent PARAMS ((char *)); 435 extern FILE *open_tmpfile PARAMS ((char **, const char *)); 390 # define lindex(s, limit, c) ((char *)memchr((s), (c), (limit) - (s))) 391 #else 392 char *lindex (const char *, const char *, int); 393 #endif 394 int alpha_compare (const void *, const void *); 395 void print_spaces (unsigned int); 396 char *find_percent (char *); 397 const char *find_percent_cached (const char **); 398 FILE *open_tmpfile (char **, const char *); 436 399 437 400 #ifndef NO_ARCHIVES 438 extern int ar_name PARAMS ((char *)); 439 extern void ar_parse_name PARAMS ((char *, char **, char **)); 440 extern int ar_touch PARAMS ((char *)); 441 extern time_t ar_member_date PARAMS ((char *)); 442 #endif 443 444 extern int dir_file_exists_p PARAMS ((char *, char *)); 445 extern int file_exists_p PARAMS ((char *)); 446 extern int file_impossible_p PARAMS ((char *)); 447 extern void file_impossible PARAMS ((char *)); 448 extern char *dir_name PARAMS ((char *)); 449 extern void hash_init_directories PARAMS ((void)); 450 451 extern void define_default_variables PARAMS ((void)); 452 extern void set_default_suffixes PARAMS ((void)); 453 extern void install_default_suffix_rules PARAMS ((void)); 454 extern void install_default_implicit_rules PARAMS ((void)); 455 456 extern void build_vpath_lists PARAMS ((void)); 457 extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath)); 458 extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr)); 459 extern int gpath_search PARAMS ((char *file, unsigned int len)); 460 461 extern void construct_include_path PARAMS ((char **arg_dirs)); 462 463 extern void user_access PARAMS ((void)); 464 extern void make_access PARAMS ((void)); 465 extern void child_access PARAMS ((void)); 466 467 extern void close_stdout PARAMS ((void)); 468 469 extern char *strip_whitespace PARAMS ((const char **begpp, const char **endpp)); 401 int ar_name (const char *); 402 void ar_parse_name (const char *, char **, char **); 403 int ar_touch (const char *); 404 time_t ar_member_date (const char *); 405 406 typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated, 407 long int hdrpos, long int datapos, 408 long int size, long int date, int uid, 409 int gid, int mode, const void *arg); 410 411 long int ar_scan (const char *archive, ar_member_func_t function, const void *arg); 412 int ar_name_equal (const char *name, const char *mem, int truncated); 413 #ifndef VMS 414 int ar_member_touch (const char *arname, const char *memname); 415 #endif 416 #endif 417 418 int dir_file_exists_p (const char *, const char *); 419 int file_exists_p (const char *); 420 int file_impossible_p (const char *); 421 void file_impossible (const char *); 422 const char *dir_name (const char *); 423 void hash_init_directories (void); 424 425 void define_default_variables (void); 426 void set_default_suffixes (void); 427 void install_default_suffix_rules (void); 428 void install_default_implicit_rules (void); 429 430 void build_vpath_lists (void); 431 void construct_vpath_list (char *pattern, char *dirpath); 432 const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr); 433 int gpath_search (const char *file, unsigned int len); 434 435 void construct_include_path (const char **arg_dirs); 436 437 void user_access (void); 438 void make_access (void); 439 void child_access (void); 440 441 void close_stdout (void); 442 443 char *strip_whitespace (const char **begpp, const char **endpp); 470 444 471 445 /* String caching */ 472 extern void strcache_init PARAMS ((void));473 extern void strcache_print_stats PARAMS ((const char *prefix));474 extern int strcache_iscached PARAMS ((const char *str));475 extern const char *strcache_add PARAMS ((const char *str));476 extern const char *strcache_add_len PARAMS ((const char *str, int len));477 extern int strcache_setbufsize PARAMS ((int size));446 void strcache_init (void); 447 void strcache_print_stats (const char *prefix); 448 int strcache_iscached (const char *str); 449 const char *strcache_add (const char *str); 450 const char *strcache_add_len (const char *str, int len); 451 int strcache_setbufsize (int size); 478 452 479 453 #ifdef HAVE_VFORK_H … … 486 460 #if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) 487 461 488 externlong int atol ();462 long int atol (); 489 463 # ifndef VMS 490 externlong int lseek ();464 long int lseek (); 491 465 # endif 492 466 … … 494 468 495 469 #ifdef HAVE_GETCWD 496 # if !defined(VMS) && !defined(__DECC) && !defined(_MSC_VER) 497 externchar *getcwd ();498 # endif 499 #else 500 externchar *getwd ();470 # if !defined(VMS) && !defined(__DECC) && !defined(_MSC_VER) /* bird: MSC */ 471 char *getcwd (); 472 # endif 473 #else 474 char *getwd (); 501 475 # define getcwd(buf, len) getwd (buf) 476 #endif 477 478 #if !HAVE_STRCASECMP 479 # if HAVE_STRICMP 480 # define strcasecmp stricmp 481 # elif HAVE_STRCMPI 482 # define strcasecmp strcmpi 483 # else 484 /* Create our own, in misc.c */ 485 int strcasecmp (const char *s1, const char *s2); 486 # endif 502 487 #endif 503 488 … … 505 490 extern const struct floc **expanding_var; 506 491 507 #if !defined(_MSC_VER) 492 #if !defined(_MSC_VER) /* bird */ 508 493 extern char **environ; 509 494 #endif … … 522 507 extern int batch_mode_shell; 523 508 509 extern char cmd_prefix; 510 524 511 extern unsigned int job_slots; 525 512 extern int job_fds[2]; … … 573 560 #endif 574 561 575 576 562 #ifdef __EMX__ 577 # if !HAVE_STRCASECMP578 # define strcasecmp stricmp579 # endif580 581 563 # if !defined chdir 582 564 # define chdir _chdir2 … … 617 599 to do it ourselves here. */ 618 600 619 #define ENULLLOOP(_v,_c) do{ errno = 0; \ 620 while (((_v)=_c)==0 && errno==EINTR); }while(0) 601 #define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \ 602 while((_v)==0 && errno==EINTR) 603 621 604 622 605 #if defined(__EMX__) && defined(CONFIG_WITH_OPTIMIZATION_HACKS) /* bird: saves 40-100ms on libc. */
Note:
See TracChangeset
for help on using the changeset viewer.