diff options
| author | Tyge Løvset <[email protected]> | 2022-06-01 18:31:41 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-06-01 18:31:41 +0200 |
| commit | 254e61e2774d6b8fa6064e61c054014bfc460d91 (patch) | |
| tree | 1d350b9370a00cbc87f57ec484620d766788f8f7 /include | |
| parent | de5b9db42473801e83e93b35968c7cfc4b782e3a (diff) | |
| download | STC-modified-254e61e2774d6b8fa6064e61c054014bfc460d91.tar.gz STC-modified-254e61e2774d6b8fa6064e61c054014bfc460d91.zip | |
Reverted to default static linkage of non-templated symbols (cstr, csview, ..), as it gives smaller executables and is convenient for small applications. (no need to define i_implement when functions is used in one translaton unit only).
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cbits.h | 5 | ||||
| -rw-r--r-- | include/stc/crandom.h | 3 | ||||
| -rw-r--r-- | include/stc/cstr.h | 3 | ||||
| -rw-r--r-- | include/stc/csview.h | 3 |
4 files changed, 5 insertions, 9 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h index bf5d5406..f7ce2368 100644 --- a/include/stc/cbits.h +++ b/include/stc/cbits.h @@ -51,7 +51,6 @@ int main() { */ #ifndef CBITS_H_INCLUDED -#define i_header #include "ccommon.h" #include <stdlib.h> #include <string.h> @@ -246,8 +245,8 @@ STC_INLINE bool _i_memb(_disjoint)(const i_type* self, const i_type* other) { return _cbits_disjoint(self->data64, other->data64, _i_memb(_size)(self)); } - -#if defined(i_implement) +/* -------------------------- IMPLEMENTATION ------------------------- */ +#if defined(i_implement) || defined(i_extern) #if !defined i_len STC_DEF cbits* cbits_copy(cbits* self, const cbits* other) { diff --git a/include/stc/crandom.h b/include/stc/crandom.h index ea26eba3..1b94fd66 100644 --- a/include/stc/crandom.h +++ b/include/stc/crandom.h @@ -20,7 +20,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#define i_header #include "ccommon.h" #ifndef CRANDOM_H_INCLUDED @@ -119,7 +118,7 @@ STC_INLINE stc64_normalf_t stc64_normalf_init(double mean, double stddev) { return stc64_normalf_new(mean, stddev); } /* -------------------------- IMPLEMENTATION ------------------------- */ -#if defined(i_implement) +#if defined(i_implement) || defined(i_extern) /* Global random() */ static stc64_t stc64_global = {{ diff --git a/include/stc/cstr.h b/include/stc/cstr.h index b33faf43..1bf58a18 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -30,7 +30,6 @@ #ifndef CSTR_H_INCLUDED #define CSTR_H_INCLUDED -#define i_header #include "ccommon.h" #include "forward.h" #include "utf8.h" @@ -355,7 +354,7 @@ STC_INLINE uint64_t cstr_hash(const cstr *self) { } /* -------------------------- IMPLEMENTATION ------------------------- */ -#if defined(i_implement) +#if defined(i_implement) || defined(i_extern) STC_DEF char* _cstr_internal_move(cstr* self, const size_t pos1, const size_t pos2) { cstr_buf r = cstr_buffer(self); diff --git a/include/stc/csview.h b/include/stc/csview.h index 90e1b10b..e55e547b 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -23,7 +23,6 @@ #ifndef CSVIEW_H_INCLUDED #define CSVIEW_H_INCLUDED -#define i_header #include "ccommon.h" #include "forward.h" #include "utf8.h" @@ -175,7 +174,7 @@ STC_INLINE uint64_t csview_hash(const csview *self) { return c_fasthash(self->str, self->size); } /* -------------------------- IMPLEMENTATION ------------------------- */ -#if defined(i_implement) +#if defined(i_implement) || defined(i_extern) STC_DEF csview csview_substr_ex(csview sv, intptr_t pos, size_t n) { |
