You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/09/13 19:11:06 UTC

svn commit: r575374 - /incubator/stdcxx/trunk/src/memattr.cpp

Author: sebor
Date: Thu Sep 13 10:11:06 2007
New Revision: 575374

URL: http://svn.apache.org/viewvc?rev=575374&view=rev
Log:
2007-09-13  Martin Sebor  <se...@roguewave.com>

	* memattr.cpp (EFAULT): #defined macro when not #defined in system
	headers. Needed by EDG eccp on Linux.
	[Linux] (__USE_BSD): #defined macro when not already #defined to
	bring in declarations of caddr_t, madvise(), and MADV_WILLNEED.
	Also needed by EDG eccp on Linux.

Modified:
    incubator/stdcxx/trunk/src/memattr.cpp

Modified: incubator/stdcxx/trunk/src/memattr.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/memattr.cpp?rev=575374&r1=575373&r2=575374&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/memattr.cpp (original)
+++ incubator/stdcxx/trunk/src/memattr.cpp Thu Sep 13 10:11:06 2007
@@ -23,7 +23,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2005-2006 Rogue Wave Software.
+ * Copyright 2005-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -32,6 +32,10 @@
 #include <errno.h>    // for ENOMEM, errno
 #include <string.h>   // for memchr
 
+#ifndef EFAULT
+#  define EFAULT  14   // Linux value
+#endif   // EFAULT
+
 #ifdef __CYGWIN__
    // use the Windows API on Cygwin
 #  define _WIN32
@@ -43,6 +47,12 @@
 #    include <time.h>
 #  endif
 #  include <unistd.h>     // for getpagesize(), sysconf()
+
+#  if defined (_RWSTD_OS_LINUX) && !defined (__USE_BSD)
+     // needed for caddr_t, madvise, and MADV_WILLNEED
+#    define __USE_BSD
+#  endif   // _RWSTD_OS_LINUX && !__USE_BSD
+
 #  include <sys/mman.h>   // for mincore()
 #  include <sys/types.h>