Don't include libbfd.h outside of bfd, part 1
[deliverable/binutils-gdb.git] / bfd / bfd-in2.h
index 3f2d93b03cd477222914058b88dd49a23268fb87..5fffc46c333aa1b9d6f4ed42254b2063644208e3 100644 (file)
@@ -263,7 +263,7 @@ struct orl                  /* Output ranlib.  */
   } u;                 /* bfd* or file position.  */
   int namidx;          /* Index into string table.  */
 };
-\f
+
 /* Linenumber stuff.  */
 typedef struct lineno_cache_entry
 {
@@ -277,11 +277,19 @@ typedef struct lineno_cache_entry
 alent;
 \f
 /* Object and core file sections.  */
+typedef struct bfd_section *sec_ptr;
 
 #define        align_power(addr, align)        \
   (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
 
-typedef struct bfd_section *sec_ptr;
+/* Align an address upward to a boundary, expressed as a number of bytes.
+   E.g. align to an 8-byte boundary with argument of 8.  Take care never
+   to wrap around if the address is within boundary-1 of the end of the
+   address space.  */
+#define BFD_ALIGN(this, boundary)                                        \
+  ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this))             \
+   ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
+   : ~ (bfd_vma) 0)
 
 #define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
 #define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
This page took 0.025979 seconds and 4 git commands to generate.