Include ld-lib.exp from ctf-lib.exp
[binutils-gdb.git] / libctf / ctf-decls.h
index c840b793c9bdf8cb9983c42dd9f860f3c04a2e90..b9f960dbee0f990df6b6ac8db4328c977109200b 100644 (file)
@@ -1,5 +1,5 @@
 /* Declarations for missing functions.
-   Copyright (C) 2019 Free Software Foundation, Inc.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
    This file is part of libctf.
 
@@ -24,6 +24,7 @@
 
 #include <stddef.h>
 #include <stdlib.h>
+#include "libiberty.h"
 
 #if HAVE_QSORT_R_ARG_LAST
 static inline void
@@ -45,7 +46,7 @@ ctf_qsort_compar_thunk (void *arg, const void *a, const void *b)
 {
   struct ctf_qsort_arg *qsort_arg = (struct ctf_qsort_arg *) arg;
 
-  return qsort_arg->compar (a, b, arg);
+  return qsort_arg->compar (a, b, qsort_arg->arg);
 }
 
 static inline void
@@ -71,4 +72,8 @@ void ctf_qsort_r (void *base, size_t nmemb, size_t size,
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 
+#if !HAVE_DECL_STPCPY
+extern char *stpcpy (char *, const char *);
+#endif
+
 #endif /* _CTF_DECLS_H */