This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix includes for <string.h> and PATH_MAX


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"

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]