[Python-checkins] r47203 - python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
thomas.heller
python-checkins at python.org
Mon Jul 3 09:58:09 CEST 2006
Author: thomas.heller
Date: Mon Jul 3 09:58:09 2006
New Revision: 47203
Modified:
python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
Log:
Cleanup: Remove commented out code.
Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
==============================================================================
--- python/trunk/Modules/_ctypes/libffi_msvc/ffi.c (original)
+++ python/trunk/Modules/_ctypes/libffi_msvc/ffi.c Mon Jul 3 09:58:09 2006
@@ -227,11 +227,7 @@
void **arg_area;
unsigned short rtype;
void *resp = (void*)&res;
-//#ifdef _MSC_VER
void *args = &argp[1];
-//#else
-// void *args = __builtin_dwarf_cfa ();
-//#endif
cif = closure->cif;
arg_area = (void**) alloca (cif->nargs * sizeof (void*));
@@ -353,10 +349,6 @@
/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */
-/* MOV EDX, ESP is 0x8b 0xd4 */
-
-//#ifdef _MSC_VER
-
#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,BYTES) \
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
unsigned int __fun = (unsigned int)(FUN); \
@@ -365,26 +357,13 @@
*(unsigned char*) &__tramp[0] = 0xb9; \
*(unsigned int*) &__tramp[1] = __ctx; /* mov ecx, __ctx */ \
*(unsigned char*) &__tramp[5] = 0x8b; \
- *(unsigned char*) &__tramp[6] = 0xd4; \
+ *(unsigned char*) &__tramp[6] = 0xd4; /* mov edx, esp */ \
*(unsigned char*) &__tramp[7] = 0xe8; \
*(unsigned int*) &__tramp[8] = __dis; /* call __fun */ \
*(unsigned char*) &__tramp[12] = 0xC2; /* ret BYTES */ \
*(unsigned short*) &__tramp[13] = BYTES; \
}
-//#else
-//#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,BYTES) \
-//({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-// unsigned int __fun = (unsigned int)(FUN); \
-// unsigned int __ctx = (unsigned int)(CTX); \
-// unsigned int __dis = __fun - ((unsigned int) __tramp + FFI_TRAMPOLINE_SIZE); \
-// *(unsigned char*) &__tramp[0] = 0xb8; \
-// *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
-// *(unsigned char *) &__tramp[5] = 0xe9; \
-// *(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \
-// })
-//#endif
-
/* the cif must already be prep'ed */
ffi_status
More information about the Python-checkins
mailing list