Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get sqlite module compiling for Silverlight, Android.

  • Loading branch information...
commit 8398a8989f2bfab7df71b08a268fab3d47d7e810 1 parent 52a6a51
@jdhardy jdhardy authored
View
4 Languages/IronPython/IronPython.Modules/IronPython.Modules.csproj
@@ -34,6 +34,10 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight4Release|AnyCPU' ">
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight5Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight5Release|AnyCPU' ">
+ </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidDebug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidRelease|AnyCPU' ">
View
6 Languages/IronPython/IronPython.SQLite/Connection.cs
@@ -24,6 +24,7 @@
using IronPython.Runtime.Types;
using Microsoft.Scripting;
using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Utils;
using sqlite3_stmt = Community.CsharpSqlite.Sqlite3.Vdbe;
using sqlite3_value = Community.CsharpSqlite.Sqlite3.Mem;
@@ -65,7 +66,7 @@ public string isolation_level
private List<WeakReference> statements = new List<WeakReference>();
private int created_statements = 0;
- private Hashtable function_pinboard = new Hashtable();
+ private Dictionary<object, object> function_pinboard = new Dictionary<object, object>();
internal Sqlite3.sqlite3 db;
@@ -376,7 +377,8 @@ private static void setResult(Sqlite3.sqlite3_context ctx, object result)
Sqlite3.sqlite3_result_text(ctx, (string)result, -1, Sqlite3.SQLITE_TRANSIENT);
else if(result is byte[])
{
- string s = Latin1.GetString((byte[])result);
+ byte[] b = (byte[])result;
+ string s = Latin1.GetString(b, 0, b.Length);
Sqlite3.sqlite3_result_blob(ctx, s, s.Length, Sqlite3.SQLITE_TRANSIENT);
}
else if(result is PythonBuffer)
View
8 Languages/IronPython/IronPython.SQLite/Cursor.cs
@@ -14,6 +14,7 @@
* ***************************************************************************/
using System.Collections;
+using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using Community.CsharpSqlite;
@@ -21,6 +22,7 @@
using IronPython.Runtime.Exceptions;
using IronPython.Runtime.Operations;
using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Utils;
using sqlite3_stmt = Community.CsharpSqlite.Sqlite3.Vdbe;
@@ -38,7 +40,7 @@ public class Cursor : IEnumerable
bool resultsDone;
int last_step_rc;
- ArrayList row_cast_map = new ArrayList();
+ List<object> row_cast_map = new List<object>();
public PythonTuple description { get; private set; }
@@ -325,7 +327,7 @@ private object fetchOneRow(CodeContext context)
}
else
{
- string item = Latin1.GetString(val);
+ string item = Latin1.GetString(val, 0, val.Length);
converted = PythonCalls.Call(context, converter, item);
}
}
@@ -526,7 +528,7 @@ private bool buildRowCastMap()
if(this.connection.detect_types == 0)
return true;
- row_cast_map = new ArrayList();
+ row_cast_map = new List<object>();
object converter = null;
for(int i = 0; i < Sqlite3.sqlite3_column_count(this.statement.st); ++i)
View
30 Languages/IronPython/IronPython.SQLite/IronPython.SQLite.csproj
@@ -10,24 +10,42 @@
<AssemblyName>IronPython.SQLite</AssemblyName>
<DocumentationFile>$(SolutionDir)..\bin\$(Configuration)\IronPython.SQLite.xml</DocumentationFile>
<OutputPath>$(OutputPath)\DLLs</OutputPath>
- <SQLiteCommon>TRUE;WIN32;_MSC_VER;SQLITE_ASCII;SQLITE_DEBUG;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_MUTEX_W32;SQLITE_THREADSAFE;VDBE_PROFILE_OFF</SQLiteCommon>
+ <SQLiteCommon>SQLITE_DEBUG;TRUE;WIN32;_MSC_VER;SQLITE_ASCII;SQLITE_MEM_POOL;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_OS_WIN;SQLITE_SYSTEM_MALLOC;VDBE_PROFILE_OFF</SQLiteCommon>
<SQLiteCommonOmit>SQLITE_OMIT_AUTHORIZATION;SQLITE_OMIT_DEPRECATED;SQLITE_OMIT_GET_TABLE;SQLITE_OMIT_INCRBLOB;SQLITE_OMIT_LOOKASIDE;SQLITE_OMIT_SHARED_CACHE;SQLITE_OMIT_UTF16;SQLITE_OMIT_WAL</SQLiteCommonOmit>
<NoWarn>$(NoWarn);0168 ; 0169; 0414; 0618; 0649; 1587</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'FxCop|AnyCPU' ">
- <DefineConstants>$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);NDEBUG</DefineConstants>
+ <DefineConstants>NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;NDEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DefineConstants>$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
+ <DefineConstants>NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DefineConstants>$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);NDEBUG</DefineConstants>
+ <DefineConstants>NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;NDEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'v2Debug|AnyCPU' ">
- <DefineConstants>NET_35;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
+ <DefineConstants>NET_35;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'v2Release|AnyCPU' ">
- <DefineConstants>NET_35;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);NDEBUG</DefineConstants>
+ <DefineConstants>NET_35;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;NDEBUG</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight4Debug|AnyCPU' ">
+ <DefineConstants>SQLITE_SILVERLIGHT;NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_OMIT;SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight4Release|AnyCPU' ">
+ <DefineConstants>SQLITE_SILVERLIGHT;NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_OMIT;NDEBUG</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight5Debug|AnyCPU' ">
+ <DefineConstants>SQLITE_SILVERLIGHT;NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_OMIT;SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight5Release|AnyCPU' ">
+ <DefineConstants>SQLITE_SILVERLIGHT;NET_40;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_OMIT;NDEBUG</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidDebug|AnyCPU' ">
+ <DefineConstants>NET_35;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;SQLITE_DEBUG;SQLITE_ENABLE_OVERSIZE_CELL_CHECK</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidRelease|AnyCPU' ">
+ <DefineConstants>NET_35;$(DefineConstants);$(SQLiteCommon);$(SQLiteCommonOmit);SQLITE_MUTEX_W32;SQLITE_THREADSAFE;NDEBUG</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Runtime\Microsoft.Scripting.Core\Microsoft.Scripting.Core.csproj" Condition="'$(FeatureCoreDlr)' != 'true'">
View
7 Languages/IronPython/IronPython.SQLite/Properties/AssemblyInfo.cs
@@ -21,9 +21,10 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("225ca84b-ef0f-409e-a3d4-42ab1fd899cc")]
-#if !SILVERLIGHT
+#if FEATURE_APTCA
[assembly: AllowPartiallyTrustedCallers]
-#if !CLR2
-[assembly: SecurityRules(SecurityRuleSet.Level1)]
#endif
+
+#if FEATURE_SECURITY_RULES
+[assembly: SecurityRules(SecurityRuleSet.Level1)]
#endif
View
1  Languages/IronPython/IronPython.SQLite/_sqlite.cs
@@ -22,6 +22,7 @@
using IronPython.Runtime.Operations;
using IronPython.Runtime.Types;
using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Utils;
[assembly: PythonModule("_sqlite3", typeof(IronPython.SQLite.PythonSQLite))]
View
2  Languages/IronPython/IronPython.SQLite/c#sqlite/Delegates.cs
@@ -288,7 +288,7 @@ sqlite_vfs Delegates
}
}
-#if( NET_35 && !NET_40) || WINDOWS_PHONE
+#if !FEATURE_FUNCS_5_16
namespace System
{
// Summary:
View
4 Languages/IronPython/IronPython.SQLite/c#sqlite/os_win_c.cs
@@ -432,7 +432,11 @@ static bool isNT()
//#define winLogError(a,b,c) winLogErrorAtLine(a,b,c,__LINE__)
static int winLogError( int a, string b, string c )
{
+#if !SILVERLIGHT5
StackTrace st = new StackTrace( new StackFrame( true ) );
+#else
+ StackTrace st = new StackTrace(new StackFrame());
+#endif
StackFrame sf = st.GetFrame( 0 );
return winLogErrorAtLine( a, b, c, sf.GetFileLineNumber() );
View
6 Languages/IronPython/IronPython/IronPython.csproj
@@ -43,6 +43,12 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight4Release|AnyCPU' ">
<NoWarn>1591;0429</NoWarn>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight5Debug|AnyCPU' ">
+ <NoWarn>1591;0429</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Silverlight5Release|AnyCPU' ">
+ <NoWarn>1591;0429</NoWarn>
+ </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidDebug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AndroidRelease|AnyCPU' ">
View
6 Solutions/IronPython.sln
@@ -425,7 +425,9 @@ Global
{2AE75F5A-CD1F-4925-9647-AF4D1C282FB4}.Win8Debug|Any CPU.ActiveCfg = Win8Debug|Any CPU
{2AE75F5A-CD1F-4925-9647-AF4D1C282FB4}.Win8Release|Any CPU.ActiveCfg = Win8Release|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.AndroidDebug|Any CPU.ActiveCfg = AndroidDebug|Any CPU
+ {4A617A40-2BA7-4713-AAFE-F90C4325C581}.AndroidDebug|Any CPU.Build.0 = AndroidDebug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.AndroidRelease|Any CPU.ActiveCfg = AndroidRelease|Any CPU
+ {4A617A40-2BA7-4713-AAFE-F90C4325C581}.AndroidRelease|Any CPU.Build.0 = AndroidRelease|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.FxCop|Any CPU.ActiveCfg = FxCop|Any CPU
@@ -435,9 +437,13 @@ Global
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight3Debug|Any CPU.ActiveCfg = Silverlight3Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight3Release|Any CPU.ActiveCfg = Silverlight3Release|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight4Debug|Any CPU.ActiveCfg = Silverlight4Debug|Any CPU
+ {4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight4Debug|Any CPU.Build.0 = Silverlight4Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight4Release|Any CPU.ActiveCfg = Silverlight4Release|Any CPU
+ {4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight4Release|Any CPU.Build.0 = Silverlight4Release|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight5Debug|Any CPU.ActiveCfg = Silverlight5Debug|Any CPU
+ {4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight5Debug|Any CPU.Build.0 = Silverlight5Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight5Release|Any CPU.ActiveCfg = Silverlight5Release|Any CPU
+ {4A617A40-2BA7-4713-AAFE-F90C4325C581}.Silverlight5Release|Any CPU.Build.0 = Silverlight5Release|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.v2Debug|Any CPU.ActiveCfg = v2Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.v2Debug|Any CPU.Build.0 = v2Debug|Any CPU
{4A617A40-2BA7-4713-AAFE-F90C4325C581}.v2Release|Any CPU.ActiveCfg = v2Release|Any CPU
Please sign in to comment.
Something went wrong with that request. Please try again.