Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions include/fluent-bit/flb_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#ifndef FLB_COMPAT_H
#define FLB_COMPAT_H

#include <string.h>
Comment thread
cosmo0920 marked this conversation as resolved.

/*
* libmonkey exposes compat macros for <unistd.h>, which some platforms lack,
* so include the header here.
Expand Down Expand Up @@ -204,8 +206,14 @@ static inline uint32_t __attribute__((optimize("-O0"))) FLB_ALIGNED_DWORD_READ(u
#endif

#else
static inline uint32_t FLB_ALIGNED_DWORD_READ(unsigned char *source) {
return *((uint32_t *) source);
static inline uint32_t FLB_ALIGNED_DWORD_READ(unsigned char *source)
{
uint32_t result;

/* MessagePack extension payloads are not guaranteed to be aligned. */
memcpy(&result, source, sizeof(result));

return result;
}
#endif

Expand Down
Loading