summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b886f9a)
raw | patch | inline | side by side (parent: b886f9a)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 6 Jun 2008 10:32:13 +0000 (12:32 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 6 Jun 2008 10:32:13 +0000 (12:32 +0200) |
NexentaStor 1.0.2 doesn't have <endian.h>, for example :/
configure.in | patch | blob | history | |
src/collectd.h | patch | blob | history |
diff --git a/configure.in b/configure.in
index 93375237135fd147a6d1161eca3030caf3251c21..e51bbd7a86bf01b2453df1ff7eb7a11166bb903a 100644 (file)
--- a/configure.in
+++ b/configure.in
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
-AC_CHECK_HEADERS(stdint.h stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h)
+AC_CHECK_HEADERS(stdint.h stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
# For ping library
AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
diff --git a/src/collectd.h b/src/collectd.h
index 411048af0694650fb61c5c588926c35cb4dad20d..0ccf5336e6887f1bce252d8955d98895e4c19ea4 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
# endif /* !defined(isnan) */
#endif /* NAN_ZERO_ZERO */
+/* Try really, really hard to determine endianess. Under NexentaStor 1.0.2 this
+ * information is in <sys/isa_defs.h>, possibly some other Solaris versions do
+ * this too.. */
#if HAVE_ENDIAN_H
# include <endian.h>
+#elif HAVE_SYS_ISA_DEFS_H
+# include <sys/isa_defs.h>
#endif
#ifndef BYTE_ORDER
# define BIG_ENDIAN __BIG_ENDIAN
# endif
#endif
+#ifndef LITTLE_ENDIAN
+# if defined(_LITTLE_ENDIAN)
+# define LITTLE_ENDIAN _LITTLE_ENDIAN
+# elif defined(__LITTLE_ENDIAN)
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# endif
+#endif
+#ifndef BYTE_ORDER
+# if defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
+# undef BIG_ENDIAN
+# define BIG_ENDIAN 4321
+# define LITTLE_ENDIAN 1234
+# define BYTE_ORDER BIG_ENDIAN
+# elif !defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
+# undef LITTLE_ENDIAN
+# define BIG_ENDIAN 4321
+# define LITTLE_ENDIAN 1234
+# define BYTE_ORDER LITTLE_ENDIAN
+# endif
+#endif
#if !defined(BYTE_ORDER) || !defined(BIG_ENDIAN)
# error "Cannot determine byte order"
#endif