X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=binutils%2Fbin2c.c;h=ae8994ed15e1e52e6deedd3e1c8a073699c80c7c;hb=21af24c8371a3e040f6f548ddfafb20114442c28;hp=b3138e1f7413d58e79c2e256344d096821dd793a;hpb=417ed8af836c10ff5c0cbcdc4c011f5024a7269b;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/bin2c.c b/binutils/bin2c.c index b3138e1f74..ae8994ed15 100644 --- a/binutils/bin2c.c +++ b/binutils/bin2c.c @@ -1,5 +1,5 @@ /* bin2c.c -- dump binary file in hex format - Copyright 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,33 +18,9 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "sysdep.h" -#include "bfd.h" -#include "bucomm.h" - -#if !defined O_TEXT && defined _O_TEXT - /* For MSC-compatible compilers. */ -# define O_TEXT _O_TEXT -#endif - -#ifdef __BEOS__ - /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ -# undef O_BINARY -# undef O_TEXT -#endif - -#if O_BINARY -# ifndef __DJGPP__ -# define setmode _setmode -# define fileno(_fp) _fileno (_fp) -# endif /* not DJGPP */ -# define SET_BINARY(_f) \ - do { if (!isatty (_f)) setmode (_f, O_BINARY); } while (0) -#else -# define SET_BINARY(f) (void) 0 -# define O_BINARY 0 -# define O_TEXT 0 -#endif /* O_BINARY */ +#include +#include +#include "binary-io.h" int main (int argc, char *argv[]) @@ -52,19 +28,9 @@ main (int argc, char *argv[]) int c; int i; -#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) - setlocale (LC_MESSAGES, ""); -#endif -#if defined (HAVE_SETLOCALE) - setlocale (LC_CTYPE, ""); -#endif - bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); - if (argc != 1) { int ishelp = 0; - int isvers = 0; FILE *stream; if (argc == 2 && argv[1][0] == '-') @@ -73,15 +39,11 @@ main (int argc, char *argv[]) if (*opt == '-') ++opt; ishelp = *opt == 'h' || *opt == 'H'; - isvers = *opt == 'v' || *opt == 'V'; } - if (isvers) - print_version ("bin2c"); - stream = ishelp ? stdout : stderr; - fprintf (stream, _("Usage: %s < input_file > output_file\n"), argv[0]); - fprintf (stream, _("Prints bytes from stdin in hex format.\n")); + fprintf (stream, "Usage: %s < input_file > output_file\n", argv[0]); + fprintf (stream, "Prints bytes from stdin in hex format.\n"); exit (!ishelp); }