- Added wrappers for new and delete from gcc2 libraries
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 5 Jan 2005 12:21:30 +0000 (12:21 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 5 Jan 2005 12:21:30 +0000 (12:21 +0000)
- sys/stat.h and fcntl.h included in nms_common.h

12 files changed:
.gitattributes
configure.ac
include/nms_common.h
src/agent/core/sysinfo.cpp
src/agent/subagents/linux/net.cpp
src/libnetxms/Makefile.am
src/libnetxms/c_lgcc2.cpp [new file with mode: 0644]
src/libnetxms/hash.cpp
src/server/core/main.cpp
src/server/core/netinfo.cpp
src/server/core/tools.cpp
tools/Makefile.am

index 7c78464..cd7f747 100644 (file)
@@ -406,6 +406,7 @@ src/console/win32starter/nxcstart.rc -text
 src/console/win32starter/resource.h -text
 src/libnetxms/Makefile.am -text
 src/libnetxms/Makefile.nw -text
+src/libnetxms/c_lgcc2.cpp -text
 src/libnetxms/c_lgcc3.cpp -text
 src/libnetxms/config.cpp -text
 src/libnetxms/dir.c -text
index cd1fb6c..ec7a09a 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.47 2005-01-05 10:58:02 victor Exp $
+# $Id: configure.ac,v 1.48 2005-01-05 12:21:18 victor Exp $
 #
 # Process this file with autoconf to produce a configure script.
 #
@@ -191,7 +191,7 @@ AC_HEADER_STAT
 AC_HEADER_TIME
 AC_CHECK_HEADERS([sys/int_types.h])
 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h])
-AC_CHECK_HEADERS([sys/ioctl.h sys/sockio.h])
+AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h])
 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h])
 AC_CHECK_HEADERS([readline/readline.h])
 AC_CHECK_HEADERS([byteswap.h])
index a9729a6..942a565 100644 (file)
@@ -102,6 +102,7 @@ typedef int socklen_t;
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/select.h>
 #include <netinet/in.h>
@@ -166,6 +167,10 @@ typedef int SOCKET;
 #include <sys/int_types.h>
 #endif
 
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -186,8 +191,11 @@ typedef int SOCKET;
 #include <netdb.h>
 #endif
 
-#include <dirent.h>
+#if HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
+
+#include <dirent.h>
 
 typedef int BOOL;
 typedef long int LONG;
index 2a08146..42f2818 100644 (file)
 
 #include "nxagentd.h"
 
-#ifndef _WIN32
-
-#if HAVE_SYS_STAT_H || defined(_NETWARE)
-#include <sys/stat.h>
-#endif
-
-#endif   /* _WIN32 */
-
 
 //
 // Handler for Agent.Uptime parameter
index 313e31b..df51936 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: net.cpp,v 1.3 2004-11-25 08:01:27 victor Exp $ */
+/* $Id: net.cpp,v 1.4 2005-01-05 12:21:24 victor Exp $ */
 
 /* 
 ** NetXMS subagent for GNU/Linux
 
 #include <linux/sysctl.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <net/if.h>
@@ -255,6 +252,9 @@ LONG H_NetIfList(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue)
 /*
 
 $Log: not supported by cvs2svn $
+Revision 1.3  2004/11/25 08:01:27  victor
+Processing of interface list will be stopped on error
+
 Revision 1.2  2004/10/23 22:53:23  alk
 ArpCache: ignore incomplete entries
 
index 9bd2b83..f35f6e4 100644 (file)
@@ -1,7 +1,7 @@
 INCLUDES=-I@top_srcdir@/include
 
 lib_LTLIBRARIES = libnetxms.la
-libnetxms_la_SOURCES = c_lgcc3.cpp config.cpp dload.cpp hash.cpp icmp.cpp inline.cpp main.cpp md5.cpp scandir.c sha1.cpp strtoll.c strtoull.c tools.cpp unicode.cpp
+libnetxms_la_SOURCES = c_lgcc2.cpp c_lgcc3.cpp config.cpp dload.cpp hash.cpp icmp.cpp inline.cpp main.cpp md5.cpp scandir.c sha1.cpp strtoll.c strtoull.c tools.cpp unicode.cpp
 libnetxms_la_LDFLAGS = -version-info $(LIBNETXMS_LIBRARY_VERSION)
 
 EXTRA_DIST = \
diff --git a/src/libnetxms/c_lgcc2.cpp b/src/libnetxms/c_lgcc2.cpp
new file mode 100644 (file)
index 0000000..c8601a7
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+** Allow gcc 2.x programs to link without libgcc and company
+**
+** Copyright (c) 2005 Victor Kirhenshtein
+**
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+extern "C"
+{
+   void * __builtin_new(int memsize);
+   void __builtin_delete(void *ptr);
+}
+
+void * __builtin_new(int memsize)
+{
+   return malloc(memsize);
+}
+
+void __builtin_delete(void *ptr)
+{
+   if (ptr != NULL)
+      free(ptr);
+}
index cd066db..92f8ff1 100644 (file)
 
 #if defined(_WIN32) && !defined(UNDER_CE)
 # include <io.h>
-#elif !defined(UNDER_CE)
-# include <fcntl.h>
-# include <sys/types.h>
-# include <sys/stat.h>
 #endif
 
 
index fb3f520..2a94ffc 100644 (file)
@@ -33,7 +33,6 @@
 # include <direct.h>
 # include <errno.h> 
 #else
-# include <sys/stat.h>
 # include <signal.h>
 #endif
 
index e0e529d..99145fb 100644 (file)
@@ -31,9 +31,6 @@
 
 #else
 
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
 #if HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
index e99190e..75eebaa 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "nxcore.h"
 
-#include <fcntl.h>
-#include <sys/stat.h>
 #ifdef _WIN32
 # include <io.h>
 #else
index 71925d6..68fc131 100644 (file)
@@ -8,4 +8,4 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-EXTRA_DIST = nwmkimp.pl mc.pl
+EXTRA_DIST = nwmkimp.pl mc.pl patch_libtool.pl