Commit 30c6021f authored by Justin Bronn's avatar Justin Bronn
Browse files

[1.1.X] When `GEOSFree` is not available on NT platforms, have to specifically...

[1.1.X] When `GEOSFree` is not available on NT platforms, have to specifically use the MS C library.

Backport of r12024 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12025 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent db867be9
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
"""
 Error checking functions for GEOS ctypes prototype functions.
"""
import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import lgeos, GEOS_VERSION
@@ -15,7 +16,11 @@ if GEOS_VERSION >= (3, 1, 1):
    free.restype = None
else:
    # Getting the `free` routine from the C library of the platform.
    # The C library is obtained by passing None into `CDLL`.
    if os.name == 'nt':
        # On NT, use the MS C library.
        libc = CDLL('msvcrt')
    else:
        # On POSIX platforms C library is obtained by passing None into `CDLL`.
        libc = CDLL(None)
    free = libc.free