Add dll exports for compiling on win32
parent
ea1e36558c
commit
c67c29cf27
|
@ -0,0 +1,21 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "factor", "factor.vcproj", "{3AE5FAF6-99AC-4B8F-9107-8A346B3D87A4}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{3AE5FAF6-99AC-4B8F-9107-8A346B3D87A4}.Debug.ActiveCfg = Debug|Win32
|
||||
{3AE5FAF6-99AC-4B8F-9107-8A346B3D87A4}.Debug.Build.0 = Debug|Win32
|
||||
{3AE5FAF6-99AC-4B8F-9107-8A346B3D87A4}.Release.ActiveCfg = Release|Win32
|
||||
{3AE5FAF6-99AC-4B8F-9107-8A346B3D87A4}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,454 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="factor"
|
||||
ProjectGUID="{3AE5FAF6-99AC-4B8F-9107-8A346B3D87A4}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="1"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/factor.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/factor.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="TRUE"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/factor.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
<File
|
||||
RelativePath="native\arithmetic.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\array.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\bignum.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\boolean.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\compiler.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\complex.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\cons.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\error.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\factor.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\ffi.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\fixnum.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\float.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\gc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\image.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\memory.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\misc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\port.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\primitives.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\ratio.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\relocate.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\run.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\s48_bignum.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\sbuf.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\stack.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\string.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\vector.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\word.c">
|
||||
</File>
|
||||
<Filter
|
||||
Name="win32"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="native\win32\file.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\win32\io.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\native\win32\misc.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\win32\read.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\win32\write.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="unix"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="native\unix\file.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\unix\io.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\unix\read.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\unix\signal.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\unix\socket.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\unix\write.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<File
|
||||
RelativePath="native\arithmetic.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\array.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\bignum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\boolean.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\compiler.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\complex.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\cons.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\error.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\factor.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\ffi.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\file.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\fixnum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\float.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\gc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\image.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\io.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\memory.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\misc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\port.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\primitives.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\ratio.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\read.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\relocate.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\run.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\s48_bignum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\s48_bignumint.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\sbuf.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\signal.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\socket.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\stack.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\string.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\types.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\vector.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\word.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="native\write.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,6 +1,6 @@
|
|||
#include "factor.h"
|
||||
|
||||
CELL arithmetic_type(CELL obj1, CELL obj2);
|
||||
DLLEXPORT CELL arithmetic_type(CELL obj1, CELL obj2);
|
||||
void primitive_arithmetic_type(void);
|
||||
|
||||
bool realp(CELL tagged);
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
#define FACTOR_X86
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
|
||||
/* CELL must be 32 bits and your system must have 32-bit pointers */
|
||||
typedef unsigned long int CELL;
|
||||
#define CELLS ((signed)sizeof(CELL))
|
||||
|
@ -13,7 +19,7 @@ typedef unsigned long int CELL;
|
|||
CELL ds_bot;
|
||||
|
||||
/* raw pointer to datastack top */
|
||||
CELL ds;
|
||||
DLLEXPORT CELL ds;
|
||||
|
||||
/* raw pointer to callstack bottom */
|
||||
CELL cs_bot;
|
||||
|
|
10
native/ffi.c
10
native/ffi.c
|
@ -53,7 +53,7 @@ void primitive_dlsym(void)
|
|||
|
||||
void primitive_dlsym_self(void)
|
||||
{
|
||||
#ifdef FFI
|
||||
#if defined(FFI)
|
||||
void* sym = dlsym(NULL,unbox_c_string());
|
||||
if(sym == NULL)
|
||||
{
|
||||
|
@ -61,6 +61,14 @@ void primitive_dlsym_self(void)
|
|||
from_c_string(dlerror())));
|
||||
}
|
||||
dpush(tag_cell((CELL)sym));
|
||||
#elif defined(WIN32)
|
||||
void *sym = GetProcAddress(GetModuleHandle(NULL), unbox_c_string());
|
||||
if(sym == NULL)
|
||||
{
|
||||
general_error(ERROR_FFI, tag_object(
|
||||
from_c_string("bad symbol")));
|
||||
}
|
||||
dpush(tag_cell((CELL)sym));
|
||||
#else
|
||||
general_error(ERROR_FFI_DISABLED,F);
|
||||
#endif
|
||||
|
|
|
@ -43,7 +43,7 @@ CELL T;
|
|||
#define NUMBER_TYPE 103 /* F_COMPLEX or REAL */
|
||||
#define TEXT_TYPE 104 /* F_FIXNUM or F_STRING */
|
||||
|
||||
CELL type_of(CELL tagged);
|
||||
DLLEXPORT CELL type_of(CELL tagged);
|
||||
bool typep(CELL type, CELL tagged);
|
||||
|
||||
INLINE CELL tag_header(CELL cell)
|
||||
|
|
|
@ -23,6 +23,8 @@ void primitive_close (void)
|
|||
|
||||
void primitive_next_io_task (void)
|
||||
{
|
||||
maybe_garbage_collection();
|
||||
|
||||
if (callback_list != F)
|
||||
{
|
||||
F_CONS *cons = untag_cons(callback_list);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
void primitive_add_write_io_task (void)
|
||||
{
|
||||
maybe_garbage_collection();
|
||||
|
||||
callback_list = cons(dpop(), callback_list);
|
||||
dpop();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue