Browse Source

global data uses libc_hidden_data_def, convert all -I hope- and add some new

Peter S. Mazinger 20 years ago
parent
commit
f45706ca6a

+ 1 - 3
libc/inet/in6_addr.c

@@ -24,12 +24,10 @@
 #ifdef __UCLIBC_HAS_IPV6__
 #ifdef __UCLIBC_HAS_IPV6__
 const struct in6_addr in6addr_any =
 const struct in6_addr in6addr_any =
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
-//libc_hidden_proto(in6addr_any)
-//libc_hidden_def(in6addr_any)
 libc_hidden_proto(in6addr_loopback)
 libc_hidden_proto(in6addr_loopback)
 const struct in6_addr in6addr_loopback =
 const struct in6_addr in6addr_loopback =
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
-libc_hidden_def(in6addr_loopback)
+libc_hidden_data_def(in6addr_loopback)
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
 
 
 
 

+ 2 - 0
libc/inet/resolv.c

@@ -237,6 +237,7 @@ extern char * __searchdomain[MAX_SEARCH] attribute_hidden;
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
 extern pthread_mutex_t __resolv_lock;
 extern pthread_mutex_t __resolv_lock;
+libc_hidden_proto(__resolv_lock)
 #endif
 #endif
 #define BIGLOCK	__pthread_mutex_lock(&__resolv_lock)
 #define BIGLOCK	__pthread_mutex_lock(&__resolv_lock)
 #define BIGUNLOCK	__pthread_mutex_unlock(&__resolv_lock)
 #define BIGUNLOCK	__pthread_mutex_unlock(&__resolv_lock)
@@ -1021,6 +1022,7 @@ char * __searchdomain[MAX_SEARCH];
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
 pthread_mutex_t __resolv_lock = PTHREAD_MUTEX_INITIALIZER;
 pthread_mutex_t __resolv_lock = PTHREAD_MUTEX_INITIALIZER;
+libc_hidden_data_def(__resolv_lock)
 #endif
 #endif
 
 
 /*
 /*

+ 9 - 9
libc/misc/ctype/ctype.c

@@ -856,16 +856,16 @@ const __ctype_mask_t __C_ctype_b_data[] = {
 	/*  254  M-~  */ 0,
 	/*  254  M-~  */ 0,
 	/*  255  M-^? */ 0
 	/*  255  M-^? */ 0
 };
 };
-libc_hidden_def(__C_ctype_b_data)
+libc_hidden_data_def(__C_ctype_b_data)
 
 
 libc_hidden_proto(__C_ctype_b)
 libc_hidden_proto(__C_ctype_b)
 const __ctype_mask_t *__C_ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET;
 const __ctype_mask_t *__C_ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET;
-libc_hidden_def(__C_ctype_b)
+libc_hidden_data_def(__C_ctype_b)
 
 
 #ifndef __UCLIBC_HAS_XLOCALE__
 #ifndef __UCLIBC_HAS_XLOCALE__
 
 
 const __ctype_mask_t *__ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET;
 const __ctype_mask_t *__ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET;
-libc_hidden_def(__ctype_b)
+libc_hidden_data_def(__ctype_b)
 
 
 #endif
 #endif
 
 
@@ -975,19 +975,19 @@ const __ctype_touplow_t __C_ctype_tolower_data[] = {
 	 248,          249,          250,          251,
 	 248,          249,          250,          251,
 	 252,          253,          254,          255
 	 252,          253,          254,          255
 };
 };
-libc_hidden_def(__C_ctype_tolower_data)
+libc_hidden_data_def(__C_ctype_tolower_data)
 
 
 libc_hidden_proto(__C_ctype_tolower)
 libc_hidden_proto(__C_ctype_tolower)
 const __ctype_touplow_t *__C_ctype_tolower = __C_ctype_tolower_data
 const __ctype_touplow_t *__C_ctype_tolower = __C_ctype_tolower_data
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
-libc_hidden_def(__C_ctype_tolower)
+libc_hidden_data_def(__C_ctype_tolower)
 
 
 #ifndef __UCLIBC_HAS_XLOCALE__
 #ifndef __UCLIBC_HAS_XLOCALE__
 
 
 libc_hidden_proto(__ctype_tolower)
 libc_hidden_proto(__ctype_tolower)
 const __ctype_touplow_t *__ctype_tolower = __C_ctype_tolower_data
 const __ctype_touplow_t *__ctype_tolower = __C_ctype_tolower_data
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
-libc_hidden_def(__ctype_tolower)
+libc_hidden_data_def(__ctype_tolower)
 
 
 #endif
 #endif
 
 
