├── .gitmodules └── libffi-msvc ├── testdll ├── testdll.cpp ├── stdafx.cpp ├── targetver.h ├── stdafx.h ├── dllmain.cpp ├── testdll.vcxproj.filters ├── ReadMe.txt └── testdll.vcxproj ├── testCaller ├── stdafx.cpp ├── targetver.h ├── stdafx.h ├── testCaller.cpp ├── testCaller.vcxproj.filters ├── ReadMe.txt └── testCaller.vcxproj ├── libffi ├── ReadMe.txt ├── libffi.vcxproj.filters ├── libffi.vcxproj ├── fficonfig.h └── ffi.h └── libffi-msvc.sln /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libffi"] 2 | path = libffi 3 | url = https://github.com/atgreen/libffi.git 4 | -------------------------------------------------------------------------------- /libffi-msvc/testdll/testdll.cpp: -------------------------------------------------------------------------------- 1 | // testdll.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | extern "C" 7 | { 8 | __declspec(dllexport) int testFunc1(int number) 9 | { 10 | return number + 99; 11 | } 12 | } -------------------------------------------------------------------------------- /libffi-msvc/testdll/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // testdll.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // testCaller.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /libffi-msvc/testdll/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | 17 | #include -------------------------------------------------------------------------------- /libffi-msvc/testdll/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /libffi-msvc/testdll/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/testCaller.cpp: -------------------------------------------------------------------------------- 1 | // testCaller.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "ffi.h" 6 | 7 | 8 | int testFunc1(int number) 9 | { 10 | return number + 99; 11 | } 12 | 13 | typedef int (__cdecl *MYPROC)(int); 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | ffi_cif cif; 18 | ffi_type *args[1]; 19 | void* values[1]; 20 | int value1 = 47; 21 | int rvalue; 22 | 23 | args[0] = &ffi_type_sint32; 24 | values[0] = &value1; 25 | 26 | HINSTANCE hinstLib = LoadLibrary(TEXT("testdll.dll")); 27 | if(NULL != hinstLib) 28 | { 29 | MYPROC procAdd = (MYPROC)GetProcAddress(hinstLib, "testFunc1"); 30 | 31 | if(NULL != procAdd) 32 | { 33 | ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint32, args); 34 | ffi_call(&cif, FFI_FN(procAdd), &rvalue, values); 35 | } 36 | FreeLibrary(hinstLib); 37 | } 38 | 39 | printf("Result: %d\n", rvalue); 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /libffi-msvc/libffi/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | STATIC LIBRARY : libffi Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this libffi library project for you. 6 | 7 | No source files were created as part of your project. 8 | 9 | 10 | libffi.vcxproj 11 | This is the main project file for VC++ projects generated using an Application Wizard. 12 | It contains information about the version of Visual C++ that generated the file, and 13 | information about the platforms, configurations, and project features selected with the 14 | Application Wizard. 15 | 16 | libffi.vcxproj.filters 17 | This is the filters file for VC++ projects generated using an Application Wizard. 18 | It contains information about the association between the files in your project 19 | and the filters. This association is used in the IDE to show grouping of files with 20 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 21 | "Source Files" filter). 22 | 23 | ///////////////////////////////////////////////////////////////////////////// 24 | Other notes: 25 | 26 | AppWizard uses "TODO:" comments to indicate parts of the source code you 27 | should add to or customize. 28 | 29 | ///////////////////////////////////////////////////////////////////////////// 30 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/testCaller.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | -------------------------------------------------------------------------------- /libffi-msvc/testdll/testdll.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | CONSOLE APPLICATION : testCaller Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this testCaller application for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your testCaller application. 9 | 10 | 11 | testCaller.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | testCaller.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | testCaller.cpp 25 | This is the main application source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | Other standard files: 29 | 30 | StdAfx.h, StdAfx.cpp 31 | These files are used to build a precompiled header (PCH) file 32 | named testCaller.pch and a precompiled types file named StdAfx.obj. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | Other notes: 36 | 37 | AppWizard uses "TODO:" comments to indicate parts of the source code you 38 | should add to or customize. 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /libffi-msvc/libffi-msvc.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libffi", "libffi\libffi.vcxproj", "{793F0ABE-66E5-48C0-9690-3060FF08AFF5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdll", "testdll\testdll.vcxproj", "{79ABD150-9E03-4654-BB90-AA94A0D4A67B}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testCaller", "testCaller\testCaller.vcxproj", "{33390110-D2EC-423F-AC76-314185C4C86B}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {793F0ABE-66E5-48C0-9690-3060FF08AFF5}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {793F0ABE-66E5-48C0-9690-3060FF08AFF5}.Debug|Win32.Build.0 = Debug|Win32 18 | {793F0ABE-66E5-48C0-9690-3060FF08AFF5}.Release|Win32.ActiveCfg = Release|Win32 19 | {793F0ABE-66E5-48C0-9690-3060FF08AFF5}.Release|Win32.Build.0 = Release|Win32 20 | {79ABD150-9E03-4654-BB90-AA94A0D4A67B}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {79ABD150-9E03-4654-BB90-AA94A0D4A67B}.Debug|Win32.Build.0 = Debug|Win32 22 | {79ABD150-9E03-4654-BB90-AA94A0D4A67B}.Release|Win32.ActiveCfg = Release|Win32 23 | {79ABD150-9E03-4654-BB90-AA94A0D4A67B}.Release|Win32.Build.0 = Release|Win32 24 | {33390110-D2EC-423F-AC76-314185C4C86B}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {33390110-D2EC-423F-AC76-314185C4C86B}.Debug|Win32.Build.0 = Debug|Win32 26 | {33390110-D2EC-423F-AC76-314185C4C86B}.Release|Win32.ActiveCfg = Release|Win32 27 | {33390110-D2EC-423F-AC76-314185C4C86B}.Release|Win32.Build.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /libffi-msvc/libffi/libffi.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | 46 | 47 | Source Files 48 | 49 | 50 | -------------------------------------------------------------------------------- /libffi-msvc/testdll/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : testdll Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this testdll DLL for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your testdll application. 9 | 10 | 11 | testdll.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | testdll.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | testdll.cpp 25 | This is the main DLL source file. 26 | 27 | When created, this DLL does not export any symbols. As a result, it 28 | will not produce a .lib file when it is built. If you wish this project 29 | to be a project dependency of some other project, you will either need to 30 | add code to export some symbols from the DLL so that an export library 31 | will be produced, or you can set the Ignore Input Library property to Yes 32 | on the General propert page of the Linker folder in the project's Property 33 | Pages dialog box. 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | Other standard files: 37 | 38 | StdAfx.h, StdAfx.cpp 39 | These files are used to build a precompiled header (PCH) file 40 | named testdll.pch and a precompiled types file named StdAfx.obj. 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | Other notes: 44 | 45 | AppWizard uses "TODO:" comments to indicate parts of the source code you 46 | should add to or customize. 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | -------------------------------------------------------------------------------- /libffi-msvc/testdll/testdll.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {79ABD150-9E03-4654-BB90-AA94A0D4A67B} 15 | Win32Proj 16 | testdll 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | Unicode 23 | 24 | 25 | DynamicLibrary 26 | false 27 | true 28 | Unicode 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | true 42 | 43 | 44 | false 45 | 46 | 47 | 48 | Use 49 | Level3 50 | Disabled 51 | WIN32;_DEBUG;_WINDOWS;_USRDLL;TESTDLL_EXPORTS;%(PreprocessorDefinitions) 52 | 53 | 54 | Windows 55 | true 56 | 57 | 58 | 59 | 60 | Level3 61 | Use 62 | MaxSpeed 63 | true 64 | true 65 | WIN32;NDEBUG;_WINDOWS;_USRDLL;TESTDLL_EXPORTS;%(PreprocessorDefinitions) 66 | 67 | 68 | Windows 69 | true 70 | true 71 | true 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | false 84 | 85 | 86 | false 87 | 88 | 89 | 90 | 91 | Create 92 | Create 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /libffi-msvc/testCaller/testCaller.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {33390110-D2EC-423F-AC76-314185C4C86B} 15 | Win32Proj 16 | testCaller 17 | 18 | 19 | 20 | Application 21 | true 22 | Unicode 23 | 24 | 25 | Application 26 | false 27 | true 28 | Unicode 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | true 42 | 43 | 44 | false 45 | 46 | 47 | 48 | Use 49 | Level3 50 | Disabled 51 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);FFI_BUILDING 52 | $(SolutionDir)libffi\;$(SolutionDir)..\libffi\include;$(SolutionDir)..\libffi\src\x86;%(AdditionalIncludeDirectories) 53 | 54 | 55 | Console 56 | true 57 | 58 | 59 | 60 | 61 | Level3 62 | Use 63 | MaxSpeed 64 | true 65 | true 66 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);FFI_BUILDING 67 | $(SolutionDir)libffi\;$(SolutionDir)..\libffi\include;$(SolutionDir)..\libffi\src\x86;%(AdditionalIncludeDirectories) 68 | 69 | 70 | Console 71 | true 72 | true 73 | true 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Create 86 | Create 87 | 88 | 89 | 90 | 91 | 92 | {793f0abe-66e5-48c0-9690-3060ff08aff5} 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /libffi-msvc/libffi/libffi.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {793F0ABE-66E5-48C0-9690-3060FF08AFF5} 15 | Win32Proj 16 | libffi 17 | 18 | 19 | 20 | StaticLibrary 21 | true 22 | Unicode 23 | 24 | 25 | StaticLibrary 26 | false 27 | true 28 | Unicode 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Level3 46 | Disabled 47 | WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions),FFI_BUILDING 48 | $(ProjectDir);$(SolutionDir)..\libffi\include;$(SolutionDir)..\libffi\src\x86;%(AdditionalIncludeDirectories) 49 | 50 | 51 | Windows 52 | true 53 | 54 | 55 | 56 | 57 | Level3 58 | 59 | 60 | MaxSpeed 61 | true 62 | true 63 | WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions),FFI_BUILDING 64 | $(ProjectDir);$(SolutionDir)..\libffi\include;$(SolutionDir)..\libffi\src\x86;%(AdditionalIncludeDirectories) 65 | 66 | 67 | Windows 68 | true 69 | true 70 | true 71 | 72 | 73 | 74 | 75 | Document 76 | cl.exe /EP /I . /I $(SolutionDir)..\libffi\include /I $(SolutionDir)..\libffi\src\x86 %(FullPath) > $(Platform)/$(Configuration)/win32_plain.asm 77 | ml.exe /c /Cx /coff /Fo $(Platform)/$(Configuration)/win32.obj $(Platform)/$(Configuration)/win32_plain.asm 78 | cl.exe /EP /I . /I $(SolutionDir)..\libffi\include /I $(SolutionDir)..\libffi\src\x86 %(FullPath) > $(Platform)/$(Configuration)/win32_plain.asm 79 | ml.exe /c /Cx /coff /Fo $(Platform)/$(Configuration)/win32.obj $(Platform)/$(Configuration)/win32_plain.asm 80 | $(Platform)/$(Configuration)/win32.obj 81 | $(Platform)/$(Configuration)/win32.obj 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /libffi-msvc/libffi/fficonfig.h: -------------------------------------------------------------------------------- 1 | /* fficonfig.h. Generated from fficonfig.h.in by configure. */ 2 | /* fficonfig.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP 8 | systems. This function is required for `alloca.c' support on those systems. 9 | */ 10 | /* #undef CRAY_STACKSEG_END */ 11 | 12 | /* Define to 1 if using `alloca.c'. */ 13 | #define C_ALLOCA 1 14 | 15 | /* Define to the flags needed for the .section .eh_frame directive. */ 16 | /* #undef EH_FRAME_FLAGS */ 17 | 18 | /* Define this if you want extra debugging. */ 19 | /* #undef FFI_DEBUG */ 20 | 21 | /* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ 22 | /* #undef FFI_EXEC_TRAMPOLINE_TABLE */ 23 | 24 | /* Cannot use malloc on this target, so, we revert to alternative means */ 25 | /* #undef FFI_MMAP_EXEC_WRIT */ 26 | 27 | /* Define this is you do not want support for the raw API. */ 28 | /* #undef FFI_NO_RAW_API */ 29 | 30 | /* Define this is you do not want support for aggregate types. */ 31 | /* #undef FFI_NO_STRUCTS */ 32 | 33 | /* Define to 1 if you have `alloca', as a function or macro. */ 34 | /* #undef HAVE_ALLOCA */ 35 | 36 | /* Define to 1 if you have and it should be used (not on Ultrix). 37 | */ 38 | /* #undef HAVE_ALLOCA_H */ 39 | 40 | /* Define if your assembler supports .ascii. */ 41 | /* #undef HAVE_AS_ASCII_PSEUDO_OP */ 42 | 43 | /* Define if your assembler supports .cfi_* directives. */ 44 | /* #undef HAVE_AS_CFI_PSEUDO_OP */ 45 | 46 | /* Define if your assembler supports .register. */ 47 | /* #undef HAVE_AS_REGISTER_PSEUDO_OP */ 48 | 49 | /* Define if your assembler and linker support unaligned PC relative relocs. 50 | */ 51 | /* #undef HAVE_AS_SPARC_UA_PCREL */ 52 | 53 | /* Define if your assembler supports .string. */ 54 | /* #undef HAVE_AS_STRING_PSEUDO_OP */ 55 | 56 | /* Define if your assembler supports unwind section type. */ 57 | /* #undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE */ 58 | 59 | /* Define if your assembler supports PC relative relocs. */ 60 | /* #undef HAVE_AS_X86_PCREL */ 61 | 62 | /* Define to 1 if you have the header file. */ 63 | /* #undef HAVE_DLFCN_H */ 64 | 65 | /* Define if __attribute__((visibility("hidden"))) is supported. */ 66 | /* #undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE */ 67 | 68 | /* Define to 1 if you have the header file. */ 69 | /* #undef HAVE_INTTYPES_H */ 70 | 71 | /* Define if you have the long double type and it is bigger than a double */ 72 | /* #undef HAVE_LONG_DOUBLE */ 73 | 74 | /* Define to 1 if you have the `memcpy' function. */ 75 | /* #undef HAVE_MEMCPY */ 76 | 77 | /* Define to 1 if you have the header file. */ 78 | #define HAVE_MEMORY_H 1 79 | 80 | /* Define to 1 if you have the `mmap' function. */ 81 | /* #undef HAVE_MMAP */ 82 | 83 | /* Define if mmap with MAP_ANON(YMOUS) works. */ 84 | /* #undef HAVE_MMAP_ANON */ 85 | 86 | /* Define if mmap of /dev/zero works. */ 87 | /* #undef HAVE_MMAP_DEV_ZERO */ 88 | 89 | /* Define if read-only mmap of a plain file works. */ 90 | /* #undef HAVE_MMAP_FILE */ 91 | 92 | /* Define if .eh_frame sections should be read-only. */ 93 | /* #undef HAVE_RO_EH_FRAME */ 94 | 95 | /* Define to 1 if you have the header file. */ 96 | #define HAVE_STDINT_H 1 97 | 98 | /* Define to 1 if you have the header file. */ 99 | #define HAVE_STDLIB_H 1 100 | 101 | /* Define to 1 if you have the header file. */ 102 | /* #undef HAVE_STRINGS_H */ 103 | 104 | /* Define to 1 if you have the header file. */ 105 | #define HAVE_STRING_H 1 106 | 107 | /* Define to 1 if you have the header file. */ 108 | /* #undef HAVE_SYS_MMAN_H */ 109 | 110 | /* Define to 1 if you have the header file. */ 111 | #define HAVE_SYS_STAT_H 1 112 | 113 | /* Define to 1 if you have the header file. */ 114 | #define HAVE_SYS_TYPES_H 1 115 | 116 | /* Define to 1 if you have the header file. */ 117 | /* #undef HAVE_UNISTD_H */ 118 | 119 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 120 | */ 121 | #define LT_OBJDIR ".libs/" 122 | 123 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 124 | /* #undef NO_MINUS_C_MINUS_O */ 125 | 126 | /* Name of package */ 127 | #define PACKAGE "libffi" 128 | 129 | /* Define to the address where bug reports for this package should be sent. */ 130 | #define PACKAGE_BUGREPORT "http://github.com/atgreen/libffi/issues" 131 | 132 | /* Define to the full name of this package. */ 133 | #define PACKAGE_NAME "libffi" 134 | 135 | /* Define to the full name and version of this package. */ 136 | #define PACKAGE_STRING "libffi 3.0.11" 137 | 138 | /* Define to the one symbol short name of this package. */ 139 | #define PACKAGE_TARNAME "libffi" 140 | 141 | /* Define to the home page for this package. */ 142 | #define PACKAGE_URL "" 143 | 144 | /* Define to the version of this package. */ 145 | #define PACKAGE_VERSION "3.0.11" 146 | 147 | /* The size of `double', as computed by sizeof. */ 148 | #define SIZEOF_DOUBLE 0 149 | 150 | /* The size of `long double', as computed by sizeof. */ 151 | #define SIZEOF_LONG_DOUBLE 0 152 | 153 | /* If using the C implementation of alloca, define if you know the 154 | direction of stack growth for your system; otherwise it will be 155 | automatically deduced at runtime. 156 | STACK_DIRECTION > 0 => grows toward higher addresses 157 | STACK_DIRECTION < 0 => grows toward lower addresses 158 | STACK_DIRECTION = 0 => direction of growth unknown */ 159 | #define STACK_DIRECTION -1 160 | 161 | /* Define to 1 if you have the ANSI C header files. */ 162 | #define STDC_HEADERS 1 163 | 164 | /* Define if symbols are underscored. */ 165 | /* #undef SYMBOL_UNDERSCORE */ 166 | 167 | /* Define this if you are using Purify and want to suppress spurious messages. 168 | */ 169 | /* #undef USING_PURIFY */ 170 | 171 | /* Version number of package */ 172 | #define VERSION "3.0.11" 173 | 174 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 175 | significant byte first (like Motorola and SPARC, unlike Intel). */ 176 | #if defined AC_APPLE_UNIVERSAL_BUILD 177 | # if defined __BIG_ENDIAN__ 178 | # define WORDS_BIGENDIAN 1 179 | # endif 180 | #else 181 | # ifndef WORDS_BIGENDIAN 182 | # define WORDS_BIGENDIAN 1 183 | # endif 184 | #endif 185 | 186 | /* Define to `unsigned int' if does not define. */ 187 | /* #undef size_t */ 188 | 189 | 190 | #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 191 | #ifdef LIBFFI_ASM 192 | #define FFI_HIDDEN(name) .hidden name 193 | #else 194 | #define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) 195 | #endif 196 | #else 197 | #ifdef LIBFFI_ASM 198 | #define FFI_HIDDEN(name) 199 | #else 200 | #define FFI_HIDDEN 201 | #endif 202 | #endif 203 | 204 | -------------------------------------------------------------------------------- /libffi-msvc/libffi/ffi.h: -------------------------------------------------------------------------------- 1 | /* -----------------------------------------------------------------*-C-*- 2 | libffi 3.0.11 - Copyright (c) 2011 Anthony Green 3 | - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the ``Software''), to deal in the Software without 8 | restriction, including without limitation the rights to use, copy, 9 | modify, merge, publish, distribute, sublicense, and/or sell copies 10 | of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | 25 | ----------------------------------------------------------------------- */ 26 | 27 | /* ------------------------------------------------------------------- 28 | The basic API is described in the README file. 29 | 30 | The raw API is designed to bypass some of the argument packing 31 | and unpacking on architectures for which it can be avoided. 32 | 33 | The closure API allows interpreted functions to be packaged up 34 | inside a C function pointer, so that they can be called as C functions, 35 | with no understanding on the client side that they are interpreted. 36 | It can also be used in other cases in which it is necessary to package 37 | up a user specified parameter and a function pointer as a single 38 | function pointer. 39 | 40 | The closure API must be implemented in order to get its functionality, 41 | e.g. for use by gij. Routines are provided to emulate the raw API 42 | if the underlying platform doesn't allow faster implementation. 43 | 44 | More details on the raw and cloure API can be found in: 45 | 46 | http://gcc.gnu.org/ml/java/1999-q3/msg00138.html 47 | 48 | and 49 | 50 | http://gcc.gnu.org/ml/java/1999-q3/msg00174.html 51 | -------------------------------------------------------------------- */ 52 | 53 | #ifndef LIBFFI_H 54 | #define LIBFFI_H 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | /* Specify which architecture libffi is configured for. */ 61 | #ifndef X86_WIN32 62 | #define X86_WIN32 63 | #endif 64 | 65 | /* ---- System configuration information --------------------------------- */ 66 | 67 | #include 68 | 69 | #ifndef LIBFFI_ASM 70 | 71 | #ifdef _MSC_VER 72 | #define __attribute__(X) 73 | #endif 74 | 75 | #include 76 | #include 77 | 78 | /* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). 79 | But we can find it either under the correct ANSI name, or under GNU 80 | C's internal name. */ 81 | 82 | #define FFI_64_BIT_MAX 9223372036854775807 83 | 84 | #ifdef LONG_LONG_MAX 85 | # define FFI_LONG_LONG_MAX LONG_LONG_MAX 86 | #else 87 | # ifdef LLONG_MAX 88 | # define FFI_LONG_LONG_MAX LLONG_MAX 89 | # ifdef _AIX52 /* or newer has C99 LLONG_MAX */ 90 | # undef FFI_64_BIT_MAX 91 | # define FFI_64_BIT_MAX 9223372036854775807LL 92 | # endif /* _AIX52 or newer */ 93 | # else 94 | # ifdef __GNUC__ 95 | # define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ 96 | # endif 97 | # ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ 98 | # ifndef __PPC64__ 99 | # if defined (__IBMC__) || defined (__IBMCPP__) 100 | # define FFI_LONG_LONG_MAX LONGLONG_MAX 101 | # endif 102 | # endif /* __PPC64__ */ 103 | # undef FFI_64_BIT_MAX 104 | # define FFI_64_BIT_MAX 9223372036854775807LL 105 | # endif 106 | # endif 107 | #endif 108 | 109 | /* The closure code assumes that this works on pointers, i.e. a size_t */ 110 | /* can hold a pointer. */ 111 | 112 | typedef struct _ffi_type 113 | { 114 | size_t size; 115 | unsigned short alignment; 116 | unsigned short type; 117 | struct _ffi_type **elements; 118 | } ffi_type; 119 | 120 | #ifndef LIBFFI_HIDE_BASIC_TYPES 121 | #if SCHAR_MAX == 127 122 | # define ffi_type_uchar ffi_type_uint8 123 | # define ffi_type_schar ffi_type_sint8 124 | #else 125 | #error "char size not supported" 126 | #endif 127 | 128 | #if SHRT_MAX == 32767 129 | # define ffi_type_ushort ffi_type_uint16 130 | # define ffi_type_sshort ffi_type_sint16 131 | #elif SHRT_MAX == 2147483647 132 | # define ffi_type_ushort ffi_type_uint32 133 | # define ffi_type_sshort ffi_type_sint32 134 | #else 135 | #error "short size not supported" 136 | #endif 137 | 138 | #if INT_MAX == 32767 139 | # define ffi_type_uint ffi_type_uint16 140 | # define ffi_type_sint ffi_type_sint16 141 | #elif INT_MAX == 2147483647 142 | # define ffi_type_uint ffi_type_uint32 143 | # define ffi_type_sint ffi_type_sint32 144 | #elif INT_MAX == 9223372036854775807 145 | # define ffi_type_uint ffi_type_uint64 146 | # define ffi_type_sint ffi_type_sint64 147 | #else 148 | #error "int size not supported" 149 | #endif 150 | 151 | #if LONG_MAX == 2147483647 152 | # if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX 153 | #error "no 64-bit data type supported" 154 | # endif 155 | #elif LONG_MAX != FFI_64_BIT_MAX 156 | #error "long size not supported" 157 | #endif 158 | 159 | #if LONG_MAX == 2147483647 160 | # define ffi_type_ulong ffi_type_uint32 161 | # define ffi_type_slong ffi_type_sint32 162 | #elif LONG_MAX == FFI_64_BIT_MAX 163 | # define ffi_type_ulong ffi_type_uint64 164 | # define ffi_type_slong ffi_type_sint64 165 | #else 166 | #error "long size not supported" 167 | #endif 168 | 169 | /* Need minimal decorations for DLLs to works on Windows. */ 170 | /* GCC has autoimport and autoexport. Rely on Libtool to */ 171 | /* help MSVC export from a DLL, but always declare data */ 172 | /* to be imported for MSVC clients. This costs an extra */ 173 | /* indirection for MSVC clients using the static version */ 174 | /* of the library, but don't worry about that. Besides, */ 175 | /* as a workaround, they can define FFI_BUILDING if they */ 176 | /* *know* they are going to link with the static library. */ 177 | #if defined _MSC_VER && !defined FFI_BUILDING 178 | #define FFI_EXTERN extern __declspec(dllimport) 179 | #else 180 | #define FFI_EXTERN extern 181 | #endif 182 | 183 | /* These are defined in types.c */ 184 | FFI_EXTERN ffi_type ffi_type_void; 185 | FFI_EXTERN ffi_type ffi_type_uint8; 186 | FFI_EXTERN ffi_type ffi_type_sint8; 187 | FFI_EXTERN ffi_type ffi_type_uint16; 188 | FFI_EXTERN ffi_type ffi_type_sint16; 189 | FFI_EXTERN ffi_type ffi_type_uint32; 190 | FFI_EXTERN ffi_type ffi_type_sint32; 191 | FFI_EXTERN ffi_type ffi_type_uint64; 192 | FFI_EXTERN ffi_type ffi_type_sint64; 193 | FFI_EXTERN ffi_type ffi_type_float; 194 | FFI_EXTERN ffi_type ffi_type_double; 195 | FFI_EXTERN ffi_type ffi_type_pointer; 196 | 197 | #if 0 198 | FFI_EXTERN ffi_type ffi_type_longdouble; 199 | #else 200 | #define ffi_type_longdouble ffi_type_double 201 | #endif 202 | #endif /* LIBFFI_HIDE_BASIC_TYPES */ 203 | 204 | typedef enum { 205 | FFI_OK = 0, 206 | FFI_BAD_TYPEDEF, 207 | FFI_BAD_ABI 208 | } ffi_status; 209 | 210 | typedef unsigned FFI_TYPE; 211 | 212 | typedef struct { 213 | ffi_abi abi; 214 | unsigned nargs; 215 | ffi_type **arg_types; 216 | ffi_type *rtype; 217 | unsigned bytes; 218 | unsigned flags; 219 | #ifdef FFI_EXTRA_CIF_FIELDS 220 | FFI_EXTRA_CIF_FIELDS; 221 | #endif 222 | } ffi_cif; 223 | 224 | /* Used internally, but overridden by some architectures */ 225 | ffi_status ffi_prep_cif_core(ffi_cif *cif, 226 | ffi_abi abi, 227 | unsigned int isvariadic, 228 | unsigned int nfixedargs, 229 | unsigned int ntotalargs, 230 | ffi_type *rtype, 231 | ffi_type **atypes); 232 | 233 | /* ---- Definitions for the raw API -------------------------------------- */ 234 | 235 | #ifndef FFI_SIZEOF_ARG 236 | # if LONG_MAX == 2147483647 237 | # define FFI_SIZEOF_ARG 4 238 | # elif LONG_MAX == FFI_64_BIT_MAX 239 | # define FFI_SIZEOF_ARG 8 240 | # endif 241 | #endif 242 | 243 | #ifndef FFI_SIZEOF_JAVA_RAW 244 | # define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG 245 | #endif 246 | 247 | typedef union { 248 | ffi_sarg sint; 249 | ffi_arg uint; 250 | float flt; 251 | char data[FFI_SIZEOF_ARG]; 252 | void* ptr; 253 | } ffi_raw; 254 | 255 | #if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 256 | /* This is a special case for mips64/n32 ABI (and perhaps others) where 257 | sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ 258 | typedef union { 259 | signed int sint; 260 | unsigned int uint; 261 | float flt; 262 | char data[FFI_SIZEOF_JAVA_RAW]; 263 | void* ptr; 264 | } ffi_java_raw; 265 | #else 266 | typedef ffi_raw ffi_java_raw; 267 | #endif 268 | 269 | 270 | void ffi_raw_call (ffi_cif *cif, 271 | void (*fn)(void), 272 | void *rvalue, 273 | ffi_raw *avalue); 274 | 275 | void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); 276 | void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); 277 | size_t ffi_raw_size (ffi_cif *cif); 278 | 279 | /* This is analogous to the raw API, except it uses Java parameter */ 280 | /* packing, even on 64-bit machines. I.e. on 64-bit machines */ 281 | /* longs and doubles are followed by an empty 64-bit word. */ 282 | 283 | void ffi_java_raw_call (ffi_cif *cif, 284 | void (*fn)(void), 285 | void *rvalue, 286 | ffi_java_raw *avalue); 287 | 288 | void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw); 289 | void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args); 290 | size_t ffi_java_raw_size (ffi_cif *cif); 291 | 292 | /* ---- Definitions for closures ----------------------------------------- */ 293 | 294 | #if FFI_CLOSURES 295 | 296 | #ifdef _MSC_VER 297 | __declspec(align(8)) 298 | #endif 299 | typedef struct { 300 | #if 0 301 | void *trampoline_table; 302 | void *trampoline_table_entry; 303 | #else 304 | char tramp[FFI_TRAMPOLINE_SIZE]; 305 | #endif 306 | ffi_cif *cif; 307 | void (*fun)(ffi_cif*,void*,void**,void*); 308 | void *user_data; 309 | #ifdef __GNUC__ 310 | } ffi_closure __attribute__((aligned (8))); 311 | #else 312 | } ffi_closure; 313 | # ifdef __sgi 314 | # pragma pack 0 315 | # endif 316 | #endif 317 | 318 | void *ffi_closure_alloc (size_t size, void **code); 319 | void ffi_closure_free (void *); 320 | 321 | ffi_status 322 | ffi_prep_closure (ffi_closure*, 323 | ffi_cif *, 324 | void (*fun)(ffi_cif*,void*,void**,void*), 325 | void *user_data); 326 | 327 | ffi_status 328 | ffi_prep_closure_loc (ffi_closure*, 329 | ffi_cif *, 330 | void (*fun)(ffi_cif*,void*,void**,void*), 331 | void *user_data, 332 | void*codeloc); 333 | 334 | #ifdef __sgi 335 | # pragma pack 8 336 | #endif 337 | typedef struct { 338 | #if 0 339 | void *trampoline_table; 340 | void *trampoline_table_entry; 341 | #else 342 | char tramp[FFI_TRAMPOLINE_SIZE]; 343 | #endif 344 | ffi_cif *cif; 345 | 346 | #if !FFI_NATIVE_RAW_API 347 | 348 | /* if this is enabled, then a raw closure has the same layout 349 | as a regular closure. We use this to install an intermediate 350 | handler to do the transaltion, void** -> ffi_raw*. */ 351 | 352 | void (*translate_args)(ffi_cif*,void*,void**,void*); 353 | void *this_closure; 354 | 355 | #endif 356 | 357 | void (*fun)(ffi_cif*,void*,ffi_raw*,void*); 358 | void *user_data; 359 | 360 | } ffi_raw_closure; 361 | 362 | typedef struct { 363 | #if 0 364 | void *trampoline_table; 365 | void *trampoline_table_entry; 366 | #else 367 | char tramp[FFI_TRAMPOLINE_SIZE]; 368 | #endif 369 | 370 | ffi_cif *cif; 371 | 372 | #if !FFI_NATIVE_RAW_API 373 | 374 | /* if this is enabled, then a raw closure has the same layout 375 | as a regular closure. We use this to install an intermediate 376 | handler to do the transaltion, void** -> ffi_raw*. */ 377 | 378 | void (*translate_args)(ffi_cif*,void*,void**,void*); 379 | void *this_closure; 380 | 381 | #endif 382 | 383 | void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); 384 | void *user_data; 385 | 386 | } ffi_java_raw_closure; 387 | 388 | ffi_status 389 | ffi_prep_raw_closure (ffi_raw_closure*, 390 | ffi_cif *cif, 391 | void (*fun)(ffi_cif*,void*,ffi_raw*,void*), 392 | void *user_data); 393 | 394 | ffi_status 395 | ffi_prep_raw_closure_loc (ffi_raw_closure*, 396 | ffi_cif *cif, 397 | void (*fun)(ffi_cif*,void*,ffi_raw*,void*), 398 | void *user_data, 399 | void *codeloc); 400 | 401 | ffi_status 402 | ffi_prep_java_raw_closure (ffi_java_raw_closure*, 403 | ffi_cif *cif, 404 | void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), 405 | void *user_data); 406 | 407 | ffi_status 408 | ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, 409 | ffi_cif *cif, 410 | void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), 411 | void *user_data, 412 | void *codeloc); 413 | 414 | #endif /* FFI_CLOSURES */ 415 | 416 | /* ---- Public interface definition -------------------------------------- */ 417 | 418 | ffi_status ffi_prep_cif(ffi_cif *cif, 419 | ffi_abi abi, 420 | unsigned int nargs, 421 | ffi_type *rtype, 422 | ffi_type **atypes); 423 | 424 | ffi_status ffi_prep_cif_var(ffi_cif *cif, 425 | ffi_abi abi, 426 | unsigned int nfixedargs, 427 | unsigned int ntotalargs, 428 | ffi_type *rtype, 429 | ffi_type **atypes); 430 | 431 | void ffi_call(ffi_cif *cif, 432 | void (*fn)(void), 433 | void *rvalue, 434 | void **avalue); 435 | 436 | /* Useful for eliminating compiler warnings */ 437 | #define FFI_FN(f) ((void (*)(void))f) 438 | 439 | /* ---- Definitions shared with assembly code ---------------------------- */ 440 | 441 | #endif 442 | 443 | /* If these change, update src/mips/ffitarget.h. */ 444 | #define FFI_TYPE_VOID 0 445 | #define FFI_TYPE_INT 1 446 | #define FFI_TYPE_FLOAT 2 447 | #define FFI_TYPE_DOUBLE 3 448 | #if 0 449 | #define FFI_TYPE_LONGDOUBLE 4 450 | #else 451 | #define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE 452 | #endif 453 | #define FFI_TYPE_UINT8 5 454 | #define FFI_TYPE_SINT8 6 455 | #define FFI_TYPE_UINT16 7 456 | #define FFI_TYPE_SINT16 8 457 | #define FFI_TYPE_UINT32 9 458 | #define FFI_TYPE_SINT32 10 459 | #define FFI_TYPE_UINT64 11 460 | #define FFI_TYPE_SINT64 12 461 | #define FFI_TYPE_STRUCT 13 462 | #define FFI_TYPE_POINTER 14 463 | 464 | /* This should always refer to the last type code (for sanity checks) */ 465 | #define FFI_TYPE_LAST FFI_TYPE_POINTER 466 | 467 | #ifdef __cplusplus 468 | } 469 | #endif 470 | 471 | #endif 472 | --------------------------------------------------------------------------------