Skip to content

Commit

Permalink
corec: always define OFS() to C11 offsetof()
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Jan 1, 2025
1 parent e32def9 commit dfa2632
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions corec/corec/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@
#ifndef __HELPER_H
#define __HELPER_H

#ifdef __cplusplus
#define OFS(name,item) offsetof(name,item)
#else // !__cplusplus
#ifdef TARGET_LINUX
#include <stddef.h>
#define OFS(name,item) offsetof(name,item)
#else
#define OFS(name,item) ((uintptr_t)&(((name*)NULL)->item))
#endif
#endif // !__cplusplus

#define ALIGN64(x) (((x) + 63) & ~63)
#define ALIGN16(x) (((x) + 15) & ~15)
#define ALIGN8(x) (((x) + 7) & ~7)
Expand Down

0 comments on commit dfa2632

Please sign in to comment.