@@ -1097,19 +1097,19 @@ const __ctype_touplow_t __C_ctype_toupper_data[] = {
 	 248,          249,          250,          251,
 	 248,          249,          250,          251,
 	 252,          253,          254,          255
 	 252,          253,          254,          255
 };
 };
-libc_hidden_def(__C_ctype_toupper_data)
+libc_hidden_data_def(__C_ctype_toupper_data)
 
 
 libc_hidden_proto(__C_ctype_toupper)
 libc_hidden_proto(__C_ctype_toupper)
 const __ctype_touplow_t *__C_ctype_toupper = __C_ctype_toupper_data
 const __ctype_touplow_t *__C_ctype_toupper = __C_ctype_toupper_data
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
-libc_hidden_def(__C_ctype_toupper)
+libc_hidden_data_def(__C_ctype_toupper)
 
 
 #ifndef __UCLIBC_HAS_XLOCALE__
 #ifndef __UCLIBC_HAS_XLOCALE__
 
 
 libc_hidden_proto(__ctype_toupper)
 libc_hidden_proto(__ctype_toupper)
 const __ctype_touplow_t *__ctype_toupper = __C_ctype_toupper_data
 const __ctype_touplow_t *__ctype_toupper = __C_ctype_toupper_data
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
 											+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
-libc_hidden_def(__ctype_toupper)
+libc_hidden_data_def(__ctype_toupper)
 
 
 #endif
 #endif
 
 

+ 2 - 0
libc/misc/error/error.c

@@ -39,7 +39,9 @@ libc_hidden_proto(stdout)
 libc_hidden_proto(stderr)
 libc_hidden_proto(stderr)
 
 
 /* This variable is incremented each time `error' is called.  */
 /* This variable is incremented each time `error' is called.  */
+libc_hidden_proto(error_message_count)
 unsigned int error_message_count = 0;
 unsigned int error_message_count = 0;
+libc_hidden_data_def(error_message_count)
 /* Sometimes we want to have at most one error per line.  This
 /* Sometimes we want to have at most one error per line.  This
    variable controls whether this mode is selected or not.  */
    variable controls whether this mode is selected or not.  */
 int error_one_per_line;
 int error_one_per_line;

+ 2 - 2
libc/misc/gnu/obstack.c

@@ -97,7 +97,7 @@ void (*obstack_alloc_failed_handler) (void) = print_and_abort;
 static void print_and_abort ();
 static void print_and_abort ();
 void (*obstack_alloc_failed_handler) () = print_and_abort;
 void (*obstack_alloc_failed_handler) () = print_and_abort;
 # endif
 # endif
-libc_hidden_def(obstack_alloc_failed_handler)
+libc_hidden_data_def(obstack_alloc_failed_handler)
 
 
 
 
 /* Exit value used when `print_and_abort' is used.  */
 /* Exit value used when `print_and_abort' is used.  */
@@ -118,7 +118,7 @@ libc_hidden_proto(fwprintf)
 
 
 libc_hidden_proto(obstack_exit_failure)
 libc_hidden_proto(obstack_exit_failure)
 int obstack_exit_failure = EXIT_FAILURE;
 int obstack_exit_failure = EXIT_FAILURE;
-libc_hidden_def(obstack_exit_failure)
+libc_hidden_data_def(obstack_exit_failure)
 
 
 /* The non-GNU-C macros copy the obstack into this global variable
 /* The non-GNU-C macros copy the obstack into this global variable
    to avoid multiple evaluation.  */
    to avoid multiple evaluation.  */

+ 2 - 2
libc/misc/internals/__uClibc_main.c

