libsheepy

C lib for handling text files, strings and json like data structure with an object oriented system
git clone https://spartatek.se/git/libsheepy.git
Log | Files | Refs | README | LICENSE

commit 0315d26d9fbef3339d5549025cf60d2b85c400e0
parent 4319c5877ae5ca84a2fbd6021416d04dfd348a2b
Author: Remy Noulin <loader2x@gmail.com>
Date:   Fri, 16 Aug 2024 09:37:36 +0200

add support for riscv cpus

tested with gcc 14 in debian sid with rv64 cpu

update copyright year

LICENSE                                     |  2 +-
genMake.c                                   | 10 +++++++---
make.sh                                     |  2 ++
release/json/libsheepyCSmallArray.h         |  2 +-
release/json/libsheepyCSmallBool.h          |  2 +-
release/json/libsheepyCSmallBytes.h         |  2 +-
release/json/libsheepyCSmallContainer.h     |  2 +-
release/json/libsheepyCSmallDict.h          |  2 +-
release/json/libsheepyCSmallDouble.h        |  2 +-
release/json/libsheepyCSmallInt.h           |  2 +-
release/json/libsheepyCSmallJson.h          |  2 +-
release/json/libsheepyCSmallString.h        |  2 +-
release/json/libsheepyCUndefined.h          |  2 +-
release/json/recycleContainers.h            |  2 +-
release/libsheepy.c                         | 12 ++++++------
release/libsheepy.h                         |  6 +++---
release/libsheepyObject.h                   |  2 +-
release/libsheepySmall.c                    |  2 +-
release/libsheepySmall.h                    |  2 +-
src/json/libsheepyCSmallArray.c             |  2 +-
src/json/libsheepyCSmallArray.h             |  2 +-
src/json/libsheepyCSmallArrayInternal.h     |  2 +-
src/json/libsheepyCSmallBool.c              |  2 +-
src/json/libsheepyCSmallBool.h              |  2 +-
src/json/libsheepyCSmallBoolInternal.h      |  2 +-
src/json/libsheepyCSmallBytes.c             |  2 +-
src/json/libsheepyCSmallBytes.h             |  2 +-
src/json/libsheepyCSmallBytesInternal.h     |  2 +-
src/json/libsheepyCSmallContainer.c         |  2 +-
src/json/libsheepyCSmallContainer.h         |  2 +-
src/json/libsheepyCSmallContainerInternal.h |  2 +-
src/json/libsheepyCSmallDict.c              |  2 +-
src/json/libsheepyCSmallDict.h              |  2 +-
src/json/libsheepyCSmallDictInternal.h      |  2 +-
src/json/libsheepyCSmallDouble.c            |  2 +-
src/json/libsheepyCSmallDouble.h            |  2 +-
src/json/libsheepyCSmallDoubleInternal.h    |  2 +-
src/json/libsheepyCSmallInt.c               |  2 +-
src/json/libsheepyCSmallInt.h               |  2 +-
src/json/libsheepyCSmallIntInternal.h       |  2 +-
src/json/libsheepyCSmallJson.c              |  2 +-
src/json/libsheepyCSmallJson.h              |  2 +-
src/json/libsheepyCSmallJsonInternal.h      |  2 +-
src/json/libsheepyCSmallString.c            |  2 +-
src/json/libsheepyCSmallString.h            |  2 +-
src/json/libsheepyCSmallStringInternal.h    |  2 +-
src/json/libsheepyCUndefined.c              |  2 +-
src/json/libsheepyCUndefined.h              |  2 +-
src/json/libsheepyCUndefinedInternal.h      |  2 +-
src/json/libsheepyObject.c                  |  2 +-
src/json/recycleContainers.h                |  2 +-
src/libsheepy.c                             | 12 ++++++------
src/libsheepy.h                             |  6 +++---
src/libsheepyObject.h                       |  2 +-
src/libsheepySmall.c                        |  2 +-
src/libsheepySmall.h                        |  2 +-
56 files changed, 77 insertions(+), 71 deletions(-)

