Commit f03eab08248f122ce3b623a18df9e19fae1b6e98

Anthony Green 2013-01-11T17:14:11

Remove obsolete inline test functions

diff --git a/ChangeLog b/ChangeLog
index 144833c..3d451b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,8 +3,9 @@
 	* src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style
 	comments with /* */ for xlc compiler.
 	* src/powerpc/aix.S (ffi_call_AIX): Ditto.
-	* testsuite/libffi.call/ffitest.h (allocate_mmap): Remove inline
-	for xlc compiler.
+	* testsuite/libffi.call/ffitest.h (allocate_mmap): Delete
+	deprecated inline function.
+	* testsuite/libffi.special/ffitestcxx.h: Ditto.
 	* README: Add update for AIX support.
 
 2013-01-11  Anthony Green  <green@moxielogic.com>
diff --git a/testsuite/libffi.call/ffitest.h b/testsuite/libffi.call/ffitest.h
index 5564b6d..830fcc7 100644
--- a/testsuite/libffi.call/ffitest.h
+++ b/testsuite/libffi.call/ffitest.h
@@ -127,44 +127,3 @@
 #define PRId64 "I64d"
 #endif
 
-#ifdef USING_MMAP
-static void *
-allocate_mmap (size_t size)
-{
-  void *page;
-#if defined (HAVE_MMAP_DEV_ZERO)
-  static int dev_zero_fd = -1;
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-  if (dev_zero_fd == -1)
-    {
-      dev_zero_fd = open ("/dev/zero", O_RDONLY);
-      if (dev_zero_fd == -1)
-	{
-	  perror ("open /dev/zero: %m");
-	  exit (1);
-	}
-    }
-#endif
-
-
-#ifdef HAVE_MMAP_ANON
-  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-	       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
-#ifdef HAVE_MMAP_DEV_ZERO
-  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-	       MAP_PRIVATE, dev_zero_fd, 0);
-#endif
-
-  if (page == (void *) MAP_FAILED)
-    {
-      perror ("virtual memory exhausted");
-      exit (1);
-    }
-
-  return page;
-}
-
-#endif
diff --git a/testsuite/libffi.special/ffitestcxx.h b/testsuite/libffi.special/ffitestcxx.h
index 83f5442..c6da7ef 100644
--- a/testsuite/libffi.special/ffitestcxx.h
+++ b/testsuite/libffi.special/ffitestcxx.h
@@ -53,44 +53,3 @@
 #define PRIuLL "llu"
 #endif
 
-#ifdef USING_MMAP
-static inline void *
-allocate_mmap (size_t size)
-{
-  void *page;
-#if defined (HAVE_MMAP_DEV_ZERO)
-  static int dev_zero_fd = -1;
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-  if (dev_zero_fd == -1)
-    {
-      dev_zero_fd = open ("/dev/zero", O_RDONLY);
-      if (dev_zero_fd == -1)
-	{
-	  perror ("open /dev/zero: %m");
-	  exit (1);
-	}
-    }
-#endif
-
-
-#ifdef HAVE_MMAP_ANON
-  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-	       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
-#ifdef HAVE_MMAP_DEV_ZERO
-  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-	       MAP_PRIVATE, dev_zero_fd, 0);
-#endif
-
-  if (page == (char *) MAP_FAILED)
-    {
-      perror ("virtual memory exhausted");
-      exit (1);
-    }
-
-  return page;
-}
-
-#endif