@@ -97,7 +97,7 @@ strong_alias (__progname_full, program_invocation_name)
  */
  */
 libc_hidden_proto(__environ)
 libc_hidden_proto(__environ)
 char **__environ = 0;
 char **__environ = 0;
-libc_hidden_def(__environ)
+libc_hidden_data_def(__environ)
 /* psm: arm segfaults with strong_alias, although defined */
 /* psm: arm segfaults with strong_alias, although defined */
 weak_alias(__environ,environ)
 weak_alias(__environ,environ)
 
 
@@ -105,7 +105,7 @@ weak_alias(__environ,environ)
 extern size_t __pagesize;
 extern size_t __pagesize;
 libc_hidden_proto(__pagesize)
 libc_hidden_proto(__pagesize)
 size_t __pagesize = 0;
 size_t __pagesize = 0;
-libc_hidden_def(__pagesize)
+libc_hidden_data_def(__pagesize)
 
 
 #ifndef O_NOFOLLOW
 #ifndef O_NOFOLLOW
 # define O_NOFOLLOW	0
 # define O_NOFOLLOW	0

+ 2 - 2
libc/misc/locale/locale.c

@@ -377,12 +377,12 @@ libc_hidden_proto(__ctype_toupper)
 __uclibc_locale_t __global_locale_data;
 __uclibc_locale_t __global_locale_data;
 
 
 __locale_t __global_locale = &__global_locale_data;
 __locale_t __global_locale = &__global_locale_data;
-libc_hidden_def(__global_locale)
+libc_hidden_data_def(__global_locale)
 
 
 #ifdef __UCLIBC_HAS_XLOCALE__
 #ifdef __UCLIBC_HAS_XLOCALE__
 libc_hidden_proto(__curlocale_var)
 libc_hidden_proto(__curlocale_var)
 __locale_t __curlocale_var = &__global_locale_data;
 __locale_t __curlocale_var = &__global_locale_data;
-libc_hidden_def(__curlocale_var)
+libc_hidden_data_def(__curlocale_var)
 #endif
 #endif
 
 
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/

+ 3 - 3
libc/misc/time/time.c

