Django

Code

Changeset 7100

Show
Ignore:
Timestamp:
02/08/08 08:42:37 (5 months ago)
Author:
jbronn
Message:

gis: geos: Fixed declaration of geos_version to explicitly set restype to c_char_p due to incompatibilities with 64-bit platforms. Thanks jlivni.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/geos/libgeos.py

    r6978 r7100  
    88""" 
    99import atexit, os, re, sys 
    10 from ctypes import c_char_p, string_at, Structure, CDLL, CFUNCTYPE, POINTER 
     10from ctypes import c_char_p, Structure, CDLL, CFUNCTYPE, POINTER 
    1111from django.contrib.gis.geos.error import GEOSException 
    1212 
     
    9393    return GeomArr() 
    9494 
    95 def geos_version(): 
    96     "Returns the string version of GEOS." 
    97     return string_at(lgeos.GEOSversion()) 
     95# Returns the string version of the GEOS library. Have to set the restype  
     96# explicitly to c_char_p to ensure compatibility accross 32 and 64-bit platforms. 
     97geos_version = lgeos.GEOSversion 
     98geos_version.argtypes = None    
     99geos_version.restype = c_char_p 
    98100 
    99101# Regular expression should be able to parse version strings such as