~ubuntu-branches/ubuntu/saucy/python3.3/saucy-proposed

« back to all changes in this revision

Viewing changes to Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-05-15 21:42:49 UTC
  • mfrom: (1.2.9) (22.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130515214249-otmm671u8fiylkc2
Tags: 3.3.2-1ubuntu1
Regenerate the control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#define MAX_ARGS 256
17
17
 
18
 
#define CHECK(x) !(x) ? abort() : 0
 
18
#define CHECK(x) !(x) ? (abort(), 1) : 0
19
19
 
20
20
/* Define __UNUSED__ that also other compilers than gcc can run the tests.  */
21
21
#undef __UNUSED__
127
127
#define PRId64 "I64d"
128
128
#endif
129
129
 
130
 
#ifdef USING_MMAP
131
 
static inline void *
132
 
allocate_mmap (size_t size)
133
 
{
134
 
  void *page;
135
 
#if defined (HAVE_MMAP_DEV_ZERO)
136
 
  static int dev_zero_fd = -1;
137
 
#endif
138
 
 
139
 
#ifdef HAVE_MMAP_DEV_ZERO
140
 
  if (dev_zero_fd == -1)
141
 
    {
142
 
      dev_zero_fd = open ("/dev/zero", O_RDONLY);
143
 
      if (dev_zero_fd == -1)
144
 
        {
145
 
          perror ("open /dev/zero: %m");
146
 
          exit (1);
147
 
        }
148
 
    }
149
 
#endif
150
 
 
151
 
 
152
 
#ifdef HAVE_MMAP_ANON
153
 
  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
154
 
               MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
155
 
#endif
156
 
#ifdef HAVE_MMAP_DEV_ZERO
157
 
  page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
158
 
               MAP_PRIVATE, dev_zero_fd, 0);
159
 
#endif
160
 
 
161
 
  if (page == (void *) MAP_FAILED)
162
 
    {
163
 
      perror ("virtual memory exhausted");
164
 
      exit (1);
165
 
    }
166
 
 
167
 
  return page;
168
 
}
169
 
 
 
130
#ifndef PRIuPTR
 
131
#define PRIuPTR "u"
170
132
#endif