Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shehab wchar fix #11

Merged
merged 16 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ set(PREFIX "${PROJECT_BINARY_DIR}")
configure_file(picolibc.specs.in "${PROJECT_BINARY_DIR}/picolibc.specs" @ONLY)

set(PICOLIBC_COMPILE_OPTIONS
"-include" "${PICOLIBC_INCLUDE}/picolibc.h"
"-nostdlib"
"-D_LIBC"
${TLSMODEL}
Expand Down
1 change: 0 additions & 1 deletion COPYING.picolibc
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,6 @@ Files: .clang-format
newlib/libm/ld/files
newlib/libm/libm.in.xml
newlib/man.xsl
newlib/newlib.hin
newlib/refcontainers.xslt
newlib/testsuite/newlib.time/tzset.c
picolibc.h.in
Expand Down
2 changes: 1 addition & 1 deletion dummyhost/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <unistd.h>

void _ATTRIBUTE((__noreturn__))
_exit(int code)
Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ newlib_nano_malloc = get_option('newlib-nano-malloc')
lite_exit = get_option('lite-exit')

newlib_elix_level = get_option('newlib-elix-level')
c_args = ['-include', '@0@/@1@'.format(meson.current_build_dir(), 'picolibc.h')] + core_c_args
c_args = core_c_args
native_common_args = ['-DNO_NEWLIB']

if get_option('profile')
Expand Down Expand Up @@ -788,6 +788,8 @@ common_warnings = [
'-Wno-missing-braces',
'-Wno-return-type',
'-Wno-unused-command-line-argument',
'-Wmissing-prototypes',
'-Wmissing-declarations',
]
if get_option('analyzer')
common_warnings += [
Expand Down
2 changes: 2 additions & 0 deletions newlib/libc/ctype/ctype_.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

# define DEFAULT_CTYPE_PTR ((char *) _ctype_)

void
__set_ctype (struct __locale_t *loc, const char *charset);
1 change: 1 addition & 0 deletions newlib/libc/ctype/isascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ PORTABILITY

No supporting OS subroutines are required.
*/
#define _DEFAULT_SOURCE
#include <ctype.h>

#undef isascii
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswalnum_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswalpha_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswblank_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswcntrl_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswlower_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswprint_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswpunct_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswspace_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/iswupper_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
2 changes: 1 addition & 1 deletion newlib/libc/ctype/jp2uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <newlib.h>
#include <picolibc.h>

#ifdef _MB_CAPABLE
/* Under Cygwin, the incoming wide character is already given in UTF due
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/toascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ POSIX-1.2008.
No supporting OS subroutines are required.
*/

#define _GNU_SOURCE
#include <_ansi.h>
#include <ctype.h>
#undef toascii
Expand Down
1 change: 1 addition & 0 deletions newlib/libc/ctype/towctrans_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2016 Corinna Vinschen <[email protected]>
Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
*/
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <wctype.h>
#include <stdint.h>
Expand Down
1 change: 0 additions & 1 deletion newlib/libc/ctype/towlower_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <newlib.h>
#include <wctype.h>
#include "local.h"

Expand Down
1 change: 0 additions & 1 deletion newlib/libc/ctype/towupper.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ No supporting OS subroutines are required.
*/

#include <_ansi.h>
#include <newlib.h>
#include <string.h>
#include <ctype.h>
#include <wctype.h>
Expand Down
1 change: 0 additions & 1 deletion newlib/libc/iconv/ccs/ccsbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef __CCSBI_H__
#define __CCSBI_H__

#include <newlib.h>
#include <_ansi.h>
#include "ccs.h"

Expand Down
2 changes: 0 additions & 2 deletions newlib/libc/iconv/ces/cesbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* This file was automatically generated mkdeps.pl script. Don't edit.
*/

#include <_ansi.h>
#include <newlib.h>
#include "../lib/ucsconv.h"
#include "cesbi.h"

Expand Down
1 change: 0 additions & 1 deletion newlib/libc/iconv/ces/cesbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef __CESBI_H__
#define __CESBI_H__

#include <newlib.h>
#include <_ansi.h>
#include "../lib/encnames.h"
#include "../lib/ucsconv.h"
Expand Down
4 changes: 0 additions & 4 deletions newlib/libc/iconv/ces/euc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@
#if defined (ICONV_TO_UCS_CES_EUC) \
|| defined (ICONV_FROM_UCS_CES_EUC)

#include <_ansi.h>
#include <newlib.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/types.h>
#include "../lib/local.h"
#include "../lib/ucsconv.h"
#include "../lib/encnames.h"
#include "../ccs/ccsnames.h"

#define TYPE_EUC_JP 0
Expand Down
3 changes: 0 additions & 3 deletions newlib/libc/iconv/ces/mkdeps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ ($$)
print CESBI_H "$comment_automatic\n\n";
print CESBI_H "#ifndef __CESBI_H__\n";
print CESBI_H "#define __CESBI_H__\n\n";
print CESBI_H "#include <newlib.h>\n";
print CESBI_H "#include <_ansi.h>\n";
print CESBI_H "#include \"../lib/encnames.h\"\n";
print CESBI_H "#include \"../lib/ucsconv.h\"\n\n";
Expand Down Expand Up @@ -707,7 +706,6 @@ ($)
print CCSBI_H "$comment_automatic\n\n";
print CCSBI_H "#ifndef __CCSBI_H__\n";
print CCSBI_H "#define __CCSBI_H__\n\n";
print CCSBI_H "#include <newlib.h>\n";
print CCSBI_H "#include <_ansi.h>\n";
print CCSBI_H "#include \"ccs.h\"\n\n";
print CCSBI_H "/*\n";
Expand Down Expand Up @@ -781,7 +779,6 @@ ($)

print CESBI_C "$comment_automatic\n\n";
print CESBI_C "#include <_ansi.h>\n";
print CESBI_C "#include <newlib.h>\n";
print CESBI_C "#include \"../lib/ucsconv.h\"\n";
print CESBI_C "#include \"cesbi.h\"\n\n";
print CESBI_C "/*\n";
Expand Down
3 changes: 0 additions & 3 deletions newlib/libc/iconv/ces/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#if defined (ICONV_TO_UCS_CES_TABLE) \
|| defined (ICONV_FROM_UCS_CES_TABLE)

#include <_ansi.h>
#include <newlib.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
Expand All @@ -38,7 +36,6 @@
#include <sys/iconvnls.h>
#include "../lib/endian.h"
#include "../lib/local.h"
#include "../lib/ucsconv.h"
#include "../ccs/ccs.h"

/*
Expand Down
1 change: 0 additions & 1 deletion newlib/libc/iconv/lib/aliasesi.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
#define _DEFAULT_SOURCE
#include <_ansi.h>
#include <newlib.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
Expand Down
1 change: 0 additions & 1 deletion newlib/libc/iconv/lib/iconvnls.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* SUCH DAMAGE.
*/
#include <_ansi.h>
#include <newlib.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion newlib/libc/iconv/lib/iconvnls.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SUCH DAMAGE.
#ifndef __ICONV_ICONVNLS_H__
#define __ICONV_ICONVNLS_H__

#include <newlib.h>
#include <stdint.h>

/*
* Include ucs-2-internal or ucs-4-internal if Newlib is configured as
Expand Down
1 change: 0 additions & 1 deletion newlib/libc/include/_ansi.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ SUCH DAMAGE.
#ifndef _ANSIDECL_H_
#define _ANSIDECL_H_

#include <newlib.h>
#include <sys/config.h>

/* ISO C++. */
Expand Down
5 changes: 2 additions & 3 deletions newlib/libc/include/inttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#ifndef _INTTYPES_H
#define _INTTYPES_H

#include <newlib.h>
#include <sys/config.h>
#include <sys/_intsup.h>
#include "_ansi.h"
Expand All @@ -33,9 +32,9 @@
#define __PRI8FAST(x) __FAST8 __STRINGIFY(x)

/* NOTICE: scanning 8-bit types requires use of the hh specifier
* which is only supported on newlib platforms that
* which is only supported on picolibc platforms that
* are built with C99 I/O format support enabled. If the flag in
* newlib.h hasn't been set during configuration to indicate this, the 8-bit
* picolibc.h hasn't been set during configuration to indicate this, the 8-bit
* scanning format macros are disabled here as they result in undefined
* behaviour which can include memory overwrite. Overriding the flag after the
* library has been built is not recommended as it will expose the underlying
Expand Down
1 change: 0 additions & 1 deletion newlib/libc/include/limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#ifndef _LIBC_LIMITS_H_
# define _LIBC_LIMITS_H_ 1

#include <newlib.h>
#include <sys/cdefs.h>
#include <sys/syslimits.h>

Expand Down
2 changes: 1 addition & 1 deletion newlib/libc/include/machine/ieeefp.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ duplicated in all such forms.
This file is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <sys/features.h>
#ifndef __IEEE_BIG_ENDIAN
#include <picolibc.h>
#ifndef __IEEE_LITTLE_ENDIAN

/* This file can define macros to choose variations of the IEEE float
Expand Down
21 changes: 16 additions & 5 deletions newlib/libc/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ extern int __finite (double);
extern int __finitef (float);
#if defined(_HAVE_LONG_DOUBLE)
extern int __fpclassifyl (long double);
extern int __isinfl (long double);
extern int __isnanl (long double);
extern int __finitel (long double);
extern int __signbitl (long double);
#endif

/* Note: isinf and isnan were once functions in newlib that took double
Expand Down Expand Up @@ -378,9 +381,16 @@ int __issignalingl(long double d);
__builtin_signbit ((double) (__x)))
#endif
#else
#define signbit(__x) \
((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \
__signbitd((double) (__x)))
#if defined(_HAVE_LONG_DOUBLE)
#define signbit(__x) \
((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \
((sizeof(__x) == sizeof(double)) ? __signbit ((double)(__x)) : \
__signbitl((long double)(__x))))
#else
#define signbit(__x) \
((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \
__signbitd((double) (__x)))
#endif
#endif

#if __GNUC_PREREQ (2, 97) && !(defined(__riscv) && defined(__clang__))
Expand Down Expand Up @@ -538,6 +548,7 @@ extern float hypotf (float, float);
/* These functions are always available for long double */

extern long double hypotl (long double, long double);
extern long double infinityl (void);
extern long double sqrtl (long double);
extern long double frexpl (long double, int *);
extern long double scalbnl (long double, int);
Expand All @@ -558,6 +569,8 @@ extern long long int llroundl (long double);
extern long double truncl (long double);
extern long double nanl (const char *);
extern long double floorl (long double);
extern long double scalbl (long double, long double);
extern long double significandl(long double);
/* Compiler provides these */
extern long double fabsl (long double);
extern long double copysignl (long double, long double);
Expand Down Expand Up @@ -589,7 +602,6 @@ extern double nexttoward (double, long double);
extern long double nexttowardl (long double, long double);
extern long double log2l (long double);
extern long double exp2l (long double);
extern long double scalbl (long double, long double);
extern long double tgammal (long double);
extern long double remquol (long double, long double, int *);
extern long double fdiml (long double, long double);
Expand All @@ -609,7 +621,6 @@ extern long double jnl(int, long double);
extern long double ynl(int, long double);

extern long double getpayloadl(const long double *x);
extern long double significandl(long double);

#endif /* _HAVE_LONG_DOUBLE_MATH */

Expand Down
2 changes: 2 additions & 0 deletions newlib/libc/include/picotls.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#ifndef _PICOTLS_H_
#define _PICOTLS_H_

#include <picolibc.h>

#ifdef PICOLIBC_TLS

#include <sys/types.h>
Expand Down
Loading