@@ -1705,13 +1705,13 @@ static const char vals[] = {
 /* Initialize to UTC. */
 /* Initialize to UTC. */
 libc_hidden_proto(daylight)
 libc_hidden_proto(daylight)
 int daylight = 0;
 int daylight = 0;
-libc_hidden_def(daylight)
+libc_hidden_data_def(daylight)
 libc_hidden_proto(timezone)
 libc_hidden_proto(timezone)
 long timezone = 0;
 long timezone = 0;
-libc_hidden_def(timezone)
+libc_hidden_data_def(timezone)
 libc_hidden_proto(tzname)
 libc_hidden_proto(tzname)
 char *tzname[2] = { (char *) UTC, (char *) (UTC-1) };
 char *tzname[2] = { (char *) UTC, (char *) (UTC-1) };
-libc_hidden_def(tzname)
+libc_hidden_data_def(tzname)
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 attribute_hidden pthread_mutex_t _time_tzlock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 attribute_hidden pthread_mutex_t _time_tzlock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;

+ 1 - 1
libc/misc/wchar/wchar.c

@@ -1269,7 +1269,7 @@ const unsigned char __iconv_codesets[] =
 	"\x08\x02""UTF-8\x00"
 	"\x08\x02""UTF-8\x00"
 	"\x0b\x01""US-ASCII\x00"
 	"\x0b\x01""US-ASCII\x00"
 	"\x07\x01""ASCII";			/* Must be last! (special case to save a nul) */
 	"\x07\x01""ASCII";			/* Must be last! (special case to save a nul) */
-libc_hidden_def(__iconv_codesets)
+libc_hidden_data_def(__iconv_codesets)
 
 
 libc_hidden_proto(strcasecmp)
 libc_hidden_proto(strcasecmp)
 
 

+ 3 - 0
libc/stdio/__fsetlocking.c

@@ -9,6 +9,9 @@
 #include <stdio_ext.h>
 #include <stdio_ext.h>
 
 
 libc_hidden_proto(__fsetlocking)
 libc_hidden_proto(__fsetlocking)
+#ifdef __UCLIBC_HAS_THREADS__
+libc_hidden_proto(_stdio_user_locking)
+#endif
 
 
 /* Not threadsafe. */
 /* Not threadsafe. */
 
 

+ 4 - 0
libc/stdio/_fopen.c

@@ -11,6 +11,10 @@ libc_hidden_proto(isatty)
 libc_hidden_proto(open)
 libc_hidden_proto(open)
 libc_hidden_proto(fcntl)
 libc_hidden_proto(fcntl)
 
 
+#ifdef __UCLIBC_HAS_THREADS__
+libc_hidden_proto(_stdio_user_locking)
+#endif
+
 /*
 /*
  * Cases:
  * Cases:
  *  fopen64  : filename != NULL, stream == NULL, filedes == -2
  *  fopen64  : filename != NULL, stream == NULL, filedes == -2

+ 7 - 3
libc/stdio/_stdio.c

@@ -129,15 +129,15 @@ static FILE _stdio_streams[] = {
 FILE *stdin  = _stdio_streams;
 FILE *stdin  = _stdio_streams;
 libc_hidden_def(stdin)
 libc_hidden_def(stdin)
 FILE *stdout = _stdio_streams + 1;
 FILE *stdout = _stdio_streams + 1;
-libc_hidden_def(stdout)
+libc_hidden_data_def(stdout)
 libc_hidden_proto(stderr)
 libc_hidden_proto(stderr)
 FILE *stderr = _stdio_streams + 2;
 FILE *stderr = _stdio_streams + 2;
-libc_hidden_def(stderr)
+libc_hidden_data_def(stderr)
 
 
 #ifdef __STDIO_GETC_MACRO
 #ifdef __STDIO_GETC_MACRO
 libc_hidden_proto(__stdin)
 libc_hidden_proto(__stdin)
 FILE *__stdin = _stdio_streams;		 /* For getchar() macro. */
 FILE *__stdin = _stdio_streams;		 /* For getchar() macro. */
-libc_hidden_def(__stdin)
+libc_hidden_data_def(__stdin)
 #endif
 #endif
 #ifdef __STDIO_PUTC_MACRO
 #ifdef __STDIO_PUTC_MACRO
 FILE *__stdout = _stdio_streams + 1; /* For putchar() macro. */
 FILE *__stdout = _stdio_streams + 1; /* For putchar() macro. */
@@ -159,9 +159,11 @@ FILE *__stdout = _stdio_streams + 1; /* For putchar() macro. */
  */
  */
 
 
 FILE *_stdio_openlist = _stdio_streams;
 FILE *_stdio_openlist = _stdio_streams;
+libc_hidden_data_def(_stdio_openlist)
 
 
 # ifdef __UCLIBC_HAS_THREADS__
 # ifdef __UCLIBC_HAS_THREADS__
 pthread_mutex_t _stdio_openlist_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 pthread_mutex_t _stdio_openlist_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+libc_hidden_data_def(_stdio_openlist_lock)
 int _stdio_openlist_delflag = 0;
 int _stdio_openlist_delflag = 0;
 # endif
 # endif
 
 
@@ -170,7 +172,9 @@ int _stdio_openlist_delflag = 0;
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 
 
 /* 2 if threading not initialized and 0 otherwise; */
 /* 2 if threading not initialized and 0 otherwise; */
+libc_hidden_proto(_stdio_user_locking)
 int _stdio_user_locking = 2;
 int _stdio_user_locking = 2;
+libc_hidden_data_def(_stdio_user_locking)
 
 
 void attribute_hidden __stdio_init_mutex(pthread_mutex_t *m)
 void attribute_hidden __stdio_init_mutex(pthread_mutex_t *m)
 {
 {

+ 3 - 0
libc/stdio/_stdio.h

@@ -23,8 +23,11 @@
 libc_hidden_proto(stdin)
 libc_hidden_proto(stdin)
 libc_hidden_proto(stdout)
 libc_hidden_proto(stdout)
 
 
+libc_hidden_proto(_stdio_openlist)
+
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 #include <pthread.h>
+libc_hidden_proto(_stdio_openlist_lock)
 
 
 #define __STDIO_THREADLOCK_OPENLIST \
 #define __STDIO_THREADLOCK_OPENLIST \
 	__pthread_mutex_lock(&_stdio_openlist_lock)
 	__pthread_mutex_lock(&_stdio_openlist_lock)

+ 1 - 0
libc/stdio/fflush.c

@@ -16,6 +16,7 @@ libc_hidden_proto(fflush_unlocked)
 #endif /* __UCLIBC_MJN3_ONLY__ */
 #endif /* __UCLIBC_MJN3_ONLY__ */
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
+libc_hidden_proto(_stdio_user_locking)
 /* Even if the stream is set to user-locking, we still need to lock
 /* Even if the stream is set to user-locking, we still need to lock
  * when all (lbf) writing streams are flushed. */
  * when all (lbf) writing streams are flushed. */
 #define MY_STDIO_THREADLOCK(STREAM) \
 #define MY_STDIO_THREADLOCK(STREAM) \

+ 2 - 0
libc/stdlib/atexit.c

@@ -49,6 +49,7 @@ libc_hidden_proto(_exit)
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
 extern pthread_mutex_t mylock;
 extern pthread_mutex_t mylock;
+libc_hidden_proto(mylock)
 #endif
 #endif
 #define LOCK	__pthread_mutex_lock(&mylock)
 #define LOCK	__pthread_mutex_lock(&mylock)
 #define UNLOCK	__pthread_mutex_unlock(&mylock)
 #define UNLOCK	__pthread_mutex_unlock(&mylock)
@@ -314,6 +315,7 @@ extern void weak_function _stdio_term(void) attribute_hidden;
 attribute_hidden void (*__exit_cleanup) (int) = 0;
 attribute_hidden void (*__exit_cleanup) (int) = 0;
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+libc_hidden_data_def(mylock)
 #endif
 #endif
 
 
 #ifdef __UCLIBC_CTOR_DTOR__
 #ifdef __UCLIBC_CTOR_DTOR__

+ 4 - 4
libc/unistd/getopt.c

@@ -84,7 +84,7 @@ extern int _getopt_internal (int argc, char *const *argv, const char *optstring,
    each non-option ARGV-element is returned here.  */
    each non-option ARGV-element is returned here.  */
 
 
 char *optarg = NULL;
 char *optarg = NULL;
-libc_hidden_def(optarg)
+libc_hidden_data_def(optarg)
 
 
 /* Index in ARGV of the next element to be scanned.
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
    This is used for communication to and from the caller
@@ -100,20 +100,20 @@ libc_hidden_def(optarg)
 
 
 /* 1003.2 says this must be 1 before any call.  */
 /* 1003.2 says this must be 1 before any call.  */
 int optind = 1;
 int optind = 1;
-libc_hidden_def(optind)
+libc_hidden_data_def(optind)
 
 
 /* Callers store zero here to inhibit the error message
 /* Callers store zero here to inhibit the error message
    for unrecognized options.  */
    for unrecognized options.  */
 
 
 int opterr = 1;
 int opterr = 1;
-libc_hidden_def(opterr)
+libc_hidden_data_def(opterr)
 
 
 /* Set to an option character which was unrecognized.
 /* Set to an option character which was unrecognized.
    This must be initialized on some systems to avoid linking in the
    This must be initialized on some systems to avoid linking in the
    system's own getopt implementation.  */
    system's own getopt implementation.  */
 
 
 int optopt = '?';
 int optopt = '?';
-libc_hidden_def(optopt)
+libc_hidden_data_def(optopt)
 
 
 /* The next char to be scanned in the option-element
 /* The next char to be scanned in the option-element
    in which the last option character we returned was found.
    in which the last option character we returned was found.

+ 1 - 1
libm/s_lib_version.c

@@ -38,4 +38,4 @@ _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
 #endif
 #endif
 #endif
 #endif
 #endif
 #endif
-libm_hidden_def(_LIB_VERSION)
+libm_hidden_data_def(_LIB_VERSION)