@B fix compatibilty issues for VC

This commit is contained in:
bebbo 2017-02-06 15:04:37 +01:00
parent 78fa84d0b7
commit b9511c9413
21 changed files with 51 additions and 30 deletions

View File

@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#define TARGETNAME "a.out-amiga"
#define MACHTYPE_OK(m) ((m)==M_UNKNOWN || (m)==M_68010 || (m)==M_68020)
#define TARGET_IS_BIG_ENDIAN_P

View File

@ -118,6 +118,7 @@ DESCRIPTION
#define KEEPIT udata.i
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "safe-ctype.h"
@ -998,7 +999,7 @@ adjust_z_magic (abfd, execp)
text_pad = ((obj_textsec (abfd)->filepos - obj_textsec (abfd)->vma)
& (adata (abfd).page_size - 1));
else
text_pad = ((- obj_textsec (abfd)->vma)
text_pad = ((- (long)obj_textsec (abfd)->vma)
& (adata (abfd).page_size - 1));
}
@ -4727,7 +4728,7 @@ aout_link_write_other_symbol (h, data)
H_PUT_16 (output_bfd, 0, outsym.e_desc);
indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string,
FALSE);
if (indx == - (bfd_size_type) 1)
if (indx == - (long)(bfd_size_type) 1)
{
/* FIXME: No way to handle errors. */
abort ();

View File

@ -127,6 +127,7 @@ DESCRIPTION
" 18 " - Long name 18 characters long, extended pseudo-BSD.
*/
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
@ -625,7 +626,7 @@ bfd_generic_archive_p (abfd)
struct artdata *tdata_hold;
char armag[SARMAG + 1];
bfd_size_type amt;
printf("bfd_generic_archive_p\n");
if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG)
{
if (bfd_get_error () != bfd_error_system_call)

View File

@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
the file. objcopy cooperates by specially setting the start
address to zero by default. */
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "safe-ctype.h"

View File

@ -40,10 +40,16 @@ SECTION
*/
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#ifdef DEBUGPRINT
#define DBGPRINT(a) printf a
#else
#define DBGPRINT(a)
/* IMPORT from targets.c. */
extern const size_t _bfd_target_vector_entries;
@ -230,8 +236,9 @@ bfd_check_format_matches (abfd, format, matching)
_bfd_check_format might have this problem. */
bfd_set_error (bfd_error_wrong_format);
temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd));
DBGPRINT(("%s using %s: %p\n", abfd->filename, abfd->xvec->name, abfd->xvec->_bfd_check_format));
temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd));
DBGPRINT(("%s using %s: %p -> %p\n", abfd->filename, abfd->xvec->name, abfd->xvec->_bfd_check_format, temp));
if (temp)
{
/* This format checks out as ok! */

View File

@ -119,6 +119,7 @@ The MRI compiler uses this, which is a repeat of type 5:
20..21 Carriage return, line feed
*/
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
@ -366,12 +367,12 @@ ihex_scan (abfd)
chksum = len + addr + (addr >> 8) + type;
for (i = 0; i < len; i++)
chksum += HEX2 (buf + 2 * i);
if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i))
if (((- (int)chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i))
{
(*_bfd_error_handler)
(_("%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"),
bfd_archive_filename (abfd), lineno,
(- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
(- (int)chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
@ -788,7 +789,7 @@ ihex_write_record (abfd, count, addr, type, data)
chksum += *data;
}
TOHEX (p, (- chksum) & 0xff);
TOHEX (p, (- (int)chksum) & 0xff);
p[2] = '\r';
p[3] = '\n';

View File

@ -916,7 +916,7 @@ space consuming. For each target:
case -2:
{
long x = bfd_get_32 (abfd, (bfd_byte *) data + octets);
relocation = -relocation;
relocation = -(long)relocation;
DOIT (x);
bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets);
}
@ -925,7 +925,7 @@ space consuming. For each target:
case -1:
{
long x = bfd_get_16 (abfd, (bfd_byte *) data + octets);
relocation = -relocation;
relocation = -(long)relocation;
DOIT (x);
bfd_put_16 (abfd, (bfd_vma) x, (bfd_byte *) data + octets);
}
@ -1300,7 +1300,7 @@ space consuming. For each target:
case -2:
{
long x = bfd_get_32 (abfd, (bfd_byte *) data);
relocation = -relocation;
relocation = -(long)relocation;
DOIT (x);
bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data);
}
@ -1409,7 +1409,7 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
/* If the size is negative, negate RELOCATION. This isn't very
general. */
if (howto->size < 0)
relocation = -relocation;
relocation = -(long)relocation;
/* Get the value we are going to relocate. */
size = bfd_get_reloc_size (howto);

View File

@ -104,6 +104,7 @@ DESCRIPTION
*/
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"

View File

@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "bfd.h"
#define ARCH_SIZE 32 /* Value doesn't matter. */

View File

@ -67,6 +67,7 @@ The data can come out of order, and may be discontigous. This is a
serial protocol, so big files are unlikely, so we keep a list of 8k chunks
*/
#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"

View File

@ -12,12 +12,12 @@
the application unable to be configured for both "same" and "binary"
variant systems. */
#define FOPEN_RB "r"
#define FOPEN_WB "w"
#define FOPEN_AB "a"
#define FOPEN_RUB "r+"
#define FOPEN_WUB "w+"
#define FOPEN_AUB "a+"
#define FOPEN_RB "rb"
#define FOPEN_WB "wb"
#define FOPEN_AB "ab"
#define FOPEN_RUB "r+b"
#define FOPEN_WUB "w+b"
#define FOPEN_AUB "a+b"
#define FOPEN_RT "r"
#define FOPEN_WT "w"

View File

@ -307,7 +307,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp)
case '-':
make_abs (&result);
result.value = -result.value;
result.value = -(long)result.value;
break;
case NEXT:
@ -668,7 +668,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
bfd_vma dot;
bfd_vma *dotp;
{
etree_value_type result;
etree_value_type result = { 0, 0, 0, 0 };
if (tree == NULL)
{

View File

@ -3377,7 +3377,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax,
a page could be saved in the data segment. */
bfd_vma first, last;
first = -exp_data_seg.base & (exp_data_seg.pagesize - 1);
first = -(long)exp_data_seg.base & (exp_data_seg.pagesize - 1);
last = exp_data_seg.end & (exp_data_seg.pagesize - 1);
if (first && last
&& ((exp_data_seg.base & ~(exp_data_seg.pagesize - 1))

View File

@ -14,7 +14,7 @@
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
#include "config.h"
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>

View File

@ -50,6 +50,10 @@ components will be simplified. The returned value will be allocated using
#include <string.h>
#endif
#ifndef DIR_SEPARATOR_S
#define DIR_SEPARATOR_S "/"
#endif
/* On GNU libc systems the declaration is only visible with _GNU_SOURCE. */
#if defined(HAVE_CANONICALIZE_FILE_NAME) \
&& defined(NEED_DECLARATION_CANONICALIZE_FILE_NAME)
@ -113,7 +117,7 @@ lrealpath (filename)
#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H)
{
/* Find out the max path size. */
long path_max = pathconf ("/", _PC_PATH_MAX);
long path_max = pathconf (DIR_SEPARATOR_S, _PC_PATH_MAX);
if (path_max > 0)
{
/* PATH_MAX is bounded. */

View File

@ -67,6 +67,7 @@ pwait (pid, status, flags)
{
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
int pid = wait (status);
//int
pid = wait (status);
return pid;
}

View File

@ -132,7 +132,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
char * const *argv;
const char *this_pname;
const char *temp_base;
char **errmsg_fmt, **errmsg_arg;
const char **errmsg_fmt, **errmsg_arg;
int flags;
{
int pid;

View File

@ -152,7 +152,7 @@ physmem_total ()
#if defined _WIN32
{ /* this works on windows */
PFN_MS_EX pfnex;
HMODULE h = GetModuleHandle ("kernel32.dll");
HMODULE h = GetModuleHandleA ("kernel32.dll");
if (!h)
return 0.0;
@ -253,7 +253,7 @@ physmem_available ()
#if defined _WIN32
{ /* this works on windows */
PFN_MS_EX pfnex;
HMODULE h = GetModuleHandle ("kernel32.dll");
HMODULE h = GetModuleHandleA ("kernel32.dll");
if (!h)
return 0.0;

View File

@ -12,10 +12,10 @@ exists, it is removed.
*/
#include "ansidecl.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ansidecl.h"
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>

View File

@ -11,7 +11,7 @@ not be used in new projects. Use @code{mkstemp} instead.
@end deftypefn
*/
#include "config.h"
#include <stdio.h>
#ifndef L_tmpnam

View File

@ -13,10 +13,10 @@ will never return a @code{NULL} pointer.
*/
#include "config.h"
#include <stdio.h>
#include "libiberty.h"
#include "config.h"
#ifdef VMS
#include <errno.h>