do not apply. */
#include "tconfig.h"
+
+/* We disable this when inhibit_libc, so that gcc can still be built without
+ needing header files first. */
+/* ??? This is not a good solution, since prototypes may be required in
+ some cases for correct code. See also libgcc2.c. */
+#ifndef inhibit_libc
+/* fixproto guarantees these system headers exist. */
+#include <stdlib.h>
+#include <unistd.h>
+#endif
+
#include "defaults.h"
#ifdef DWARF2_UNWIND_INFO
linear->count = j;
}
-/* This is O(n log(n)). */
+/* This is O(n log(n)). BSD/OS defines heapsort in stdlib.h, so we must
+ use a name that does not conflict. */
static inline void
-heapsort (fde_vector *erratic)
+frame_heapsort (fde_vector *erratic)
{
/* For a description of this algorithm, see:
Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
fde_split (&accu->linear, &accu->erratic);
if (accu->linear.count + accu->erratic.count != count)
abort ();
- heapsort (&accu->erratic);
+ frame_heapsort (&accu->erratic);
fde_merge (&accu->linear, &accu->erratic);
free (accu->erratic.array);
return accu->linear.array;
return p;
}
-/* Decode one instruction's worth of of DWARF 2 call frame information.
+/* Decode one instruction's worth of DWARF 2 call frame information.
Used by __frame_state_for. Takes pointers P to the instruction to
decode, STATE to the current register unwind information, INFO to the
current CIE information, and PC to the current PC value. Returns a