Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/libb2: rename config.h to avoid conflicts in the global namespace, set HAVE_ALIGNED_ACCESS_REQUIRED based on CPU (fixes build on esp8266) #12135

Merged
merged 3 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions cpu/native/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
extern "C" {
#endif

/**
* @brief The CPU supports unaligned memory access.
* Even if the underlying architecture does not support it, the kernel will take care of it.
*/
#define CPU_HAS_UNALIGNED_ACCESS

/**
* @brief Prints the address the callee will return to
*/
Expand Down
12 changes: 9 additions & 3 deletions pkg/libb2/include/config.h → pkg/libb2/include/libb2_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifndef CONFIG_H
#define CONFIG_H
#ifndef LIBB2_CONFIG_H
#define LIBB2_CONFIG_H

#include "cpu.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -13,7 +15,11 @@ extern "C" {
#define NATIVE_LITTLE_ENDIAN
#endif

#ifndef CPU_HAS_UNALIGNED_ACCESS
#define HAVE_ALIGNED_ACCESS_REQUIRED
benpicco marked this conversation as resolved.
Show resolved Hide resolved
#endif

#ifdef __cplusplus
}
#endif
#endif /* CONFIG_H */
#endif /* LIBB2_CONFIG_H */
26 changes: 26 additions & 0 deletions pkg/libb2/patches/0001-rename-config.h-to-libb2_config.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 213f6bb69962154a890925124d44aa8f3361270e Mon Sep 17 00:00:00 2001
benpicco marked this conversation as resolved.
Show resolved Hide resolved
From: Benjamin Valentin <benpicco@googlemail.com>
Date: Sun, 1 Sep 2019 17:21:06 +0200
Subject: [PATCH] rename config.h to libb2_config.h

This avoids conflics with other config.h files
---
src/blake2-impl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/blake2-impl.h b/src/blake2-impl.h
index c99e3de..a8622e7 100644
--- a/src/blake2-impl.h
+++ b/src/blake2-impl.h
@@ -17,7 +17,7 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>
-#include "config.h"
+#include "libb2_config.h"

#define BLAKE2_IMPL_CAT(x,y) x ## y
#define BLAKE2_IMPL_EVAL(x,y) BLAKE2_IMPL_CAT(x,y)
--
2.20.1