mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/avr8_common: use tiny_strerror_as_strerror
The custom `strerror()` is dropped and replaced by the module `tiny_strerror_as_strerror`.
This commit is contained in:
parent
1bdc1a5967
commit
f6ed9fd781
@ -12,6 +12,7 @@ config CPU_ARCH_AVR8
|
||||
select HAS_ARCH_AVR8
|
||||
|
||||
select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG
|
||||
select MODULE_TINY_STRERROR_AS_STRERROR if TEST_KCONFIG
|
||||
# static C++ constructors need guards for thread safe initialization
|
||||
select MODULE_CXX_CTOR_GUARDS if MODULE_CPP
|
||||
# new and delete operators needed
|
||||
|
@ -9,6 +9,9 @@ USEMODULE += avr8_common
|
||||
# instead.
|
||||
USEMODULE += malloc_thread_safe
|
||||
|
||||
# The AVR-libc provides no strerror, so we provide it via tiny_strerror
|
||||
USEMODULE += tiny_strerror_as_strerror
|
||||
|
||||
# the atmel port uses stdio_uart by default
|
||||
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
|
||||
USEMODULE += stdio_uart
|
||||
|
@ -177,80 +177,4 @@ ssize_t write(int fd, const void *src, size_t count)
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *strerror(int errnum)
|
||||
{
|
||||
if (errnum < 0) {
|
||||
errnum = -errnum;
|
||||
}
|
||||
|
||||
switch (errnum) {
|
||||
case 0: return "OK";
|
||||
case EDOM: return "EDOM";
|
||||
case ERANGE: return "ERANGE";
|
||||
case ENOSYS: return "ENOSYS";
|
||||
case EINTR: return "EINTR";
|
||||
case E2BIG: return "E2BIG";
|
||||
case EACCES: return "EACCES";
|
||||
case EADDRINUSE: return "EADDRINUSE";
|
||||
case EADDRNOTAVAIL: return "EADDRNOTAVAIL";
|
||||
case EAFNOSUPPORT: return "EAFNOSUPPORT";
|
||||
case EAGAIN: return "EAGAIN";
|
||||
case EALREADY: return "EALREADY";
|
||||
case EBADF: return "EBADF";
|
||||
case EBUSY: return "EBUSY";
|
||||
case ECHILD: return "ECHILD";
|
||||
case ECONNABORTED: return "ECONNABORTED";
|
||||
case ECONNREFUSED: return "ECONNREFUSED";
|
||||
case ECONNRESET: return "ECONNRESET";
|
||||
case EDEADLK: return "EDEADLK";
|
||||
case EDESTADDRREQ: return "EDESTADDRREQ";
|
||||
case EEXIST: return "EEXIST";
|
||||
case EFAULT: return "EFAULT";
|
||||
case EFBIG: return "EFBIG";
|
||||
case EHOSTUNREACH: return "EHOSTUNREACH";
|
||||
case EILSEQ: return "EILSEQ";
|
||||
case EINPROGRESS: return "EINPROGRESS";
|
||||
case EINVAL: return "EINVAL";
|
||||
case EIO: return "EIO";
|
||||
case EISCONN: return "EISCONN";
|
||||
case EISDIR: return "EISDIR";
|
||||
case ELOOP: return "ELOOP";
|
||||
case EMFILE: return "EMFILE";
|
||||
case EMLINK: return "EMLINK";
|
||||
case EMSGSIZE: return "EMSGSIZE";
|
||||
case ENAMETOOLONG: return "ENAMETOOLONG";
|
||||
case ENETDOWN: return "ENETDOWN";
|
||||
case ENETRESET: return "ENETRESET";
|
||||
case ENETUNREACH: return "ENETUNREACH";
|
||||
case ENFILE: return "ENFILE";
|
||||
case ENOBUFS: return "ENOBUFS";
|
||||
case ENODEV: return "ENODEV";
|
||||
case ENOENT: return "ENOENT";
|
||||
case ENOEXEC: return "ENOEXEC";
|
||||
case ENOLCK: return "ENOLCK";
|
||||
case ENOMEM: return "ENOMEM";
|
||||
case ENOMSG: return "ENOMSG";
|
||||
case ENOPROTOOPT: return "ENOPROTOOPT";
|
||||
case ENOSPC: return "ENOSPC";
|
||||
case ENOTCONN: return "ENOTCONN";
|
||||
case ENOTDIR: return "ENOTDIR";
|
||||
case ENOTEMPTY: return "ENOTEMPTY";
|
||||
case ENOTSOCK: return "ENOTSOCK";
|
||||
case ENOTTY: return "ENOTTY";
|
||||
case ENXIO: return "ENXIO";
|
||||
case EOPNOTSUPP: return "EOPNOTSUPP";
|
||||
case EPERM: return "EPERM";
|
||||
case EPIPE: return "EPIPE";
|
||||
case EPROTONOSUPPORT: return "EPROTONOSUPPORT";
|
||||
case EPROTOTYPE: return "EPROTOTYPE";
|
||||
case EROFS: return "EROFS";
|
||||
case ESPIPE: return "ESPIPE";
|
||||
case ESRCH: return "ESRCH";
|
||||
case ETIMEDOUT: return "ETIMEDOUT";
|
||||
case EWOULDBLOCK: return "EWOULDBLOCK";
|
||||
case EXDEV: return "EXDEV";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user