Replace use of macros from sys/cdefs.h since cdefs.h is missing on musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate

Index: fts/fts.h
===================================================================
--- fts.orig/fts.h
+++ fts/fts.h
@@ -126,15 +126,21 @@ typedef struct _ftsent {
 	char fts_name[1];		/* file name */
 } FTSENT;
 
-#include <sys/cdefs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-__BEGIN_DECLS
-FTSENT	*fts_children __P((FTS *, int));
-int	 fts_close __P((FTS *));
-FTS	*fts_open __P((char * const *, int,
-	    int (*)(const FTSENT **, const FTSENT **)));
-FTSENT	*fts_read __P((FTS *));
-int	 fts_set __P((FTS *, FTSENT *, int));
-__END_DECLS
+#ifndef __P
+#define __P
+#endif
+FTSENT	*fts_children (FTS *p, int opts);
+int	 fts_close (FTS *p);
+FTS	*fts_open (char * const * path, int opts,
+	    int (*compfn)(const FTSENT **, const FTSENT **));
+FTSENT	*fts_read (FTS *p);
+int	 fts_set (FTS *p, FTSENT *f, int opts);
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* !_FTS_H_ */
Index: fts/fts.c
===================================================================
--- fts.orig/fts.c
+++ fts/fts.c
@@ -50,15 +50,15 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
 #include <string.h>
 #include <unistd.h>
 
-static FTSENT	*fts_alloc __P((FTS *, char *, int));
-static FTSENT	*fts_build __P((FTS *, int));
-static void	 fts_lfree __P((FTSENT *));
-static void	 fts_load __P((FTS *, FTSENT *));
-static size_t	 fts_maxarglen __P((char * const *));
-static void	 fts_padjust __P((FTS *, void *));
-static int	 fts_palloc __P((FTS *, size_t));
-static FTSENT	*fts_sort __P((FTS *, FTSENT *, int));
-static u_short	 fts_stat __P((FTS *, struct dirent *, FTSENT *, int));
+static FTSENT	*fts_alloc __P(FTS *, char *, int);
+static FTSENT	*fts_build __P(FTS *, int);
+static void	 fts_lfree __P(FTSENT *);
+static void	 fts_load __P(FTS *, FTSENT *);
+static size_t	 fts_maxarglen __P(char * const *);
+static void	 fts_padjust __P(FTS *, void *);
+static int	 fts_palloc __P(FTS *, size_t);
+static FTSENT	*fts_sort __P(FTS *, FTSENT *, int);
+static u_short	 fts_stat __P(FTS *, struct dirent *, FTSENT *, int);
 
 #define	ISDOT(a)	(a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
 
