[pypy-svn] r32188 - pypy/dist/pypy/module/crypt

arigo at codespeak.net arigo at codespeak.net
Mon Sep 11 21:22:17 CEST 2006


Author: arigo
Date: Mon Sep 11 21:22:15 2006
New Revision: 32188

Modified:
   pypy/dist/pypy/module/crypt/interp_crypt.py
Log:
Fix 'module/crypt'.  Using CConfig ensures that we get the correct '-l'
linker option when compiling.



Modified: pypy/dist/pypy/module/crypt/interp_crypt.py
==============================================================================
--- pypy/dist/pypy/module/crypt/interp_crypt.py	(original)
+++ pypy/dist/pypy/module/crypt/interp_crypt.py	Mon Sep 11 21:22:15 2006
@@ -6,10 +6,13 @@
 import sys
 from ctypes import *
 
-cryptfn = find_library("crypt")
-cryptdll = load_library(cryptfn)
+class CConfig:
+    _includes_ = ('unistd.h',)
+    cryptlib = ctypes_platform.Library('crypt')
 
-c_crypt = cryptdll.crypt 
+globals().update(ctypes_platform.configure(CConfig))
+
+c_crypt = cryptlib.crypt 
 c_crypt.argtypes = [c_char_p, c_char_p]
 c_crypt.restype = c_char_p 
 



More information about the Pypy-commit mailing list