-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathChangeLog
More file actions
1669 lines (1123 loc) · 58.8 KB
/
ChangeLog
File metadata and controls
1669 lines (1123 loc) · 58.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2006-11-07 Thomas Heller <theller@python.net>
* Fixed the _ctypes.py and _ctypes_test.py loader modules to work
independend of the cwd.
2006-10-20 Thomas Heller <theller@python.net>
* Replaced the mechanism to run ctypes from the SVN sandbox: a
_ctypes.py file at top-level loads the _ctypes.pyd / _ctypes.so
extension module from the platform specific build directory
without installing it. Same for _ctypes_test.
----- big change in SVN repository -----
* Removed the 'ctypes' and 'source' directories with 'svn rm'.
Replaced them by svn:externals definitions pointing into the official
Python SVN tree:
source http://svn.python.org/projects/python/trunk/Modules/_ctypes/
ctypes http://svn.python.org/projects/python/trunk/Lib/ctypes/
2006-08-24 Thomas Heller <theller@python.net>
* Various changes for Win64 / AMD64 support.
2006-08-18 Thomas Heller <theller@python.net>
* Sync with the Python SVN version of ctypes:
Remove the special casing of Py_None when converting the return
value of the Python part of a callback function to C. If it
cannot be converted, call PyErr_WriteUnraisable with the exception
we got. Before, arbitrary data has been passed to the calling C
code in this case.
The __repr__ method of a NULL py_object does no longer raise an
exception. Remove a stray '?' character from the exception text
when the value is retrieved of such an object.
Add commented assert statements to check that the result of
PyObject_stgdict() and PyType_stgdict() calls are non-NULL before
dereferencing the result.
Fix a few other nits as well.
Check for NULL return value from new_CArgObject().
Check for NULL return value from GenericCData_new().
2006-08-14 Thomas Heller <theller@python.net>
* New testcases for the _as_parameter_ property in
ctypes/test/test_as_parameter.py, contributed by Shane Holloway.
* Unfortunately, the result storage for a C callback function
cannot be zero'd out in an easy way because the size is unknown in
source/callbacks.c - so the following change has been taken out
again.
2006-08-11 Thomas Heller <theller@python.net>
* source/callbacks.c: When a ctypes C callback function is called,
zero out the result storage before converting the result to C
data. This ensures that callback functions returning None will
pass a zero or NULL value (depending on the result type) to the
calling code.
Provide a better context for errors when the conversion of a
callback function's result cannot be converted.
2006-08-09 Thomas Heller <theller@python.net>
* Remove the builtin _as_parameter_ attributes of ctypes
instances. Instead, a function pointer in the type's stgdict is
used to convert a ctypes instance to a function call parameter.
This allows to change the from_param methods to check for
_as_parameter_ attribute as the documentation promises.
Change version number to 1.0.1.
2006-08-08 Thomas Heller <theller@python.net>
* Patch from Damien Miller for OpenBSD: Remove unneeded
"-fno-stack-protector" flag, support x86_64. Regenerated
source/libffi/configure.
2006-08-03 Thomas Heller <theller@python.net>
* Changed version number to 1.0.0.
* ctypes/__init__.py: Remove support for ctypes.com in
DllCanUnloadNow and DllGetClassObject.
Fix the DllGetClassObject and DllCanUnloadNow so that they forward
the call to the comtypes.server.inprocserver module.
2006-08-01 Thomas Heller <theller@python.net>
* source/_ctypes.c: Fix a potential segfault and several potential
refcount leaks in the cast() function.
2006-07-21 Thomas Heller <theller@python.net>
* source/libffi/configure.ac: Integrated a patch from Damien
Miller: More target platforms for OpenBSD. source/libffi/configure
regenerated with autoconf 2.59.
* Merged in changes from Python trunk: Make sure the _ctypes
extension can be compiled when WITH_THREAD is not defined on
Windows, even if that configuration is probably not supported at
all.
* Replace an unneeded Py_XINCREF with Py_INCREF.
2006-07-14 Thomas Heller <theller@python.net>
* Merged in changes done in Python trunk:
Fix #1521375. When running with root priviledges, 'gcc -o
/dev/null' did overwrite /dev/null. Use a temporary file instead
of /dev/null.
When a foreign function is retrived by calling __getitem__ on a
ctypes library instance, do not set it as attribute.
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3
to load shared libraries.
2006-07-13 Thomas Heller <theller@python.net>
* Change version number to 0.9.9.9.
* Because of a misspelled symbols (WITH_THREADS instead of
WITH_THREAD) ctypes was always compiled without thread support;
this is now fixed.
* Index checking on 1-sized arrays was reintroduced, so they can
no longer be used as variable sized data.
2006-07-10 Thomas Heller <theller@python.net>
* Backport various fixes done in Python SVN:
Assigning None to pointer type structure fields possible overwrote
wrong fields.
Fixed a segfault when ctypes.wintypes were imported on non-Windows
machines.
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
Patch #1517790: It is now possible to use custom objects in the
ctypes foreign function argtypes sequence as long as they provide
a from_param method, no longer is it required that the object is a
ctypes type.
2006-07-06 Thomas Heller <theller@python.net>
* ctypes\test\test_win32.py: Disable the test_SEH test unless the
"SEH" resource is enabled when running tests.
* Remove the "ctypes.uses_seh()" function again, it will not go
into Python 2.5.
2006-07-05 Thomas Heller <theller@python.net>
* Merge in change done in Python SVN trunk: Protect the thread api
calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
* Merge changes done by Ronald Oussoren in Python SVN trunk: Sync
the darwin/x86 port libffi with the copy in PyObjC. This fixes a
number of bugs in that port. The most annoying ones were due to
some subtle differences between the document ABI and the actual
implementation :-( There are no python unittests that fail without
this patch, but without it some of libffi's unittests fail.
2006-07-04 Thomas Heller <theller@python.net>
* source\cfield.c: Applied a patch that Khalid A. Bakr sent in
some time ago, it fixes the bitfield test when _ctypes is compiled
with the MINGW32.
2006-06-30 Thomas Heller <theller@python.net>
* source/libffi_msvc/fficonfig.h: #define __attribute__(x) only
for MSVC, not for mingw compilers. This was the main thing that
was missing for building _ctypes with MINGW32.
Still, 2 tests are failing when compiled with mingw32:
test_bitfields and test_struct_return_8H.
* source/callproc.c: The _ctypes extension module now exports the
function "uses_seh()" which will return True when Windows
Structured Exception Handling (SEH) is used to catch faults in
foreign functions, False otherwise. SEH is not used when _ctypes
is compiled with the Mingw compiler, or with MSVC in DEBUG mode.
2006-06-22 Thomas Heller <theller@python.net>
* Merge in changes done in Python SVN for 2.5 beta 1:
- cleanup whitespace
- add Python2.3 compatibility comments
- fix the testsuite for openbsd
2006-06-12 Thomas Heller <theller@python.net>
* Fix wrong printf format in _ctypes.c.
* Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
2006-06-10 Thomas Heller <theller@python.net>
* Tagged release_0_9_9_7.
* Fix build on MIPS for libffi.
2006-06-09 Thomas Heller <theller@python.net>
* Correctly support nested anonymous structures/union fields.
* Remove the restriction that pointer item assignments only work
with index of zero. Another fix for the cast function to keep
needed objects alive.
* A casted object does now reference the source objects '_objects'
member.
* It is now possible to assign arbitrary indexes on pointer
instances.
2006-06-08 Thomas Heller <theller@python.net>
* Merged in changes done in Python trunk: Fixes for 64-bit big
endian machines.
2006-06-02 Thomas Heller <theller@python.net>
* Fixed slice assignment to variable-sized arrays, with test.
2006-06-01 Thomas Heller <theller@python.net>
* Added support for unnamed structure fields, they must be listed
in the '_anonymous_' class variable.
2006-05-31 Thomas Heller <theller@python.net>
* Merged in changes done in Python trunk, by Bob Ippolito and
Ronald Oussuren: enable darwin/x86 support for libffi and hence
ctypes (doesn't yet support --enable-universalsdk)
2006-05-23 Thomas Heller <theller@python.net>
* ctypes\__init__.py: Fixed a possible FutureWarning when id()
returned an integer less than zero or larger than sys.maxint, in
CDLL.__repr__.
2006-05-19 Thomas Heller <theller@python.net>
* docs\anatomy.txt: Add some documentation, also containing
doctest testcases, about some ctypes object internals.
* docs\manual\tutorial.txt: Document variable-sized data types.
* source\_ctypes.c: Allow zero-sized arrays again, although
accessing elements will always raise IndexError.
* source\_ctypes.c: Change the way unique_key calculates the keys
into the b_objects array. The previous way was broken for arrays
or structures having more than 256 components, which led to
strange errors.
2006-05-18 Thomas Heller <theller@python.net>
* source\callproc.c: Fix compiler warning about comparison of
signed and unsigned values.
* source\_ctypes.c: Correct refcount issues in the (unlikely) case
that KeepRef fails.
2006-05-12 Thomas Heller <theller@python.net>
* Bug fix for the cast function, so that it better keeps needed
objects alive. Prevent creation of array types with zero or
negative sizes.
* Implemented support for variable sized data structures: array
types with exactly 1 element don't do bounds checking any more,
and a resize function can resize the internal memory buffer of
ctypes instances.
* Some fixes to the test-suite. Free allocated memory, remove
duplicate tests, don't run unreliable tests by default.
2006-04-28 Thomas Heller <theller@python.net>
* docs/manual/tutorial.txt: End each code sample with '>>>', so
that doctest also works on the LaTeX version of the tutorial
(otherwise some tests would break because doctest would see
'\end{verbatim}' as expected output.
* docs/manual/test-tutorial.py: Python 2.5a2 formats exceptions in
a different way (I'm not sure if this will be fixed or not). Add
doctest.IGNORE_EXCEPTION_DETAIL.
2006-04-26 Thomas Heller <theller@python.net>
* Tagged release_0_9_9_6, and released it.
2006-04-25 Thomas Heller <theller@python.net>
* Fix compiler warnings on Darwin, patch by Brett Canon.
2006-04-19 Thomas Heller <theller@python.net>
* docs\manual\tutorial.txt: Updates to the tutorial.
* When a 'source' object is casted to another object, the other
object keeps a reference to the source object to keep it alive.
2006-04-18 Thomas Heller <theller@python.net>
* Patch from Skip Montanaro, in Python SVN: C++ compiler cleanup:
the typical few casts, and ... C++ didn't like that the
StgDictObject's ffi_type member had the same name as its type. I
changed that to ffi_type_pointer.
Fix refcount issues in CreateSwappedType - this removes the
refleak when reloading ctypes.
2006-04-15 Thomas Heller <theller@python.net>
* source\libffi\src\x86\ffi.c (ffi_prep_cif_machdep): Add a fix
for FreeBSD. See also http://python.org/sf/1470353.
2006-04-13 Thomas Heller <theller@python.net>
* Changed version number to 0.9.9.6.
* Merged in changes made in the 'LoadLibrary_branch' branch:
Restore the old way to load libraries again:
cdll/windll have a LoadLibrary method, and no other public
attributes. CDLL/WinDLL accept library pathname in the
constructor, that's the only public attribute: all the find(),
load(), and load_library() methods are gone. In other words,
use these ways to load shared libraries:
CDLL("path_to_lib")
CDLL("path_to_lib", mode=RTLD_GLOBAL)
cdll.path_to_lib
cdll.LoadLibrary("path_to_lib")
cdll.LoadLibrary("path_to_lib", mode=RTLD_GLOBAL)
The CDLL/WinDLL base class has been renamed to LibraryLoader,
in case anyone wants to subclass it.
The ctypes._loader module has been removed completely.
ctypes.util has been revived, it implements a find_library()
function which should be useful to find libraries from the linker
name (on platforms where this makes sense):
find_library("c") -> "/usr/lib/libc.so.6" (Linux)
find_library("c") -> "/usr/lib/libc.dylib" (OS X)
find_library("msvcr71") -> "c:\windows\system32\msvcr71.dll" (Windows)
If the library is not found, None is returned.
2006-04-13 Thomas Heller <theller@python.net>
* Merged in several changes made in Python SVN: RTLD_LOCAL and
RTLD_GLOBAL are defined for each platform.
2006-04-06 Thomas Heller <theller@python.net>
* Simplify code, improve error handling, and a Py_ssize_t fix by
Neal Norwitz.
* Spelled 'signed char' instead of 'char', to avoid test failures
on platforms where the C 'char' type is unsigned.
2006-04-05 Thomas Heller <theller@python.net>
* ctypes/_loader.py: Extend the posix findLib_ld function to try
output from 'ldd'. This makes findLib work on OSF1 (True
64). Patch from Neal Norwitz.
* source/libffi/src/powerpc/darwin_closure.S: Remove the
live_support segment attribute so that this file compiles on OSX 10.3.
* source/libffi: Add support for OpenBSD. The ctypes test-suite
works.
2006-03-29 Thomas Heller <theller@python.net>
* source\_ctypes.c: Accept function pointers as first argument,
and a function pointer types as second argument in the cast
function.
Fix a potential segfault.
2006-03-27 Thomas Heller <theller@python.net>
* source/libffi_msvc/prep_cif.c: Fix calling of stdcall functions
on Windows, when compiled with MingW32.
* setup.py: Fixes from Khalid A. Bakr.
He writes: """I have made some changes (see attached diff) to the
setup.py to have MinGW pass the "--enable-stdcall-fixup" to the
linker to suppress some warnings. And I have added another linker
option, namely "--kill-at" to remove the @XY decoration that MinGW
normally attaches to stdcall functions.
With the latter change, test_cfuncs (which had previously reported
26 failures out of 52 tests) now only reports 3. It seems that the
stdcall part now passes as it does when compiled with a MSVC type
compiler."""
Still, all ctypes callback tests crash Python, and there are other
failures as well - when compiled with mingw.
2006-03-20 Thomas Heller <theller@python.net>
* source\cfield.c: Accessing unaligned structure fields
is now supported on all machines.
2006-03-17 Thomas Heller <theller@python.net>
* Several changes that will eventually allow to compile the
extensions with the MingW32 compiler on Windows (hopefully!).
Currently, calling foreign functions seems to work with some
exceptions: functions that return structures raise errors.
Callback functions crash Python.
* source\libffi_msvc: Remove unneeded #ifdef and #if defined
blocks: the code in this directory is for Windows X86 ONLY.
* source: Backport some changes made in the Python SVN repository
that made the code more robust and did better handling of errors.
The only visible change should be that for [in, lcid] parameter
types a default value of int(0) is used if not default has been
supplied in paramflags.
2006-03-15 Thomas Heller <theller@python.net>
* source/libffi/include/ffi.h.in: Suppress most warnings when
files that include ffi.h are compiled by using proper function
prototypes.
2006-03-15 Thomas Heller <theller@python.net>
* source/cfield.c: PyString_FromFormat()b understands the C99 "z"
qualifier on all platforms, in Python 2.5. Patch from Tim Peters,
adapted to work with older Python versions.
2006-03-14 Thomas Heller <theller@python.net>
* source\ctypes.h, source\_ctypes.c: Apply a patch (after adding
support for older versions of Python) supplied by Neal Norwitz.
This patch implements the changes needed for PEP353 (Py_ssize_t).
He writes:
The attached patch fixes all the ctypes tests so they pass on
amd64. It also fixes several warnings. I'm not sure what else to
do with the patch. Let me know how you want to handle these in
the future.
I'm not sure the patch is 100% correct. You will need to decide
what can be 64 bits and what can't. I believe
sq_{item,slice,ass_item,ass_slice} all need to use Py_ssize_t.
The types in ctypes.h may not require all the changes I made. I
don't know how you want to support older version, so I
unconditionally changed the types to Py_ssize_t.
2006-03-10 Thomas Heller <theller@python.net>
* source/_ctypes.c: Fix foreign functions loaded via ordinal on Windows CE.
2006-03-10 Thomas Heller <theller@python.net>
* (Repository): cast is now implemented as foreign function.
This should fix potential issues on 64-bit platforms.
* On Windows, it is now possible to access functions
exported by ordinal by indexing the loaded dll with the ordinal
number:
my_function = somedll[42]
To implement this, the signature of the _CFuncPtr class has changed.
The _CFuncPtr constructor now be accepts these arguments:
_CFuncPtr(integer address) -> foreign function
_CFuncPtr(callable) -> create a C callable function from callable
_CFuncPtr(integer index, method name) -> foreign function
calling a COM method
_CFuncPtr((ordinal number, dll object), ...) -> foreign
function exported by ordinal
_CFuncPtr((function name, dll object), ...) -> foreign
function exported by name
WINFUNCTYPE and CFUNCTYPE are factory functions for _CFuncPtr
subclasses, so the above applies to the types returned from those
as well.
* Changed version number to 0.9.9.5.
* Use /Wp64 compiler flag on Windows.
2006-03-08 Thomas Heller <theller@python.net>
* (Repository): Tagged as release_0_9_9_4.
2006-03-07 Thomas Heller <theller@python.net>
* (Repository): Removed the ctypes.decorators module completely,
so the cdecl and stdcall symbols are no longer available.
2006-03-03 Thomas Heller <theller@python.net>
* (Repository): Moved all files from the CVS branch 'branch_1_0'
to CVS head. The branch is dead, long live the HEAD!
* ctypes/__init__.py, ctypes/test/test_sizes.py: Added c_int8,
c_int16, c_int32, c_int64, c_uint8, c_uint16, c_uint32, c_uint64
types. Patch and unittest provided by Joe Wreschnig.
Also added c_size_t which represents the C type size_t.
* ctypes/_loader.py: Added a load_library() method to library
loader classes. Plus an alias LoadLibrary() for backwards
compatibility.
* (Repository): Removed the codegenerator in ctypes/wrap
completely. The last state has been tagged in CVS as
'BEFORE_REMOVAL'. It will be revived later - not yet sure where.
* Changed the version number to 0.9.9.4.
2006-03-01 Thomas Heller <theller@python.net>
* (Repository): Removed the samples subdirectory completely,
because it has become out of sync.
* (Repository): Moved the ctypes.wintypes module into the ctypes/
directory, got rid of the platform specific modules magic in setup.py
and the .CTYPES_DEVEL file.
* source\callbacks.c: Checked the return value of PyErr_Warn().
2006-02-28 Thomas Heller <theller@python.net>
* ctypes\__init__.py (OleDLL._FuncPtr._restype_): oledll now uses
the HRESULT restype, no longer the ctypes builtin FUNCFLAG_HRESULT
magic flag. This allows easier overriding.
2006-02-22 Thomas Heller <theller@python.net>
* source/callbacks.c: Discovered and hacked around a problem with
callback functions.
If the callback function has a return type other than void,
py_object, or an integral C type, it is impossible to either avoid
a memory leak or return a possibly invalid result. Previously,
the possibly invalid result has been returned, now the memory leak
will appear but a "RuntimeWarning: memory leak in callback
function" will be emitted.
2006-02-21 Thomas Heller <theller@python.net>
* source/_ctypes.c: The _b_needsfree_ member is now always 1 if
the object 'owns' it's memory buffer (even if it uses it's small
builtin buffer, instead of mallocing a new one). This is useful
to determine whether resources in the buffer need to be freed when
the object is destroyed.
* source/_ctypes.c: Finally fix this nasty 'set array through
pointer' bug. See ctypes.test.test_array_in_pointer
* source/malloc_closure.c: Fix compilation on Windows.
2006-02-15 Bob Ippolito <bob@redivi.com>
* New ctypes_dlfcn.h created to allow for potential indirection
of dl functions. Changed code to use "ctypes_" prefix on all
dl functions.
* Darwin's dlfcn compatibility wrapper no longer used for 10.3
and later, as it has a native implementation in libSystem.
Compiler macros and weak linking are used to make sure
the right thing happens even if compiled on OS X 10.3+ with a
deployment target of 10.2. Tested with gcc-3.3 and gcc-4.0.
2006-02-15 Thomas Heller <theller@python.net>
* ctypes 0.9.9.3 released.
2006-02-10 Thomas Heller <theller@python.net>
* string_at and wstring_at are now implemented in the same way as
memmove and memset.
* Fixed the wrong return type of memmove.
2006-02-09 Thomas Heller <theller@python.net>
* memmove and memset are now implemented as foreign functions,
using the standard ctypes mechanism. The addresses are exported
by the _ctypes extension, restype and argtypes are set in
ctypes/__init__.py.
This Required to extend c_void_p.from_param to accept int/long
arguments as well.
memmove and memset now work on 64-bit platforms.
2006-02-02 Hye-Shik Chang <perky@FreeBSD.org>
* source/callproc.c: ConvParam() is fixed to convert Python
int and long types via libffi signed long. This fixes a
compatibility problem on alpha and ia64.
2006-02-01 Thomas Heller <theller@python.net>
* Hye-Shik Chang <perky@users.sourceforge.net> made these changes:
Update libffi to gcc head as of 2006/02/01. This fixes several
unittest failures on 64bit platforms.
2006-02-01 Thomas Heller <theller@python.net>
* Committed a patch from Hye-Shik Chang (perky).
See http://mail.python.org/pipermail/python-dev/2006-January/060199.html,
where he wrote:
I did some work to make ctypes+libffi compacter and liberal. I
removed sources/gcc and put sources/libffi copied from gcc 4.0.2.
And removed all automake-related build processes and integrated
them info setup.py. There's still aclocal.m4 in
sources/libffi. But it is just identical to libffi's acinclude.m4
which looks liberal.
2006-01-26 Thomas Heller <theller@python.net>
* ctypes._loader implements the new LibraryLoader class. The
class itself is exposed from the ctypes module itself.
LibraryLoader objects expose load(), find(), and load_version()
methods - see the docstrings.
The register_library_alias() function is gone, it does belong
somewhere else (if at all).
2006-01-02 Thomas Heller <theller@python.net>
* Subtypes of simple types (the c_int and c_char variations,
c_void_p, c_char_p and c_wchar_p) behave different now. XXX More
explanations needed.
* Removed the complete ctypes.com package, which lived
(in CVS) in the ctypes\win32\com directory.
2005-12-30 Thomas Heller <theller@python.net>
* Changes for Windows CE, contributed by Luke Dunstan.
2005-12-14 Thomas Heller <theller@python.net>
* Implemented different endians for c_float and c_double.
Added testcases for them.
2005-11-30 Thomas Heller <theller@python.net>
* Implemented BigEndianStructure and LittleEndianStructure base
classes which support different endians. The fields of structures
with non-native byte ordering are limited to c_char and all the
integer variantions of different sizes, plus arrays of these.
Integer bit fields do work. c_double, c_float, and structures are
not yet supported as field types.
* Changed version number to 0.9.9.1.
2005-11-04 Thomas Heller <theller@python.net>
* Moved tests from the 'unittests' directories to packages
'ctypes.test' and 'ctypes.com.test'. The ctypes.test package's
__init__.py file contains test support functions, and a test
runner. The test runner is also called by starting the script
ctypes/test/runtests.py.
The test runner can search for refcount leaks by running the tests
in a loop, this requires a debug build of Python and takes quite
some time. Start runtests.py with a '-r' command line option.
Tests can now 'require' additional resources (which are strings),
by default these tests are disabled. To provide resources, these
can be specified by the '-u' command line flag.
The 'out-of-process' test command has been removed.
Tests can also be run by setup in this way:
python setup.py test [-u<resources>] [-r]
2005-11-03 Thomas Heller <theller@python.net>
* source\callbacks.c: For callback functions with result type None
('void'), actually ignore the return value. Add some assert
statements for easier debugging.
* source\_ctypes.c: Enable cycle GC on CFuncPtrType objects (does
not seem to have a visible effect). Fix quite some refcount leaks,
and a crash when outargs is NULL. Add some asserts for easier
debugging.
* source\stgdict.c: Fixed a very nasty bug: The dict portion of
StgDict objects were never freed. Assigning a non-sequence to a
Structure _fields_ raises TypeError, not AttributeError. Fix
another refcount leak.
2005-10-28 Thomas Heller <theller@python.net>
* setup.py: ctypes.macholib was missing in the packages list.
Remove the comtypes package from the tests.
* source\cfield.c: Fix a refcount leak when unicode is converted
to ascii.
* source\_ctypes.c: Fix a refcount leak. And finally correct the
wrong static declaration of Pointer_Type, preventing compilation
with gcc4 (which I don't have).
* source\callproc.c: Fix a refcount leak when COMError is raised.
2005-10-21 Thomas Heller <theller@python.net>
* ctypes\wrap\codegenerator.py: The codegenerator now by default
assumes 'char *' and 'wchar_t *' types are pointers to
zero-terminated strings. It generates
STRING = c_char_p
WSTRING = c_wchar_p
and STRING / WSTRING is used instead of POINTER(c_char) and
POINTER(c_wchar). This behaviour can be changed by setting the
global variable ASSUME_STRINGS to False.
2005-10-18 Thomas Heller <theller@python.net>
* source\callproc.c: Remove all the too fancy traceback printing
stuff.
The DllGetClassObject() and DllCanUnloadNow() functions are now
exposed by the ctypes module itself, which forwards their requests
to ctypes.com.server. Later, there should also be a way to
forward to comtypes.server (when that exists).
* source\_ctypes.c: Implemented __nonzero__ for simple types.
2005-10-14 Thomas Heller <theller@python.net>
* source\callbacks.c: Fixed a refcount leak in callbacks.
2005-09-06 Thomas Heller <theller@python.net>
* source\_ctypes.c (CData_FromBaseObj): The b_size member is now
set. Before, the effect was that sizeof(obj) would return always
zero for objects retrieved from structure fields, for example.
2005-09-02 Thomas Heller <theller@python.net>
* source: Implemented Mike Fletcher's errcheck protocol. A new
'errcheck' field has been added to CFuncPtrObject. If the
function has an 'errcheck' attribute, this is called with
(function_return_value, function, arguments, ...) and the result
of this call is returned. The 'errcheck' function must accept
more than three parameters for future compatibility.
* source/callproc.c: Call checker (which is the _check_retval_
attribute of the restype) also when restype is *not* a simple
ctypes type.
2005-08-30 Thomas Heller <theller@python.net>
* source/callproc.c: Don't call __new__ and __init__ when a ctypes
instance is created from a function return value.
* ctypes/wrap/cparser.py: Added a function to find gccxml on
$PATH.
2005-08-24 Thomas Heller <theller@python.net>
* ctypes/wrap: Merged some of Andreas Degert's changes from CVS
HEAD:
The code generator now sorts the generated definitions according
to the location in the source code.
If function argument names are found in the xml-file (newer gccxml
create these), the code generator uses them in the generated
wrappers.
2005-08-22 Thomas Heller <theller@python.net>
* source\_ctypes.c (CDataType_from_address): Fixed another
potential problem for systems where sizeof(int) != sizeof(void *).
* Fix a problem which showed up as array.value != array[:].
2005-08-19 Thomas Heller <theller@python.net>
* source\_ctypes.c: Add a CFuncPtr_repr which gives more useful
output when the instance is a COM method.
Fix two problems that will show up on platforms where sizeof(int)
!= sizeof(void *). Get pointer values by PyLong_AsVoidPtr.
Fix a bug when paramflags are specified as [], and so the
numerical flag value is 0.
Per suggestion from Mike Fletcher: call byref() automatically, if
needed, for POINTER types in argtypes. Fix crash with ARRAY types
in argtypes. Fix a small refcount leak. Cleanup and clarify some
code.
2005-08-18 Thomas Heller <theller@python.net>
* Finally committed a patch from Mike Fletcher which allows to use
the RTLD_GLOBAL flag to load libraries.
2005-08-17 Thomas Heller <theller@python.net>
* source\*.[ch]: Implement rich error reporting for COM method
calls (on Windows).
CFuncPtrObject gets a new 'iid' slot which stores a pointer to the
guid of the interface this method belongs to. When iid is !=
NULL, use IErrorInfo to get rich error information from the com
object.
Add a COMError class, and implement custom __init__ and __str__
methods.
2005-08-12 Thomas Heller <theller@python.net>
* source\callbacks.c: A buffer allocated for callbacks was too
small. This could lead to crashed when callbacks were garbage
collected. Problem reported by Mike Fletcher.
2005-05-20 Thomas Heller <theller@python.net>
* source\_ctypes.c: Also don't call __new__ when a ctypes instance
is created from a base object.
2005-05-17 Andreas Degert <ad@papyrus-gmbh.de>
* source/gcc, README.txt: merged with HEAD
2005-05-11 Thomas Heller <theller@python.net>
* source\_ctypes.c (CData_FromBaseObj): Don't call __init__, only
__new__, when a ctypes instance is retrieved from a base object.
This avoids confusion when structure fields containing structures
(for example) are accessed.
2005-05-06 Thomas Heller <theller@python.net>
* source/_ctypes.c: Clearer code, less code, and greater
performance by reworking CData_FromBaseObj.
* source/_ctypes.c, source/ctypes.h: CDataObject and
CFuncPtrObject now have a small buffer. If the C type fits into
that it is used, otherwise PyMem_Malloc() is called to create a
bigger one. This speeds up instance creation a lot.
2005-04-22 Thomas Heller <theller@python.net>
* Committed a patch from Andreas Degert which allows to call
vararg functions on x86_64b platforms (although not officially
supported by libffi).
2005-04-19 Thomas Heller <theller@python.net>
* Fixed quite a few problems on 64-bit platforms. Reported and
partly patched by Mike Flechter.
2005-04-15 Thomas Heller <theller@python.net>
* Added some files from Bob Ippolito's macholib, to help finding
shared libraries on OS X.
2005-04-14 Thomas Heller <theller@python.net>
* source/_ctypes.c: Fix a crash when a POINTER type has no _type_.
Reported by Georg Thalhammer, patch provided by Andreas Degert,
somewhat modified.
2005-04-07 Thomas Heller <theller@python.net>
* Changed version number to 0.9.8.
2005-04-04 Thomas Heller <theller@python.net>
* Fix a refcount leak.
* Fix a possible segfault in the 'cast' function (the code
possibly tried to Py_DECREF an uninitialized pointer).
2005-04-04 Thomas Heller <theller@python.net>
* CVS: Created a branch_1_0 branch.
2005-03-18 Thomas Heller <theller@python.net>
* ctypes-0.9.6 released.
* Back out the '.so' magic again.
2005-03-17 Thomas Heller <theller@python.net>
* ctypes\__init__.py: On platforms where dlopen is used, and '.so'
is the default shared library extension, if dlopen fails and the
filename doesn't end with '.so', try again with '.so' appended to
the filename. This allows to use the attribute access syntax to
cdll to load libraries in some cases: 'cdll.libm'.
* ctypes\__init__.py: Removed the __del__ method in _CDLL. This
caused garbage in Python's gc. Reported by Erik Andersen.
* ctypes.com.register: Enclose the Python script to run as com
server in double quotes in case the path contains spaces. Fix by
Juan Carlos Coruna.
* ctypes.wrap.h2xml script: Added command line options to include
preprocessor symbols into the xml file (that was the default
before), and to not delete temporary files which may help locating
problems in the compilation. The latter was suggested by 'Bryan'
on the ctypes-users list.
Expanded the default excluded symbols list on Windows, so that
'limits.h' can be processed.
'h2xml.py' can now read preprocessor symbol names to exclude from
a local configuration file 'h2xml.cfg' inb the current directory.
2005-03-16 Thomas Heller <theller@python.net>
* ctypes\source\_ctypes.c: Subclasses of c_char_p, c_wchar_p, and
c_void_p were not able to override the from_param class method in
their class definitions because SimpleType_new overwrote them.
Reported by Andreas Degert.
* ctypes\source: Removed the unneeded nArgBytes member from
StgDictObject, and changed the code accordingly. Thanks to
Andreas Degert for spotting this.
* ctypes\wrap\cparser_config.py: Added some symbols from windows
limits.h header file to the excluded list - h2xml.py choked on
them.
2005-03-14 Thomas Heller <theller@python.net>
* _ctypes.c: Fixed refcount leak in functions with 'out'
parameters. This has only relevance for the unreleased comtypes
package.
* _ctypes.c: Keyword arguments to Structures/Unions were ignored.
Thanks to Jimmy Retzlaff for finding this.
2005-03-11 Thomas Heller <theller@python.net>
* ctypes-0.9.5 released.
* The prototypes that WINFUNCTYPE or CFUNCTYPE return can now be
called with an optional third parameter: paramflags. This must be
a tuple specifying the parameter direction (in, out), the
parameter name (optional), and the default parameter value (also
optional). This creates a somewhat higher level function, and
also allows to call functions with named parameters.
The change made on 2005-01-15 has been reverted again - it is
better to create instancemethods, if needed, in the calling code.
2005-02-10 Thomas Heller <theller@python.net>
* Clean up the_ semantics on Structure/Union types. The _fields_
attribute can no longer be set after one of the following happens:
- The _fields_ attribute is set.
- An instance of the type is created.
- The type is used as field in another Structure/Union.