Fix sds building with C++

These should really just be macros to shut up our type system.
This commit is contained in:
Matt Stancliff 2015-01-05 12:26:40 -05:00
parent 6a00a4643b
commit 0cacb485fe
1 changed files with 2 additions and 2 deletions

4
sds.h
View File

@ -45,12 +45,12 @@ struct sdshdr {
};
static inline size_t sdslen(const sds s) {
struct sdshdr *sh = (void*)(s-sizeof *sh);
struct sdshdr *sh = (struct sdshdr *)(s-sizeof *sh);
return sh->len;
}
static inline size_t sdsavail(const sds s) {
struct sdshdr *sh = (void*)(s-sizeof *sh);
struct sdshdr *sh = (struct sdshdr *)(s-sizeof *sh);
return sh->free;
}