[MacPorts] #25148: py-ctypes: error: 'MAP_ANONYMOUS' undeclared

MacPorts noreply at macports.org
Sun Jun 27 16:23:30 PDT 2010


#25148: py-ctypes: error: 'MAP_ANONYMOUS' undeclared
-------------------------------------+--------------------------------------
 Reporter:  IgnitusBoyone@…          |       Owner:  ryandesign@…           
     Type:  defect                   |      Status:  assigned               
 Priority:  Normal                   |   Milestone:                         
Component:  ports                    |     Version:  1.8.2                  
 Keywords:                           |        Port:  py-ctypes              
-------------------------------------+--------------------------------------
Changes (by ryandesign@…):

  * status:  new => assigned
 * cc: ryandesign@… (removed)
  * owner:  macports-tickets@… => ryandesign@…


Comment:

 Back to the error originally reported in this ticket: "`error:
 'MAP_ANONYMOUS' undeclared`". `MAP_ANONYMOUS` (which is called `MAP_ANON`
 on Mac OS X) is defined in /usr/include/sys/mman.h, but only if
 `_POSIX_C_SOURCE` is not defined, unless `_DARWIN_C_SOURCE` is also
 defined. python24 on Mac OS X 10.5 does not define `_POSIX_C_SOURCE` (try
 "`grep _C_SOURCE /opt/local/include/python2.4/pyconfig.h`") so ctypes
 works on Mac OS X 10.5, but python24 on Mac OS X 10.6 does define
 `_POSIX_C_SOURCE` (and does not define `_DARWIN_C_SOURCE`) so ctypes does
 not work on Mac OS X 10.6.

 The attached patch fixes this by defining `_DARWIN_C_SOURCE`. I don't know
 what other implications this might have. The patch also fixes #22418 by
 using the system's libffi instead of the ancient bundled one.

-- 
Ticket URL: <http://trac.macports.org/ticket/25148#comment:6>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list