ctypes-commit Mailing List for ctypes (Page 89)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Thomas H. <th...@us...> - 2004-10-13 16:56:02
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25952 Modified Files: test_bitfields.py Log Message: Another test. Index: test_bitfields.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_bitfields.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_bitfields.py 11 Oct 2004 09:11:57 -0000 1.2 --- test_bitfields.py 13 Oct 2004 16:55:07 -0000 1.3 *************** *** 193,196 **** --- 193,212 ---- return detail.__class__, str(detail) + def test_mixed(self): + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_int, 4)] + self.failUnlessEqual(sizeof(X), sizeof(c_int)*2) + + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_int, 32)] + self.failUnlessEqual(sizeof(X), sizeof(c_int)*2) + + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_ubyte, 4)] + self.failUnlessEqual(sizeof(X), sizeof(c_byte)) + if __name__ == "__main__": unittest.main() |
From: Thomas H. <th...@us...> - 2004-10-13 16:54:28
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25418 Modified Files: stgdict.c ctypes.h cfield.c Log Message: A hopefully simpler way to do bit fields. Index: ctypes.h =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/ctypes.h,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ctypes.h 28 Sep 2004 11:35:13 -0000 1.52 --- ctypes.h 13 Oct 2004 16:53:12 -0000 1.53 *************** *** 88,92 **** extern PyObject * CField_FromDesc(PyObject *desc, int index, ! PyObject *prev_desc, int bitsize, int *pbitofs, int *psize, int *poffset, int *palign, int pack); --- 88,92 ---- extern PyObject * CField_FromDesc(PyObject *desc, int index, ! int *pfield_size, int bitsize, int *pbitofs, int *psize, int *poffset, int *palign, int pack); Index: stgdict.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/stgdict.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** stgdict.c 12 Oct 2004 13:41:15 -0000 1.17 --- stgdict.c 13 Oct 2004 16:53:12 -0000 1.18 *************** *** 133,136 **** --- 133,137 ---- int len, offset, size, align, i; int union_size, total_align; + int field_size = 0; PyObject *prev_desc = NULL; int bitofs; *************** *** 232,236 **** if (isStruct) { prop = CField_FromDesc(desc, i, ! prev_desc, bitsize, &bitofs, &size, &offset, &align, pack); } else /* union */ { --- 233,237 ---- if (isStruct) { prop = CField_FromDesc(desc, i, ! &field_size, bitsize, &bitofs, &size, &offset, &align, pack); } else /* union */ { *************** *** 239,243 **** align = 0; prop = CField_FromDesc(desc, i, ! prev_desc, bitsize, &bitofs, &size, &offset, &align, pack); union_size = max(size, union_size); --- 240,244 ---- align = 0; prop = CField_FromDesc(desc, i, ! &field_size, bitsize, &bitofs, &size, &offset, &align, pack); union_size = max(size, union_size); *************** *** 258,262 **** Py_DECREF(pair); Py_DECREF(prop); - prev_desc = desc; /* store, in case of continued bitfield */ } #undef realdict --- 259,262 ---- Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** cfield.c 12 Oct 2004 10:38:04 -0000 1.53 --- cfield.c 13 Oct 2004 16:53:12 -0000 1.54 *************** *** 21,24 **** --- 21,41 ---- } + /* compilers seem to have different behaviour with this structure. GCC on x86 + * packs the fields into one 32-bit int, MSVC creates one char and one int. + * The WIDEN_BITFIELDS function returns .... XXXX FIXME + */ + struct b_bitfields { char a:2; int b:28; }; + #define WIDEN_BITFIELDS (!(sizeof(struct b_bitfields) - sizeof(int))) + + /* convert to macro? */ + static int + can_continue_bitfield(StgDictObject *prev, StgDictObject *this) + { + if (WIDEN_BITFIELDS) + return prev && this->size == prev->size; + else + return prev == this; + } + /* * Expects the size, index and offset for the current field in *psize and *************** *** 35,39 **** PyObject * CField_FromDesc(PyObject *desc, int index, ! PyObject *prev_desc, int bitsize, int *pbitofs, int *psize, int *poffset, int *palign, int pack) { --- 52,56 ---- PyObject * CField_FromDesc(PyObject *desc, int index, ! int *pfield_size, int bitsize, int *pbitofs, int *psize, int *poffset, int *palign, int pack) { *************** *** 43,47 **** SETFUNC setfunc = NULL; GETFUNC getfunc = NULL; ! StgDictObject *dict, *prev_dict; int fieldtype; #define NO_BITFIELD 0 --- 60,64 ---- SETFUNC setfunc = NULL; GETFUNC getfunc = NULL; ! StgDictObject *dict; int fieldtype; #define NO_BITFIELD 0 *************** *** 54,58 **** return NULL; dict = PyType_stgdict(desc); - prev_dict = prev_desc ? PyType_stgdict(prev_desc) : NULL; if (!dict) { PyErr_SetString(PyExc_TypeError, --- 71,74 ---- *************** *** 61,69 **** return NULL; } if (bitsize /* this is a bitfield request */ ! // && prev_desc == desc /* basic types are same */ ! && prev_dict && dict->size == prev_dict->size ! && *pbitofs /* we have a bitfield open */ ! && (*pbitofs + bitsize) <= (dict->size * 8)) { /* fits into the space */ /* continue bit field */ fieldtype = CONT_BITFIELD; --- 77,87 ---- return NULL; } + #ifdef _DEBUG + _asm int 3; + #endif if (bitsize /* this is a bitfield request */ ! && *pfield_size /* we have a bitfield open */ ! && dict->size * 8 == *pfield_size /* MSVC */ ! && (*pbitofs + bitsize) <= *pfield_size) { /* continue bit field */ fieldtype = CONT_BITFIELD; *************** *** 72,79 **** --- 90,99 ---- fieldtype = NEW_BITFIELD; *pbitofs = 0; + *pfield_size = dict->size * 8; } else { /* not a bit field */ fieldtype = NO_BITFIELD; *pbitofs = 0; + *pfield_size = 0; } |
From: Thomas H. <th...@us...> - 2004-10-13 15:24:31
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4158 Modified Files: callproc.c Log Message: Document the cast function. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** callproc.c 12 Oct 2004 12:37:59 -0000 1.108 --- callproc.c 13 Oct 2004 15:24:12 -0000 1.109 *************** *** 1275,1278 **** --- 1275,1286 ---- #endif + static char cast_doc[] = + "cast(cobject, ctype) -> ctype-instance\n\ + \n\ + Create an instance of ctype, and copy the internal memory buffer\n\ + of cobject to the new instance. Should be used to cast one type\n\ + of pointer to another type of pointer.\n\ + Doesn't work correctly with ctypes integers.\n"; + static PyObject *cast(PyObject *self, PyObject *args) { *************** *** 1296,1300 **** PyMethodDef module_methods[] = { ! {"cast", cast, METH_VARARGS}, #ifdef Py_USING_UNICODE {"set_conversion_mode", set_conversion_mode, METH_VARARGS, set_conversion_mode_doc}, --- 1304,1308 ---- PyMethodDef module_methods[] = { ! {"cast", cast, METH_VARARGS, cast_doc}, #ifdef Py_USING_UNICODE {"set_conversion_mode", set_conversion_mode, METH_VARARGS, set_conversion_mode_doc}, |
From: Thomas H. <th...@us...> - 2004-10-12 19:23:47
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14963 Modified Files: test_unicode.py Log Message: Use the wcslen function exported by the test extension module. Easier than to portably find the platform's libc in the unittests. Index: test_unicode.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_unicode.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_unicode.py 12 Oct 2004 19:05:08 -0000 1.2 --- test_unicode.py 12 Oct 2004 19:23:38 -0000 1.3 *************** *** 3,25 **** import ctypes ! def get_libc(): ! import os, sys ! if os.name == "nt": ! return ctypes.cdll.msvcrt ! elif os.name == "posix": ! if sys.platform == "darwin": ! return ctypes.cdll.LoadLibrary("/usr/lib/libc.dylib") ! elif sys.platform == "cygwin": ! return ctypes.cdll.LoadLibrary("/bin/cygwin1.dll") ! elif sys.platform == "sunos5": ! return ctypes.cdll.LoadLibrary("/lib/libc.so") ! else: ! try: ! return ctypes.cdll.LoadLibrary("/lib/libc.so.6") ! except OSError: ! pass ! return None ! libc = get_libc() ! wcslen = libc.wcslen wcslen.argtypes = [ctypes.c_wchar_p] --- 3,9 ---- import ctypes ! import _ctypes_test ! libc = ctypes.CDLL(_ctypes_test.__file__) ! wcslen = libc.my_wcslen wcslen.argtypes = [ctypes.c_wchar_p] |
From: Thomas H. <th...@us...> - 2004-10-12 19:22:24
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14697 Modified Files: _ctypes_test.c Log Message: Implement and export a wcslen function. Easier than to portably find the platform's libc in the unittests. Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** _ctypes_test.c 12 Oct 2004 09:39:31 -0000 1.31 --- _ctypes_test.c 12 Oct 2004 19:22:15 -0000 1.32 *************** *** 76,79 **** --- 76,84 ---- #endif } + + EXPORT(size_t *) my_wcslen(wchar_t *src) + { + return wcslen(src); + } #endif |
From: Thomas H. <th...@us...> - 2004-10-12 19:12:10
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12630 Modified Files: test_slicing.py Log Message: Adapt the test for different sizes of wchar_t. Index: test_slicing.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_slicing.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_slicing.py 18 Aug 2004 12:58:32 -0000 1.2 --- test_slicing.py 12 Oct 2004 19:11:52 -0000 1.3 *************** *** 84,88 **** res, 0, 5, u"abcde") ! dll.my_wcsdup.restype = POINTER(c_short) res = dll.my_wcsdup(s) self.failUnlessEqual(res[:len(s)-1], range(ord("a"), ord("z")+1)) --- 84,93 ---- res, 0, 5, u"abcde") ! if sizeof(c_wchar) == sizeof(c_short): ! dll.my_wcsdup.restype = POINTER(c_short) ! elif sizeof(c_wchar) == sizeof(c_int): ! dll.my_wcsdup.restype = POINTER(c_int) ! elif sizeof(c_wchar) == sizeof(c_long): ! dll.my_wcsdup.restype = POINTER(c_long) res = dll.my_wcsdup(s) self.failUnlessEqual(res[:len(s)-1], range(ord("a"), ord("z")+1)) |
From: Thomas H. <th...@us...> - 2004-10-12 19:05:19
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11303 Modified Files: test_unicode.py Log Message: Test that conversions also work in create_string_buffer and create_unicode_buffer. Index: test_unicode.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_unicode.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_unicode.py 12 Oct 2004 18:03:54 -0000 1.1 --- test_unicode.py 12 Oct 2004 19:05:08 -0000 1.2 *************** *** 63,66 **** --- 63,80 ---- self.failUnlessEqual(wcslen("äöüß"), 4) + def test_buffers(self): + ctypes.set_conversion_mode("ascii", "strict") + buf = ctypes.create_unicode_buffer("abc") + self.failUnlessEqual(len(buf), 3+1) + + ctypes.set_conversion_mode("ascii", "replace") + buf = ctypes.create_unicode_buffer("abäöü") + self.failUnlessEqual(buf[:], u"ab\uFFFD\uFFFD\uFFFD\0") + + ctypes.set_conversion_mode("ascii", "ignore") + buf = ctypes.create_unicode_buffer("abäöü") + # is that correct? not sure. But with 'ignore', you get what you pay for.. + self.failUnlessEqual(buf[:], u"ab\0\0\0\0") + import _ctypes_test func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p *************** *** 95,99 **** --- 109,125 ---- self.failUnlessEqual(func(u"äöüß"), "????") + def test_buffers(self): + ctypes.set_conversion_mode("ascii", "strict") + buf = ctypes.create_string_buffer(u"abc") + self.failUnlessEqual(len(buf), 3+1) + ctypes.set_conversion_mode("ascii", "replace") + buf = ctypes.create_string_buffer(u"abäöü") + self.failUnlessEqual(buf[:], "ab???\0") + + ctypes.set_conversion_mode("ascii", "ignore") + buf = ctypes.create_string_buffer(u"abäöü") + # is that correct? not sure. But with 'ignore', you get what you pay for.. + self.failUnlessEqual(buf[:], "ab\0\0\0\0") if __name__ == '__main__': |
From: Thomas H. <th...@us...> - 2004-10-12 19:03:42
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10765 Modified Files: _ctypes.c Log Message: Accept and convert unicode an CharArray_set_value. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** _ctypes.c 11 Oct 2004 08:58:28 -0000 1.165 --- _ctypes.c 12 Oct 2004 19:03:32 -0000 1.166 *************** *** 712,728 **** char *ptr; int size; ! if (-1 == PyString_AsStringAndSize(value, &ptr, &size)) return -1; if (size > self->b_size) { PyErr_SetString(PyExc_ValueError, "string too long"); return -1; } memcpy(self->b_ptr, ptr, size); if (size < self->b_size) self->b_ptr[size] = '\0'; ! /* What about CData_GetList()? We don't care, since we have a copy of the data */ return 0; } --- 712,745 ---- char *ptr; int size; ! ! if (PyUnicode_Check(value)) { ! value = PyUnicode_AsEncodedString(value, ! conversion_mode_encoding, ! conversion_mode_errors); ! if (!value) ! return -1; ! } else if (!PyString_Check(value)) { ! PyErr_Format(PyExc_TypeError, ! "string expected instead of %s instance", ! value->ob_type->tp_name); return -1; + } else + Py_INCREF(value); + size = PyString_GET_SIZE(value); if (size > self->b_size) { PyErr_SetString(PyExc_ValueError, "string too long"); + Py_DECREF(value); return -1; } + ptr = PyString_AS_STRING(value); memcpy(self->b_ptr, ptr, size); if (size < self->b_size) self->b_ptr[size] = '\0'; + Py_DECREF(value); ! /* What about CData_GetList()? No need to do something, since we have ! a copy of the data */ return 0; } |
From: Thomas H. <th...@us...> - 2004-10-12 19:02:39
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10547 Modified Files: __init__.py Log Message: Remove the conversion calls in create_string_buffer and create_unicode_buffer, they are done in C, and use the conversion mode that has been set. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/__init__.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** __init__.py 11 Oct 2004 08:59:50 -0000 1.39 --- __init__.py 12 Oct 2004 19:02:29 -0000 1.40 *************** *** 45,49 **** """ if isinstance(init, (str, unicode)): - init = str(init) if size is None: size = len(init)+1 --- 45,48 ---- *************** *** 236,240 **** """ if isinstance(init, (str, unicode)): - init = unicode(init) if size is None: size = len(init)+1 --- 235,238 ---- |
From: Thomas H. <th...@us...> - 2004-10-12 18:04:05
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30330 Added Files: test_unicode.py Log Message: Test unicode conversions. --- NEW FILE: test_unicode.py --- # coding: latin-1 import unittest import ctypes def get_libc(): import os, sys if os.name == "nt": return ctypes.cdll.msvcrt elif os.name == "posix": if sys.platform == "darwin": return ctypes.cdll.LoadLibrary("/usr/lib/libc.dylib") elif sys.platform == "cygwin": return ctypes.cdll.LoadLibrary("/bin/cygwin1.dll") elif sys.platform == "sunos5": return ctypes.cdll.LoadLibrary("/lib/libc.so") else: try: return ctypes.cdll.LoadLibrary("/lib/libc.so.6") except OSError: pass return None libc = get_libc() wcslen = libc.wcslen wcslen.argtypes = [ctypes.c_wchar_p] class UnicodeTestCase(unittest.TestCase): def setUp(self): self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict") def tearDown(self): ctypes.set_conversion_mode(*self.prev_conv_mode) def test_ascii_strict(self): ctypes.set_conversion_mode("ascii", "strict") # no conversions take place with unicode arguments self.failUnlessEqual(wcslen(u"abc"), 3) self.failUnlessEqual(wcslen(u"ab\u2070"), 3) # string args are converted self.failUnlessEqual(wcslen("abc"), 3) self.failUnlessRaises(ctypes.ArgumentError, wcslen, "abä") def test_ascii_replace(self): ctypes.set_conversion_mode("ascii", "replace") self.failUnlessEqual(wcslen(u"abc"), 3) self.failUnlessEqual(wcslen(u"ab\u2070"), 3) self.failUnlessEqual(wcslen("abc"), 3) self.failUnlessEqual(wcslen("abä"), 3) def test_ascii_ignore(self): ctypes.set_conversion_mode("ascii", "ignore") self.failUnlessEqual(wcslen(u"abc"), 3) self.failUnlessEqual(wcslen(u"ab\u2070"), 3) # ignore error mode skips non-ascii characters self.failUnlessEqual(wcslen("abc"), 3) self.failUnlessEqual(wcslen("äöüß"), 0) def test_latin1_strict(self): ctypes.set_conversion_mode("latin-1", "strict") self.failUnlessEqual(wcslen(u"abc"), 3) self.failUnlessEqual(wcslen(u"ab\u2070"), 3) self.failUnlessEqual(wcslen("abc"), 3) self.failUnlessEqual(wcslen("äöüß"), 4) import _ctypes_test func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p class StringTestCase(UnicodeTestCase): def setUp(self): self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict") func.argtypes = [ctypes.c_char_p] func.restype = ctypes.c_char_p def tearDown(self): ctypes.set_conversion_mode(*self.prev_conv_mode) func.argtypes = None func.restype = ctypes.c_int def test_ascii_replace(self): ctypes.set_conversion_mode("ascii", "strict") self.failUnlessEqual(func("abc"), "abc") self.failUnlessEqual(func(u"abc"), "abc") self.assertRaises(ctypes.ArgumentError, func, u"abä") def test_ascii_ignore(self): ctypes.set_conversion_mode("ascii", "ignore") self.failUnlessEqual(func("abc"), "abc") self.failUnlessEqual(func(u"abc"), "abc") self.failUnlessEqual(func(u"äöüß"), "") def test_ascii_replace(self): ctypes.set_conversion_mode("ascii", "replace") self.failUnlessEqual(func("abc"), "abc") self.failUnlessEqual(func(u"abc"), "abc") self.failUnlessEqual(func(u"äöüß"), "????") if __name__ == '__main__': unittest.main() |
From: Thomas H. <th...@us...> - 2004-10-12 13:59:25
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3660/unittests Modified Files: test_parameters.py Log Message: Make this test work on linux. Index: test_parameters.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_parameters.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_parameters.py 16 Sep 2004 14:18:04 -0000 1.25 --- test_parameters.py 12 Oct 2004 13:57:54 -0000 1.26 *************** *** 1,3 **** ! import unittest class SimpleTypesTestCase(unittest.TestCase): --- 1,3 ---- ! import unittest, sys class SimpleTypesTestCase(unittest.TestCase): *************** *** 49,58 **** return s = u"123" ! self.failUnless(c_wchar_p.from_param(s)._obj is s) ! ! self.assertRaises(TypeError, c_wchar_p.from_param, 42) ! # new in 0.9.1: convert (decode) ascii to unicode ! self.failUnlessEqual(c_wchar_p.from_param("123")._obj, u"123") self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, "123\377") --- 49,58 ---- return s = u"123" ! if sys.platform == "win32": ! self.failUnless(c_wchar_p.from_param(s)._obj is s) ! self.assertRaises(TypeError, c_wchar_p.from_param, 42) ! # new in 0.9.1: convert (decode) ascii to unicode ! self.failUnlessEqual(c_wchar_p.from_param("123")._obj, u"123") self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, "123\377") |
From: Thomas H. <th...@us...> - 2004-10-12 13:42:50
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516 Modified Files: stgdict.c Log Message: c_wchar not allowed for bit field. Index: stgdict.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/stgdict.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** stgdict.c 11 Oct 2004 08:58:28 -0000 1.16 --- stgdict.c 12 Oct 2004 13:41:15 -0000 1.17 *************** *** 200,204 **** case FFI_TYPE_UINT8: case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_SINT64: --- 200,203 ---- *************** *** 208,211 **** --- 207,211 ---- case FFI_TYPE_SINT8: case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: if (dict->getfunc != getentry("c")->getfunc #ifdef Py_USING_UNICODE |
From: Thomas H. <th...@us...> - 2004-10-12 12:38:24
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20628 Modified Files: callproc.c Log Message: Seems the unicode support is now complete. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** callproc.c 12 Oct 2004 08:29:11 -0000 1.107 --- callproc.c 12 Oct 2004 12:37:59 -0000 1.108 *************** *** 503,515 **** #ifdef Py_USING_UNICODE if (PyUnicode_Check(obj)) { - pa->ffi_type = &ffi_type_pointer; #ifdef HAVE_USABLE_WCHAR_T pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; #else ! #error FIXME - create a 'wchar_t *' ! #endif return 0; } #endif --- 503,530 ---- #ifdef Py_USING_UNICODE if (PyUnicode_Check(obj)) { #ifdef HAVE_USABLE_WCHAR_T + pa->ffi_type = &ffi_type_pointer; pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; + return 0; #else ! int size = PyUnicode_GET_SIZE(obj); ! size += 1; /* terminating NUL */ ! size *= sizeof(wchar_t); ! pa->value.p = PyMem_Malloc(size); ! if (!pa->value.p) ! return -1; ! memset(pa->value.p, 0, size); ! pa->keep = PyCObject_FromVoidPtr(pa->value.p, PyMem_Free); ! if (!pa->keep) { ! PyMem_Free(pa->value.p); ! return -1; ! } ! if (-1 == PyUnicode_AsWideChar((PyUnicodeObject *)obj, ! pa->value.p, PyUnicode_GET_SIZE(obj))) ! return -1; return 0; + #endif } #endif *************** *** 595,599 **** int argcount) { ! PyThreadState *_save; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */ ffi_cif cif; int cc; --- 610,614 ---- int argcount) { ! PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */ ffi_cif cif; int cc; |
From: Thomas H. <th...@us...> - 2004-10-12 10:38:13
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26220 Modified Files: cfield.c Log Message: Fully implement the Z_set function, even if HAVE_USABLE_WCHAR_T is not defined. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** cfield.c 12 Oct 2004 09:43:06 -0000 1.52 --- cfield.c 12 Oct 2004 10:38:04 -0000 1.53 *************** *** 865,874 **** } else Py_INCREF(value); - *(wchar_t **)ptr = PyUnicode_AS_UNICODE(value); #ifdef HAVE_USABLE_WCHAR_T #else ! //#error FIXME #endif - return value; } --- 865,904 ---- } else Py_INCREF(value); #ifdef HAVE_USABLE_WCHAR_T + /* HAVE_USABLE_WCHAR_T means that Py_UNICODE and wchar_t is the same + type. So we can copy directly. Hm, are unicode objects always NUL + terminated in Python, internally? + */ + *(wchar_t **)ptr = PyUnicode_AS_UNICODE(value); + return value; #else ! { ! /* We must create a wchar_t* buffer from the unicode object, ! and keep it alive */ ! PyObject *keep; ! wchar_t *buffer; ! ! int size = PyUnicode_GET_SIZE(value); ! size += 1; /* terminating NUL */ ! size *= sizeof(wchar_t); ! buffer = (wchar_t *)PyMem_Malloc(size); ! if (!buffer) ! return NULL; ! memset(buffer, 0, size); ! keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); ! if (!keep) { ! PyMem_Free(buffer); ! return NULL; ! } ! *(wchar_t **)ptr = (wchar_t *)buffer; ! if (-1 == PyUnicode_AsWideChar((PyUnicodeObject *)value, ! buffer, PyUnicode_GET_SIZE(value))) { ! Py_DECREF(value); ! return NULL; ! } ! Py_DECREF(value); ! return keep; ! } #endif } |
From: Thomas H. <th...@us...> - 2004-10-12 09:43:17
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15673 Modified Files: cfield.c Log Message: Fix compiler warning, simplify code. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** cfield.c 12 Oct 2004 09:36:45 -0000 1.51 --- cfield.c 12 Oct 2004 09:43:06 -0000 1.52 *************** *** 642,646 **** { int len; - wchar_t *p; if (PyString_Check(value)) { --- 642,645 ---- *************** *** 658,666 **** Py_INCREF(value); - p = PyUnicode_AsUnicode(value); - if (!p) { - Py_DECREF(value); - return NULL; - } len = PyUnicode_GET_SIZE(value); if (len != 1) { --- 657,660 ---- *************** *** 670,674 **** return NULL; } ! *(wchar_t *)ptr = p[0]; Py_DECREF(value); --- 664,669 ---- return NULL; } ! ! *(wchar_t *)ptr = PyUnicode_AS_UNICODE(value)[0]; Py_DECREF(value); |
From: Thomas H. <th...@us...> - 2004-10-12 09:40:28
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14986 Modified Files: _ctypes_test.c Log Message: Why does MS have their own naming conventions for library functions? Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** _ctypes_test.c 11 Oct 2004 09:14:02 -0000 1.30 --- _ctypes_test.c 12 Oct 2004 09:39:31 -0000 1.31 *************** *** 70,74 **** --- 70,78 ---- EXPORT(wchar_t *) my_wcsdup(wchar_t *src) { + #ifdef MS_WIN32 return _wcsdup(src); + #else + return wcsdup(src); + #endif } #endif |
From: Thomas H. <th...@us...> - 2004-10-12 09:36:59
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14501 Modified Files: cfield.c Log Message: Fix compiler warning. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** cfield.c 12 Oct 2004 09:32:27 -0000 1.50 --- cfield.c 12 Oct 2004 09:36:45 -0000 1.51 *************** *** 747,751 **** /* copy terminating NUL character */ size += 1; ! PyUnicode_AsWideChar(value, (wchar_t *)ptr, size); return value; } --- 747,751 ---- /* copy terminating NUL character */ size += 1; ! PyUnicode_AsWideChar((PyUnicodeObject *)value, (wchar_t *)ptr, size); return value; } |
From: Thomas H. <th...@us...> - 2004-10-12 09:32:44
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13654 Modified Files: cfield.c Log Message: Fix some *very* strange code. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** cfield.c 12 Oct 2004 09:14:58 -0000 1.49 --- cfield.c 12 Oct 2004 09:32:27 -0000 1.50 *************** *** 690,693 **** --- 690,694 ---- PyObject *result; unsigned int len; + Py_UNICODE *p; size /= sizeof(wchar_t); /* we count character units here, not bytes */ *************** *** 702,710 **** */ /* chop off at the first NUL character, if any. */ ! /* XXX FIXME: But it seems wcslen would access forbidden memory locations ! if the original pointer was not zero terminated */ - /* Anyway, this is very strange code */ - len = wcslen(PyUnicode_AS_UNICODE(result)); if (len < size) { PyObject *ob = PyUnicode_FromWideChar((wchar_t *)ptr, len); --- 703,711 ---- */ /* chop off at the first NUL character, if any. */ ! p = PyUnicode_AS_UNICODE(result); ! for (len = 0; len < size; ++len) ! if (!p[len]) ! break; if (len < size) { PyObject *ob = PyUnicode_FromWideChar((wchar_t *)ptr, len); *************** *** 869,876 **** } else Py_INCREF(value); - #ifdef HAVE_USABLE_WCHAR_T *(wchar_t **)ptr = PyUnicode_AS_UNICODE(value); #else ! #error FIXME #endif return value; --- 870,877 ---- } else Py_INCREF(value); *(wchar_t **)ptr = PyUnicode_AS_UNICODE(value); + #ifdef HAVE_USABLE_WCHAR_T #else ! //#error FIXME #endif return value; |
From: Thomas H. <th...@us...> - 2004-10-12 09:15:11
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10669 Modified Files: cfield.c Log Message: Use the correct ffi_type for wchar_t. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** cfield.c 12 Oct 2004 08:46:36 -0000 1.48 --- cfield.c 12 Oct 2004 09:14:58 -0000 1.49 *************** *** 1016,1021 **** { 'z', z_set, z_get, &ffi_type_pointer}, #ifdef Py_USING_UNICODE ! /* Correct or not? */ ! { 'u', u_set, u_get, &ffi_type_sshort}, { 'U', U_set, U_get, &ffi_type_pointer}, { 'Z', Z_set, Z_get, &ffi_type_pointer}, --- 1016,1020 ---- { 'z', z_set, z_get, &ffi_type_pointer}, #ifdef Py_USING_UNICODE ! { 'u', u_set, u_get, NULL}, /* ffi_type set later */ { 'U', U_set, U_get, &ffi_type_pointer}, { 'Z', Z_set, Z_get, &ffi_type_pointer}, *************** *** 1031,1036 **** --- 1030,1046 ---- getentry(char *fmt) { + static int initialized = 0; struct fielddesc *table = formattable; + if (!initialized) { + initialized = 1; + if (sizeof(wchar_t) == sizeof(short)) + getentry("u")->pffi_type = &ffi_type_sshort; + else if (sizeof(wchar_t) == sizeof(int)) + getentry("u")->pffi_type = &ffi_type_sint; + else if (sizeof(wchar_t) == sizeof(long)) + getentry("u")->pffi_type = &ffi_type_slong; + } + for (; table->code; ++table) { if (table->code == fmt[0]) |
From: Thomas H. <th...@us...> - 2004-10-12 08:47:42
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5348 Modified Files: cfield.c Log Message: Make the code more general, to work with any size of wchar_t. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** cfield.c 12 Oct 2004 08:29:11 -0000 1.47 --- cfield.c 12 Oct 2004 08:46:36 -0000 1.48 *************** *** 720,723 **** --- 720,726 ---- unsigned int size; + /* It's easier to calculate in characters than in bytes */ + length /= sizeof(wchar_t); + if (PyString_Check(value)) { value = PyUnicode_FromEncodedObject(value, *************** *** 733,751 **** } else Py_INCREF(value); ! size = PyUnicode_GET_DATA_SIZE(value); if (size > length) { PyErr_Format(PyExc_ValueError, ! "too long (%d instead of less than %d)", size, length); Py_DECREF(value); return NULL; ! } else if (size < length-sizeof(wchar_t)) /* copy terminating NUL character */ ! size += sizeof(wchar_t); ! #ifdef HAVE_USABLE_WCHAR_T ! memcpy((wchar_t *)ptr, PyUnicode_AS_UNICODE(value), size); ! #else ! #error FIXME: use PyUnicode_FromWideChar() ! #endif return value; } --- 736,750 ---- } else Py_INCREF(value); ! size = PyUnicode_GET_SIZE(value); if (size > length) { PyErr_Format(PyExc_ValueError, ! "too long (%d chars instead of less than %d)", size, length); Py_DECREF(value); return NULL; ! } else if (size < length-1) /* copy terminating NUL character */ ! size += 1; ! PyUnicode_AsWideChar(value, (wchar_t *)ptr, size); return value; } |
From: Thomas H. <th...@us...> - 2004-10-12 08:30:27
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv978 Modified Files: cfield.c callproc.c Log Message: More changes for unicode support. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** callproc.c 11 Oct 2004 08:58:28 -0000 1.106 --- callproc.c 12 Oct 2004 08:29:11 -0000 1.107 *************** *** 504,510 **** --- 504,514 ---- if (PyUnicode_Check(obj)) { pa->ffi_type = &ffi_type_pointer; + #ifdef HAVE_USABLE_WCHAR_T pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; + #else + #error FIXME - create a 'wchar_t *' + #endif return 0; } Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** cfield.c 11 Oct 2004 08:58:28 -0000 1.46 --- cfield.c 12 Oct 2004 08:29:11 -0000 1.47 *************** *** 637,641 **** #ifdef Py_USING_UNICODE ! /* u - a single unicode character */ static PyObject * u_set(void *ptr, PyObject *value, unsigned size) --- 637,641 ---- #ifdef Py_USING_UNICODE ! /* u - a single wchar_t character */ static PyObject * u_set(void *ptr, PyObject *value, unsigned size) *************** *** 698,705 **** /* We need 'result' to be able to count the characters with wcslen, since ptr may not be NUL terminated. If the length is smaller (if ! it was actually NUL terminated, we construct a new one and thorw away the result. */ /* chop off at the first NUL character, if any. */ len = wcslen(PyUnicode_AS_UNICODE(result)); if (len < size) { --- 698,709 ---- /* We need 'result' to be able to count the characters with wcslen, since ptr may not be NUL terminated. If the length is smaller (if ! it was actually NUL terminated, we construct a new one and throw away the result. */ /* chop off at the first NUL character, if any. */ + /* XXX FIXME: But it seems wcslen would access forbidden memory locations + if the original pointer was not zero terminated */ + + /* Anyway, this is very strange code */ len = wcslen(PyUnicode_AS_UNICODE(result)); if (len < size) { *************** *** 739,743 **** --- 743,751 ---- /* copy terminating NUL character */ size += sizeof(wchar_t); + #ifdef HAVE_USABLE_WCHAR_T memcpy((wchar_t *)ptr, PyUnicode_AS_UNICODE(value), size); + #else + #error FIXME: use PyUnicode_FromWideChar() + #endif return value; } *************** *** 862,866 **** --- 870,878 ---- } else Py_INCREF(value); + #ifdef HAVE_USABLE_WCHAR_T *(wchar_t **)ptr = PyUnicode_AS_UNICODE(value); + #else + #error FIXME + #endif return value; } |
From: Thomas H. <th...@us...> - 2004-10-11 09:14:17
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30292 Modified Files: _ctypes_test.c Log Message: Fix typo in #ifdef. Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** _ctypes_test.c 11 Oct 2004 09:04:26 -0000 1.29 --- _ctypes_test.c 11 Oct 2004 09:14:02 -0000 1.30 *************** *** 67,71 **** } ! #ifdef HAVE_WCHAR_h EXPORT(wchar_t *) my_wcsdup(wchar_t *src) { --- 67,71 ---- } ! #ifdef HAVE_WCHAR_H EXPORT(wchar_t *) my_wcsdup(wchar_t *src) { |
From: Thomas H. <th...@us...> - 2004-10-11 09:13:08
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30119 Modified Files: test_strings.py Log Message: Replace some failUnless(x == y) by failUnlessEqual(x, y). Index: test_strings.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_strings.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_strings.py 4 May 2004 09:16:23 -0000 1.14 --- test_strings.py 11 Oct 2004 09:12:57 -0000 1.15 *************** *** 7,24 **** buf = BUF("a", "b", "c") ! self.failUnless(buf.value == "abc") ! self.failUnless(buf.raw == "abc\000") buf.value = "ABCD" ! self.failUnless(buf.value == "ABCD") ! self.failUnless(buf.raw == "ABCD") buf.value = "x" ! self.failUnless(buf.value == "x") ! self.failUnless(buf.raw == "x\000CD") buf[1] = "Z" ! self.failUnless(buf.value == "xZCD") ! self.failUnless(buf.raw == "xZCD") self.assertRaises(ValueError, setattr, buf, "value", "aaaaaaaa") --- 7,24 ---- buf = BUF("a", "b", "c") ! self.failUnlessEqual(buf.value, "abc") ! self.failUnlessEqual(buf.raw, "abc\000") buf.value = "ABCD" ! self.failUnlessEqual(buf.value, "ABCD") ! self.failUnlessEqual(buf.raw, "ABCD") buf.value = "x" ! self.failUnlessEqual(buf.value, "x") ! self.failUnlessEqual(buf.raw, "x\000CD") buf[1] = "Z" ! self.failUnlessEqual(buf.value, "xZCD") ! self.failUnlessEqual(buf.raw, "xZCD") self.assertRaises(ValueError, setattr, buf, "value", "aaaaaaaa") *************** *** 64,77 **** buf = BUF(u"a", u"b", u"c") ! self.failUnless(buf.value == u"abc") buf.value = u"ABCD" ! self.failUnless(buf.value == u"ABCD") buf.value = u"x" ! self.failUnless(buf.value == u"x") buf[1] = u"Z" ! self.failUnless(buf.value == u"xZCD") class StringTestCase(unittest.TestCase): --- 64,77 ---- buf = BUF(u"a", u"b", u"c") ! self.failUnlessEqual(buf.value, u"abc") buf.value = u"ABCD" ! self.failUnlessEqual(buf.value, u"ABCD") buf.value = u"x" ! self.failUnlessEqual(buf.value, u"x") buf[1] = u"Z" ! self.failUnlessEqual(buf.value, u"xZCD") class StringTestCase(unittest.TestCase): *************** *** 81,102 **** # Cannot call len on a c_string any longer self.assertRaises(TypeError, len, cs) ! self.failUnless(sizeof(cs) == 7) # The value property is the string up to the first terminating NUL. ! self.failUnless(cs.value == "abcdef") ! self.failUnless(c_string("abc\000def").value == "abc") # The raw property is the total buffer contents: ! self.failUnless(cs.raw == "abcdef\000") ! self.failUnless(c_string("abc\000def").raw == "abc\000def\000") # We can change the value: cs.value = "ab" ! self.failUnless(cs.value == "ab") ! self.failUnless(cs.raw == "ab\000\000\000\000\000") cs.raw = "XY" ! self.failUnless(cs.value == "XY") ! self.failUnless(cs.raw == "XY\000\000\000\000\000") self.assertRaises(TypeError, c_string, u"123") --- 81,102 ---- # Cannot call len on a c_string any longer self.assertRaises(TypeError, len, cs) ! self.failUnlessEqual(sizeof(cs), 7) # The value property is the string up to the first terminating NUL. ! self.failUnlessEqual(cs.value, "abcdef") ! self.failUnlessEqual(c_string("abc\000def").value, "abc") # The raw property is the total buffer contents: ! self.failUnlessEqual(cs.raw, "abcdef\000") ! self.failUnlessEqual(c_string("abc\000def").raw, "abc\000def\000") # We can change the value: cs.value = "ab" ! self.failUnlessEqual(cs.value, "ab") ! self.failUnlessEqual(cs.raw, "ab\000\000\000\000\000") cs.raw = "XY" ! self.failUnlessEqual(cs.value, "XY") ! self.failUnlessEqual(cs.raw, "XY\000\000\000\000\000") self.assertRaises(TypeError, c_string, u"123") |
From: Thomas H. <th...@us...> - 2004-10-11 09:12:30
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29954 Modified Files: test_bitfields.py Log Message: typo. Index: test_bitfields.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_bitfields.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_bitfields.py 21 Sep 2004 17:01:24 -0000 1.1 --- test_bitfields.py 11 Oct 2004 09:11:57 -0000 1.2 *************** *** 131,136 **** pass else: ! result = self.fail_fields(("a", c_char, 1)) ! self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type c_char')) class Dummy(Structure): --- 131,136 ---- pass else: ! result = self.fail_fields(("a", c_wchar, 1)) ! self.failUnlessEqual(result, (TypeError, 'bit fields not allowed for type c_wchar')) class Dummy(Structure): |
From: Thomas H. <th...@us...> - 2004-10-11 09:04:50
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28508 Modified Files: _ctypes_test.c Log Message: MS_WIN32 -> HAVE_WCHAR_H Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** _ctypes_test.c 22 Sep 2004 07:00:15 -0000 1.28 --- _ctypes_test.c 11 Oct 2004 09:04:26 -0000 1.29 *************** *** 67,71 **** } ! #ifdef MS_WIN32 EXPORT(wchar_t *) my_wcsdup(wchar_t *src) { --- 67,71 ---- } ! #ifdef HAVE_WCHAR_h EXPORT(wchar_t *) my_wcsdup(wchar_t *src) { |