Commit Graph

81 Commits

Author SHA1 Message Date
Xiang Xiao
1bca457b28 libc: Always declare getenv, link/symlink and atexit/on_exit
since many c++ library implementation reference these symbols by using ::xxx but never
really use them, the declaration avoid the unused code is pulled into the final binary

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idd7bf9a1e09b77a6b21f900cd3ede08a1cc82d86
2020-07-08 12:07:22 +01:00
Xiang Xiao
60fe0a0f96 libc: Refine the inline handling
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 11:10:29 +09:00
Xiang Xiao
b984534255 lib/math: Remove float32 and float64 definition
since they aren't defined by standard and never supported by other POSIX OS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-02 10:53:34 -03:00
Xiang Xiao
d17b963bca libc: Move double_t typedef from sys/types.h to math.h
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 13:37:41 +01:00
Xiang Xiao
771f532dcb cxx: Remove CONFIG_NET guard from [get|set]hostname
since these two functions is always implemented now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iae46fa4d38b680a5d1ce5c314ffcb71af4a3dc95
2020-06-29 09:06:36 -03:00
David Sidrane
c91a81149d cstdlib:Add missing atox to std namespace 2020-06-18 10:23:47 +08:00
Gregory Nutt
ff0161000f cstdlib: mallinfo is no longer in stdlib.h 2020-06-15 08:35:44 -06:00
liuhaitao
ff9d435a95 include/cxx/cwchar: include wctype.h to fix libcxx build break
Note that iswalnum etc functions defined in wctype.h, and cwchar uses them.
So include wctype.h to fix libcxx build break.

Change-Id: I0f6b402d817f0927729800bdb8b9fce15e76ec3d
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-06-04 12:07:16 +01:00
Gregory Nutt
82debdc213 Make task_init() and task_activate() internal OS functions.
-Move task_init() and task_activate() prototypes from include/sched.h to include/nuttx/sched.h.  These are internal OS functions and should not be exposed to the user.
-Remove references to task_init() and task_activate() from the User Manual.
-Rename task_init() to nxtask_init() since since it is an OS internal function
-Rename task_activate() to nxtask_activate since it is an OS internal function
2020-05-25 23:54:45 +01:00
Gregory Nutt
67ec3d7926 Remove CONFIG_CAN_PASS_STRUCT
This commit resolves issue #620:

Remove CONFIG_CAN_PASS_STRUCTS #620

The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    struct mallinfo mallinfo(void);
    #else
    int      mallinfo(FAR struct mallinfo *info);
    #endif

And even leads to violation of a few POSIX interfaces like:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    int  sigqueue(int pid, int signo, union sigval value);
    #else
    int  sigqueue(int pid, int signo, FAR void *sival_ptr);
    #endif

This breaks the 1st INVIOLABLES rule:

Strict POSIX compliance
-----------------------

  o Strict conformance to the portable standard OS interface as defined at
    OpenGroup.org.
  o A deeply embedded system requires some special support.  Special
    support must be minimized.
  o The portable interface must never be compromised only for the sake of
    expediency.
  o Expediency or even improved performance are not justifications for
   violation of the strict POSIX interface

Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132

NOTE:  This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
2020-04-11 21:19:47 +01:00
Xiang Xiao
cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Gregory Nutt
ace25a78d9 include/cxx/ctime: Remove gititimer and setitimer. These are prototyped in sys/time.h, not time.h. Alternatively, ctime could include sys/time.h. Those APIs should also be in the std namespace. 2019-11-13 14:01:25 -06:00
liuhaitao
9b75ef06ea include/sys/time.h, libs/libc/unistd, sched/timer: Implement alarm(), setitimer() and getitimer() APIs. 2019-11-13 08:10:16 -06:00
athan Hartman
6d7e0feea1 Remove 'executable' bit on several files 2019-08-01 14:13:55 -06:00
junmin-kim
9e78931b91 include/cxx/cstddef: Add C11++ std::nullptr_t 2019-07-11 06:07:34 -06:00
Gregory Nutt
eef5e777c9 include/cxx/cstdlib: Add std::random() 2019-04-21 15:11:24 -06:00
Gregory Nutt
ccabac3eb6 More fixes for compilation with current SDCC compiler 2017-09-30 15:28:04 -06:00
David Sidrane
d0023038a5 cwchar:Use CONFIG_LIBC_WCHAR to only export the wc/mb functions
When a build does not want to use wide or multibyte char
   CONFIG_LIBC_WCHAR is not set. Therefore we should to only
   export the wc/mb functions when defined.

   Regardless of the stat of CONFIG_LIBC_WCHAR the non mb/wc
   definitions such as mbstate_t, wint_t, wctype_t need to be
   exported.
