summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2011-02-24 15:25:43 -0800
committerRoland McGrath <roland@redhat.com>2011-02-24 15:25:43 -0800
commit2b5a3e13064be99a415c173422a06a6b77623bda (patch)
treef7ff9941b13a3581727939c0fef487103765f2e4
parent2cd13586ef3479b6ae2fe60486d6043f04b68af4 (diff)
downloadelfutils-2b5a3e13064be99a415c173422a06a6b77623bda.tar.gz
Make libdwP.h internal declarations C++-compatible.
-rw-r--r--libdw/ChangeLog4
-rw-r--r--libdw/libdwP.h21
2 files changed, 17 insertions, 8 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 1b85aebf..35baf27c 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -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):
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 8d49f501..58f3f908 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -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)