diff options
| author | Tyge Løvset <[email protected]> | 2022-03-31 15:31:34 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-03-31 15:31:34 +0200 |
| commit | 39dce2065ce5b6b8de5d52d788effe70372e6d47 (patch) | |
| tree | 8453224135890cf51535ef9512e8b2ad2292c6e9 /include | |
| parent | 7e046cecf093e3b71e636b07ef786350c536c1cf (diff) | |
| download | STC-modified-39dce2065ce5b6b8de5d52d788effe70372e6d47.tar.gz STC-modified-39dce2065ce5b6b8de5d52d788effe70372e6d47.zip | |
Some unneeded strictness removed in template.h
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/alt/cstr.h | 2 | ||||
| -rw-r--r-- | include/stc/cstr.h | 2 | ||||
| -rw-r--r-- | include/stc/forward.h | 2 | ||||
| -rw-r--r-- | include/stc/template.h | 20 |
4 files changed, 15 insertions, 11 deletions
diff --git a/include/stc/alt/cstr.h b/include/stc/alt/cstr.h index 536cd10e..5d84f538 100644 --- a/include/stc/alt/cstr.h +++ b/include/stc/alt/cstr.h @@ -26,7 +26,7 @@ */
#ifndef CSTR_H_INCLUDED
#define CSTR_H_INCLUDED
-#define CSTR_USE_SSO
+#define STC_USE_SSO 1
#include <stc/ccommon.h>
#include <stc/forward.h>
diff --git a/include/stc/cstr.h b/include/stc/cstr.h index 5ffd09bf..189fc467 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -21,7 +21,7 @@ * SOFTWARE.
*/
-#ifdef CSTR_USE_SSO
+#ifdef STC_USE_SSO
#include "alt/cstr.h"
#else
#ifndef CSTR_H_INCLUDED
diff --git a/include/stc/forward.h b/include/stc/forward.h index 5dae64c6..06ec3897 100644 --- a/include/stc/forward.h +++ b/include/stc/forward.h @@ -44,7 +44,7 @@ typedef struct { char* data; size_t size, cap; } cstr_rep_t;
typedef char cstr_value;
-#ifdef CSTR_USE_SSO
+#ifdef STC_USE_SSO
typedef union {
struct { char data[sizeof(cstr_rep_t) - 1]; uint8_t last; } sso;
struct { char* data; size_t size, ncap; } lon;
diff --git a/include/stc/template.h b/include/stc/template.h index 269957f5..6e058f19 100644 --- a/include/stc/template.h +++ b/include/stc/template.h @@ -93,8 +93,8 @@ #endif
#endif
-#if defined i_keyraw && !(defined i_keyto && defined i_keyfrom)
- #error "if i_keyraw defined, i_keyfrom and i_keyto must be defined"
+#if defined i_keyraw && !defined i_keyfrom
+ #error "if i_keyraw defined, i_keyfrom (and often i_keyto) must be defined"
#endif
/* Resolve i_drop and i_from here */
@@ -146,8 +146,8 @@ #endif
#endif
-#if defined i_valraw && !(defined i_valto && defined i_valfrom)
- #error "if i_valraw defined, i_valfrom and i_valto must be defined"
+#if defined i_valraw && !defined i_valfrom
+ #error "if i_valraw defined, i_valfrom (and often i_valto) must be defined"
#endif
#ifdef i_key
@@ -158,11 +158,13 @@ #define i_tag i_key
#endif
#if !defined i_keyfrom
+ #define _i_no_keyraw
#define i_keyfrom c_default_from
#endif
#ifndef i_keyraw
- #define _i_no_keyraw
#define i_keyraw i_key
+ #endif
+ #ifndef i_keyto
#define i_keyto c_default_toraw
#endif
#ifndef i_keydrop
@@ -176,13 +178,15 @@ #define i_tag i_val
#endif
#if !defined i_valfrom
- #define i_valfrom c_default_from
-#endif
-#ifndef i_valraw
#if !defined i_key || defined _i_no_keyraw
#define _i_no_raw
#endif
+ #define i_valfrom c_default_from
+#endif
+#ifndef i_valraw
#define i_valraw i_val
+#endif
+#ifndef i_valto
#define i_valto c_default_toraw
#endif
#ifndef i_valdrop
|