Diffstat:
MLICENSE | 2+-
MgenMake.c | 10+++++++---
Mmake.sh | 2++
Mrelease/json/libsheepyCSmallArray.h | 2+-
Mrelease/json/libsheepyCSmallBool.h | 2+-
Mrelease/json/libsheepyCSmallBytes.h | 2+-
Mrelease/json/libsheepyCSmallContainer.h | 2+-
Mrelease/json/libsheepyCSmallDict.h | 2+-
Mrelease/json/libsheepyCSmallDouble.h | 2+-
Mrelease/json/libsheepyCSmallInt.h | 2+-
Mrelease/json/libsheepyCSmallJson.h | 2+-
Mrelease/json/libsheepyCSmallString.h | 2+-
Mrelease/json/libsheepyCUndefined.h | 2+-
Mrelease/json/recycleContainers.h | 2+-
Mrelease/libsheepy.c | 12++++++------
Mrelease/libsheepy.h | 6+++---
Mrelease/libsheepyObject.h | 2+-
Mrelease/libsheepySmall.c | 2+-
Mrelease/libsheepySmall.h | 2+-
Msrc/json/libsheepyCSmallArray.c | 2+-
Msrc/json/libsheepyCSmallArray.h | 2+-
Msrc/json/libsheepyCSmallArrayInternal.h | 2+-
Msrc/json/libsheepyCSmallBool.c | 2+-
Msrc/json/libsheepyCSmallBool.h | 2+-
Msrc/json/libsheepyCSmallBoolInternal.h | 2+-
Msrc/json/libsheepyCSmallBytes.c | 2+-
Msrc/json/libsheepyCSmallBytes.h | 2+-
Msrc/json/libsheepyCSmallBytesInternal.h | 2+-
Msrc/json/libsheepyCSmallContainer.c | 2+-
Msrc/json/libsheepyCSmallContainer.h | 2+-
Msrc/json/libsheepyCSmallContainerInternal.h | 2+-
Msrc/json/libsheepyCSmallDict.c | 2+-
Msrc/json/libsheepyCSmallDict.h | 2+-
Msrc/json/libsheepyCSmallDictInternal.h | 2+-
Msrc/json/libsheepyCSmallDouble.c | 2+-
Msrc/json/libsheepyCSmallDouble.h | 2+-
Msrc/json/libsheepyCSmallDoubleInternal.h | 2+-
Msrc/json/libsheepyCSmallInt.c | 2+-
Msrc/json/libsheepyCSmallInt.h | 2+-
Msrc/json/libsheepyCSmallIntInternal.h | 2+-
Msrc/json/libsheepyCSmallJson.c | 2+-
Msrc/json/libsheepyCSmallJson.h | 2+-
Msrc/json/libsheepyCSmallJsonInternal.h | 2+-
Msrc/json/libsheepyCSmallString.c | 2+-
Msrc/json/libsheepyCSmallString.h | 2+-
Msrc/json/libsheepyCSmallStringInternal.h | 2+-
Msrc/json/libsheepyCUndefined.c | 2+-
Msrc/json/libsheepyCUndefined.h | 2+-
Msrc/json/libsheepyCUndefinedInternal.h | 2+-
Msrc/json/libsheepyObject.c | 2+-
Msrc/json/recycleContainers.h | 2+-
Msrc/libsheepy.c | 12++++++------
Msrc/libsheepy.h | 6+++---
Msrc/libsheepyObject.h | 2+-
Msrc/libsheepySmall.c | 2+-
Msrc/libsheepySmall.h | 2+-
56 files changed, 77 insertions(+), 71 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Remy Noulin +Copyright (c) 2024 Remy Noulin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/genMake.c b/genMake.c @@ -152,7 +152,7 @@ bool fileExists(const char *filePath) { int main(int ARGC, char** ARGV) { -#if __arm__ || __aarch64__ +#if __arm__ || __aarch64__ || __riscv // remove -mrdrnd cflag in Makefile on ARM platforms // because there is no HW random number generator @@ -161,9 +161,13 @@ int main(int ARGC, char** ARGV) { char *B = readFileToS("buildMemcheck.sh"); char *a = readFileToS("buildAsan.sh"); #if !TERMUX +#if __riscv + puts("RISCV cpu"); +#else puts("ARM cpu"); +#endif iReplaceS(&m, " -mrdrnd", "", 1); - iReplaceS(&b, " -mrdrnd", "", 1); + iReplaceS(&b, " -mrdrnd", "", 2); iReplaceS(&B, " -mrdrnd", "", 1); iReplaceS(&a, " -mrdrnd", "", 1); #else // #if !TERMUX @@ -191,7 +195,7 @@ int main(int ARGC, char** ARGV) { free(B); free(a); -#endif // #if __arm__ || __aarch64__ +#endif // #if __arm__ || __aarch64__ || __riscv #if __APPLE__ diff --git a/make.sh b/make.sh @@ -17,3 +17,5 @@ echo Building libsheepy without container recycling for memcheck # reset Makefile (modified on ARM platforms) git checkout Makefile git checkout build.sh +git checkout buildAsan.sh +git checkout buildMemcheck.sh diff --git a/release/json/libsheepyCSmallArray.h b/release/json/libsheepyCSmallArray.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallBool.h b/release/json/libsheepyCSmallBool.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallBytes.h b/release/json/libsheepyCSmallBytes.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallContainer.h b/release/json/libsheepyCSmallContainer.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallDict.h b/release/json/libsheepyCSmallDict.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallDouble.h b/release/json/libsheepyCSmallDouble.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallInt.h b/release/json/libsheepyCSmallInt.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallJson.h b/release/json/libsheepyCSmallJson.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCSmallString.h b/release/json/libsheepyCSmallString.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/libsheepyCUndefined.h b/release/json/libsheepyCUndefined.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/json/recycleContainers.h b/release/json/recycleContainers.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/libsheepy.c b/release/libsheepy.c @@ -2,7 +2,7 @@ // // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -75,7 +75,7 @@ typedef enum { LOCALE_NORMAL, LOCALE_TURKIC, LOCALE_LITHUANIAN } localeType; #endif #if ((__FreeBSD__)) #endif -#if (!(__arm__ || __aarch64__ || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) +#if (!(__arm__ || __aarch64__ || __riscv || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) internal void segfault_sigaction(int signal, siginfo_t *si, void *arg); internal void segfault_sigaction(int signal UNUSED, siginfo_t *si UNUSED, void *arg UNUSED); #endif @@ -888,7 +888,7 @@ static struct sigaction default_sa = init0Var; * * prints line and file where the segfault crash occured */ -#if (!(__arm__ || __aarch64__ || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) +#if (!(__arm__ || __aarch64__ || __riscv || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) internal void segfault_sigaction(int signal, siginfo_t *si, void *arg) { /* char addr[20] */ @@ -908,7 +908,7 @@ internal void segfault_sigaction(int signal, siginfo_t *si, void *arg) { default_sa.sa_sigaction(signal, si, arg); } -#else // __arm__ || __aarch64__ || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__ +#else // __arm__ || __aarch64__ || __riscv || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__ internal void segfault_sigaction(int signal UNUSED, siginfo_t *si UNUSED, void *arg UNUSED) { // call default signal handler @@ -5969,7 +5969,7 @@ uint64_t randomWordFromHW(void) { unsigned long long r; #ifdef __GNUC__ - #if (!defined(__arm__) && !defined(__aarch64__) && !defined(__i386__)) + #if (!defined(__arm__) && !defined(__aarch64__) && !defined(__riscv) && !defined(__i386__)) // TODO valgrind doesn't support the rdrand instruction 171117 #ifndef unitTest _rdrand64_step(&r); @@ -5980,7 +5980,7 @@ uint64_t randomWordFromHW(void) { #else logE("HW Random generator not available on the ARM platform"); return(0); - // __arm__ || __aarch64__ || __i386__ + // __arm__ || __aarch64__ || __riscv || __i386__ #endif // __GNUC__ #endif diff --git a/release/libsheepy.h b/release/libsheepy.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,9 +36,9 @@ #include <stdlib.h> #include <ctype.h> #ifdef __GNUC__ -#if !defined(__arm__) && !defined(__aarch64__) +#if !defined(__arm__) && !defined(__aarch64__) && !defined(__riscv) #include <immintrin.h> -#endif // #if !defined(__arm__) && !defined(__aarch64__) +#endif // #if !defined(__arm__) && !defined(__aarch64__) && !defined(__riscv) #endif // __GNUC__ #include <time.h> #include <setjmp.h> diff --git a/release/libsheepyObject.h b/release/libsheepyObject.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/libsheepySmall.c b/release/libsheepySmall.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/release/libsheepySmall.h b/release/libsheepySmall.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallArray.c b/src/json/libsheepyCSmallArray.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallArray.h b/src/json/libsheepyCSmallArray.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallArrayInternal.h b/src/json/libsheepyCSmallArrayInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallBool.c b/src/json/libsheepyCSmallBool.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallBool.h b/src/json/libsheepyCSmallBool.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallBoolInternal.h b/src/json/libsheepyCSmallBoolInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallBytes.c b/src/json/libsheepyCSmallBytes.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallBytes.h b/src/json/libsheepyCSmallBytes.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallBytesInternal.h b/src/json/libsheepyCSmallBytesInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallContainer.c b/src/json/libsheepyCSmallContainer.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallContainer.h b/src/json/libsheepyCSmallContainer.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallContainerInternal.h b/src/json/libsheepyCSmallContainerInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallDict.c b/src/json/libsheepyCSmallDict.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallDict.h b/src/json/libsheepyCSmallDict.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallDictInternal.h b/src/json/libsheepyCSmallDictInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallDouble.c b/src/json/libsheepyCSmallDouble.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallDouble.h b/src/json/libsheepyCSmallDouble.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallDoubleInternal.h b/src/json/libsheepyCSmallDoubleInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallInt.c b/src/json/libsheepyCSmallInt.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallInt.h b/src/json/libsheepyCSmallInt.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallIntInternal.h b/src/json/libsheepyCSmallIntInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallJson.c b/src/json/libsheepyCSmallJson.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallJson.h b/src/json/libsheepyCSmallJson.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallJsonInternal.h b/src/json/libsheepyCSmallJsonInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallString.c b/src/json/libsheepyCSmallString.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallString.h b/src/json/libsheepyCSmallString.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCSmallStringInternal.h b/src/json/libsheepyCSmallStringInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCUndefined.c b/src/json/libsheepyCUndefined.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCUndefined.h b/src/json/libsheepyCUndefined.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyCUndefinedInternal.h b/src/json/libsheepyCUndefinedInternal.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/libsheepyObject.c b/src/json/libsheepyObject.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/json/recycleContainers.h b/src/json/recycleContainers.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/libsheepy.c b/src/libsheepy.c @@ -2,7 +2,7 @@ // // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -77,7 +77,7 @@ typedef enum { LOCALE_NORMAL, LOCALE_TURKIC, LOCALE_LITHUANIAN } localeType; #endif void *myMalloc(size_t l); void *myRealloc(void *buffer, size_t l); -#if (!(__arm__ || __aarch64__ || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) +#if (!(__arm__ || __aarch64__ || __riscv || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) internal void segfault_sigaction(int signal, siginfo_t *si, void *arg); internal void segfault_sigaction(int signal UNUSED, siginfo_t *si UNUSED, void *arg UNUSED); #endif @@ -944,7 +944,7 @@ static struct sigaction default_sa = init0Var; * * prints line and file where the segfault crash occured */ -#if (!(__arm__ || __aarch64__ || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) +#if (!(__arm__ || __aarch64__ || __riscv || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__)) internal void segfault_sigaction(int signal, siginfo_t *si, void *arg) { /* char addr[20] */ @@ -964,7 +964,7 @@ internal void segfault_sigaction(int signal, siginfo_t *si, void *arg) { default_sa.sa_sigaction(signal, si, arg); } -#else // __arm__ || __aarch64__ || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__ +#else // __arm__ || __aarch64__ || __riscv || __APPLE__ || __i386__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __HAIKU__ internal void segfault_sigaction(int signal UNUSED, siginfo_t *si UNUSED, void *arg UNUSED) { // call default signal handler @@ -6025,7 +6025,7 @@ uint64_t randomWordFromHW(void) { unsigned long long r; #ifdef __GNUC__ - #if (!defined(__arm__) && !defined(__aarch64__) && !defined(__i386__)) + #if (!defined(__arm__) && !defined(__aarch64__) && !defined(__riscv) && !defined(__i386__)) // TODO valgrind doesn't support the rdrand instruction 171117 #ifndef unitTest _rdrand64_step(&r); @@ -6036,7 +6036,7 @@ uint64_t randomWordFromHW(void) { #else logE("HW Random generator not available on the ARM platform"); return(0); - // __arm__ || __aarch64__ || __i386__ + // __arm__ || __aarch64__ || __riscv || __i386__ #endif // __GNUC__ #endif diff --git a/src/libsheepy.h b/src/libsheepy.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,9 +36,9 @@ #include <stdlib.h> #include <ctype.h> #ifdef __GNUC__ -#if !defined(__arm__) && !defined(__aarch64__) +#if !defined(__arm__) && !defined(__aarch64__) && !defined(__riscv) #include <immintrin.h> -#endif // #if !defined(__arm__) && !defined(__aarch64__) +#endif // #if !defined(__arm__) && !defined(__aarch64__) && !defined(__riscv) #endif // __GNUC__ #include <time.h> #include <setjmp.h> diff --git a/src/libsheepyObject.h b/src/libsheepyObject.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/libsheepySmall.c b/src/libsheepySmall.c @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/libsheepySmall.h b/src/libsheepySmall.h @@ -1,6 +1,6 @@ // MIT License // -// Copyright (c) 2023 Remy Noulin +// Copyright (c) 2024 Remy Noulin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal