From b69becdebf69b1abbdbe1403c48ba9b3708d2a59 Mon Sep 17 00:00:00 2001 From: Gabriel Wang Date: Wed, 5 Aug 2020 16:54:36 +0100 Subject: [PATCH] add __PLOOC_CLASS_IMPLEMENT__ and __PLOOC_CLASS_INHERIT__ --- README.md | 3 +++ example/byte_queue/byte_queue.h | 4 +-- .../enhanced_byte_queue/enhanced_byte_queue.h | 4 +-- example/project/mdk/plooc_example.uvprojx | 26 +++++++++++++++---- plooc_class.h | 2 ++ plooc_class_black_box.h | 4 ++- plooc_class_simple.h | 10 ++++--- plooc_class_simple_c90.h | 7 +++-- plooc_class_strict.h | 6 +++-- 9 files changed, 48 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 953016b..04c95e9 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,9 @@ If you have any questions or suggestions, please feel free to let us know. ## Update Log --- +- \[05/08/2020\] Add \_\_PLOOC\_CLASS\_IMPLEMENT\_\_ and \_\_PLOOC\_CLASS\_INHERIT\_\_ version 4.5.6 + - use \_\_xxxxx\_\_ as emphasis because \_\_xxxxx usually means "internal" + - The original \_\_PLOOC\_CLASS\_IMPLEMENT and \_\_PLOOC\_CLASS\_INHERIT are deprecated and will be kept for a while before completely removed. - \[18/05/2020\] Introduce both short- and long- style of macro, version 4.5.5 - dcl_xxxxx/declare_xxxxx - def_xxxx/define_xxxxx; end_def_xxxx/end_define_xxxx diff --git a/example/byte_queue/byte_queue.h b/example/byte_queue/byte_queue.h index bc2f8ff..87a6786 100644 --- a/example/byte_queue/byte_queue.h +++ b/example/byte_queue/byte_queue.h @@ -37,9 +37,9 @@ typedef struct mem_t { #define __PLOOC_CLASS_USE_STRICT_TEMPLATE__ #if defined(__BYTE_QUEUE_CLASS_IMPLEMENT) -# define __PLOOC_CLASS_IMPLEMENT +# define __PLOOC_CLASS_IMPLEMENT__ #elif defined(__BYTE_QUEUE_CLASS_INHERIT) -# define __PLOOC_CLASS_INHERIT +# define __PLOOC_CLASS_INHERIT__ #endif #include "plooc_class.h" diff --git a/example/enhanced_byte_queue/enhanced_byte_queue.h b/example/enhanced_byte_queue/enhanced_byte_queue.h index 96a0c32..6a601c8 100644 --- a/example/enhanced_byte_queue/enhanced_byte_queue.h +++ b/example/enhanced_byte_queue/enhanced_byte_queue.h @@ -34,10 +34,10 @@ #define __PLOOC_CLASS_USE_STRICT_TEMPLATE__ #if defined(__ENHANCED_BYTE_QUEUE_CLASS_IMPLEMENT) -# define __PLOOC_CLASS_IMPLEMENT +# define __PLOOC_CLASS_IMPLEMENT__ # undef __ENHANCED_BYTE_QUEUE_CLASS_IMPLEMENT #elif defined(__ENHANCED_BYTE_QUEUE_CLASS_INHERIT) -# define __PLOOC_CLASS_INHERIT +# define __PLOOC_CLASS_INHERIT__ # undef __ENHANCED_BYTE_QUEUE_CLASS_INHERIT #endif diff --git a/example/project/mdk/plooc_example.uvprojx b/example/project/mdk/plooc_example.uvprojx index caa0f9f..e381625 100644 --- a/example/project/mdk/plooc_example.uvprojx +++ b/example/project/mdk/plooc_example.uvprojx @@ -10,7 +10,7 @@ arm_compiler_6_example 0x4 ARM-ADS - 6140000::V6.14.0.2 (dev drop 2)::..\..\Program Files\ARMCompiler6.14Internal + 6150000::V6.15.0.1 dev::.\ARMCompiler6.15 1 @@ -185,6 +185,7 @@ 0 0 0 + 0 0 0 8 @@ -336,7 +337,7 @@ 0 -fms-extensions -Wno-microsoft-anon-tag -Wno-empty-body - _MSC_VER + _MSC_VER __OOC_DEBUG__ ..\mdk;..\..\..\example;..\..\..\..\PLOOC @@ -351,7 +352,7 @@ 0 0 0 - 0 + 4 @@ -487,8 +488,8 @@ - - + + @@ -528,4 +529,19 @@ + + + + <Project Info> + + + + + + 0 + 1 + + + + diff --git a/plooc_class.h b/plooc_class.h index 890da4e..40d7e99 100644 --- a/plooc_class.h +++ b/plooc_class.h @@ -321,6 +321,8 @@ extern "C" { #undef __PLOOC_CLASS_USE_SIMPLE_TEMPLATE__ #undef __PLOOC_CLASS_USE_BLACK_BOX_TEMPLATE__ #undef __PLOOC_CLASS_IMPLEMENT +#undef __PLOOC_CLASS_IMPLEMENT__ +#undef __PLOOC_CLASS_INHERIT__ #undef __PLOOC_CLASS_INHERIT #if defined(__cplusplus) diff --git a/plooc_class_black_box.h b/plooc_class_black_box.h index dff4831..0016002 100644 --- a/plooc_class_black_box.h +++ b/plooc_class_black_box.h @@ -42,7 +42,7 @@ extern "C" { #undef __class /*============================ MACROFIED FUNCTIONS ===========================*/ -#if defined(__PLOOC_CLASS_IMPLEMENT) +#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT) # ifdef __OOC_DEBUG__ # define __def_class(__NAME, __PUBLIC ,...) \ @@ -237,6 +237,8 @@ extern "C" { /*============================ LOCAL VARIABLES ===============================*/ /*============================ PROTOTYPES ====================================*/ +#undef __PLOOC_CLASS_IMPLEMENT__ +#undef __PLOOC_CLASS_INHERIT__ #undef __PLOOC_CLASS_IMPLEMENT #undef __PLOOC_CLASS_INHERIT diff --git a/plooc_class_simple.h b/plooc_class_simple.h index 402e439..4e15f35 100644 --- a/plooc_class_simple.h +++ b/plooc_class_simple.h @@ -65,13 +65,13 @@ extern "C" { # define protected_member(...) PLOOC_VISIBLE(__VA_ARGS__) # define public_member(...) PLOOC_VISIBLE(__VA_ARGS__) -#elif defined(__PLOOC_CLASS_IMPLEMENT) +#elif defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT) # define private_member(...) PLOOC_VISIBLE(__VA_ARGS__) # define protected_member(...) PLOOC_VISIBLE(__VA_ARGS__) # define public_member(...) PLOOC_VISIBLE(__VA_ARGS__) -#elif defined(__PLOOC_CLASS_INHERIT) +#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT) # define private_member(...) PLOOC_INVISIBLE(__VA_ARGS__) # define protected_member(...) PLOOC_VISIBLE(__VA_ARGS__) @@ -109,7 +109,7 @@ extern "C" { }; -#if defined(__PLOOC_CLASS_IMPLEMENT) +#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT) # undef __class # define __class(__NAME) __NAME @@ -144,7 +144,7 @@ extern "C" { #define __end_extern_class(...) -#elif defined(__PLOOC_CLASS_INHERIT) +#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT) # undef __class_protected # define __class_protected(__NAME) __NAME @@ -205,6 +205,8 @@ extern "C" { #define end_extern_class(__NAME, ...) __end_extern_class(__NAME, __VA_ARGS__) +#undef __PLOOC_CLASS_IMPLEMENT__ +#undef __PLOOC_CLASS_INHERIT__ #undef __PLOOC_CLASS_IMPLEMENT #undef __PLOOC_CLASS_INHERIT /*============================ TYPES =========================================*/ diff --git a/plooc_class_simple_c90.h b/plooc_class_simple_c90.h index c188fb4..34988b7 100644 --- a/plooc_class_simple_c90.h +++ b/plooc_class_simple_c90.h @@ -91,7 +91,7 @@ extern "C" { }; -#if defined(__PLOOC_CLASS_IMPLEMENT) +#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT) # undef __class # define __class(__NAME) __NAME @@ -112,7 +112,7 @@ extern "C" { #define __end_extern_class(__NAME) -#elif defined(__PLOOC_CLASS_INHERIT) +#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT) # undef __class_protected # define __class_protected(__NAME) __NAME @@ -157,8 +157,11 @@ extern "C" { #define end_extern_class(__name) __end_extern_class(__name) +#undef __PLOOC_CLASS_IMPLEMENT__ +#undef __PLOOC_CLASS_INHERIT__ #undef __PLOOC_CLASS_IMPLEMENT #undef __PLOOC_CLASS_INHERIT + /*============================ TYPES =========================================*/ /*============================ GLOBAL VARIABLES ==============================*/ /*============================ LOCAL VARIABLES ===============================*/ diff --git a/plooc_class_strict.h b/plooc_class_strict.h index 81291fb..4bf9913 100644 --- a/plooc_class_strict.h +++ b/plooc_class_strict.h @@ -68,7 +68,7 @@ extern "C" { /*============================ MACROFIED FUNCTIONS ===========================*/ -#if defined(__PLOOC_CLASS_IMPLEMENT) +#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT) # define __def_class2(__NAME, _1) \ typedef struct __NAME __NAME; \ @@ -220,7 +220,7 @@ extern "C" { __class_internal(__SRC, __DES, __TYPE, __VA_ARGS__) -#elif defined(__PLOOC_CLASS_INHERIT) +#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT) # define __def_class2(__NAME, _1) \ typedef struct __NAME __NAME; \ @@ -456,6 +456,8 @@ extern "C" { #define end_extern_class(...) __end_extern_class(__VA_ARGS__) +#undef __PLOOC_CLASS_IMPLEMENT__ +#undef __PLOOC_CLASS_INHERIT__ #undef __PLOOC_CLASS_IMPLEMENT #undef __PLOOC_CLASS_INHERIT /*============================ TYPES =========================================*/