X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=binutils%2Fbucomm.h;h=48b2c50aced103b14d3313527a7871f31fdaeee5;hb=37870be8740a4f903a61d43e6c1adede415473a9;hp=a93c378994fa863a699e13d627e07bd916e822df;hpb=4b95cf5c0c75d6efc1b2f96af72317aecca079f1;p=binutils-gdb.git diff --git a/binutils/bucomm.h b/binutils/bucomm.h index a93c378994f..48b2c50aced 100644 --- a/binutils/bucomm.h +++ b/binutils/bucomm.h @@ -1,5 +1,5 @@ /* bucomm.h -- binutils common include file. - Copyright (C) 1991-2014 Free Software Foundation, Inc. + Copyright (C) 1991-2022 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,6 +21,8 @@ #ifndef _BUCOMM_H #define _BUCOMM_H +/* In bucomm.c. */ + /* Return the filename in a static buffer. */ const char *bfd_get_archive_filename (const bfd *); @@ -47,31 +49,43 @@ void list_supported_architectures (const char *, FILE *); int display_info (void); -void print_arelt_descr (FILE *, bfd *, bfd_boolean); +void print_arelt_descr (FILE *, bfd *, bool, bool); -char *make_tempname (char *); -char *make_tempdir (char *); +char *make_tempname (const char *, int *); +char *make_tempdir (const char *); bfd_vma parse_vma (const char *, const char *); off_t get_file_size (const char *); +bool is_valid_archive_path (char const *); + extern char *program_name; -/* filemode.c */ +/* In filemode.c. */ void mode_string (unsigned long, char *); -/* version.c */ +/* In version.c. */ extern void print_version (const char *); -/* rename.c */ +/* In rename.c. */ extern void set_times (const char *, const struct stat *); -extern int smart_rename (const char *, const char *, int); +extern int smart_rename (const char *, const char *, int, + struct stat *, bool); -/* libiberty. */ + +/* In libiberty. */ void *xmalloc (size_t); void *xrealloc (void *, size_t); +#if __GNUC__ >= 7 +#define _mul_overflow(a, b, res) __builtin_mul_overflow (a, b, res) +#else +/* Assumes unsigned values. Careful! Args evaluated multiple times. */ +#define _mul_overflow(a, b, res) \ + ((*res) = (a), (*res) *= (b), (b) != 0 && (*res) / (b) != (a)) +#endif + #endif /* _BUCOMM_H */