浏览代码

Remove function declartions from include/features.h, create
a separate header file for those, and fixup references.
-Erik

Eric Andersen 23 年之前
父节点
当前提交
3d9e386284

+ 1 - 14
include/features.h

@@ -384,7 +384,7 @@ uClibc was built without large file support enabled.
 #  define strong_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define strong_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define weak_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define weak_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define _strong_alias(name, aliasname) \
 #  define _strong_alias(name, aliasname) \
-	__asm__(".global _" #aliasname "\n.set _" #aliasname ",_" #name);
+	__asm__(".global " #aliasname "\n.set " #aliasname "," #name);
 #  define link_warning(symbol, msg) \
 #  define link_warning(symbol, msg) \
 	asm (".stabs \"" msg "\",30,0,0,0\n\t" \
 	asm (".stabs \"" msg "\",30,0,0,0\n\t" \
 	      ".stabs \"" #symbol "\",1,0,0,0\n");
 	      ".stabs \"" #symbol "\",1,0,0,0\n");
@@ -417,19 +417,6 @@ uClibc was built without large file support enabled.
 /* --- this is added to integrate linuxthreads */
 /* --- this is added to integrate linuxthreads */
 #define __USE_UNIX98            1
 #define __USE_UNIX98            1
 
 
-/* For want of a better place, here are some function prototypes
- * for things from libc/misc/internals */
-#define	__need_size_t
-#include <stddef.h>
-extern int __path_search (char *tmpl, size_t tmpl_len, const char *dir, 
-	        const char *pfx, int try_tmpdir);
-extern int __gen_tempname (char *__tmpl, int __kind);
-/* The __kind argument to __gen_tempname may be one of: */
-#define __GT_FILE     0       /* create a file */
-#define __GT_BIGFILE  1       /* create a file, using open64 */
-#define __GT_DIR      2       /* create a directory */
-#define __GT_NOCREATE 3       /* just find a name not currently in use */
-
 #endif /* _LIBC only stuff */
 #endif /* _LIBC only stuff */
 
 
 
 

+ 1 - 0
libc/misc/internals/tempname.c

@@ -33,6 +33,7 @@
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/time.h>
+#include "tempname.h"
 
 
 
 
 /* Return nonzero if DIR is an existent directory.  */
 /* Return nonzero if DIR is an existent directory.  */

+ 16 - 0
libc/misc/internals/tempname.h

@@ -0,0 +1,16 @@
+#ifndef __TEMPNAME_H__ 
+#define __TEMPNAME_H__
+
+#define	__need_size_t
+#include <stddef.h>
+extern int __path_search (char *tmpl, size_t tmpl_len, const char *dir, 
+	        const char *pfx, int try_tmpdir);
+extern int __gen_tempname (char *__tmpl, int __kind);
+
+/* The __kind argument to __gen_tempname may be one of: */
+#define __GT_FILE     0       /* create a file */
+#define __GT_BIGFILE  1       /* create a file, using open64 */
+#define __GT_DIR      2       /* create a directory */
+#define __GT_NOCREATE 3       /* just find a name not currently in use */
+
+#endif

+ 1 - 0
libc/stdio/tempnam.c

@@ -18,6 +18,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>
+#include "../misc/internals/tempname.h"
 
 
 /* Generate a unique temporary filename using up to five characters of PFX
 /* Generate a unique temporary filename using up to five characters of PFX
    if it is not NULL.  The directory to put this file in is searched for
    if it is not NULL.  The directory to put this file in is searched for

+ 1 - 0
libc/stdio/tmpfile.c

@@ -19,6 +19,7 @@
 #include <features.h>
 #include <features.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <unistd.h>
+#include "../misc/internals/tempname.h"
 
 
 /* This returns a new stream opened on a temporary file (generated
 /* This returns a new stream opened on a temporary file (generated
    by tmpnam).  The file is opened with mode "w+b" (binary read/write).
    by tmpnam).  The file is opened with mode "w+b" (binary read/write).

+ 1 - 0
libc/stdio/tmpnam.c

@@ -18,6 +18,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>
+#include "../misc/internals/tempname.h"
 
 
 static char tmpnam_buffer[L_tmpnam];
 static char tmpnam_buffer[L_tmpnam];
 
 

+ 1 - 0
libc/stdio/tmpnam_r.c

@@ -17,6 +17,7 @@
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
 #include <stdio.h>
 #include <stdio.h>
+#include "../misc/internals/tempname.h"
 
 
 /* Generate a unique filename in P_tmpdir.  If S is NULL return NULL.
 /* Generate a unique filename in P_tmpdir.  If S is NULL return NULL.
    This makes this function thread safe.  */
    This makes this function thread safe.  */

+ 1 - 0
libc/stdlib/mkstemp.c

@@ -18,6 +18,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
+#include "../misc/internals/tempname.h"
 
 
 /* Generate a unique temporary file name from TEMPLATE.
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    The last six characters of TEMPLATE must be "XXXXXX";

+ 1 - 0
libc/stdlib/mkstemp64.c

@@ -18,6 +18,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
+#include "../misc/internals/tempname.h"
 
 
 /* Generate a unique temporary file name from TEMPLATE.
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    The last six characters of TEMPLATE must be "XXXXXX";

+ 1 - 0
libc/stdlib/mktemp.c

@@ -18,6 +18,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
+#include "../misc/internals/tempname.h"
 
 
 /* Generate a unique temporary file name from TEMPLATE.
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    The last six characters of TEMPLATE must be "XXXXXX";