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 d6414473bca896054ca7e4eec16ba5ceca934f86
parent 3d5b7f6cc722398b3fbb1a8563bae9bed4449207
Author: Remy Noulin <loader2x@gmail.com>
Date:   Mon, 14 Jun 2021 10:12:31 +0200

fix o() macro for methods without parameters

Before this patch, the macro O() was used for calling object methods
without parameters.
Now it is possible to use o() for all methods:

o(string, upper);

release/libsheepy.h       | 2 +-
release/libsheepyObject.h | 5 ++++-
src/libsheepy.h           | 2 +-
src/libsheepyObject.h     | 5 ++++-
4 files changed, 10 insertions(+), 4 deletions(-)

Diffstat:
Mrelease/libsheepy.h | 2+-
Mrelease/libsheepyObject.h | 5++++-
Msrc/libsheepy.h | 2+-
Msrc/libsheepyObject.h | 5++++-
4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/release/libsheepy.h b/release/libsheepy.h @@ -98,7 +98,7 @@ // version accoring to the version package: Release.Major.minor.patch // https://noulin.net/version/file/README.md.html -#define LIBSHEEPY_VERSION "2.2.5.3" +#define LIBSHEEPY_VERSION "2.2.5.4" #ifndef SH_PREFIX #define SH_PREFIX(NAME) NAME diff --git a/release/libsheepyObject.h b/release/libsheepyObject.h @@ -392,8 +392,11 @@ void finishManyOF(void *paramType, ...); * The o macro simplies the creation of new classes * inheriting from the base class removing the need * to create macros to access the methods + * Note: With GCC, the preprocessor eliminates the comma in + * , ## __VA_ARGS__ + * if __VA_ARGS__ is empty. (https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html) */ -#define o(obj, method, ...) (obj)->f->method(obj, __VA_ARGS__) +#define o(obj, method, ...) (obj)->f->method(obj, ## __VA_ARGS__) /** * iterators diff --git a/src/libsheepy.h b/src/libsheepy.h @@ -98,7 +98,7 @@ // version accoring to the version package: Release.Major.minor.patch // https://noulin.net/version/file/README.md.html -#define LIBSHEEPY_VERSION "2.2.5.3" +#define LIBSHEEPY_VERSION "2.2.5.4" #ifndef SH_PREFIX #define SH_PREFIX(NAME) NAME diff --git a/src/libsheepyObject.h b/src/libsheepyObject.h @@ -392,8 +392,11 @@ void finishManyOF(void *paramType, ...); * The o macro simplies the creation of new classes * inheriting from the base class removing the need * to create macros to access the methods + * Note: With GCC, the preprocessor eliminates the comma in + * , ## __VA_ARGS__ + * if __VA_ARGS__ is empty. (https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html) */ -#define o(obj, method, ...) (obj)->f->method(obj, __VA_ARGS__) +#define o(obj, method, ...) (obj)->f->method(obj, ## __VA_ARGS__) /** * iterators