2017-08-10 14:22:51 -10:00
Alan Carvalho de Assiss
680368b656 libm: Port gamma() and lgamma() from FreeBSD to NuttX. 2017-08-08 07:02:39 -06:00
Gregory Nutt
14ae6df182 locale.h: Add a bogus definition of locale_t 2017-05-12 10:13:18 -06:00
Alan Carvalho de Assis
dbc074edab Include wcstold in C++ cwchar header file 2017-03-27 09:49:44 -06:00
Alan Carvalho de Assis
d43380d543 Add wcstoull function 2017-03-08 13:28:50 -06:00
Alan Carvalho de Assis
2d1ace3ee5 Add wcstof function 2017-03-08 12:47:23 -06:00
Alan Carvalho de Assis
3ccef07863 C library: Add wcstoll function 2017-03-08 12:26:35 -06:00
Alan Carvalho de Assis
fda095ccda Add mbtowc and wctomb to C++ std namespace 2017-03-08 12:16:56 -06:00
Gregory Nutt
05a288f2e1 C library: Add strerror_r 2017-03-08 12:14:07 -06:00
Gregory Nutt
cb7c5f9921 Implement strings.h macros as inline functions when possible for better C++ compatibility. 2017-02-22 10:20:58 -06:00
Gregory Nutt
22a8c2178d cstring: undefine macros defined in new strings.h. 2017-02-22 06:59:39 -06:00
Gregory Nutt
acf020c649 Add setbuf and setvbuf to cstdio. 2017-02-17 10:06:30 -06:00
Gregory Nutt
7a4d498b42 wctype.h needs extern C 2017-02-17 09:48:55 -06:00
Gregory Nutt
673b2ed2bf Update cwchar. Add cwctype. 2017-02-17 09:45:54 -06:00
Gregory Nutt
4f5879f998 C library: Add ffs(). Add strings.h. Move strcasecmp, strncasecmp, bzero, bcmp, and bcopy to where they belong in strings.h.h, not string.h. bzero, bcmp, and bcopy are legacy functions; the contemporary counterparts should be used instead. 2017-02-16 16:10:09 -06:00
Gregory Nutt
a49b349614 C library: Add swab() 2017-02-16 14:42:27 -06:00
Gregory Nutt
fed9d5a0f8 cunistd: Fix stray single back quote the crept in in last commit. 2017-02-16 11:22:02 -06:00
Gregory Nutt
6bcace62a8 Update some C++ header files 2017-02-14 07:48:54 -06:00
Gregory Nutt
de30c2e5dd Back out the rest of commit 1e754402b8. Newlib support will not be accepted into the NuttX repository. 2016-11-03 09:41:38 -06:00
Alan Carvalho de Assis
1e754402b8 Add C++ support linking with GNU toolchain newlib/stdlibc++ 2016-11-03 08:50:58 -06:00
Gregory Nutt
c08cb7ddea Implement ctype.h functions as inline if possible. cctype can then properly select namespace. 2016-10-22 08:18:00 -06:00
David Sidrane
b1ed7910f0 Allows c++ code to compile with or without CONFIG_LIBC_LOCALE
and will generate a link error if CONFIG_LIBC_LOCALE is not defined
and setlocale is referneced. With CONFIG_LIBC_LOCALE defined
setlocale will act as if MB string is not supported and return
"C" for POSIX. C and ""
2016-10-19 06:49:19 -10:00
Alan Carvalho de Assis
53700fc71f Add isblank() macro to ctype.h 2016-10-19 07:22:13 -06:00
Gregory Nutt
c73d3e9c5f Remove comments that no longer apply. clocale should not do anyting if CONFIG_LIBC_LOCALE is not defined. 2016-10-19 07:06:43 -06:00
Gregory Nutt
626408bc29 C Library: Add clocale header file 2016-10-18 07:52:22 -06:00
Gregory Nutt
440d535360 include/cxx: Update some C++ header files due to recent changes to C hader files 2016-08-25 15:06:46 -06:00
Gregory Nutt
f1cf6731eb Add raise to std:: namespace in csignal 2016-07-04 12:22:33 -06:00
Gregory Nutt
e879d0f423 Move scheduler instrumentation hooks out of sched.h (where they seem like application interfaces) and into nuttx/sched.h where it is clare that these are OS internal interfaces. 2016-03-16 11:00:31 -06:00
Sebastien Lorquet
77e4e7b231 Change all references from avsprintf to vasprintf. From Sebastien Lorquet 2015-09-07 13:22:13 -06:00
Paul A. Patience
3b89eabd50 Correct #if to #ifdef when the macro can be undefined. Fix bug in AT24XX driver: it should compare AT24XX_ADDRSIZE to 2. 2015-09-01 13:52:29 -04:00
Gregory Nutt
8f7453b5ec Addings to stdlib.h must be added to cstdlib too 2015-08-14 12:04:57 -06:00
Gregory Nutt
4adda9d428 Fix numerous typos in configuration variable names. Tracked down by Alan Carvalho de Assis 2015-05-23 17:08:35 -06:00
Gregory Nutt
ca29c652c3 Remove duplicate prototype of statfs from stdio.h. Belongs in sys/statfs.h only. Note by Michael Hope 2015-05-12 07:00:11 -06:00