From cde006dce165aa455b7509226b6e0098320b7e27 Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Tue, 13 Feb 2018 14:44:32 +0100
Subject: [PATCH] Added makefile switch for Alpine Linux

Change-Id: I56229d94f6a5887c1b2ffdda269aa02a6674eaf4
Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
---
 compiler2/record.c          | 2 +-
 core/Error.cc               | 4 ++--
 core/Fd_And_Timeout_User.hh | 4 ++++
 core/Parallel_main.cc       | 4 ++--
 core/Single_main.cc         | 4 ++--
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/compiler2/record.c b/compiler2/record.c
index 716965713..35dc461e2 100644
--- a/compiler2/record.c
+++ b/compiler2/record.c
@@ -6841,7 +6841,7 @@ static void defEmptyRecordTemplate(const char *name, const char *dispname,
     src = mputprintf(src, "boolean %s_template::match(const %s& other_value, "
       "boolean) const\n"
 	"{\n"
-    "if (!other_value.is_bound()) return FALSE;"
+    "if (!other_value.is_bound()) return FALSE;\n"
 	"return match(NULL_VALUE);\n"
 	"}\n\n", name, name);
 
diff --git a/core/Error.cc b/core/Error.cc
index 80caa8241..9aede6543 100644
--- a/core/Error.cc
+++ b/core/Error.cc
@@ -29,7 +29,7 @@
 #include "Runtime.hh"
 #include "Charstring.hh"
 
-#ifdef LINUX
+#if defined(LINUX) && !defined(ALPINE_LINUX)
 #include <ucontext.h>
 #include <dlfcn.h>
 #include <execinfo.h>
@@ -41,7 +41,7 @@ using namespace __cxxabiv1;
 
 #endif
 
-#ifdef LINUX
+#if defined(LINUX) && !defined(ALPINE_LINUX)
 
 const size_t MAX_DEPTH=100;
 
diff --git a/core/Fd_And_Timeout_User.hh b/core/Fd_And_Timeout_User.hh
index 0437f5fda..7624adc8f 100644
--- a/core/Fd_And_Timeout_User.hh
+++ b/core/Fd_And_Timeout_User.hh
@@ -47,6 +47,10 @@
 #include "Error.hh"
 #include "Event_Handler.hh"
 
+#if defined(USE_EPOLL) && !defined(__uint32_t)
+typedef unsigned int __uint32_t;
+#endif
+
 
 class FdMap {
 public:
diff --git a/core/Parallel_main.cc b/core/Parallel_main.cc
index 4c03023e9..09c544b2c 100644
--- a/core/Parallel_main.cc
+++ b/core/Parallel_main.cc
@@ -40,7 +40,7 @@
 #include "Error.hh"
 #include "Encdec.hh"
 #include "TCov.hh"
-#ifdef LINUX
+#if defined(LINUX) && !defined(ALPINE_LINUX)
 #include <execinfo.h>
 #endif  
 
@@ -67,7 +67,7 @@ void signal_handler(int signum)
     fprintf(stderr,"%s %s: %s\n",ts,stored_argv,signum==SIGABRT?"Abort was called":"Segmentation fault occurred");
   }
   fflush(stderr);
-#ifdef LINUX
+#if defined(LINUX) && !defined(ALPINE_LINUX)
   int nptrs;
   void *buffer[100];
   nptrs = backtrace(buffer, 100);
diff --git a/core/Single_main.cc b/core/Single_main.cc
index adb9b4234..794c44a32 100644
--- a/core/Single_main.cc
+++ b/core/Single_main.cc
@@ -38,7 +38,7 @@
 #include "Encdec.hh"
 #include "TitanLoggerApi.hh"
 #include "TCov.hh"
-#ifdef LINUX
+#if defined(LINUX) && !defined(ALPINE_LINUX)
 #include <execinfo.h>
 #endif  
 
@@ -62,7 +62,7 @@ void signal_handler(int signum)
   } else {
   retval = write(STDERR_FILENO, abortcall , sizeof(abortcall)-1); // sizeof includes \0
   }
-#ifdef LINUX
+#if defined(LINUX) && !defined(ALPINE_LINUX)
   int nptrs;
   void *buffer[100];
   nptrs = backtrace(buffer, 100);
-- 
GitLab