diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-23 17:41:23 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-23 17:41:23 +0900 |
| commit | 8646e6f693fd935c6cb81e776a6c92a3fd093a33 (patch) | |
| tree | 450b60115282243bf0567b495e9e85f0d56abba1 /src/common.c | |
| parent | d83647f390d2910547ada2854eee6189e8552cb8 (diff) | |
| download | ducc-8646e6f693fd935c6cb81e776a6c92a3fd093a33.tar.gz ducc-8646e6f693fd935c6cb81e776a6c92a3fd093a33.tar.zst ducc-8646e6f693fd935c6cb81e776a6c92a3fd093a33.zip | |
feat: output executable using gcc
Diffstat (limited to 'src/common.c')
| -rw-r--r-- | src/common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c index 3553419..4e747bb 100644 --- a/src/common.c +++ b/src/common.c @@ -11,6 +11,14 @@ void fatal_error(const char* msg, ...) { #define unimplemented() fatal_error("%s:%d: unimplemented", __FILE__, __LINE__) +BOOL str_ends_with(const char* s, const char* suffix) { + size_t l1 = strlen(s); + size_t l2 = strlen(suffix); + if (l1 < l2) + return FALSE; + return strcmp(s + l1 - l2, suffix) == 0; +} + struct StrBuilder { size_t len; size_t capacity; |
