Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc Tielen committed Aug 10, 2023
1 parent 97ff9f5 commit 97dcdae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
18 changes: 13 additions & 5 deletions include/sdb/cwisstable.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@
CWISS_GCC_ALLOW("-Wunused-function") \
CWISS_GCC_ALLOW("-Wunused-parameter") \
CWISS_GCC_ALLOW("-Wcast-qual") \
CWISS_GCC_ALLOW("-Wmissing-field-initializers") \
CWISS_GCC_ALLOW("-Wtypedef-redefinition")
CWISS_GCC_ALLOW("-Wmissing-field-initializers")
#define CWISS_END CWISS_GCC_POP

/// `CWISS_HAVE_SSE2` is nonzero if we have SSE2 support.
Expand Down Expand Up @@ -201,11 +200,20 @@
/// quite believe in it.
#if CWISS_IS_MSVC
#define CWISS_alignas(align_) __declspec(align(align_))
#define alignof __alignof

#else
#include <stdalign.h>

#ifdef alignas
#define CWISS_alignas(align_) alignas(align_)
#else
#define CWISS_alignas(align_) __attribute__((aligned(align_)))
#endif

#endif

#ifndef alignof
#define alignof __alignof
#endif

/// `CWISS_HAVE_BUILTIN` will, in Clang, detect whether a Clang language
Expand Down Expand Up @@ -1639,7 +1647,7 @@ typedef struct {
///
/// See the header documentation for more information.
#define CWISS_DECLARE_NODE_MAP_POLICY(kPolicy_, K_, V_, obj_copy, obj_dtor, key_hash, key_eq) \
typedef struct kPolicy_##_entry_t { \
typedef struct kPolicy_##_entry_t { \
K_ k; \
V_ v; \
} kPolicy_##_Entry; \
Expand Down Expand Up @@ -2674,7 +2682,7 @@ CWISS_BEGIN_EXTERN
/// See header documentation for examples of generated API.
#define CWISS_DECLARE_NODE_HASHMAP(HashMap_, K_, V_, a,b,c,d) \
CWISS_DECLARE_NODE_MAP_POLICY(HashMap_##_kPolicy, K_, V_, a,b,c,d); \
CWISS_DECLARE_HASHMAP_WITH(HashMap_, K_, V_, HashMap_##_kPolicy)
CWISS_DECLARE_HASHMAP_WITH(HashMap_, K_, V_, HashMap_##_kPolicy)

#define CWISS_DECLARE_NODE_HASHMAP_DEFAULT(HashMap_, K_, V_) \
typedef struct { \
Expand Down
2 changes: 1 addition & 1 deletion src/ht_pu.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CWISS_DECLARE_FLAT_HASHMAP_DEFAULT(HtPU, void*, ut64);
#endif

SDB_API HtPU* ht_pu_new0(void) {
HtPU *hm = sdb_gh_calloc (1, sizeof (HtPU));
HtPU *hm = (HtPU*) sdb_gh_calloc (1, sizeof (HtPU));
if (hm) {
*hm = HtPU_new (0);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ht_su.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "sdb/ht_su.h"
#include "sdb/heap.h"
#include "sdb/sdb.h"
#include "../../../libr/include/cwisstable.h" // XXX use cwisstable from sdb itself
#include "sdb/cwisstable.h"

#if defined(__GNUC__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -52,7 +52,7 @@ static inline bool string_eq(const void *a, const void *b) {
#endif

SDB_API HtSU* ht_su_new0(void) {
HtSU *hm = sdb_gh_calloc (1, sizeof (HtSU));
HtSU *hm = (HtSU*) sdb_gh_calloc (1, sizeof (HtSU));
if (hm) {
*hm = HtSU_new (0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ht_uu.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CWISS_DECLARE_FLAT_HASHMAP_DEFAULT(HtUU, ut64, ut64);
#endif

SDB_API HtUU* ht_uu_new0(void) {
HtUU *hm = sdb_gh_calloc (1, sizeof (HtUU));
HtUU *hm = (HtUU*) sdb_gh_calloc (1, sizeof (HtUU));
if (hm) {
*hm = HtUU_new (0);
}
Expand Down

0 comments on commit 97dcdae

Please sign in to comment.