Message260079
If the examples continue to use printf, then msvcrt.dll is the best option. The universal CRT exports a single Swiss-Army-knife function, __stdio_common_vfprintf, which requires 5 parameters, including a va_list for the variadic argument list. That's not appropriate for a tutorial. We just need a docs update to warn that msvcrt.dll has its own set of file descriptors, heap, and thread-locale state.
> Does it mean `cdll.msvcrt` is not the standard way to access
> the C symbols anymore?
On a tangent, cdll.msvcrt shouldn't be recommended anywhere in the ctypes docs. All code that uses cdll.msvcrt shares the same restype, argtypes, and errcheck prototypes for each function pointer, which is an unholy mess. The docs should recommend CDLL('mscvrt') or CDLL('msvcrt', use_errno=True). Every module or package should use its own private instance of CDLL. |
|
Date |
User |
Action |
Args |
2016-02-11 09:32:55 | eryksun | set | recipients:
+ eryksun, amaury.forgeotdarc, belopolsky, pitrou, tim.golden, cgohlke, meador.inge, python-dev, zach.ware, steve.dower |
2016-02-11 09:32:55 | eryksun | set | messageid: <1455183175.18.0.528893094855.issue23606@psf.upfronthosting.co.za> |
2016-02-11 09:32:55 | eryksun | link | issue23606 messages |
2016-02-11 09:32:54 | eryksun | create | |
|