From 3c0e02f8f6837d6f3eac6ef9028ab3d3994e8dfa Mon Sep 17 00:00:00 2001
From: James Michael DuPont <JamesMikeDuPont@gmail.com>
Date: Sat, 13 Oct 2012 07:15:13 +0200
Subject: [PATCH] patch LibreDWG - Tasks: task #12284, compile with -std=c99

---
 src/decode.c       |    8 +++++---
 src/decode_r2007.c |    2 --
 src/encode.c       |    2 ++
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/decode.c b/src/decode.c
index 5d29ba2..a2f0292 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -277,6 +277,8 @@ resolve_objectref_vector(Dwg_Data * dwg);
 
 int decode_R13_R15(Bit_Chain* dat, Dwg_Data * dwg); // froward
 int read_r2007_meta_data(Bit_Chain *dat, Dwg_Data *dwg);
+int decode_R2004(Bit_Chain* dat, Dwg_Data * dwg); // forward
+int decode_R2007(Bit_Chain* dat, Dwg_Data * dwg); // forward
 
 /*--------------------------------------------------------------------------------
  * Public variables
@@ -2136,7 +2138,7 @@ dwg_resolve_handle(Dwg_Data* dwg, long unsigned int absref)
   return 0;
 }
 
-static Dwg_Object_Ref *
+inline Dwg_Object_Ref *
 dwg_decode_handleref(Bit_Chain * dat, Dwg_Object * obj, Dwg_Data* dwg)
 {
   // Welcome to the house of evil code!
@@ -2205,7 +2207,7 @@ dwg_decode_handleref(Bit_Chain * dat, Dwg_Object * obj, Dwg_Data* dwg)
   return ref;
 }
 
-static Dwg_Object_Ref *
+inline Dwg_Object_Ref *
 dwg_decode_handleref_with_code(Bit_Chain * dat, Dwg_Object * obj, Dwg_Data* dwg, unsigned int code)
 {
   Dwg_Object_Ref * ref;
@@ -2237,7 +2239,7 @@ dwg_decode_header_variables(Bit_Chain* dat, Dwg_Data * dwg)
   #include "header_variables.spec"
 }
 
-static void
+inline void
 dwg_decode_common_entity_handle_data(Bit_Chain * dat, Dwg_Object * obj)
 {
 
diff --git a/src/decode_r2007.c b/src/decode_r2007.c
index b89e585..ca87828 100644
--- a/src/decode_r2007.c
+++ b/src/decode_r2007.c
@@ -25,8 +25,6 @@
 
 static unsigned int loglevel;
 
-#define DWG_LOGLEVEL loglevel
-
 typedef struct r2007_file_header
 {
   int64_t header_size;            // 0x70
diff --git a/src/encode.c b/src/encode.c
index 0c6a0d5..05d8b6d 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -248,6 +248,8 @@ void
 dwg_encode_handleref_with_code(Bit_Chain * dat, Dwg_Object * obj,Dwg_Data* dwg, Dwg_Object_Ref* ref, int code);
 void
 dwg_encode_add_object(Dwg_Object * obj, Bit_Chain * dat, long unsigned int address);
+void 
+dwg_encode_common_entity_handle_data(Bit_Chain * dat, Dwg_Object * obj); 
 
 /*--------------------------------------------------------------------------------
  * Public variables
-- 
1.5.6.5

