This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
[PATCH] Fix includes for <string.h> and PATH_MAX
- From: Christian Jaeger <christian at jaeger dot mine dot nu>
- To: ecos-patches at ecos dot sourceware dot org
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 11 Aug 2008 22:18:54 +0200
- Subject: [PATCH] Fix includes for <string.h> and PATH_MAX
- References: <48A03241.9090404@jaeger.mine.nu> <48A03813.80900@jaeger.mine.nu> <20080811143107.GA4934@sg-ubuntu.local> <48A05990.90100@jaeger.mine.nu> <20080811170634.GA7504@ubuntu.local> <48A07802.9060508@jaeger.mine.nu> <20080811180618.GD11199@lunn.ch> <48A0A081.80502@jaeger.mine.nu>
This was required for me to build the configtool (using
host/configure) on Debian testing (Lenny) with gcc 4.3.1
Probably there are nicer places to put those includes, though.
---
PS. gcc 4.2.4-3 is also installed, but the default compiler "gcc" is
set to 4.3.1-8.
PS.2: note that I also had to change acsupport/config.sub to
#! /bin/sh
echo "$1"
as I'm on a x86_64 machine and it didn't recognize the string.
PS.3: there were also tons of warnings which I didn't care about.
PS.4: tell me if you can handle this kind of patches (there are some
knobs to tweak)
host/infra/assert.cxx | 4 ++++
host/libcdl/build.cxx | 4 ++++
host/libcdl/cdlmisc.cxx | 3 +++
host/libcdl/parse.cxx | 3 +++
.../configtool/standalone/common/cdl_exec.cxx | 3 +++
.../configtool/standalone/common/ecosconfig.cxx | 1 +
6 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/host/infra/assert.cxx b/host/infra/assert.cxx
index 27922a5..5892de1 100644
--- a/host/infra/assert.cxx
+++ b/host/infra/assert.cxx
@@ -68,6 +68,10 @@ extern "C" {
}
#endif
+#if defined(HAVE_MKSTEMP) && !defined(_MSC_VER)
+#include <string.h> // strcpy
+#endif
+
// These are needed for the table of callbacks.
#include <utility>
#include <iterator>
diff --git a/host/libcdl/build.cxx b/host/libcdl/build.cxx
index 551c3de..0a09fd9 100644
--- a/host/libcdl/build.cxx
+++ b/host/libcdl/build.cxx
@@ -58,6 +58,10 @@
// the class definitions rely on these headers.
#include <cdlcore.hxx>
+// strncmp, strlen, strcpy
+#include <string.h>
+
+
//}}}
//{{{ Statics
diff --git a/host/libcdl/cdlmisc.cxx b/host/libcdl/cdlmisc.cxx
index 8366629..9c94539 100644
--- a/host/libcdl/cdlmisc.cxx
+++ b/host/libcdl/cdlmisc.cxx
@@ -76,6 +76,9 @@
// For access to DBL_DIG
#include <cfloat>
+// strlen, strncmp:
+#include <string.h>
+
//}}}
//{{{ Cdl::is_valid_xxx()
diff --git a/host/libcdl/parse.cxx b/host/libcdl/parse.cxx
index db9ed08..51f90fa 100644
--- a/host/libcdl/parse.cxx
+++ b/host/libcdl/parse.cxx
@@ -59,6 +59,9 @@
// the class definitions rely on these headers.
#include <cdlcore.hxx>
+// strcmp, strncmp:
+#include <string.h>
+
//}}}
//{{{ Description
diff --git a/host/tools/configtool/standalone/common/cdl_exec.cxx b/host/tools/configtool/standalone/common/cdl_exec.cxx
index 8ba066e..40aafb7 100644
--- a/host/tools/configtool/standalone/common/cdl_exec.cxx
+++ b/host/tools/configtool/standalone/common/cdl_exec.cxx
@@ -53,6 +53,9 @@
#include "build.hxx"
#include "cdl_exec.hxx"
+// on Linux (Debian): PATH_MAX:
+#include <linux/limits.h>
+
// ----------------------------------------------------------------------------
bool cdl_exec::quiet = false;
bool cdl_exec::verbose = false;
diff --git a/host/tools/configtool/standalone/common/ecosconfig.cxx b/host/tools/configtool/standalone/common/ecosconfig.cxx
index 8e27780..b02d6ff 100644
--- a/host/tools/configtool/standalone/common/ecosconfig.cxx
+++ b/host/tools/configtool/standalone/common/ecosconfig.cxx
@@ -51,6 +51,7 @@
#endif
#include "cdl_exec.hxx"
#include "ecosconfig.hxx"
+#include <string.h> // strcmp, strncmp
#define TOOL_VERSION "2.net"
#define TOOL_COPYRIGHT "Copyright (c) 2002 Red Hat, Inc.\nCopyright (c) 2004-2006 eCosCentric Limited"