20+ years is long enough to warn.
* bfd-in.h (bfd_read, bfd_write): Don't define
(_bfd_warn_deprecated): Don't declare.
* bfd-in2.h: Regenerate.
* libbfd.c (_bfd_warn_deprecated): Delete.
extern int bfd_flush (bfd *);
extern int bfd_stat (bfd *, struct stat *);
-/* Deprecated old routines. */
-#if __GNUC__
-#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \
- bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \
- bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#else
-#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
- bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
- bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#endif
-extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
-
extern bool bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
extern int bfd_flush (bfd *);
extern int bfd_stat (bfd *, struct stat *);
-/* Deprecated old routines. */
-#if __GNUC__
-#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \
- bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \
- bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#else
-#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
- bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
- bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
-#endif
-extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
-
extern bool bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
return name[0] == locals_prefix;
}
-/* Give a warning at runtime if someone compiles code which calls
- old routines. */
-
-void
-_bfd_warn_deprecated (const char *what,
- const char *file,
- int line,
- const char *func)
-{
- /* Poor man's tracking of functions we've already warned about. */
- static size_t mask = 0;
-
- if (~(size_t) func & ~mask)
- {
- fflush (stdout);
- /* Note: separate sentences in order to allow
- for translation into other languages. */
- if (func)
- /* xgettext:c-format */
- fprintf (stderr, _("Deprecated %s called at %s line %d in %s\n"),
- what, file, line, func);
- else
- fprintf (stderr, _("Deprecated %s called\n"), what);
- fflush (stderr);
- mask |= ~(size_t) func;
- }
-}
-
/* Helper function for reading uleb128 encoded data. */
bfd_vma