Author: jschultz
Date: 2006-03-13 18:09:56 -0500 (Mon, 13 Mar 2006)
New Revision: 340
Added:
trunk/stdutil/src/stdutil/private/stdarch_autoconf.h.in
trunk/stdutil/src/stdutil/private/stdarch_wintel32.h
Modified:
trunk/stdutil/configure
trunk/stdutil/configure.in
Log:
Changes to stdarch.h to do better for systems that don't use configure.
Modified: trunk/stdutil/configure
===================================================================
--- trunk/stdutil/configure 2006-03-13 22:07:00 UTC (rev 339)
+++ trunk/stdutil/configure 2006-03-13 23:09:56 UTC (rev 340)
@@ -1314,7 +1314,7 @@
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
- ac_config_headers="$ac_config_headers src/stdutil/private/stdarch.h"
+ ac_config_headers="$ac_config_headers src/stdutil/private/stdarch_autoconf.h"
ac_ext=c
@@ -8030,7 +8030,7 @@
case "$ac_config_target" in
# Handling of arguments.
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "src/stdutil/private/stdarch.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/stdutil/private/stdarch.h" ;;
+ "src/stdutil/private/stdarch_autoconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/stdutil/private/stdarch_autoconf.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
Modified: trunk/stdutil/configure.in
===================================================================
--- trunk/stdutil/configure.in 2006-03-13 22:07:00 UTC (rev 339)
+++ trunk/stdutil/configure.in 2006-03-13 23:09:56 UTC (rev 340)
@@ -1,7 +1,7 @@
AC_INIT(src/stdutil/stddefines.h)
AC_CONFIG_AUX_DIR(buildtools)
-AC_CONFIG_HEADER(src/stdutil/private/stdarch.h)
+AC_CONFIG_HEADER(src/stdutil/private/stdarch_autoconf.h)
AC_LANG_C
Added: trunk/stdutil/src/stdutil/private/stdarch_autoconf.h.in
===================================================================
--- trunk/stdutil/src/stdutil/private/stdarch_autoconf.h.in (rev 0)
+++ trunk/stdutil/src/stdutil/private/stdarch_autoconf.h.in 2006-03-13 23:09:56 UTC (rev 340)
@@ -0,0 +1,158 @@
+/* Copyright (c) 2000-2005, The Johns Hopkins University
+ * All rights reserved.
+ *
+ * The contents of this file are subject to a license (the ``License'')
+ * that is the exact equivalent of the BSD license as of July 23, 1999.
+ * You may not use this file except in compliance with the License. The
+ * specific language governing the rights and limitations of the License
+ * can be found in the file ``STDUTIL_LICENSE'' found in this
+ * distribution.
+ *
+ * Software distributed under the License is distributed on an AS IS
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ *
+ * The Original Software is:
+ * The Stdutil Library
+ *
+ * Contributors:
+ * Creator - John Lane Schultz ([email protected])
+ * The Center for Networking and Distributed Systems
+ * (CNDS - http://www.cnds.jhu.edu)
+ */
+
+#ifndef stdarch_autoconf_h_2006_03_13_17_44_12_jschultz_at_cnds_jhu_edu
+#define stdarch_autoconf_h_2006_03_13_17_44_12_jschultz_at_cnds_jhu_edu
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* the following defines are filled in by the configure script */
+
+#undef SIZEOF_CHAR
+#undef SIZEOF_SHORT
+#undef SIZEOF_INT
+#undef SIZEOF_LONG
+#undef SIZEOF_LONG_LONG
+#undef SIZEOF_SIZE_T
+#undef SIZEOF_VOID_P
+
+/* STDARCH_MAX_BYTE_ALIGNMENT must be a power of 2 (e.g. - 1, 2, 4, 8,
+ etc.) and must be the most stringent byte alignment that your
+ architecture requires for any basic type; 4 should be good enough
+ for any 32 bit or smaller architectures, 8 should be good enough
+ for any 64 bit or smaller architectures, etc.
+*/
+
+#undef STDARCH_MAX_BYTE_ALIGNMENT
+
+/* check if NULL is represented as all zero in memory for "all" types of pointers */
+
+#undef STDARCH_NULL_IS_ZERO
+
+/* endian byte reordering mapping */
+
+#undef STDENDIAN16_SWAP
+
+#undef STDENDIAN32_NET0_FROM_HOST
+#undef STDENDIAN32_NET1_FROM_HOST
+#undef STDENDIAN32_NET2_FROM_HOST
+#undef STDENDIAN32_NET3_FROM_HOST
+
+#undef STDENDIAN32_HOST0_FROM_NET
+#undef STDENDIAN32_HOST1_FROM_NET
+#undef STDENDIAN32_HOST2_FROM_NET
+#undef STDENDIAN32_HOST3_FROM_NET
+
+#undef STDENDIAN64_NET0_FROM_HOST
+#undef STDENDIAN64_NET1_FROM_HOST
+#undef STDENDIAN64_NET2_FROM_HOST
+#undef STDENDIAN64_NET3_FROM_HOST
+#undef STDENDIAN64_NET4_FROM_HOST
+#undef STDENDIAN64_NET5_FROM_HOST
+#undef STDENDIAN64_NET6_FROM_HOST
+#undef STDENDIAN64_NET7_FROM_HOST
+
+#undef STDENDIAN64_HOST0_FROM_NET
+#undef STDENDIAN64_HOST1_FROM_NET
+#undef STDENDIAN64_HOST2_FROM_NET
+#undef STDENDIAN64_HOST3_FROM_NET
+#undef STDENDIAN64_HOST4_FROM_NET
+#undef STDENDIAN64_HOST5_FROM_NET
+#undef STDENDIAN64_HOST6_FROM_NET
+#undef STDENDIAN64_HOST7_FROM_NET
+
+/* do architecture specific integer typedefs and checks */
+
+/* ensure char's are 1 byte long */
+
+#if (SIZEOF_CHAR != 1)
+# error No 1 byte integer type found!
+#endif
+
+/* ensure short's are 2 bytes long */
+
+#if (SIZEOF_SHORT != 2)
+# error No 2 byte integer type found!
+#endif
+
+/* figure out which type is 4 bytes long */
+
+#if (SIZEOF_INT == 4)
+
+typedef int stdarch_int32;
+typedef unsigned int stdarch_uint32;
+
+#elif (SIZEOF_LONG == 4)
+
+typedef long stdarch_int32;
+typedef unsigned long stdarch_uint32;
+
+#else
+# error No 4 byte integer type found!
+#endif
+
+/* figure out which type is 8 bytes long */
+
+#if (SIZEOF_LONG == 8)
+
+typedef long stdarch_int64;
+typedef unsigned long stdarch_uint64;
+
+#elif defined(_MSC_VER)
+
+typedef __int64 stdarch_int64;
+typedef unsigned __int64 stdarch_uint64;
+
+#elif (SIZEOF_LONG_LONG == 8)
+
+typedef long long stdarch_int64;
+typedef unsigned long long stdarch_uint64;
+
+#else
+# error No 8 byte integeral type found!
+#endif
+
+/* figure out which type is the same size as size_t */
+
+#if (SIZEOF_SIZE_T == 2)
+
+typedef short stdarch_ssize;
+
+#elif (SIZEOF_SIZE_T == 4)
+
+typedef stdarch_int32 stdarch_ssize;
+
+#elif (SIZEOF_SIZE_T == 8)
+
+typedef stdarch_int64 stdarch_ssize;
+
+#else
+# error No integral type of same size as size_t!
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Added: trunk/stdutil/src/stdutil/private/stdarch_wintel32.h
===================================================================
--- trunk/stdutil/src/stdutil/private/stdarch_wintel32.h (rev 0)
+++ trunk/stdutil/src/stdutil/private/stdarch_wintel32.h 2006-03-13 23:09:56 UTC (rev 340)
@@ -0,0 +1,158 @@
+/* Copyright (c) 2000-2005, The Johns Hopkins University
+ * All rights reserved.
+ *
+ * The contents of this file are subject to a license (the ``License'')
+ * that is the exact equivalent of the BSD license as of July 23, 1999.
+ * You may not use this file except in compliance with the License. The
+ * specific language governing the rights and limitations of the License
+ * can be found in the file ``STDUTIL_LICENSE'' found in this
+ * distribution.
+ *
+ * Software distributed under the License is distributed on an AS IS
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ *
+ * The Original Software is:
+ * The Stdutil Library
+ *
+ * Contributors:
+ * Creator - John Lane Schultz ([email protected])
+ * The Center for Networking and Distributed Systems
+ * (CNDS - http://www.cnds.jhu.edu)
+ */
+
+#ifndef stdarch_wintel32_h_2006_03_13_17_43_22_jschultz_at_cnds_jhu_edu
+#define stdarch_wintel32_h_2006_03_13_17_43_22_jschultz_at_cnds_jhu_edu
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* the following defines are filled in by the configure script */
+
+#define SIZEOF_CHAR 1
+#define SIZEOF_SHORT 2
+#define SIZEOF_INT 4
+#define SIZEOF_LONG 4
+#undef SIZEOF_LONG_LONG
+#define SIZEOF_SIZE_T 4
+#define SIZEOF_VOID_P 4
+
+/* STDARCH_MAX_BYTE_ALIGNMENT must be a power of 2 (e.g. - 1, 2, 4, 8,
+ etc.) and must be the most stringent byte alignment that your
+ architecture requires for any basic type; 4 should be good enough
+ for any 32 bit or smaller architectures, 8 should be good enough
+ for any 64 bit or smaller architectures, etc.
+*/
+
+#define STDARCH_MAX_BYTE_ALIGNMENT 4
+
+/* check if NULL is represented as all zero in memory for "all" types of pointers */
+
+#define STDARCH_NULL_IS_ZERO 1
+
+/* endian byte reordering mapping */
+
+#define STDENDIAN16_SWAP 1
+
+#define STDENDIAN32_NET0_FROM_HOST 3
+#define STDENDIAN32_NET1_FROM_HOST 2
+#define STDENDIAN32_NET2_FROM_HOST 1
+#define STDENDIAN32_NET3_FROM_HOST 0
+
+#define STDENDIAN32_HOST0_FROM_NET 3
+#define STDENDIAN32_HOST1_FROM_NET 2
+#define STDENDIAN32_HOST2_FROM_NET 1
+#define STDENDIAN32_HOST3_FROM_NET 0
+
+#define STDENDIAN64_NET0_FROM_HOST 7
+#define STDENDIAN64_NET1_FROM_HOST 6
+#define STDENDIAN64_NET2_FROM_HOST 5
+#define STDENDIAN64_NET3_FROM_HOST 4
+#define STDENDIAN64_NET4_FROM_HOST 3
+#define STDENDIAN64_NET5_FROM_HOST 2
+#define STDENDIAN64_NET6_FROM_HOST 1
+#define STDENDIAN64_NET7_FROM_HOST 0
+
+#define STDENDIAN64_HOST0_FROM_NET 7
+#define STDENDIAN64_HOST1_FROM_NET 6
+#define STDENDIAN64_HOST2_FROM_NET 5
+#define STDENDIAN64_HOST3_FROM_NET 4
+#define STDENDIAN64_HOST4_FROM_NET 3
+#define STDENDIAN64_HOST5_FROM_NET 2
+#define STDENDIAN64_HOST6_FROM_NET 1
+#define STDENDIAN64_HOST7_FROM_NET 0
+
+/* do architecture specific integer typedefs and checks */
+
+/* ensure char's are 1 byte long */
+
+#if (SIZEOF_CHAR != 1)
+# error No 1 byte integer type found!
+#endif
+
+/* ensure short's are 2 bytes long */
+
+#if (SIZEOF_SHORT != 2)
+# error No 2 byte integer type found!
+#endif
+
+/* figure out which type is 4 bytes long */
+
+#if (SIZEOF_INT == 4)
+
+typedef int stdarch_int32;
+typedef unsigned int stdarch_uint32;
+
+#elif (SIZEOF_LONG == 4)
+
+typedef long stdarch_int32;
+typedef unsigned long stdarch_uint32;
+
+#else
+# error No 4 byte integer type found!
+#endif
+
+/* figure out which type is 8 bytes long */
+
+#if (SIZEOF_LONG == 8)
+
+typedef long stdarch_int64;
+typedef unsigned long stdarch_uint64;
+
+#elif defined(_MSC_VER)
+
+typedef __int64 stdarch_int64;
+typedef unsigned __int64 stdarch_uint64;
+
+#elif (SIZEOF_LONG_LONG == 8)
+
+typedef long long stdarch_int64;
+typedef unsigned long long stdarch_uint64;
+
+#else
+# error No 8 byte integeral type found!
+#endif
+
+/* figure out which type is the same size as size_t */
+
+#if (SIZEOF_SIZE_T == 2)
+
+typedef short stdarch_ssize;
+
+#elif (SIZEOF_SIZE_T == 4)
+
+typedef stdarch_int32 stdarch_ssize;
+
+#elif (SIZEOF_SIZE_T == 8)
+
+typedef stdarch_int64 stdarch_ssize;
+
+#else
+# error No integral type of same size as size_t!
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.