diff options
| author | Tyge Løvset <[email protected]> | 2022-12-04 20:52:36 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-04 20:52:36 +0100 |
| commit | 20400977b40599fd1c6637dd659e72b900794d0f (patch) | |
| tree | d4c60a2af4b21d6a6da4e79829254602e5f7c16c /include/stc/utf8.h | |
| parent | 1e0f229b0b044f6df0d0084674f3cf0dc4f4d31d (diff) | |
| download | STC-modified-20400977b40599fd1c6637dd659e72b900794d0f.tar.gz STC-modified-20400977b40599fd1c6637dd659e72b900794d0f.zip | |
Support for linking dependant UTF8 and cstr functions and/or cregex.c by defining i_extern before including <stc/cstr.h> and <stc/cregex.h>. I.e.
#define i_extern
#define i_implement // define cstr functions as shared symbols (static if not defined).
#include <stc/cregex.h> // include cstr.h, utf8code.c, cregex.c, unless already included.
Diffstat (limited to 'include/stc/utf8.h')
| -rw-r--r-- | include/stc/utf8.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/stc/utf8.h b/include/stc/utf8.h index 0ff79fb9..ab39f3ba 100644 --- a/include/stc/utf8.h +++ b/include/stc/utf8.h @@ -1,8 +1,8 @@ #ifndef UTF8_H_INCLUDED #define UTF8_H_INCLUDED +#include "forward.h" #include "ccommon.h" -#include <ctype.h> // utf8 methods defined in src/utf8code.c: @@ -88,4 +88,8 @@ STC_INLINE const char* utf8_at(const char *s, size_t index) { STC_INLINE size_t utf8_pos(const char* s, size_t index) { return (size_t)(utf8_at(s, index) - s); } -#endif +#endif // UTF8_H_INCLUDED +#if defined i_extern || defined STC_EXTERN +# include "../src/utf8code.c" +# undef i_extern +#endif
\ No newline at end of file |
