aboutsummaryrefslogtreecommitdiff
path: root/gas/as.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-12-20 22:42:03 +0000
committerKen Raeburn <raeburn@cygnus>1994-12-20 22:42:03 +0000
commit87e48495014d9a1d075e7c99aeb9cb29daccc796 (patch)
tree12f68295b61f65ec259118b7107e7b7ed9d9e418 /gas/as.h
parent0427f3ec1c0f0d356e6c1e4a91e8ff116f0c3ee8 (diff)
downloadgdb-87e48495014d9a1d075e7c99aeb9cb29daccc796.zip
gdb-87e48495014d9a1d075e7c99aeb9cb29daccc796.tar.gz
gdb-87e48495014d9a1d075e7c99aeb9cb29daccc796.tar.bz2
* frags.c (frag_init): Call obstack_begin on `frags'.
* subsegs.c (subsegs_begin): Don't do it here. * as.c (main): Call frag_init before subsegs_begin. * frags.c (frag_append_1_char): New function. * frags.h (frag_append_1_char): Declare it. (FRAG_APPEND_1_CHAR): Call it. Old definition is commented out for now. * as.h (struct frag): Added (but commented out) new fields for tracking current alignment. (frag_now_fix): Changed macro to function declaration. * frags.c (frag_now_fix): Define function here. (frag_new): Use it instead of accessing `frags' directly. * frags.h (frags): Change comment to indicate it shouldn't be accessed directly. * subsegs.h (struct frchain): New field frch_obstack, intended to eventually replace global `frags' obstack. * subsegs.c (subseg_set_rest): Use frag_now_fix instead of accessing `frags' directly. Initialize fields of new frchainS explicitly instead of with memset. * config/obj-coff.c (obj_coff_ln) [!BFD_ASSEMBLER]: Use frag_now_fix. * config/tc-mips.c (s_loc), config/obj-vms.c (vms_resolve_symbol_redef), symbols.c (colon): Likewise.
Diffstat (limited to 'gas/as.h')
-rw-r--r--gas/as.h57
1 files changed, 41 insertions, 16 deletions
diff --git a/gas/as.h b/gas/as.h
index 5c22488..0ed73b7 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -37,11 +37,16 @@
#include "config.h"
-/* This is the code recommended in the autoconf documentation --
+/* This is the code recommended in the autoconf documentation, almost
verbatim. If it doesn't work for you, let me know, and notify
djm@gnu.ai.mit.edu as well. */
+/* Added #undef for DJ Delorie. The right fix is to ensure that as.h
+ is included first, before even any system header files, in all files
+ that use it. KR 1994.11.03 */
+
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
+# undef alloca
# define alloca __builtin_alloca
#else
# if HAVE_ALLOCA_H
@@ -114,11 +119,8 @@ extern char *strdup (/* const char * */);
#include <bfd.h>
#endif
-#ifdef WANT_FOPEN_BIN
-#include "fopen-bin.h"
-#else
-#include "fopen-same.h"
-#endif
+/* Define the standard progress macros. */
+#include <progress.h>
/* This doesn't get taken care of anywhere. */
#if !defined (__GNUC__) && !defined (inline)
@@ -126,17 +128,20 @@ extern char *strdup (/* const char * */);
#endif
/* Other stuff from config.h. */
-#ifdef NEED_MALLOC_DECLARATION
+#ifdef NEED_DECLARATION_MALLOC
extern PTR malloc ();
extern PTR realloc ();
#endif
-#ifdef NEED_FREE_DECLARATION
+#ifdef NEED_DECLARATION_FREE
extern void free ();
#endif
+#ifdef NEED_DECLARATION_ERRNO
+extern int errno;
+#endif
/* This is needed for VMS. */
-#if ! defined (HAVE_UNLINK) && defined (HAVE_DELETE)
-#define unlink delete
+#if ! defined (HAVE_UNLINK) && defined (HAVE_REMOVE)
+#define unlink remove
#endif
#ifdef BFD_ASSEMBLER
@@ -398,6 +403,13 @@ struct frag
relax_stateT fr_type;
relax_substateT fr_subtype;
+#if 0 /* not yet */
+ /* Track the alignment and offset of the current frag. With this,
+ sometimes we can avoid creating new frags for .align directives. */
+ unsigned short align_mask;
+ unsigned short align_offset;
+#endif
+
/* These are needed only on the NS32K machines. But since we don't
include targ-cpu.h until after this structure has been defined,
we can't really conditionalize it. This code should be
@@ -421,7 +433,7 @@ typedef struct frag fragS;
included in frchain_now. The fr_fix field is bogus; instead, use:
obstack_next_free(&frags)-frag_now->fr_literal. */
COMMON fragS *frag_now;
-#define frag_now_fix() ((char*)obstack_next_free (&frags) - frag_now->fr_literal)
+extern int frag_now_fix ();
/* For foreign-segment symbol fixups. */
COMMON fragS zero_address_frag;
@@ -488,8 +500,20 @@ struct lineno_struct
typedef struct lineno_struct lineno;
#endif
-#if defined (__STDC__) && !defined(NO_STDARG)
+/* Prefer varargs for non-ANSI compiler, since some will barf if the
+ ellipsis definition is used with a no-arguments declaration. */
+#if defined (HAVE_VARARGS_H) && !defined (__STDC__)
+#undef HAVE_STDARG_H
+#endif
+
+#if defined (HAVE_STDARG_H)
+#define USE_STDARG
+#endif
+#if !defined (USE_STDARG) && defined (HAVE_VARARGS_H)
+#define USE_VARARGS
+#endif
+#ifdef USE_STDARG
#if __GNUC__ >= 2
/* for use with -Wformat */
#define PRINTF_LIKE(FCN) void FCN (const char *format, ...) \
@@ -498,11 +522,12 @@ typedef struct lineno_struct lineno;
const char *format, ...) \
__attribute__ ((format (printf, 3, 4)))
#else /* ANSI C with stdarg, but not GNU C */
-#define PRINTF_LIKE(FCN) void FCN (const char *format, ...)
-#define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, unsigned int line, \
- const char *format, ...)
+#define PRINTF_LIKE(FCN) void FCN PARAMS ((const char *format, ...))
+#define PRINTF_WHERE_LIKE(FCN) void FCN PARAMS ((char *file, \
+ unsigned int line, \
+ const char *format, ...))
#endif
-#else /* not ANSI C, or not stdarg */
+#else /* not using stdarg */
#define PRINTF_LIKE(FCN) void FCN ()
#define PRINTF_WHERE_LIKE(FCN) void FCN ()
#endif