Skip to contentSkip to conversation

Make some ELL headers completely self-contained.

PATCH In review Ossama Othman 3 participants 5 messages Mar 8, 2017 – Mar 9, 2017

lore
Share & tools
lore
#0 lore raw

cover Make some ELL headers completely self-contained.

These patches address some compile-time errors encountered when attempting to use functions and macros declared in installed ELL headers. The headers in question were not completely self-contained.

Ossama Othman (2):
main: Fixed missing uint32_t typedef error
log: Fixed missing L_STRINGIFY macro definition

 ell/log.c  | 1 -
 ell/log.h  | 2 ++
 ell/main.h | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 main: Fixed missing uint32_t typedef error

Include <stdint.h> in <ell/main.h> to address a compile-time error that occurred when including the latter header alone.

---
 ell/main.h | 1 +
 1 file changed, 1 insertion(+)
ell/main.h +1 -0
index c23ec55..ed0c76f 100644
@@ -24,6 +24,7 @@
 #define __ELL_MAIN_H
 
 #include <stdbool.h>
+#include <stdint.h>
 
 #ifdef __cplusplus
 extern "C" {
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 log: Fixed missing L_STRINGIFY macro definition

In reply to Ossama Othman

The l_log() macro in the <ell/log.h> header uses the L_STRINGIFY macro defined in <ell/util.h> but doesn't include that header. That triggered a compile-time error in some cases where <ell/util.h> was not indirectly pulled in before <ell/log.h>.

---
 ell/log.c | 1 -
 ell/log.h | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
ell/log.c +0 -1
index 8891d0a..e6682cf 100644
@@ -34,7 +34,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 
-#include "util.h"
 #include "log.h"
 #include "private.h"
 
ell/log.h +2 -0
index 670cef2..916f08b 100644
@@ -26,6 +26,8 @@
 #include <stdarg.h>
 #include <stdbool.h>
 
+#include <ell/util.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
Signature · 1 line
2.7.4
#3 lore raw
In reply to Ossama Othman

Hi Ossama,

Quoted 8 lines · Ossama Othman

These patches address some compile-time errors encountered when attempting to use functions and macros declared in installed ELL headers. The headers in question were not completely self-contained.

Ossama Othman (2):
main: Fixed missing uint32_t typedef error
log: Fixed missing L_STRINGIFY macro definition

Both applied. Though I wonder why you're not including ell/ell.h and including these headers individually.

Regards,
-Denis

#4 lore raw

Hi Denis,

Quoted 7 lines · Denis Kenzior
Quoted 4 lines · Ossama Othman

These patches address some compile-time errors encountered when attempting to use functions and macros declared in installed ELL headers. The headers in question were not completely self-contained.

Quoted 7 lines
Quoted 5 lines

Ossama Othman (2):
main: Fixed missing uint32_t typedef error
log: Fixed missing L_STRINGIFY macro definition

Both applied. Though I wonder why you're not including ell/ell.h and including these headers individually.

Honestly, I had not noticed that header until you mentioned it. Now I see that the ELL examples include that header, too. I'll use it instead. Thanks for correcting my usage. :)

-Ossama