aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/base.c5
-rw-r--r--lib/base.h2
-rw-r--r--lib/inst.c4
-rw-r--r--lib/inst.h6
4 files changed, 9 insertions, 8 deletions
diff --git a/lib/base.c b/lib/base.c
index b7a6ed5..a2763c4 100644
--- a/lib/base.c
+++ b/lib/base.c
@@ -10,11 +10,10 @@
* Description: Implementation of basic library functions
*/
-#include <endian.h>
-#include <string.h>
-
#include "./base.h"
+#include <string.h>
+
hword convert_bytes_to_hword(byte *bytes)
{
hword be_h = 0;
diff --git a/lib/base.h b/lib/base.h
index 3b2d50b..daa6c58 100644
--- a/lib/base.h
+++ b/lib/base.h
@@ -13,6 +13,8 @@
#ifndef BASE_H
#define BASE_H
+#define _DEFAULT_SOURCE
+#include <endian.h>
#include <stdint.h>
/* Basic macros for a variety of uses. Quite self explanatory. */
diff --git a/lib/inst.c b/lib/inst.c
index eb8b5d2..f3f0598 100644
--- a/lib/inst.c
+++ b/lib/inst.c
@@ -10,13 +10,13 @@
* Description: Implementation of bytecode for instructions
*/
+#include "./inst.h"
+
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
-#include "./inst.h"
-
const char *opcode_as_cstr(opcode_t code)
{
switch (code)
diff --git a/lib/inst.h b/lib/inst.h
index e6225a6..fdba26f 100644
--- a/lib/inst.h
+++ b/lib/inst.h
@@ -13,12 +13,12 @@
#ifndef INST_H
#define INST_H
-#include <stdio.h>
-#include <stdlib.h>
-
#include <lib/base.h>
#include <lib/darr.h>
+#include <stdio.h>
+#include <stdlib.h>
+
typedef enum
{
OP_NOOP = 0,