]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Make libdwP.h internal declarations C++-compatible.
authorRoland McGrath <roland@redhat.com>
Thu, 24 Feb 2011 23:25:43 +0000 (15:25 -0800)
committerRoland McGrath <roland@redhat.com>
Thu, 24 Feb 2011 23:25:43 +0000 (15:25 -0800)
libdw/ChangeLog
libdw/libdwP.h

index 1b85aebfc5101901cee6facee44fa22de60a65ab..35baf27c7b8818a0402b3230afbfc1c90d6b302d 100644 (file)
@@ -1,3 +1,7 @@
+2011-02-24  Roland McGrath  <roland@redhat.com>
+
+       * libdwP.h: Make declarations C++-compatible using __BEGIN_DECLS.
+
 2011-02-23  Roland McGrath  <roland@redhat.com>
 
        * c++/dwarf-knowledge.cc (expected_value_space):
index 8d49f5016cf216edfd35d621e34743262ccbd115..58f3f9089b86494bf7c92791f133edd5212a88e6 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal definitions for libdwarf.
-   Copyright (C) 2002-2010 Red Hat, Inc.
+   Copyright (C) 2002-2011 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -353,6 +353,8 @@ struct Dwarf_Macro_s
 };
 
 
+__BEGIN_DECLS
+
 /* We have to include the file at this point because the inline
    functions access internals of the Dwarf structure.  */
 #include "memory-access.h"
@@ -471,7 +473,6 @@ extern Dwarf_Die *__libdw_offdie (Dwarf *dbg, Dwarf_Off offset,
 extern int __dwarf_errno_internal (void);
 
 
-#ifndef __cplusplus
 /* Reader hooks.  */
 
 /* Relocation hooks return -1 on error (in that case the error code
@@ -535,8 +536,10 @@ __libdw_in_section (Dwarf *dbg, int sec_index,
   Elf_Data *data = __libdw_checked_get_data (dbg, sec_index);
   if (data == NULL)
     return false;
-  if (unlikely (addr < data->d_buf)
-      || unlikely (data->d_size - (addr - data->d_buf) < size))
+  if (unlikely ((const char *) addr < (const char *) data->d_buf)
+      || unlikely (data->d_size - ((const char *) addr
+                                  - (const char *) data->d_buf)
+                  < size))
     {
       __libdw_seterrno (DWARF_E_INVALID_OFFSET);
       return false;
@@ -615,11 +618,10 @@ int __libdw_read_begin_end_pair_inc (Dwarf *dbg, int sec_index,
                                     Dwarf_Addr *basep)
   internal_function;
 
-unsigned char * __libdw_formptr (Dwarf_Attribute *attr, int sec_index,
-                                int err_nodata, unsigned char **endpp,
-                                Dwarf_Off *offsetp)
+unsigned char *__libdw_formptr (Dwarf_Attribute *attr, int sec_index,
+                               int err_nodata, unsigned char **endpp,
+                               Dwarf_Off *offsetp)
   internal_function;
-#endif /* Not C++ */
 
 static inline size_t
 cu_sec_idx (struct Dwarf_CU *cu)
@@ -634,6 +636,9 @@ cu_data (struct Dwarf_CU *cu)
 }
 
 
+__END_DECLS
+
+
 /* Aliases to avoid PLTs.  */
 INTDECL (dwarf_aggregate_size)
 INTDECL (dwarf_attr)