diff --git a/.gitattributes b/.gitattributes index 3a241177..9a816114 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.jpg filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text +*.exe filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index ffc9aab0..8d056f90 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -23,9 +23,14 @@ jobs: env: buildConfiguration: ${{ matrix.buildConfiguration }} steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 with: fetch-depth: 0 + lfs: true + # https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act + - name: Checkout LFS objects + run: git lfs checkout - name: Setup .NET Core 2.1 uses: actions/setup-dotnet@v1 with: @@ -38,8 +43,12 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 5.0.402 - - name: Initialize tools - run: bash ./init-tools.sh + - name: Setup .NET 6 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.100 + #- name: Initialize tools + # run: bash .github/workflows/init-tools-on-ga.sh - name: Install dependencies run: | dotnet restore il2c.sln diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 7f7616a6..9fb5a011 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -23,9 +23,14 @@ jobs: env: buildConfiguration: ${{ matrix.buildConfiguration }} steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 with: fetch-depth: 0 + lfs: true + # https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act + - name: Checkout LFS objects + run: git lfs checkout - name: Setup .NET Core 2.1 uses: actions/setup-dotnet@v1 with: @@ -38,6 +43,10 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 5.0.402 + - name: Setup .NET 6 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.100 - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.0.3 - name: Initialize tools diff --git a/.github/workflows/init-tools-on-ga.sh b/.github/workflows/init-tools-on-ga.sh new file mode 100644 index 00000000..faa06eac --- /dev/null +++ b/.github/workflows/init-tools-on-ga.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sudo -S apt-get update -y < /dev/null +sudo -S apt-get install build-essential cmake ninja-build mono-devel -y < /dev/null diff --git a/.gitignore b/.gitignore index 34729976..8bdeb545 100644 --- a/.gitignore +++ b/.gitignore @@ -248,3 +248,4 @@ toolchain/ .idea/ +logs/ diff --git a/.nuget/nuget.exe b/.nuget/nuget.exe index d56c5788..3bd8edb9 100644 Binary files a/.nuget/nuget.exe and b/.nuget/nuget.exe differ diff --git a/ArtifactCollector/ArtifactCollector.csproj b/ArtifactCollector/ArtifactCollector.csproj deleted file mode 100644 index 54f3103d..00000000 --- a/ArtifactCollector/ArtifactCollector.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - net45 - Exe - latest - true - AnyCPU - true - true - false - false - - ArtifactCollector - IL2C.ArtifactCollector - A translator implementation of .NET intermediate language to C language. - - PackageReference - - IL2C - IL2C - Copyright (c) 2017-2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - Apache-2.0 - https://github.com/kekyo/IL2C.git - https://github.com/kekyo/IL2C.git - il2c;cil;msil;translate;transpile;aot;ecma335;c;c++;win32;uefi;wdm;multi-platform;systems-programming - - .pdb - true - true - true - - - - full - - - - embedded - true - - - - - - - - - - - - - - - - - - - - - diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..a0c38bf6 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,36 @@ + + + + + IL2C + + latest + disable + AnyCPU + + true + true + false + false + false + true + true + true + $(NoWarn);CS1570;CS1591;NU5105 + + true + git + https://github.com/kekyo/IL2C.git + + + + .NETFramework + v4.0 + Client + + + + + + + diff --git a/IL2C.Core/IL2C.Core.csproj b/IL2C.Core/IL2C.Core.csproj deleted file mode 100644 index ab95eb55..00000000 --- a/IL2C.Core/IL2C.Core.csproj +++ /dev/null @@ -1,56 +0,0 @@ - - - - net45;net462;net48;netstandard2.0;netstandard2.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0 - Library - true - true - false - true - AnyCPU - latest - NU5105 - false - - IL2C.Core - IL2C - A translator implementation of .NET intermediate language to C language. - - PackageReference - - IL2C - IL2C - Copyright (c) 2017-2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - Apache-2.0 - https://github.com/kekyo/IL2C.git - https://github.com/kekyo/IL2C.git - il2c;cil;msil;translate;transpile;aot;ecma335;c;c++;win32;uefi;wdm;multi-platform;systems-programming - - .pdb - true - true - true - - - - full - - - - embedded - true - - - - - - - - - - - diff --git a/IL2C.Core/Internal/ICombinedComparer.cs b/IL2C.Core/Internal/ICombinedComparer.cs deleted file mode 100644 index fb164064..00000000 --- a/IL2C.Core/Internal/ICombinedComparer.cs +++ /dev/null @@ -1,28 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System.Collections.Generic; - -namespace IL2C.Internal -{ - internal interface ICombinedComparer - : IEqualityComparer, IComparer - { - } -} diff --git a/IL2C.Core/InvalidProgramSequenceException.cs b/IL2C.Core/InvalidProgramSequenceException.cs deleted file mode 100644 index 37bfca39..00000000 --- a/IL2C.Core/InvalidProgramSequenceException.cs +++ /dev/null @@ -1,31 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; - -namespace IL2C -{ - public sealed class InvalidProgramSequenceException : Exception - { - public InvalidProgramSequenceException(string format, params object[] args) - : base(string.Format(format, args)) - { - } - } -} diff --git a/IL2C.Core/Metadata/Attributes/NativeCharSetInformation.cs b/IL2C.Core/Metadata/Attributes/NativeCharSetInformation.cs deleted file mode 100644 index d1bfe607..00000000 --- a/IL2C.Core/Metadata/Attributes/NativeCharSetInformation.cs +++ /dev/null @@ -1,27 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -namespace IL2C.Metadata.Attributes -{ - public enum NativeCharSetInformation - { - Unicode, - UTF8 - } -} diff --git a/IL2C.Core/Metadata/IOperandPrintable.cs b/IL2C.Core/Metadata/IOperandPrintable.cs deleted file mode 100644 index 71bec1c1..00000000 --- a/IL2C.Core/Metadata/IOperandPrintable.cs +++ /dev/null @@ -1,28 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; - -namespace IL2C.Metadata -{ - internal interface IOperandPrintable - { - string PrintableString { get; } - } -} diff --git a/IL2C.Core/Properties/AssemblyInfo.cs b/IL2C.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index b44fc90f..00000000 --- a/IL2C.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: InternalsVisibleTo("IL2C.Core.Test.Fixture")] diff --git a/IL2C.Core/SimpleDriver.cs b/IL2C.Core/SimpleDriver.cs deleted file mode 100644 index 9792340d..00000000 --- a/IL2C.Core/SimpleDriver.cs +++ /dev/null @@ -1,153 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System.Collections.Generic; -using System.IO; - -namespace IL2C -{ - public static class SimpleDriver - { - public static void Translate( - TextWriter logw, - CodeTextStorage storage, - bool readSymbols, - bool enableBundler, - TargetPlatforms targetPlatform, - DebugInformationOptions debugInformationOptions, - string assemblyPath) - { - logw.Write("IL2C: Preparing assembly: \"{0}\" ...", Path.GetFullPath(assemblyPath)); - - var translateContext = new TranslateContext(assemblyPath, readSymbols, targetPlatform); - var preparedFunctions = AssemblyPreparer.Prepare(translateContext); - - logw.WriteLine(" done."); - - using (var _ = storage.EnterScope("include")) - { - AssemblyWriter.WriteHeader( - storage, - translateContext, - preparedFunctions); - } - - using (var _ = storage.EnterScope("src")) - { - AssemblyWriter.WriteSourceCode( - storage, - translateContext, - preparedFunctions, - enableBundler, - debugInformationOptions); - } - } - - public static void TranslateAll( - TextWriter logw, - CodeTextStorage storage, - bool readSymbols, - bool enableBundler, - TargetPlatforms targetPlatform, - DebugInformationOptions debugInformationOptions, - IEnumerable assemblyPaths) - { - foreach (var assemblyPath in assemblyPaths) - { - Translate( - logw, - storage, - readSymbols, - enableBundler, - targetPlatform, - debugInformationOptions, - assemblyPath); - } - } - - public static void TranslateAll( - TextWriter logw, - CodeTextStorage storage, - bool readSymbols, - bool enableBundler, - TargetPlatforms targetPlatform, - DebugInformationOptions debugInformationOptions, - params string[] assemblyPaths) - { - TranslateAll( - logw, - storage, - readSymbols, - enableBundler, - targetPlatform, - debugInformationOptions, - (IEnumerable)assemblyPaths); - } - - public static void TranslateAll( - TextWriter logw, - string outputPath, - bool readSymbols, - bool enableCpp, - bool enableBundler, - TargetPlatforms targetPlatform, - DebugInformationOptions debugInformationOptions, - IEnumerable assemblyPaths) - { - var storage = new CodeTextStorage( - logw, - outputPath, - enableCpp, - " "); - - foreach (var assemblyPath in assemblyPaths) - { - Translate( - logw, - storage, - readSymbols, - enableBundler, - targetPlatform, - debugInformationOptions, - assemblyPath); - } - } - - public static void TranslateAll( - TextWriter logw, - string outputPath, - bool readSymbols, - bool enableCpp, - bool enableBundler, - TargetPlatforms targetPlatform, - DebugInformationOptions debugInformationOptions, - params string[] assemblyPaths) - { - TranslateAll( - logw, - outputPath, - readSymbols, - enableCpp, - enableBundler, - targetPlatform, - debugInformationOptions, - (IEnumerable)assemblyPaths); - } - } -} diff --git a/IL2C.Core/Translators/Label.cs b/IL2C.Core/Translators/Label.cs deleted file mode 100644 index 3ed8f768..00000000 --- a/IL2C.Core/Translators/Label.cs +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -namespace IL2C.Translators -{ - public struct Label - { - public readonly int Offset; - - public Label(int offset) - { - this.Offset = offset; - } - - public override string ToString() => - string.Format("IL_{0:x4}", this.Offset); - } -} diff --git a/IL2C.Interop/IL2C.Interop.csproj b/IL2C.Interop/IL2C.Interop.csproj deleted file mode 100644 index 6917bd9c..00000000 --- a/IL2C.Interop/IL2C.Interop.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - net20;net35;net40-client;net45;net462;net48;netstandard1.0;netstandard2.0;netstandard2.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0 - Library - true - true - false - true - AnyCPU - latest - NU5105 - false - - IL2C.Interop - IL2C - A translator implementation of .NET intermediate language to C language. - - PackageReference - - IL2C - IL2C - Copyright (c) 2017-2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - Apache-2.0 - https://github.com/kekyo/IL2C.git - https://github.com/kekyo/IL2C.git - il2c;cil;msil;translate;transpile;aot;ecma335;c;c++;win32;uefi;wdm;multi-platform;systems-programming - - .pdb - true - true - true - - - - full - - - - embedded - true - - - - .NETFramework - v4.0 - Client - - - - - - - - - diff --git a/IL2C.Interop/NativeAttribute.cs b/IL2C.Interop/NativeAttribute.cs deleted file mode 100644 index bb4c303a..00000000 --- a/IL2C.Interop/NativeAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Collections; - -namespace System.Runtime.InteropServices -{ - public abstract class NativeAttribute : Attribute - { - protected NativeAttribute(string includeFileName) - { - this.IncludeFileName = includeFileName; - } - - internal NativeAttribute(object arg0, IDictionary props) - { - this.IncludeFileName = (string)arg0; - this.SymbolName = (string)props["SymbolName"]; - } - - public string IncludeFileName { get; } - public string SymbolName { get; set; } - } -} diff --git a/IL2C.Interop/NativeCharSet.cs b/IL2C.Interop/NativeCharSet.cs deleted file mode 100644 index 0b8d02df..00000000 --- a/IL2C.Interop/NativeCharSet.cs +++ /dev/null @@ -1,31 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Collections.Generic; -using System.Text; - -namespace System.Runtime.InteropServices -{ - public enum NativeCharSet - { - Unicode, - UTF8 - } -} diff --git a/IL2C.Interop/NativePointer.cs b/IL2C.Interop/NativePointer.cs deleted file mode 100644 index 1773a169..00000000 --- a/IL2C.Interop/NativePointer.cs +++ /dev/null @@ -1,33 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; - -namespace System.Runtime.InteropServices -{ - public struct NativePointer - { - private readonly IntPtr pointer; - - private NativePointer(IntPtr value) => this.pointer = value; - - public static implicit operator NativePointer(IntPtr value) => new NativePointer(value); - public static implicit operator IntPtr(NativePointer value) => value.pointer; - } -} diff --git a/IL2C.Interop/NativeValueAttribute.cs b/IL2C.Interop/NativeValueAttribute.cs deleted file mode 100644 index 1a6afbf2..00000000 --- a/IL2C.Interop/NativeValueAttribute.cs +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Collections; - -namespace System.Runtime.InteropServices -{ - [AttributeUsage(AttributeTargets.Field, AllowMultiple=false, Inherited=false)] - public sealed class NativeValueAttribute : NativeAttribute - { - public NativeValueAttribute(string includeFileName) - : base(includeFileName) - { - } - - internal NativeValueAttribute(object arg0, IDictionary props) - : base(arg0, props) - { - } - } -} diff --git a/IL2C.Interop/Properties/AssemblyInfo.cs b/IL2C.Interop/Properties/AssemblyInfo.cs deleted file mode 100644 index 41e92dea..00000000 --- a/IL2C.Interop/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: InternalsVisibleTo("IL2C.Core")] diff --git a/IL2C.Runtime/IL2C.Runtime.msvc.nuspec b/IL2C.Runtime/IL2C.Runtime.msvc.nuspec deleted file mode 100644 index b3c89387..00000000 --- a/IL2C.Runtime/IL2C.Runtime.msvc.nuspec +++ /dev/null @@ -1,26 +0,0 @@ - - - - IL2C.Runtime.msvc - $version$ - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - false - Apache-2.0 - https://github.com/kekyo/IL2C.git - A translator implementation of .NET intermediate language to C language. - Copyright (c) 2017-2019 Kouji Matsui - il2c native cil msil translate transpile aot ecma335 c c++ win32 uefi wdm multi-platform systems-programming - - - - - - - - - - - - - diff --git a/IL2C.Runtime/build/IL2C.Runtime.msvc.props b/IL2C.Runtime/build/IL2C.Runtime.msvc.props deleted file mode 100644 index 2e7f1074..00000000 --- a/IL2C.Runtime/build/IL2C.Runtime.msvc.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - $(MSBuildThisFileDirectory)..\lib\native - - diff --git a/IL2C.Runtime/build/IL2C.Runtime.props b/IL2C.Runtime/build/IL2C.Runtime.props deleted file mode 100644 index b78e1cb8..00000000 --- a/IL2C.Runtime/build/IL2C.Runtime.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - $(MSBuildThisFileDirectory)..\lib\native - - diff --git a/IL2C.Runtime/include/IL2C.Interop.h b/IL2C.Runtime/include/IL2C.Interop.h deleted file mode 100644 index fc0ba5c2..00000000 --- a/IL2C.Runtime/include/IL2C.Interop.h +++ /dev/null @@ -1,29 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef IL2C_Interop_dll_H__ -#define IL2C_Interop_dll_H__ - -#pragma once - -// IL2C.Interop.dll contains mostly usable IL2C/Invoke definitions -// with private knowledge. -#include - -#endif diff --git a/IL2C.Runtime/include/System.Console.h b/IL2C.Runtime/include/System.Console.h deleted file mode 100644 index 2a7b0d08..00000000 --- a/IL2C.Runtime/include/System.Console.h +++ /dev/null @@ -1,27 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef System_Console_dll_H__ -#define System_Console_dll_H__ - -#pragma once - -#include - -#endif diff --git a/IL2C.Runtime/include/System.Private.CoreLib.h b/IL2C.Runtime/include/System.Private.CoreLib.h deleted file mode 100644 index 34f1ed92..00000000 --- a/IL2C.Runtime/include/System.Private.CoreLib.h +++ /dev/null @@ -1,27 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef System_Private_CoreLib_dll_H__ -#define System_Private_CoreLib_dll_H__ - -#pragma once - -#include - -#endif diff --git a/IL2C.Runtime/include/System.Runtime.h b/IL2C.Runtime/include/System.Runtime.h deleted file mode 100644 index 5e3721af..00000000 --- a/IL2C.Runtime/include/System.Runtime.h +++ /dev/null @@ -1,27 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef System_Runtime_dll_H__ -#define System_Runtime_dll_H__ - -#pragma once - -#include - -#endif diff --git a/IL2C.Runtime/include/mscorlib.h b/IL2C.Runtime/include/mscorlib.h deleted file mode 100644 index a0dc1138..00000000 --- a/IL2C.Runtime/include/mscorlib.h +++ /dev/null @@ -1,27 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef mscorlib_dll_H__ -#define mscorlib_dll_H__ - -#pragma once - -#include - -#endif diff --git a/IL2C.Runtime/src/Platform/efi/efichar.h b/IL2C.Runtime/src/Platform/efi/efichar.h deleted file mode 100644 index 1e29df7b..00000000 --- a/IL2C.Runtime/src/Platform/efi/efichar.h +++ /dev/null @@ -1,26 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef _BOOT_EFI_EFICHAR_H_ -#define _BOOT_EFI_EFICHAR_H_ - -int ucs2_to_utf8(const efi_char *, char **); -int utf8_to_ucs2(const char *, efi_char **, size_t *); - -#endif /* _BOOT_EFI_EFICHAR_H_ */ diff --git a/IL2C.Runtime/src/Platform/no-threading.c b/IL2C.Runtime/src/Platform/no-threading.c deleted file mode 100644 index 7e4772a6..00000000 --- a/IL2C.Runtime/src/Platform/no-threading.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -/////////////////////////////////////////////////// -// Lack for threading support - -#if defined(IL2C_NO_THREADING) - -intptr_t g_TLS0; - -#endif diff --git a/IL2C.Runtime/src/System/IDisposable.c b/IL2C.Runtime/src/System/IDisposable.c deleted file mode 100644 index 16b1cf68..00000000 --- a/IL2C.Runtime/src/System/IDisposable.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "il2c_private.h" -#include - -///////////////////////////////////////////////////////////// -// System.IDisposable - -///////////////////////////////////////////////// -// VTable and runtime type info declarations - -IL2C_RUNTIME_TYPE_INTERFACE_BEGIN(System_IDisposable, "System.IDisposable", 0) -IL2C_RUNTIME_TYPE_END(); diff --git a/IL2C.Runtime/src/System/IFormatProvider.c b/IL2C.Runtime/src/System/IFormatProvider.c deleted file mode 100644 index e4cccb08..00000000 --- a/IL2C.Runtime/src/System/IFormatProvider.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "il2c_private.h" - -///////////////////////////////////////////////////////////// -// System.IFormatProvider - -///////////////////////////////////////////////// -// VTable and runtime type info declarations - -IL2C_RUNTIME_TYPE_INTERFACE_BEGIN(System_IFormatProvider, "System.IFormatProvider", 0) -IL2C_RUNTIME_TYPE_END(); diff --git a/IL2C.Runtime/src/System/IFormattable.c b/IL2C.Runtime/src/System/IFormattable.c deleted file mode 100644 index a2e604ca..00000000 --- a/IL2C.Runtime/src/System/IFormattable.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "il2c_private.h" - -///////////////////////////////////////////////////////////// -// System.IFormattable - -///////////////////////////////////////////////// -// VTable and runtime type info declarations - -IL2C_RUNTIME_TYPE_INTERFACE_BEGIN(System_IFormattable, "System.IFormattable", 0) -IL2C_RUNTIME_TYPE_END(); diff --git a/IL2C.Tasks/IL2C.Tasks.csproj b/IL2C.Tasks/IL2C.Tasks.csproj deleted file mode 100644 index c7ee07a2..00000000 --- a/IL2C.Tasks/IL2C.Tasks.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - net46;net48;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0 - Library - true - true - false - latest - true - AnyCPU - NU5105 - false - - IL2C.Tasks - IL2C - A translator implementation of .NET intermediate language to C language. - - PackageReference - - IL2C - IL2C - Copyright (c) 2017-2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - IL2C.Build - Apache-2.0 - https://github.com/kekyo/IL2C.git - https://github.com/kekyo/IL2C.git - il2c;cil;msil;translate;transpile;aot;ecma335;c;c++;win32;uefi;wdm;multi-platform;systems-programming - - - true - - - false - .pdb - $(TargetsForTfmSpecificContentInPackage);GetPublishFilesForPack - - true - true - true - - - - full - - - - embedded - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/IL2C.Tasks/LogWriter.cs b/IL2C.Tasks/LogWriter.cs deleted file mode 100644 index 7cc3dca5..00000000 --- a/IL2C.Tasks/LogWriter.cs +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Globalization; -using System.Text; - -namespace IL2C -{ - internal sealed class LogWriter : System.IO.TextWriter - { - private readonly Action writer; - private readonly StringBuilder sb = new StringBuilder(); - - public LogWriter(Action writer) - : base(CultureInfo.InvariantCulture) - { - this.writer = writer; - } - - public override Encoding Encoding - { - get - { - return Encoding.UTF8; - } - } - - public override void Flush() - { - this.WriteLine(); - } - - public override void Write(char ch) - { - sb.Append(ch); - } - - public override void Write(char[] buffer, int index, int count) - { - var value = new string(buffer, index, count); - sb.Append(value); - } - - public override void Write(string value) - { - sb.Append(value); - } - - public override void WriteLine() - { - this.WriteLine(string.Empty); - } - - public override void WriteLine(string value) - { - sb.Append(value); - writer(sb.ToString()); - sb.Clear(); - } - - public override void WriteLine(object value) - { - this.WriteLine(value?.ToString()??string.Empty); - } - } -} diff --git a/IL2C.Tasks/Translate.cs b/IL2C.Tasks/Translate.cs deleted file mode 100644 index 846b3555..00000000 --- a/IL2C.Tasks/Translate.cs +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Linq; -using Microsoft.Build.Framework; - -namespace IL2C -{ - public sealed class Translate : Microsoft.Build.Utilities.Task - { - public Translate() - { - this.DebugInformation = "CommentOnly"; - } - - [Required] - public ITaskItem[] AssemblyPaths - { - get; set; - } - - [Required] - public ITaskItem OutputPath - { - get; set; - } - - public bool ReadSymbols - { - get; set; - } - - public bool EnableCpp - { - get; set; - } - - public bool EnableBundler - { - get; set; - } - - public string TargetPlatform - { - get; set; - } - - public string DebugInformation - { - get; set; - } - - public override bool Execute() - { - var outputPath = this.OutputPath.ItemSpec.Trim(); - var debugInformation = string.IsNullOrWhiteSpace(this.DebugInformation) - ? DebugInformationOptions.CommentOnly - : (DebugInformationOptions)Enum.Parse(typeof(DebugInformationOptions), this.DebugInformation); - var targetPlatform = !string.IsNullOrWhiteSpace(this.TargetPlatform) ? - (Enum.TryParse(this.TargetPlatform, true, out var t) ? - t : TargetPlatforms.Generic) : - TargetPlatforms.Generic; - - var logw = new LogWriter(message => - this.Log.LogMessage( - MessageImportance.High, - "{0}", message)); - - SimpleDriver.TranslateAll( - logw, - outputPath, - this.ReadSymbols, - this.EnableCpp, - this.EnableBundler, - targetPlatform, - debugInformation, - this.AssemblyPaths. - Select(path => path.ItemSpec.Trim()). - ToArray()); - - return true; - } - } -} diff --git a/IL2C.Tasks/build/IL2C.Build.props b/IL2C.Tasks/build/IL2C.Build.props deleted file mode 100644 index 7b646e34..00000000 --- a/IL2C.Tasks/build/IL2C.Build.props +++ /dev/null @@ -1,8 +0,0 @@ - - - netcoreapp2.0 - net46 - $(MSBuildThisFileDirectory)..\tasks\$(TaskFolder)\IL2C.Tasks.dll - - - diff --git a/IL2C.Tasks/build/IL2C.Build.targets b/IL2C.Tasks/build/IL2C.Build.targets deleted file mode 100644 index fe56a360..00000000 --- a/IL2C.Tasks/build/IL2C.Build.targets +++ /dev/null @@ -1,22 +0,0 @@ - - - $([System.String]::Concat('$(AssemblyName)','$(TargetExt)')) - $([System.IO.Path]::Combine('$(ProjectDir)','$(OutputPath)','$(IL2CTargetAssemblyFileName)')) - $([System.String]::Concat('$(IL2CAssemblyPaths)',';','$(IL2CTargetAssemblyPath)').split(';')) - $(IL2CTargetAssemblyPath) - $([System.IO.Path]::Combine('$(ProjectDir)','$(OutputPath)','IL2C')) - Full - true - false - false - Generic - - $(CoreBuildDependsOn); - IL2CBuild - - - - - - - diff --git a/IL2C.Tasks/buildMultiTargeting/IL2C.Build.props b/IL2C.Tasks/buildMultiTargeting/IL2C.Build.props deleted file mode 100644 index ddd7fee5..00000000 --- a/IL2C.Tasks/buildMultiTargeting/IL2C.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/IL2C.Tasks/buildMultiTargeting/IL2C.Build.targets b/IL2C.Tasks/buildMultiTargeting/IL2C.Build.targets deleted file mode 100644 index 6dc9d04c..00000000 --- a/IL2C.Tasks/buildMultiTargeting/IL2C.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/IL2C/IL2C.csproj b/IL2C/IL2C.csproj deleted file mode 100644 index 55d51840..00000000 --- a/IL2C/IL2C.csproj +++ /dev/null @@ -1,61 +0,0 @@ - - - - net48;netcoreapp2.1;netcoreapp3.1;net5.0 - Exe - true - true - false - latest - true - AnyCPU - NU5105 - false - - IL2C - IL2C - IL2C.Program - A translator implementation of .NET intermediate language to C language. - - PackageReference - - IL2C - IL2C - Copyright (c) 2017-2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - Apache-2.0 - https://github.com/kekyo/IL2C.git - https://github.com/kekyo/IL2C.git - il2c;cil;msil;translate;transpile;aot;ecma335;c;c++;win32;uefi;wdm;multi-platform;systems-programming - - .pdb - true - true - true - - - - full - - - - embedded - true - - - - - - - - - - - - - - - diff --git a/IL2C/Program.cs b/IL2C/Program.cs deleted file mode 100644 index b7144ca7..00000000 --- a/IL2C/Program.cs +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Linq; -using System.Runtime.InteropServices; - -using Mono.Options; - -namespace IL2C -{ -// warning CS0649: Field is never assigned to, and will always have its default value `null' -#pragma warning disable 0649 - - public static class Program - { - public static int Main(string[] args) - { - try - { - var debugInformationOptions = DebugInformationOptions.None; - var readSymbols = true; - var enableCpp = false; - var enableBundler = false; - var targetPlatform = TargetPlatforms.Generic; - var help = false; - - var options = new OptionSet() - { - { "g1|debug", "Emit debug informations (contains only comments)", v => debugInformationOptions = DebugInformationOptions.CommentOnly }, - { "g|g2|debug-full", "Emit debug informations (contains line numbers)", v => debugInformationOptions = DebugInformationOptions.Full }, - { "no-read-symbols", "NO read symbol files", _ => readSymbols = false }, - { "cpp", "Produce C++ extension files (apply extension *.cpp instead *.c, body will not change)", _ => enableCpp = true }, - { "bundler", "Produce bundler source file", _ => enableBundler = true }, - { "target=", "Target platform [generic|ue4]", v => targetPlatform = Enum.TryParse(v, true, out var t) ? t : TargetPlatforms.Generic }, - { "h|help", "Print this help", _ => help = true }, - }; - - var extra = options.Parse(args); - if (help || (extra.Count < 2)) - { - Console.Out.WriteLine("usage: il2c.exe [options] "); - options.WriteOptionDescriptions(Console.Out); - } - else - { - var outputPath = extra[0]; - var assemblyPaths = extra.Skip(1); - - SimpleDriver.TranslateAll( - Console.Out, - outputPath, - readSymbols, - enableCpp, - enableBundler, - targetPlatform, - debugInformationOptions, - assemblyPaths); - } - - return 0; - } - catch (OptionException ex) - { - Console.Error.WriteLine(ex.Message); - return Marshal.GetHRForException(ex); - } - catch (Exception ex) - { - Console.Error.WriteLine(ex); - return Marshal.GetHRForException(ex); - } - } - } -} diff --git a/IL2C/Properties/AssemblyInfo.cs b/IL2C/Properties/AssemblyInfo.cs deleted file mode 100644 index a2462d49..00000000 --- a/IL2C/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; diff --git a/IL2C/Properties/launchSettings.json b/IL2C/Properties/launchSettings.json deleted file mode 100644 index 979ea055..00000000 --- a/IL2C/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "IL2C": { - "commandName": "Project", - "commandLineArgs": "-g1 $(ProjectDir)../samples/Calculator/Generated $(ProjectDir)../samples/Calculator/Calculator.Core/bin/Debug/netstandard2.0/Calculator.Core.dll" - } - } -} \ No newline at end of file diff --git a/images/Calculator.M5Stack.jpg b/Images/Calculator.M5Stack.jpg similarity index 100% rename from images/Calculator.M5Stack.jpg rename to Images/Calculator.M5Stack.jpg diff --git a/images/Calculator.UEFI.jpg b/Images/Calculator.UEFI.jpg similarity index 100% rename from images/Calculator.UEFI.jpg rename to Images/Calculator.UEFI.jpg diff --git a/images/Calculator.Win32.png b/Images/Calculator.Win32.png similarity index 100% rename from images/Calculator.Win32.png rename to Images/Calculator.Win32.png diff --git a/Images/IL2C.100.png b/Images/IL2C.100.png new file mode 100644 index 00000000..4829bed3 --- /dev/null +++ b/Images/IL2C.100.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2eebe1bb4c189a9ce1c4b8031ed78f735186c1ef98e11b7ccf36af6865e9af9 +size 3228 diff --git a/Images/IL2C.2048.png b/Images/IL2C.2048.png new file mode 100644 index 00000000..52747ab7 --- /dev/null +++ b/Images/IL2C.2048.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:556b7e2eae4b74f78ad70817a63cce4b7540f3a538407bdda9ce2bc1717d49dd +size 79634 diff --git a/images/IMG_20170917_194810.jpg b/Images/IMG_20170917_194810.jpg similarity index 100% rename from images/IMG_20170917_194810.jpg rename to Images/IMG_20170917_194810.jpg diff --git a/images/IMG_20170926_225355.jpg b/Images/IMG_20170926_225355.jpg similarity index 100% rename from images/IMG_20170926_225355.jpg rename to Images/IMG_20170926_225355.jpg diff --git a/images/IMG_20171130_200549.jpg b/Images/IMG_20171130_200549.jpg similarity index 100% rename from images/IMG_20171130_200549.jpg rename to Images/IMG_20171130_200549.jpg diff --git a/images/IMG_20181028_165314.jpg b/Images/IMG_20181028_165314.jpg similarity index 100% rename from images/IMG_20181028_165314.jpg rename to Images/IMG_20181028_165314.jpg diff --git a/images/IMG_20181110_181756.jpg b/Images/IMG_20181110_181756.jpg similarity index 100% rename from images/IMG_20181110_181756.jpg rename to Images/IMG_20181110_181756.jpg diff --git a/images/IMG_20181112_120412.jpg b/Images/IMG_20181112_120412.jpg similarity index 100% rename from images/IMG_20181112_120412.jpg rename to Images/IMG_20181112_120412.jpg diff --git a/images/banner.png b/Images/banner.png similarity index 100% rename from images/banner.png rename to Images/banner.png diff --git a/images/debug-runtime.png b/Images/debug-runtime.png similarity index 100% rename from images/debug-runtime.png rename to Images/debug-runtime.png diff --git a/Images/icon/IL2C.svg b/Images/icon/IL2C.svg new file mode 100644 index 00000000..a2d5d1c8 --- /dev/null +++ b/Images/icon/IL2C.svg @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Images/icon/README.md b/Images/icon/README.md new file mode 100644 index 00000000..c973b0ab --- /dev/null +++ b/Images/icon/README.md @@ -0,0 +1,42 @@ +The icon images imported from [FireFox emoji](https://github.com/mozilla/fxemoji). +These items exclude this project copyright notice. + +---- + +## License for the Code + +Copyright 2015, Mozilla Foundation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + + +## License for the Visual Design + +### Creative Commons Attribution 4.0 International (CC BY 4.0) +https://creativecommons.org/licenses/by/4.0/legalcode +or for the human readable summary: https://creativecommons.org/licenses/by/4.0/ + + +#### You are free to: +**Share** — copy and redistribute the material in any medium or format +**Adapt** — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + + +#### Under the following terms: +**Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. +No additional restrictions — You may not apply legal terms or **technological measures** that legally restrict others from doing anything the license permits. + +#### Notices: +You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. diff --git a/Images/icon/u1F5D0-pages.svg b/Images/icon/u1F5D0-pages.svg new file mode 100644 index 00000000..73726656 --- /dev/null +++ b/Images/icon/u1F5D0-pages.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + diff --git a/Images/icon/u2712-blacknib.svg b/Images/icon/u2712-blacknib.svg new file mode 100644 index 00000000..b34276d9 --- /dev/null +++ b/Images/icon/u2712-blacknib.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/images/il2c1.png b/Images/il2c1.png similarity index 100% rename from images/il2c1.png rename to Images/il2c1.png diff --git a/images/inside-boxing.png b/Images/inside-boxing.png similarity index 100% rename from images/inside-boxing.png rename to Images/inside-boxing.png diff --git a/images/inside-delegate.png b/Images/inside-delegate.png similarity index 100% rename from images/inside-delegate.png rename to Images/inside-delegate.png diff --git a/images/inside-string.png b/Images/inside-string.png similarity index 100% rename from images/inside-string.png rename to Images/inside-string.png diff --git a/images/inside-string2.png b/Images/inside-string2.png similarity index 100% rename from images/inside-string2.png rename to Images/inside-string2.png diff --git a/images/microbit.jpg b/Images/microbit.jpg similarity index 100% rename from images/microbit.jpg rename to Images/microbit.jpg diff --git a/images/overview.png b/Images/overview.png similarity index 100% rename from images/overview.png rename to Images/overview.png diff --git a/images/tutorial111.png b/Images/tutorial111.png similarity index 100% rename from images/tutorial111.png rename to Images/tutorial111.png diff --git a/images/tutorial112.png b/Images/tutorial112.png similarity index 100% rename from images/tutorial112.png rename to Images/tutorial112.png diff --git a/images/tutorial12.png b/Images/tutorial12.png similarity index 100% rename from images/tutorial12.png rename to Images/tutorial12.png diff --git a/images/tutorial13.png b/Images/tutorial13.png similarity index 100% rename from images/tutorial13.png rename to Images/tutorial13.png diff --git a/images/tutorial141.png b/Images/tutorial141.png similarity index 100% rename from images/tutorial141.png rename to Images/tutorial141.png diff --git a/images/tutorial142.png b/Images/tutorial142.png similarity index 100% rename from images/tutorial142.png rename to Images/tutorial142.png diff --git a/images/tutorial151.png b/Images/tutorial151.png similarity index 100% rename from images/tutorial151.png rename to Images/tutorial151.png diff --git a/images/tutorial152.png b/Images/tutorial152.png similarity index 100% rename from images/tutorial152.png rename to Images/tutorial152.png diff --git a/images/tutorial16.png b/Images/tutorial16.png similarity index 100% rename from images/tutorial16.png rename to Images/tutorial16.png diff --git a/images/tutorial17.png b/Images/tutorial17.png similarity index 100% rename from images/tutorial17.png rename to Images/tutorial17.png diff --git a/images/tutorial21.png b/Images/tutorial21.png similarity index 100% rename from images/tutorial21.png rename to Images/tutorial21.png diff --git a/images/tutorial22.png b/Images/tutorial22.png similarity index 100% rename from images/tutorial22.png rename to Images/tutorial22.png diff --git a/images/tutorial23.png b/Images/tutorial23.png similarity index 100% rename from images/tutorial23.png rename to Images/tutorial23.png diff --git a/images/tutorial24.png b/Images/tutorial24.png similarity index 100% rename from images/tutorial24.png rename to Images/tutorial24.png diff --git a/images/tutorial31.png b/Images/tutorial31.png similarity index 100% rename from images/tutorial31.png rename to Images/tutorial31.png diff --git a/images/tutorial32.jpg b/Images/tutorial32.jpg similarity index 100% rename from images/tutorial32.jpg rename to Images/tutorial32.jpg diff --git a/images/tutorial33.jpg b/Images/tutorial33.jpg similarity index 100% rename from images/tutorial33.jpg rename to Images/tutorial33.jpg diff --git a/build-runtime.bat b/build-runtime.bat index 7cb145a1..3615a002 100644 --- a/build-runtime.bat +++ b/build-runtime.bat @@ -2,7 +2,7 @@ setlocal enabledelayedexpansion set TOOLCHAINPATH=%~dp0toolchain\gcc4 -set CMAKE_ROOT=%TOOLCHAINPATH%\share\cmake-3.17 +set CMAKE_ROOT=%TOOLCHAINPATH%\share\cmake-3.23 if not exist %TOOLCHAINPATH% ( echo Native toolchain not found. @@ -17,7 +17,7 @@ if "%Configuration%" == "" ( set Configuration=Debug ) -cd IL2C.Runtime +cd src\IL2C.Runtime if exist build.cmake ( move build.cmake build.cmake.old @@ -50,7 +50,7 @@ echo. mkdir msvc-win-win32-rts-%Configuration% cd msvc-win-win32-rts-%Configuration% -cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=Win32 -DRUNTIMELIB=rts -DCONFIGURATION=%Configuration% ../.. +cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=Win32 -DRUNTIMELIB=rts -DCONFIGURATION=%Configuration% ../.. if errorlevel 1 ( exit /b %errorlevel% ) @@ -73,7 +73,7 @@ echo. mkdir msvc-win-x64-rts-%Configuration% cd msvc-win-x64-rts-%Configuration% -cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=x64 -DRUNTIMELIB=rts -DCONFIGURATION=%Configuration% ../.. +cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=x64 -DRUNTIMELIB=rts -DCONFIGURATION=%Configuration% ../.. if errorlevel 1 ( exit /b %errorlevel% ) @@ -96,7 +96,7 @@ echo. mkdir msvc-win-win32-rtd-%Configuration% cd msvc-win-win32-rtd-%Configuration% -cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=Win32 -DRUNTIMELIB=rtd -DCONFIGURATION=%Configuration% ../.. +cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=Win32 -DRUNTIMELIB=rtd -DCONFIGURATION=%Configuration% ../.. if errorlevel 1 ( exit /b %errorlevel% ) @@ -119,7 +119,7 @@ echo. mkdir msvc-win-x64-rtd-%Configuration% cd msvc-win-x64-rtd-%Configuration% -cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=x64 -DRUNTIMELIB=rtd -DCONFIGURATION=%Configuration% ../.. +cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-win.cmake -DPLATFORM=x64 -DRUNTIMELIB=rtd -DCONFIGURATION=%Configuration% ../.. if errorlevel 1 ( exit /b %errorlevel% ) @@ -142,7 +142,7 @@ echo. mkdir msvc-uefi-win32-%Configuration% cd msvc-uefi-win32-%Configuration% -cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-uefi.cmake -DPLATFORM=Win32 -DCONFIGURATION=%Configuration% ../.. +cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-uefi.cmake -DPLATFORM=Win32 -DCONFIGURATION=%Configuration% ../.. if errorlevel 1 ( exit /b %errorlevel% ) @@ -165,7 +165,7 @@ echo. mkdir msvc-uefi-x64-%Configuration% cd msvc-uefi-x64-%Configuration% -cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-uefi.cmake -DPLATFORM=x64 -DCONFIGURATION=%Configuration% ../.. +cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../cmake/msvc-uefi.cmake -DPLATFORM=x64 -DCONFIGURATION=%Configuration% ../.. if errorlevel 1 ( exit /b %errorlevel% ) diff --git a/build-runtime.sh b/build-runtime.sh index 8b9ffd5a..89ebf8d8 100755 --- a/build-runtime.sh +++ b/build-runtime.sh @@ -8,7 +8,7 @@ else Configuration=$1 fi -cd IL2C.Runtime +cd src/IL2C.Runtime rm -rf build.cmake diff --git a/docs/supported-opcodes.md b/docs/supported-opcodes.md index a425067a..279b9f8d 100644 --- a/docs/supported-opcodes.md +++ b/docs/supported-opcodes.md @@ -1,7 +1,7 @@ # Supported IL opcodes * Number of opcode implementations: 140 / 219 -* Number of opcode tests: 929 [81 / 219] +* Number of opcode tests: 931 [81 / 219] OpCode | Binary | Implement | Test | ILConverter |:---|:---|:---|:---|:---| @@ -38,7 +38,7 @@ OpCode | Binary | Implement | Test | ILConverter | [brfalse.s](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.brfalse_s) | 0x2c | Implemented | [Test [10]](../tests/IL2C.Core.Test.ILConverters/Brfalse_s) | IL2C.ILConverters.Brfalse_sConverter | | [brtrue](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.brtrue) | 0x3a | Implemented | [Test [10]](../tests/IL2C.Core.Test.ILConverters/Brtrue) | IL2C.ILConverters.BrtrueConverter | | [brtrue.s](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.brtrue_s) | 0x2d | Implemented | [Test [10]](../tests/IL2C.Core.Test.ILConverters/Brtrue_s) | IL2C.ILConverters.Brtrue_sConverter | -| [call](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.call) | 0x28 | Implemented | [Test [17]](../tests/IL2C.Core.Test.ILConverters/Call) | IL2C.ILConverters.CallConverter | +| [call](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.call) | 0x28 | Implemented | [Test [19]](../tests/IL2C.Core.Test.ILConverters/Call) | IL2C.ILConverters.CallConverter | | [calli](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.calli) | 0x29 | | | | | [callvirt](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.callvirt) | 0x6f | Implemented | [Test [23]](../tests/IL2C.Core.Test.ILConverters/Callvirt) | IL2C.ILConverters.CallvirtConverter | | [castclass](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.castclass) | 0x74 | Implemented | | IL2C.ILConverters.CastclassConverter | diff --git a/il2c.pack.sln b/il2c.pack.sln index 1c40fd9d..8cc31959 100644 --- a/il2c.pack.sln +++ b/il2c.pack.sln @@ -1,11 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29306.81 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C", "IL2C\IL2C.csproj", "{2CBC90EC-5581-452F-8231-086E4553D20E}" - ProjectSection(ProjectDependencies) = postProject - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} = {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Build", "src\IL2C.Build\IL2C.Build.csproj", "{2CBC90EC-5581-452F-8231-086E4553D20E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D105E6CD-626A-4C04-8AF6-0AA34A4E9CF4}" ProjectSection(SolutionItems) = preProject @@ -15,27 +12,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution pack.sh = pack.sh EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core", "IL2C.Core\IL2C.Core.csproj", "{678EFB0E-BC0A-4749-AD48-079F98D9468D}" - ProjectSection(ProjectDependencies) = postProject - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} = {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core", "src\IL2C.Core\IL2C.Core.csproj", "{678EFB0E-BC0A-4749-AD48-079F98D9468D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Tasks", "IL2C.Tasks\IL2C.Tasks.csproj", "{A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}" - ProjectSection(ProjectDependencies) = postProject - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} = {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IL2C.Runtime", "src\IL2C.Runtime\IL2C.Runtime.vcxproj", "{182A62A4-47AC-4290-8EA5-250AE8131613}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IL2C.Runtime", "IL2C.Runtime\IL2C.Runtime.vcxproj", "{182A62A4-47AC-4290-8EA5-250AE8131613}" - ProjectSection(ProjectDependencies) = postProject - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} = {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Interop", "src\IL2C.Interop\IL2C.Interop.csproj", "{854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Interop", "IL2C.Interop\IL2C.Interop.csproj", "{854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}" - ProjectSection(ProjectDependencies) = postProject - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} = {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5} - EndProjectSection +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{726D7AE4-C17F-4530-9D6B-53B517DCA037}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArtifactCollector", "misc\ArtifactCollector\ArtifactCollector.csproj", "{F0FAC02F-7F91-4ABB-8552-F037803523EE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArtifactCollector", "ArtifactCollector\ArtifactCollector.csproj", "{EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Toolchain.gcc4.mingw32", "misc\IL2C.Toolchain.gcc4.mingw32\IL2C.Toolchain.gcc4.mingw32.csproj", "{9F4783AA-5C0B-446D-952E-3062A380D00B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -51,24 +38,28 @@ Global {678EFB0E-BC0A-4749-AD48-079F98D9468D}.Debug|Any CPU.Build.0 = Debug|Any CPU {678EFB0E-BC0A-4749-AD48-079F98D9468D}.Release|Any CPU.ActiveCfg = Release|Any CPU {678EFB0E-BC0A-4749-AD48-079F98D9468D}.Release|Any CPU.Build.0 = Release|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Release|Any CPU.Build.0 = Release|Any CPU {182A62A4-47AC-4290-8EA5-250AE8131613}.Debug|Any CPU.ActiveCfg = Debug|x64 {182A62A4-47AC-4290-8EA5-250AE8131613}.Release|Any CPU.ActiveCfg = Release|x64 {854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}.Release|Any CPU.Build.0 = Release|Any CPU - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA6C4A63-B6AB-4AAD-98FA-FF102227EAB5}.Release|Any CPU.Build.0 = Release|Any CPU + {F0FAC02F-7F91-4ABB-8552-F037803523EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0FAC02F-7F91-4ABB-8552-F037803523EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0FAC02F-7F91-4ABB-8552-F037803523EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0FAC02F-7F91-4ABB-8552-F037803523EE}.Release|Any CPU.Build.0 = Release|Any CPU + {9F4783AA-5C0B-446D-952E-3062A380D00B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F4783AA-5C0B-446D-952E-3062A380D00B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F4783AA-5C0B-446D-952E-3062A380D00B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F4783AA-5C0B-446D-952E-3062A380D00B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {F0FAC02F-7F91-4ABB-8552-F037803523EE} = {726D7AE4-C17F-4530-9D6B-53B517DCA037} + {9F4783AA-5C0B-446D-952E-3062A380D00B} = {726D7AE4-C17F-4530-9D6B-53B517DCA037} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4628360-6C13-42D4-9011-6E43A3A0777C} EndGlobalSection diff --git a/il2c.sln b/il2c.sln index 0ca9ebe5..5d5bebed 100644 --- a/il2c.sln +++ b/il2c.sln @@ -1,14 +1,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29306.81 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C", "IL2C\IL2C.csproj", "{2CBC90EC-5581-452F-8231-086E4553D20E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Build", "src\IL2C.Build\IL2C.Build.csproj", "{2CBC90EC-5581-452F-8231-086E4553D20E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D105E6CD-626A-4C04-8AF6-0AA34A4E9CF4}" ProjectSection(SolutionItems) = preProject + .gitattributes = .gitattributes .gitignore = .gitignore build-runtime.bat = build-runtime.bat build-runtime.sh = build-runtime.sh + Directory.Build.props = Directory.Build.props + src\Directory.Build.props = src\Directory.Build.props il2c.sln.licenseheader = il2c.sln.licenseheader init-tools.bat = init-tools.bat init-tools.sh = init-tools.sh @@ -19,20 +22,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core", "IL2C.Core\IL2C.Core.csproj", "{678EFB0E-BC0A-4749-AD48-079F98D9468D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core", "src\IL2C.Core\IL2C.Core.csproj", "{678EFB0E-BC0A-4749-AD48-079F98D9468D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{5710A57F-57F8-4D50-8C78-82E2DFDCB613}" + ProjectSection(SolutionItems) = preProject + tests\Directory.Build.props = tests\Directory.Build.props + EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Tasks", "IL2C.Tasks\IL2C.Tasks.csproj", "{A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IL2C.Runtime", "IL2C.Runtime\IL2C.Runtime.vcxproj", "{182A62A4-47AC-4290-8EA5-250AE8131613}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IL2C.Runtime", "src\IL2C.Runtime\IL2C.Runtime.vcxproj", "{182A62A4-47AC-4290-8EA5-250AE8131613}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core.Test.Fixture", "tests\IL2C.Core.Test.Fixture\IL2C.Core.Test.Fixture.csproj", "{B0F1010D-8B73-46F7-AF8E-E3C58F68525F}" ProjectSection(ProjectDependencies) = postProject {182A62A4-47AC-4290-8EA5-250AE8131613} = {182A62A4-47AC-4290-8EA5-250AE8131613} EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Interop", "IL2C.Interop\IL2C.Interop.csproj", "{854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Interop", "src\IL2C.Interop\IL2C.Interop.csproj", "{854E1ABE-0873-4BDC-8ABF-7F9506DD66DB}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{3EBFA913-CF51-4A28-9E4D-73CB5AE27D2F}" ProjectSection(SolutionItems) = preProject @@ -52,14 +56,60 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core.Test.ILConverters EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Core.Test.RuntimeSystems", "tests\IL2C.Core.Test.RuntimeSystems\IL2C.Core.Test.RuntimeSystems.csproj", "{E397A251-4373-4A8E-AA13-3891282DEDC7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArtifactCollector", "ArtifactCollector\ArtifactCollector.csproj", "{DF4432C4-A285-4163-9F95-3A56A2226C9A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{C26C4683-9840-4307-8774-F1F952E3591B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{21592C48-BEE1-4706-8024-CF7EB0CF8BA7}" ProjectSection(SolutionItems) = preProject .github\workflows\build-linux.yaml = .github\workflows\build-linux.yaml .github\workflows\build-windows.yaml = .github\workflows\build-windows.yaml + .github\workflows\init-tools-on-ga.sh = .github\workflows\init-tools-on-ga.sh + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{4BC9EFBC-600E-48BF-ADDC-3E573D8315F0}" + ProjectSection(SolutionItems) = preProject + misc\build-tools-pack.bat = misc\build-tools-pack.bat + misc\Directory.Build.props = misc\Directory.Build.props + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArtifactCollector", "misc\ArtifactCollector\ArtifactCollector.csproj", "{C5D17DC3-D27B-4812-8916-49912F82DE0F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PlayGround", "PlayGround", "{EA30816B-8F8B-4584-9D74-103470BB6C76}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IL2C.Toolchain.gcc4.mingw32", "misc\IL2C.Toolchain.gcc4.mingw32\IL2C.Toolchain.gcc4.mingw32.csproj", "{BB7FA204-433A-416B-B9D0-9A79DF874284}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Calculator", "src\PlayGround\Calculator\Calculator.csproj", "{9DFD09E3-FEEE-4865-9743-457A676925C1}" + ProjectSection(ProjectDependencies) = postProject + {BB7FA204-433A-416B-B9D0-9A79DF874284} = {BB7FA204-433A-416B-B9D0-9A79DF874284} + {182A62A4-47AC-4290-8EA5-250AE8131613} = {182A62A4-47AC-4290-8EA5-250AE8131613} + {2CBC90EC-5581-452F-8231-086E4553D20E} = {2CBC90EC-5581-452F-8231-086E4553D20E} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Calculator.Core", "src\PlayGround\Calculator.Core\Calculator.Core.csproj", "{38BA79E6-9BCD-4C1A-821B-F930249ACE6C}" + ProjectSection(ProjectDependencies) = postProject + {BB7FA204-433A-416B-B9D0-9A79DF874284} = {BB7FA204-433A-416B-B9D0-9A79DF874284} + {182A62A4-47AC-4290-8EA5-250AE8131613} = {182A62A4-47AC-4290-8EA5-250AE8131613} + {2CBC90EC-5581-452F-8231-086E4553D20E} = {2CBC90EC-5581-452F-8231-086E4553D20E} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "src\PlayGround\HelloWorld\HelloWorld.csproj", "{6574A947-589C-413D-A866-D312F9CB7DE9}" + ProjectSection(ProjectDependencies) = postProject + {BB7FA204-433A-416B-B9D0-9A79DF874284} = {BB7FA204-433A-416B-B9D0-9A79DF874284} + {182A62A4-47AC-4290-8EA5-250AE8131613} = {182A62A4-47AC-4290-8EA5-250AE8131613} + {2CBC90EC-5581-452F-8231-086E4553D20E} = {2CBC90EC-5581-452F-8231-086E4553D20E} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShowMessageBoxOnWindows", "src\PlayGround\ShowMessageBoxOnWindows\ShowMessageBoxOnWindows.csproj", "{E7653827-67EF-4561-9809-AB52EA3496E0}" + ProjectSection(ProjectDependencies) = postProject + {BB7FA204-433A-416B-B9D0-9A79DF874284} = {BB7FA204-433A-416B-B9D0-9A79DF874284} + {182A62A4-47AC-4290-8EA5-250AE8131613} = {182A62A4-47AC-4290-8EA5-250AE8131613} + {2CBC90EC-5581-452F-8231-086E4553D20E} = {2CBC90EC-5581-452F-8231-086E4553D20E} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TakeAdvantageWithIL2CInvoke", "src\PlayGround\TakeAdvantageWithIL2CInvoke\TakeAdvantageWithIL2CInvoke.csproj", "{1DCAA734-9274-41FF-A660-2D7B281EF680}" + ProjectSection(ProjectDependencies) = postProject + {BB7FA204-433A-416B-B9D0-9A79DF874284} = {BB7FA204-433A-416B-B9D0-9A79DF874284} + {182A62A4-47AC-4290-8EA5-250AE8131613} = {182A62A4-47AC-4290-8EA5-250AE8131613} + {2CBC90EC-5581-452F-8231-086E4553D20E} = {2CBC90EC-5581-452F-8231-086E4553D20E} EndProjectSection EndProject Global @@ -76,10 +126,6 @@ Global {678EFB0E-BC0A-4749-AD48-079F98D9468D}.Debug|Any CPU.Build.0 = Debug|Any CPU {678EFB0E-BC0A-4749-AD48-079F98D9468D}.Release|Any CPU.ActiveCfg = Release|Any CPU {678EFB0E-BC0A-4749-AD48-079F98D9468D}.Release|Any CPU.Build.0 = Release|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1D40B7C-2F51-43E3-9201-EA8DFFE3B214}.Release|Any CPU.Build.0 = Release|Any CPU {182A62A4-47AC-4290-8EA5-250AE8131613}.Debug|Any CPU.ActiveCfg = Debug|x64 {182A62A4-47AC-4290-8EA5-250AE8131613}.Release|Any CPU.ActiveCfg = Release|x64 {B0F1010D-8B73-46F7-AF8E-E3C58F68525F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -106,10 +152,34 @@ Global {E397A251-4373-4A8E-AA13-3891282DEDC7}.Debug|Any CPU.Build.0 = Debug|Any CPU {E397A251-4373-4A8E-AA13-3891282DEDC7}.Release|Any CPU.ActiveCfg = Release|Any CPU {E397A251-4373-4A8E-AA13-3891282DEDC7}.Release|Any CPU.Build.0 = Release|Any CPU - {DF4432C4-A285-4163-9F95-3A56A2226C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF4432C4-A285-4163-9F95-3A56A2226C9A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF4432C4-A285-4163-9F95-3A56A2226C9A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF4432C4-A285-4163-9F95-3A56A2226C9A}.Release|Any CPU.Build.0 = Release|Any CPU + {C5D17DC3-D27B-4812-8916-49912F82DE0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5D17DC3-D27B-4812-8916-49912F82DE0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5D17DC3-D27B-4812-8916-49912F82DE0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5D17DC3-D27B-4812-8916-49912F82DE0F}.Release|Any CPU.Build.0 = Release|Any CPU + {BB7FA204-433A-416B-B9D0-9A79DF874284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB7FA204-433A-416B-B9D0-9A79DF874284}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB7FA204-433A-416B-B9D0-9A79DF874284}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB7FA204-433A-416B-B9D0-9A79DF874284}.Release|Any CPU.Build.0 = Release|Any CPU + {9DFD09E3-FEEE-4865-9743-457A676925C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DFD09E3-FEEE-4865-9743-457A676925C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DFD09E3-FEEE-4865-9743-457A676925C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DFD09E3-FEEE-4865-9743-457A676925C1}.Release|Any CPU.Build.0 = Release|Any CPU + {38BA79E6-9BCD-4C1A-821B-F930249ACE6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38BA79E6-9BCD-4C1A-821B-F930249ACE6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38BA79E6-9BCD-4C1A-821B-F930249ACE6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38BA79E6-9BCD-4C1A-821B-F930249ACE6C}.Release|Any CPU.Build.0 = Release|Any CPU + {6574A947-589C-413D-A866-D312F9CB7DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6574A947-589C-413D-A866-D312F9CB7DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6574A947-589C-413D-A866-D312F9CB7DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6574A947-589C-413D-A866-D312F9CB7DE9}.Release|Any CPU.Build.0 = Release|Any CPU + {E7653827-67EF-4561-9809-AB52EA3496E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7653827-67EF-4561-9809-AB52EA3496E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7653827-67EF-4561-9809-AB52EA3496E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7653827-67EF-4561-9809-AB52EA3496E0}.Release|Any CPU.Build.0 = Release|Any CPU + {1DCAA734-9274-41FF-A660-2D7B281EF680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DCAA734-9274-41FF-A660-2D7B281EF680}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DCAA734-9274-41FF-A660-2D7B281EF680}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DCAA734-9274-41FF-A660-2D7B281EF680}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -122,6 +192,13 @@ Global {E397A251-4373-4A8E-AA13-3891282DEDC7} = {5710A57F-57F8-4D50-8C78-82E2DFDCB613} {C26C4683-9840-4307-8774-F1F952E3591B} = {D105E6CD-626A-4C04-8AF6-0AA34A4E9CF4} {21592C48-BEE1-4706-8024-CF7EB0CF8BA7} = {C26C4683-9840-4307-8774-F1F952E3591B} + {C5D17DC3-D27B-4812-8916-49912F82DE0F} = {4BC9EFBC-600E-48BF-ADDC-3E573D8315F0} + {BB7FA204-433A-416B-B9D0-9A79DF874284} = {4BC9EFBC-600E-48BF-ADDC-3E573D8315F0} + {9DFD09E3-FEEE-4865-9743-457A676925C1} = {EA30816B-8F8B-4584-9D74-103470BB6C76} + {38BA79E6-9BCD-4C1A-821B-F930249ACE6C} = {EA30816B-8F8B-4584-9D74-103470BB6C76} + {6574A947-589C-413D-A866-D312F9CB7DE9} = {EA30816B-8F8B-4584-9D74-103470BB6C76} + {E7653827-67EF-4561-9809-AB52EA3496E0} = {EA30816B-8F8B-4584-9D74-103470BB6C76} + {1DCAA734-9274-41FF-A660-2D7B281EF680} = {EA30816B-8F8B-4584-9D74-103470BB6C76} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4628360-6C13-42D4-9011-6E43A3A0777C} diff --git a/il2c.sln.licenseheader b/il2c.sln.licenseheader index c62d624b..b17dd952 100644 --- a/il2c.sln.licenseheader +++ b/il2c.sln.licenseheader @@ -1,20 +1,10 @@ extensions: designer.cs generated.cs -extensions: .cs .il .cpp .h -///////////////////////////////////////////////////////////////////////////////////////////////// +extensions: .cs .il .c .cpp .h +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// diff --git a/init-tools.bat b/init-tools.bat index 3b65a587..89b7801a 100644 --- a/init-tools.bat +++ b/init-tools.bat @@ -7,18 +7,18 @@ mkdir toolchain cd toolchain -curl -L -O https://github.com/kekyo/IL2C/releases/download/IL2C-toolchain-gcc4-mingw32-3/IL2C-toolchain-gcc4-mingw32-3.exe +curl -L -O https://github.com/kekyo/IL2C/releases/download/IL2C-toolchain-gcc4-mingw32-4/IL2C-toolchain-gcc4-mingw32-4.exe if errorlevel 1 ( exit /b %errorlevel% ) rem It zipped by 7z sfx. -IL2C-toolchain-gcc4-mingw32-3.exe +IL2C-toolchain-gcc4-mingw32-4.exe if errorlevel 1 ( exit /b %errorlevel% ) -del /q IL2C-toolchain-gcc4-mingw32-3.exe +del /q IL2C-toolchain-gcc4-mingw32-4.exe if errorlevel 1 ( exit /b %errorlevel% ) diff --git a/init-tools.sh b/init-tools.sh index 56e6318e..59cc3a9e 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -1,13 +1,23 @@ #!/bin/sh -# Required: .NET 5.0 SDK -# https://dotnet.microsoft.com/download/dotnet/5.0 +# `mono-devel` is required only running regression test. (net48 platform) echo "Setup native binary toolchain ..." -apt update -y -apt install build-essential cmake ninja-build mono-devel -y +sudo apt update -y +sudo apt install build-essential cmake ninja-build mono-devel -y -# `mono-devel` is required only running regression test. (net48 platform) +#curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 2.1 +#curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 2.2 +#curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 3.1 +#curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 5.0 +#curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 6.0 + +#export PATH=$HOME/.dotnet:$PATH +#export DOTNET_HOME=$HOME/.dotnet + +#echo "You have to set environment variables in your sh profile:" + +#echo "export PATH=$HOME/.dotnet:$PATH" +#echo "export DOTNET_HOME=$HOME/.dotnet" -chmod 755 *.sh diff --git a/ArtifactCollector/.gitignore b/misc/ArtifactCollector/.gitignore similarity index 100% rename from ArtifactCollector/.gitignore rename to misc/ArtifactCollector/.gitignore diff --git a/ArtifactCollector/Arduino.properties b/misc/ArtifactCollector/Arduino.properties similarity index 100% rename from ArtifactCollector/Arduino.properties rename to misc/ArtifactCollector/Arduino.properties diff --git a/misc/ArtifactCollector/ArtifactCollector.csproj b/misc/ArtifactCollector/ArtifactCollector.csproj new file mode 100644 index 00000000..f3b969b6 --- /dev/null +++ b/misc/ArtifactCollector/ArtifactCollector.csproj @@ -0,0 +1,25 @@ + + + + net45 + Exe + + ArtifactCollector + IL2C.ArtifactCollector + + + + + + + + + + + + + + + + + diff --git a/ArtifactCollector/Collectors.cs b/misc/ArtifactCollector/Collectors.cs similarity index 92% rename from ArtifactCollector/Collectors.cs rename to misc/ArtifactCollector/Collectors.cs index 5dca0cc8..42a4ca84 100644 --- a/ArtifactCollector/Collectors.cs +++ b/misc/ArtifactCollector/Collectors.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -148,6 +138,7 @@ public static async Task BuildNuspecAndCollectArtifactsAsync( "pack", "-Version", versionString, "-NoPackageAnalysis", + "-Verbosity", "detailed", "-Prop", $"Configuration=Release", "-Prop", $"BuildIdentifier={buildIdentifier}", "-OutputDirectory", $"\"{outputDirectory}\"", @@ -232,13 +223,13 @@ await CopyResourceWithReplacementsAsync( { "{semver2}", typeof(Program).Assembly.GetCustomAttribute().InformationalVersion } }); - var fromIncludeDir = Path.Combine(solutionDir, "IL2C.Runtime", "include"); + var fromIncludeDir = Path.Combine(solutionDir, "src", "IL2C.Runtime", "include"); var toIncludeDir = Path.Combine(arduinoBasePath, "include"); await Task.WhenAll( Directory.EnumerateFiles(fromIncludeDir, "*.h", SearchOption.AllDirectories). Select(path => CopyFileAsync(path, Path.Combine(toIncludeDir, path.Substring(fromIncludeDir.Length + 1))))); - var fromSrcDir = Path.Combine(solutionDir, "IL2C.Runtime", "src"); + var fromSrcDir = Path.Combine(solutionDir, "src", "IL2C.Runtime", "src"); var toSrcDir = Path.Combine(arduinoBasePath, "src"); await Task.WhenAll( Directory.EnumerateFiles(fromSrcDir, "*.c", SearchOption.AllDirectories). diff --git a/ArtifactCollector/Executor.cs b/misc/ArtifactCollector/Executor.cs similarity index 75% rename from ArtifactCollector/Executor.cs rename to misc/ArtifactCollector/Executor.cs index 4a2cb547..f85d8c7e 100644 --- a/ArtifactCollector/Executor.cs +++ b/misc/ArtifactCollector/Executor.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/ArtifactCollector/Program.cs b/misc/ArtifactCollector/Program.cs similarity index 84% rename from ArtifactCollector/Program.cs rename to misc/ArtifactCollector/Program.cs index db81d92e..a8fb966e 100644 --- a/ArtifactCollector/Program.cs +++ b/misc/ArtifactCollector/Program.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.IO; @@ -66,16 +56,17 @@ private static async Task MainAsync(string[] args) SelectMany(p => Directory.GetFiles(Path.Combine(solutionDir, p), "*.csproj")). ToArray(); + var nuspecPaths = dirNames. + SelectMany(p => Directory.GetFiles(Path.Combine(solutionDir, p), "*.nuspec")). + Where(p => !csprojPaths.Any(csprojPath => Path.GetDirectoryName(csprojPath) == Path.GetDirectoryName(p))). + ToArray(); + WriteLine("\r\n/////////////////////////////////////////////////////\r\n// Collect for {0}\r\n\r\n", string.Join(", ", csprojPaths.Select(p => Path.GetFileName(p)))); await Collectors.BuildCsprojAndCollectArtifactsAsync( solutionDir, artifactsDir, buildIdentifier, csprojPaths); - var nuspecPaths = dirNames. - SelectMany(p => Directory.GetFiles(Path.Combine(solutionDir, p), "*.nuspec")). - ToArray(); - WriteLine("\r\n/////////////////////////////////////////////////////\r\n// Collect for {0}\r\n\r\n", string.Join(", ", nuspecPaths.Select(p => Path.GetFileName(p)))); diff --git a/ArtifactCollector/Properties/launchSettings.json b/misc/ArtifactCollector/Properties/launchSettings.json similarity index 100% rename from ArtifactCollector/Properties/launchSettings.json rename to misc/ArtifactCollector/Properties/launchSettings.json diff --git a/misc/Directory.Build.props b/misc/Directory.Build.props new file mode 100644 index 00000000..6744f5ad --- /dev/null +++ b/misc/Directory.Build.props @@ -0,0 +1,12 @@ + + + + + + + false + portable + False + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/.gitignore b/misc/IL2C.Toolchain.gcc4.mingw32/.gitignore new file mode 100644 index 00000000..bc6998b1 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/.gitignore @@ -0,0 +1,2 @@ +7z/ +gcc4/ diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.csproj b/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.csproj new file mode 100644 index 00000000..4df2000e --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.csproj @@ -0,0 +1,19 @@ + + + netstandard2.0 + IL2C.Toolchain.gcc4.mingw32.nuspec + true + false + + + + + + + + + + + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.nuspec b/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.nuspec new file mode 100644 index 00000000..a61264e3 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.nuspec @@ -0,0 +1,30 @@ + + + + IL2C.Toolchain.gcc4.mingw32 + $PackageVersion$ + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) + false + Apache-2.0 AND GPL-2.0-only + IL2C.100.png + https://github.com/kekyo/IL2C.git + A translator implementation of .NET intermediate language to C language. + Copyright (c) Kouji Matsui + il2c native cil msil translate transpile aot ecma335 c c++ win32 uefi wdm multi-platform systems-programming + + true + + + + + + + + + + + + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.packed.exe b/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.packed.exe new file mode 100644 index 00000000..25c16132 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.packed.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a92ed98ba3b1e896f99e8e7ae236ee97d77adfd872075ea19b54ae00ace4366 +size 18929030 diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/README.md b/misc/IL2C.Toolchain.gcc4.mingw32/README.md new file mode 100644 index 00000000..b3826095 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/README.md @@ -0,0 +1,32 @@ +# What's this? + +This is part of [IL2C](https://github.com/kekyo/IL2C) toolchain distribution file. +It contains GNU compiler collection built on MinGW environment. + +## License + +IL2C is under Apache-v2, but there are under GPL-v2 inside `IL2C-toolchain-gcc4-mingw32-4-base.exe` (7zip sfx). + +These files come from: + +```csharp +mingwBaseUrl = "https://jaist.dl.sourceforge.net/project/mingw/MinGW"; +gccRequirementUrls = + mingwBaseUrl + "/Base/binutils/binutils-2.28/binutils-2.28-1-mingw32-bin.tar.xz", + mingwBaseUrl + "/Base/mingwrt/mingwrt-3.20/mingwrt-3.20-2-mingw32-dev.tar.lzma", + mingwBaseUrl + "/Base/mingwrt/mingwrt-3.20/mingwrt-3.20-2-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/w32api/w32api-3.17/w32api-3.17-2-mingw32-dev.tar.lzma", + mingwBaseUrl + "/Base/mpc/mpc-1.0.1-2/mpc-1.0.1-2-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/mpfr/mpfr-3.1.2-2/mpfr-3.1.2-2-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/gmp/gmp-5.1.2/gmp-5.1.2-1-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/libiconv/libiconv-1.14-3/libiconv-1.14-3-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/pthreads-w32/pthreads-w32-2.9.1/pthreads-w32-2.9.1-1-mingw32-dev.tar.lzma", + mingwBaseUrl + "/Base/pthreads-w32/pthreads-w32-2.9.1/pthreads-w32-2.9.1-1-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/zlib/zlib-1.2.8/zlib-1.2.8-1-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/gettext/gettext-0.18.3.1-1/gettext-0.18.3.1-1-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma", + mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-dev.tar.lzma", + mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-dll.tar.lzma", + mingwBaseUrl + "/Extension/make/make-3.82-mingw32/make-3.82-5-mingw32-bin.tar.lzma", + mingwBaseUrl + "/Extension/gdb/gdb-7.6.1-1/gdb-7.6.1-1-mingw32-bin.tar.lzma", +``` diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/build/IL2C.Toolchain.gcc4.mingw32.props b/misc/IL2C.Toolchain.gcc4.mingw32/build/IL2C.Toolchain.gcc4.mingw32.props new file mode 100644 index 00000000..2522a1ef --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/build/IL2C.Toolchain.gcc4.mingw32.props @@ -0,0 +1,27 @@ + + + + + <_IL2C_GCC4_MinGW32_NativeToolchainBasePath>$(MSBuildThisFileDirectory).. + <_IL2C_GCC4_MinGW32_NativeToolchainName>gcc4 + <_IL2C_GCC4_MinGW32_NativeToolchainPath>$([System.IO.Path]::Combine('$(_IL2C_GCC4_MinGW32_NativeToolchainBasePath)','$(_IL2C_GCC4_MinGW32_NativeToolchainName)')) + + <_IL2C_GCC4_MinGW32_PackedNativeToolchainArchivePath>$([System.IO.Path]::Combine('$(_IL2C_GCC4_MinGW32_NativeToolchainBasePath)','IL2C.Toolchain.gcc4.mingw32.packed.exe')) + <_IL2C_WinExeMainTemplatePath>$([System.IO.Path]::Combine('$(_IL2C_GCC4_MinGW32_NativeToolchainBasePath)','src','_main_winexe_template.c_')) + + $([System.IO.Path]::Combine('$(_IL2C_GCC4_MinGW32_NativeToolchainPath)','bin','gcc.exe')) + -pipe -ggdb -static-libgcc -Wall -Werror -Wstrict-prototypes -Wno-unused + -D_WIN32 -Wl,--enable-stdcall-fixup -Wl,--add-stdcall-alias + $([System.IO.Path]::Combine('$(_IL2C_GCC4_MinGW32_NativeToolchainPath)','bin','ar.exe')) + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/build/IL2C.Toolchain.gcc4.mingw32.targets b/misc/IL2C.Toolchain.gcc4.mingw32/build/IL2C.Toolchain.gcc4.mingw32.targets new file mode 100644 index 00000000..717c86f5 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/build/IL2C.Toolchain.gcc4.mingw32.targets @@ -0,0 +1,48 @@ + + + + + + + $(_IL2C_GCC_DebugFlags) + $(_IL2C_GCC_ReleaseFlags) + $(_IL2C_GCC_DisableOptimizingFlags) + $(_IL2C_GCC_EnableOptimizingFlags) + $(_IL2C_WinExeMainTemplatePath) + $(IL2CNativeCompilerRequiredFlags) -mwindows + + + + + + + + + <_IL2C_TemporaryDirPathForExtractionGCC4PackedToolchainArchive>$([System.IO.Path]::Combine('$(_IL2C_GCC4_MinGW32_NativeToolchainBasePath)','$([System.Guid]::NewGuid().ToString())')) + + + + + <_IL2C_Build_MoveDirectory + From="$([System.IO.Path]::Combine('$(_IL2C_TemporaryDirPathForExtractionGCC4PackedToolchainArchive)','$(_IL2C_GCC4_MinGW32_NativeToolchainName)'))" + To="$(_IL2C_GCC4_MinGW32_NativeToolchainPath)" /> + + + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/buildMultiTargeting/IL2C.Toolchain.gcc4.mingw32.props b/misc/IL2C.Toolchain.gcc4.mingw32/buildMultiTargeting/IL2C.Toolchain.gcc4.mingw32.props new file mode 100644 index 00000000..94a68885 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/buildMultiTargeting/IL2C.Toolchain.gcc4.mingw32.props @@ -0,0 +1,13 @@ + + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/buildMultiTargeting/IL2C.Toolchain.gcc4.mingw32.targets b/misc/IL2C.Toolchain.gcc4.mingw32/buildMultiTargeting/IL2C.Toolchain.gcc4.mingw32.targets new file mode 100644 index 00000000..0da6db5b --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/buildMultiTargeting/IL2C.Toolchain.gcc4.mingw32.targets @@ -0,0 +1,13 @@ + + + + diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/pack7z.bat b/misc/IL2C.Toolchain.gcc4.mingw32/pack7z.bat new file mode 100644 index 00000000..0b7958ff --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/pack7z.bat @@ -0,0 +1,49 @@ +@echo off + +rem ======================================================== +rem Download preconfigured gcc4 toolchain from GitHub. +rem It contains: +rem ----------------- +rem bsdTarUrl = mingwBaseUrl + "/Extension/bsdtar/basic-bsdtar-2.8.3-1/basic-bsdtar-2.8.3-1-mingw32-bin.zip"; +rem mingwBaseUrl = "https://jaist.dl.sourceforge.net/project/mingw/MinGW"; +rem gccRequirementUrls = +rem mingwBaseUrl + "/Base/binutils/binutils-2.28/binutils-2.28-1-mingw32-bin.tar.xz", +rem mingwBaseUrl + "/Base/mingwrt/mingwrt-3.20/mingwrt-3.20-2-mingw32-dev.tar.lzma", +rem mingwBaseUrl + "/Base/mingwrt/mingwrt-3.20/mingwrt-3.20-2-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/w32api/w32api-3.17/w32api-3.17-2-mingw32-dev.tar.lzma", +rem mingwBaseUrl + "/Base/mpc/mpc-1.0.1-2/mpc-1.0.1-2-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/mpfr/mpfr-3.1.2-2/mpfr-3.1.2-2-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/gmp/gmp-5.1.2/gmp-5.1.2-1-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/libiconv/libiconv-1.14-3/libiconv-1.14-3-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/pthreads-w32/pthreads-w32-2.9.1/pthreads-w32-2.9.1-1-mingw32-dev.tar.lzma", +rem mingwBaseUrl + "/Base/pthreads-w32/pthreads-w32-2.9.1/pthreads-w32-2.9.1-1-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/zlib/zlib-1.2.8/zlib-1.2.8-1-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/gettext/gettext-0.18.3.1-1/gettext-0.18.3.1-1-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma", +rem mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-dev.tar.lzma", +rem mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-dll.tar.lzma", +rem // Require C++ +rem //mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-bin.tar.lzma", +rem //mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dev.tar.lzma", +rem //mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dll.tar.lzma", +rem mingwBaseUrl + "/Extension/make/make-3.82-mingw32/make-3.82-5-mingw32-bin.tar.lzma", +rem mingwBaseUrl + "/Extension/gdb/gdb-7.6.1-1/gdb-7.6.1-1-mingw32-bin.tar.lzma", + +curl -L -O https://github.com/kekyo/IL2C/releases/download/IL2C-toolchain-gcc4-mingw32-3/7z-19.00.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +7z-19.00.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +del /q 7z-19.00.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +7z\7za.exe a -mx9 -sfx IL2C.Toolchain.gcc4.mingw32.packed.exe gcc4 + +rmdir /s/q 7z diff --git a/misc/IL2C.Toolchain.gcc4.mingw32/src/_main_winexe_template.c_ b/misc/IL2C.Toolchain.gcc4.mingw32/src/_main_winexe_template.c_ new file mode 100644 index 00000000..f24c0567 --- /dev/null +++ b/misc/IL2C.Toolchain.gcc4.mingw32/src/_main_winexe_template.c_ @@ -0,0 +1,41 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#include +#include +#include <{headerName}> + +#ifdef __cplusplus +extern "C" +#endif +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpCmdLine); + ((void)nCmdShow); + +#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG) + _crtBreakAlloc = -1; +#endif + + il2c_initialize(); + +#if {mainIsVoid} + {mainSymbol}(); + + il2c_shutdown(); + return 0; +#else + const int r = {mainSymbol}(); + + il2c_shutdown(); + return r; +#endif +} diff --git a/build-tools-pack.bat b/misc/build-tools-pack.bat similarity index 95% rename from build-tools-pack.bat rename to misc/build-tools-pack.bat index 4b8f10f5..e6d67f3b 100644 --- a/build-tools-pack.bat +++ b/misc/build-tools-pack.bat @@ -4,8 +4,8 @@ rem ======================================================== rem Download preconfigured gcc4 toolchain from GitHub. rem It contains: rem ----------------- -rem mingwBaseUrl = "https://jaist.dl.sourceforge.net/project/mingw/MinGW"; rem bsdTarUrl = mingwBaseUrl + "/Extension/bsdtar/basic-bsdtar-2.8.3-1/basic-bsdtar-2.8.3-1-mingw32-bin.zip"; +rem mingwBaseUrl = "https://jaist.dl.sourceforge.net/project/mingw/MinGW"; rem gccRequirementUrls = rem mingwBaseUrl + "/Base/binutils/binutils-2.28/binutils-2.28-1-mingw32-bin.tar.xz", rem mingwBaseUrl + "/Base/mingwrt/mingwrt-3.20/mingwrt-3.20-2-mingw32-dev.tar.lzma", @@ -28,10 +28,11 @@ rem //mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32 rem //mingwBaseUrl + "/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dll.tar.lzma", rem mingwBaseUrl + "/Extension/make/make-3.82-mingw32/make-3.82-5-mingw32-bin.tar.lzma", rem mingwBaseUrl + "/Extension/gdb/gdb-7.6.1-1/gdb-7.6.1-1-mingw32-bin.tar.lzma", -rem "https://cmake.org/files/v3.17/cmake-3.17.3-win32-x86.zip", +rem builderRequirementUrls = +rem "https://cmake.org/files/v3.23/cmake-3.23.1-windows-i386.zip", rem "https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip" -cd toolchain +cd ..\toolchain curl -L -O https://github.com/kekyo/IL2C/releases/download/IL2C-toolchain-gcc4-mingw32-3/7z-19.00.exe if errorlevel 1 ( @@ -48,8 +49,8 @@ if errorlevel 1 ( exit /b %errorlevel% ) -7z\7za.exe a -mx9 -sfx ..\artifacts\IL2C-toolchain-gcc4-mingw32-3.exe gcc4 +7z\7za.exe a -mx9 -sfx ..\artifacts\IL2C-toolchain-gcc4-mingw32-4.exe gcc4 rem ======================================================== -cd .. +cd ..\misc diff --git a/pack.bat b/pack.bat index 2ffbd42a..558db656 100644 --- a/pack.bat +++ b/pack.bat @@ -2,7 +2,7 @@ setlocal enabledelayedexpansion set TOOLCHAINPATH=%~dp0toolchain\gcc4 -set CMAKE_ROOT=%TOOLCHAINPATH%\share\cmake-3.17 +set CMAKE_ROOT=%TOOLCHAINPATH%\share\cmake-3.23 if not exist %TOOLCHAINPATH% ( echo Native toolchain not found. @@ -15,12 +15,6 @@ if "%BuildIdentifier%" == "" ( set BuildIdentifier=manually ) -rem if not exist ArtifactCollector\ArtifactCollector.exe ( -rem echo ArtifactCollector not found. -rem echo Build il2c.sln first. -rem exit /b 1 -rem ) - rem ========================================= call build-runtime.bat Debug @@ -42,7 +36,7 @@ echo /////////////////////////////////////////////// echo // Collects artifacts. echo. -ArtifactCollector\ArtifactCollector.exe . .\artifacts "%BuildIdentifier%" IL2C.Interop IL2C.Core IL2C.Tasks IL2C.Runtime +misc\ArtifactCollector\ArtifactCollector.exe . .\artifacts "%BuildIdentifier%" src\IL2C.Interop src\IL2C.Core src\IL2C.Build src\IL2C.Runtime misc\IL2C.Toolchain.gcc4.mingw32 rem ========================================= diff --git a/pack.sh b/pack.sh index c55b874f..291ce310 100755 --- a/pack.sh +++ b/pack.sh @@ -10,31 +10,31 @@ echo "///////////////////////////////////////////////" echo "// Build IL2C.Interop" echo "" -dotnet pack --configuration Release --include-symbols -p:VersionPrefix=${VERSION} IL2C.Interop/IL2C.Interop.csproj -cp IL2C.Interop/bin/Release/IL2C.Interop.${VERSION}.symbols.nupkg artifacts/IL2C.Interop.${VERSION}.nupkg +dotnet pack --configuration Release src/IL2C.Interop/IL2C.Interop.csproj +cp src/IL2C.Interop/bin/Release/IL2C.Interop.*.nupkg artifacts/ echo "" echo "///////////////////////////////////////////////" echo "// Build IL2C.Core" echo "" -dotnet pack --configuration Release --include-symbols -p:VersionPrefix=${VERSION} IL2C.Core/IL2C.Core.csproj -cp IL2C.Core/bin/Release/IL2C.Core.${VERSION}.symbols.nupkg artifacts/IL2C.Core.${VERSION}.nupkg +dotnet pack --configuration Release src/IL2C.Core/IL2C.Core.csproj +cp src/IL2C.Core/bin/Release/IL2C.Core.*.nupkg artifacts/ echo "" echo "///////////////////////////////////////////////" echo "// Build IL2C.Runtime" echo "" -.nuget/nuget pack -Prop version=${VERSION} -OutputDirectory artifacts IL2C.Runtime/IL2C.Runtime.nuspec +.nuget/nuget pack -Prop version=${VERSION} -OutputDirectory artifacts src/IL2C.Runtime/IL2C.Runtime.nuspec echo "" echo "///////////////////////////////////////////////" echo "// Build IL2C.Build" echo "" -dotnet pack --configuration Release --include-symbols -p:VersionPrefix=${VERSION} IL2C.Tasks/IL2C.Tasks.csproj -cp IL2C.Tasks/bin/Release/IL2C.Build.${VERSION}.symbols.nupkg artifacts/IL2C.Build.${VERSION}.nupkg +dotnet pack --configuration Release src/IL2C.Build/IL2C.Build.csproj +cp src/IL2C.Build/bin/Release/IL2C.Build.*.symbols.nupkg artifacts/ echo "" echo "///////////////////////////////////////////////" @@ -42,9 +42,9 @@ echo "// Build Arduino library" echo "" mkdir artifacts/Arduino -cp /R IL2C.Runtime/include/*.h artifacts/Arduino/src/ -cp /R IL2C.Runtime/src/*.h artifacts/Arduino/src/ -cp /R IL2C.Runtime/src/*.c artifacts/Arduino/src/ +cp -R src/IL2C.Runtime/include/*.h artifacts/Arduino/src/ +cp -R src/IL2C.Runtime/src/*.h artifacts/Arduino/src/ +cp -R src/IL2C.Runtime/src/*.c artifacts/Arduino/src/ sed 's/{version}/${VERSION}/g' Arduino.properties > artifacts/Arduino/library.properties diff --git a/samples/Calculator/Calculator.CMake/CMakeLists.txt b/samples/Calculator/Calculator.CMake/CMakeLists.txt index a3464959..e680d3c1 100644 --- a/samples/Calculator/Calculator.CMake/CMakeLists.txt +++ b/samples/Calculator/Calculator.CMake/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7) project(Calculator.CMake C) -include(${CMAKE_CURRENT_LIST_DIR}/../../../IL2C.Runtime/cmake/${BUILDER}.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../../../src/IL2C.Runtime/cmake/${BUILDER}.cmake) include_directories(${CMAKE_CURRENT_LIST_DIR}/../Generated/include) include_directories(${CMAKE_CURRENT_LIST_DIR}/../Generated/src) diff --git a/samples/Calculator/Calculator.Core.Tests/Calculator.Core.Tests.csproj b/samples/Calculator/Calculator.Core.Tests/Calculator.Core.Tests.csproj index 1b49239d..09592032 100644 --- a/samples/Calculator/Calculator.Core.Tests/Calculator.Core.Tests.csproj +++ b/samples/Calculator/Calculator.Core.Tests/Calculator.Core.Tests.csproj @@ -1,28 +1,16 @@  - netcoreapp3.1 + net6.0 Library - true - PackageReference - false Calculator.Core.Tests Calculator - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2017 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - - - + + + diff --git a/samples/Calculator/Calculator.Core/Calculator.Core.csproj b/samples/Calculator/Calculator.Core/Calculator.Core.csproj index b24a93d8..c72bfd15 100644 --- a/samples/Calculator/Calculator.Core/Calculator.Core.csproj +++ b/samples/Calculator/Calculator.Core/Calculator.Core.csproj @@ -1,30 +1,42 @@  + + + + + + + netstandard2.0 - false - PackageReference - true - false Calculator.Core Calculator - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2017-2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - - $(ProjectDir)../Generated + + ..\..\..\..\Generated + + + + + + + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + diff --git a/samples/Calculator/Calculator.UEFI/Calculator.UEFI.vcxproj b/samples/Calculator/Calculator.UEFI/Calculator.UEFI.vcxproj index b44921f7..a5bf3bac 100644 --- a/samples/Calculator/Calculator.UEFI/Calculator.UEFI.vcxproj +++ b/samples/Calculator/Calculator.UEFI/Calculator.UEFI.vcxproj @@ -23,15 +23,15 @@ - + - 15.0 + 17.0 {B4BC66C2-9D98-40BC-BB24-94CA3D0E3DD5} Win32Proj Calculator DynamicLibrary - v142 + v143 false false $(ProjectDir)bin\$(Platform)\$(Configuration)\ @@ -74,7 +74,7 @@ ProgramDatabase true true - .;../Generated/include;../Generated/src;../../../IL2C.Runtime/include + .;../Generated/include;../Generated/src;../../../src/IL2C.Runtime/include Disabled @@ -91,7 +91,7 @@ EFI Application true - ../../../IL2C.Runtime/lib/$(Configuration) + ../../../src/IL2C.Runtime/lib/$(Configuration) libil2c-msvc-uefi-$(Platform).lib true true diff --git a/samples/Calculator/Calculator.Win32/Calculator.Win32.vcxproj b/samples/Calculator/Calculator.Win32/Calculator.Win32.vcxproj index f9b45ad3..aed5a121 100644 --- a/samples/Calculator/Calculator.Win32/Calculator.Win32.vcxproj +++ b/samples/Calculator/Calculator.Win32/Calculator.Win32.vcxproj @@ -19,7 +19,7 @@ - 15.0 + 17.0 {4DB1CA14-5035-4848-BCDE-10F0A7DC0F50} Win32Proj Win32Target @@ -29,7 +29,7 @@ Application true - v142 + v143 Unicode @@ -51,7 +51,7 @@ Level3 4100;4146;4197;4206 true - .;../Generated/include;../Generated/src;../../../IL2C.Runtime/include + .;../Generated/include;../Generated/src;../../../src/IL2C.Runtime/include false true true @@ -80,7 +80,7 @@ Console true true - ../../../IL2C.Runtime/lib/$(Configuration) + ../../../src/IL2C.Runtime/lib/$(Configuration) libil2c-msvc-win-$(Platform)-rts.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) /ignore:4217 %(AdditionalOptions) true @@ -96,7 +96,7 @@ - + diff --git a/samples/Calculator/Calculator/Calculator.csproj b/samples/Calculator/Calculator/Calculator.csproj new file mode 100644 index 00000000..d1959a21 --- /dev/null +++ b/samples/Calculator/Calculator/Calculator.csproj @@ -0,0 +1,48 @@ + + + + + + + + + + + net48;net6.0 + Exe + + Calculator + Calculator + + + + + + + + + + + + + + + + + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + + + diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props new file mode 100644 index 00000000..00df7dc6 --- /dev/null +++ b/samples/Directory.Build.props @@ -0,0 +1,12 @@ + + + + + + + false + portable + False + + + diff --git a/samples/GettingStartedIL2C/GettingStartedIL2C.sln b/samples/GettingStartedIL2C/GettingStartedIL2C.sln index 7dc73a69..cd656526 100644 --- a/samples/GettingStartedIL2C/GettingStartedIL2C.sln +++ b/samples/GettingStartedIL2C/GettingStartedIL2C.sln @@ -1,14 +1,13 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29411.108 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GettingStartedIL2C", "GettingStartedIL2C\GettingStartedIL2C.csproj", "{DA321962-5C65-4DD4-9224-B1A664431A75}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShowMessageBoxOnWindows", "ShowMessageBoxOnWindows\ShowMessageBoxOnWindows.csproj", "{9C9C2926-081A-4193-94A9-2FE8BD19772C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GettingStartedIL2CMain", "GettingStartedIL2CMain\GettingStartedIL2CMain.vcxproj", "{C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}" - ProjectSection(ProjectDependencies) = postProject - {DA321962-5C65-4DD4-9224-B1A664431A75} = {DA321962-5C65-4DD4-9224-B1A664431A75} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "HelloWorld\HelloWorld.csproj", "{849B0A98-1053-412A-96DC-08D299E9F56A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TakeAdvantageWithIL2CInvoke", "TakeAdvantageWithIL2CInvoke\TakeAdvantageWithIL2CInvoke.csproj", "{504A5EF3-5DA7-489D-BECD-CCACCF22244B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,30 +19,42 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA321962-5C65-4DD4-9224-B1A664431A75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Debug|x64.ActiveCfg = Debug|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Debug|x64.Build.0 = Debug|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Debug|x86.ActiveCfg = Debug|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Debug|x86.Build.0 = Debug|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Release|Any CPU.Build.0 = Release|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Release|x64.ActiveCfg = Release|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Release|x64.Build.0 = Release|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Release|x86.ActiveCfg = Release|Any CPU - {DA321962-5C65-4DD4-9224-B1A664431A75}.Release|x86.Build.0 = Release|Any CPU - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Debug|Any CPU.Build.0 = Debug|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Debug|x64.ActiveCfg = Debug|x64 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Debug|x64.Build.0 = Debug|x64 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Debug|x86.ActiveCfg = Debug|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Debug|x86.Build.0 = Debug|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Release|Any CPU.ActiveCfg = Release|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Release|Any CPU.Build.0 = Release|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Release|x64.ActiveCfg = Release|x64 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Release|x64.Build.0 = Release|x64 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Release|x86.ActiveCfg = Release|Win32 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB}.Release|x86.Build.0 = Release|Win32 + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Debug|x64.ActiveCfg = Debug|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Debug|x64.Build.0 = Debug|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Debug|x86.ActiveCfg = Debug|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Debug|x86.Build.0 = Debug|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Release|Any CPU.Build.0 = Release|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Release|x64.ActiveCfg = Release|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Release|x64.Build.0 = Release|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Release|x86.ActiveCfg = Release|Any CPU + {9C9C2926-081A-4193-94A9-2FE8BD19772C}.Release|x86.Build.0 = Release|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Debug|x64.ActiveCfg = Debug|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Debug|x64.Build.0 = Debug|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Debug|x86.ActiveCfg = Debug|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Debug|x86.Build.0 = Debug|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Release|Any CPU.Build.0 = Release|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Release|x64.ActiveCfg = Release|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Release|x64.Build.0 = Release|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Release|x86.ActiveCfg = Release|Any CPU + {849B0A98-1053-412A-96DC-08D299E9F56A}.Release|x86.Build.0 = Release|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Debug|x64.ActiveCfg = Debug|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Debug|x64.Build.0 = Debug|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Debug|x86.ActiveCfg = Debug|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Debug|x86.Build.0 = Debug|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Release|Any CPU.Build.0 = Release|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Release|x64.ActiveCfg = Release|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Release|x64.Build.0 = Release|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Release|x86.ActiveCfg = Release|Any CPU + {504A5EF3-5DA7-489D-BECD-CCACCF22244B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/samples/GettingStartedIL2C/GettingStartedIL2C/GettingStartedIL2C.csproj b/samples/GettingStartedIL2C/GettingStartedIL2C/GettingStartedIL2C.csproj deleted file mode 100644 index 13c92217..00000000 --- a/samples/GettingStartedIL2C/GettingStartedIL2C/GettingStartedIL2C.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp3.1 - - - - - - - diff --git a/samples/GettingStartedIL2C/GettingStartedIL2C/Program.cs b/samples/GettingStartedIL2C/GettingStartedIL2C/Program.cs deleted file mode 100644 index 91595c6f..00000000 --- a/samples/GettingStartedIL2C/GettingStartedIL2C/Program.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace GettingStartedIL2C -{ - public static class Program - { - [DllImport("user32.dll")] - public static extern int MessageBoxW( - IntPtr hWnd, string text, string caption, int options); - - public static void Main() - { - Console.WriteLine("Hello world with IL2C!"); - //MessageBoxW(IntPtr.Zero, "Hello world with IL2C!", "Getting started IL2C", 1); - } - } -} diff --git a/samples/GettingStartedIL2C/GettingStartedIL2CMain/GettingStartedIL2CMain.c b/samples/GettingStartedIL2C/GettingStartedIL2CMain/GettingStartedIL2CMain.c deleted file mode 100644 index b3457faa..00000000 --- a/samples/GettingStartedIL2C/GettingStartedIL2CMain/GettingStartedIL2CMain.c +++ /dev/null @@ -1,16 +0,0 @@ -// Referrer translated code. -#include - -int main() -{ - // Initialize the IL2C runtime. - il2c_initialize(); - - // Invoke (translated) the C# code. - GettingStartedIL2C_Program_Main(); - - // Shutdown the IL2C runtime. - il2c_shutdown(); - - return 0; -} diff --git a/samples/GettingStartedIL2C/GettingStartedIL2CMain/GettingStartedIL2CMain.vcxproj b/samples/GettingStartedIL2C/GettingStartedIL2CMain/GettingStartedIL2CMain.vcxproj deleted file mode 100644 index 07c00b5a..00000000 --- a/samples/GettingStartedIL2C/GettingStartedIL2CMain/GettingStartedIL2CMain.vcxproj +++ /dev/null @@ -1,183 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {C1B0FEDE-8761-4CD9-B5EE-E60D3ACBEAEB} - Win32Proj - GettingStartedIL2CMain - $(LatestTargetPlatformVersion) - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - - - Level3 - Disabled - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - $(ProjectDir)../../../IL2C.Runtime/include;$(ProjectDir)../../../IL2C.Runtime/src;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/include;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/src;%(AdditionalIncludeDirectories) - NotUsing - - - Console - true - - - - - - - Level3 - Disabled - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - $(ProjectDir)../../../IL2C.Runtime/include;$(ProjectDir)../../../IL2C.Runtime/src;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/include;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/src;%(AdditionalIncludeDirectories) - NotUsing - - - Console - true - - - - - - - Level3 - MaxSpeed - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - $(ProjectDir)../../../IL2C.Runtime/include;$(ProjectDir)../../../IL2C.Runtime/src;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/include;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/src;%(AdditionalIncludeDirectories) - NotUsing - - - Console - true - true - true - - - - - - - Level3 - MaxSpeed - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - $(ProjectDir)../../../IL2C.Runtime/include;$(ProjectDir)../../../IL2C.Runtime/src;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/include;$(ProjectDir)../GettingStartedIL2C/bin/$(Configuration)/netcoreapp3.1/IL2C/src;%(AdditionalIncludeDirectories) - NotUsing - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/GettingStartedIL2C/HelloWorld/HelloWorld.csproj b/samples/GettingStartedIL2C/HelloWorld/HelloWorld.csproj new file mode 100644 index 00000000..f39bbcef --- /dev/null +++ b/samples/GettingStartedIL2C/HelloWorld/HelloWorld.csproj @@ -0,0 +1,19 @@ + + + + Exe + net6.0 + + + -s + + + + + + + + + + + diff --git a/samples/GettingStartedIL2C/HelloWorld/Program.cs b/samples/GettingStartedIL2C/HelloWorld/Program.cs new file mode 100644 index 00000000..b6190ec6 --- /dev/null +++ b/samples/GettingStartedIL2C/HelloWorld/Program.cs @@ -0,0 +1,10 @@ +using System; + +namespace HelloWorld +{ + public static class Program + { + public static void Main() => + Console.WriteLine("Hello world with IL2C!"); + } +} diff --git a/samples/GettingStartedIL2C/ShowMessageBoxOnWindows/Program.cs b/samples/GettingStartedIL2C/ShowMessageBoxOnWindows/Program.cs new file mode 100644 index 00000000..74ce553b --- /dev/null +++ b/samples/GettingStartedIL2C/ShowMessageBoxOnWindows/Program.cs @@ -0,0 +1,29 @@ +using System; +using System.Runtime.InteropServices; + +namespace GettingStartedIL2C +{ + public static class Program + { + public enum MessageBoxOptions : uint + { + MB_OK = 0, + MB_OKCANCEL, + MB_ABORTRETRYIGNORE, + MB_YESNOCANCEL, + MB_YESNO, + MB_RETRYCANCEL, + MB_CANCELTRYCONTINUE, + } + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + public static extern int MessageBoxW( + IntPtr hWnd, string text, string caption, MessageBoxOptions options); + + public static int Main() => + MessageBoxW( + IntPtr.Zero, + "Hello world with IL2C!", "Getting started IL2C", + MessageBoxOptions.MB_YESNOCANCEL); + } +} diff --git a/samples/GettingStartedIL2C/ShowMessageBoxOnWindows/ShowMessageBoxOnWindows.csproj b/samples/GettingStartedIL2C/ShowMessageBoxOnWindows/ShowMessageBoxOnWindows.csproj new file mode 100644 index 00000000..06263acd --- /dev/null +++ b/samples/GettingStartedIL2C/ShowMessageBoxOnWindows/ShowMessageBoxOnWindows.csproj @@ -0,0 +1,21 @@ + + + + + WinExe + + net6.0 + + + -s + + + + + + + + + + + diff --git a/samples/GettingStartedIL2C/TakeAdvantageWithIL2CInvoke/Program.cs b/samples/GettingStartedIL2C/TakeAdvantageWithIL2CInvoke/Program.cs new file mode 100644 index 00000000..e0c888fe --- /dev/null +++ b/samples/GettingStartedIL2C/TakeAdvantageWithIL2CInvoke/Program.cs @@ -0,0 +1,55 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// It is intruduced what/how to do 'IL2C/Invoke'. +namespace TakeAdvantageWithIL2CInvoke +{ + // Refer tm struct type from pure C header file. + // IL2C/Invoke doesn't need to adjust any field offset/packing. + // Managed side declarations are pure stub. + [NativeType("time.h", SymbolName = "struct tm")] + internal struct tm + { + public int tm_sec; + public int tm_min; + public int tm_hour; + public int tm_mday; + public int tm_mon; + public int tm_year; + public int tm_wday; + public int tm_yday; + public int tm_isdst; + } + + public static class Program + { + // Refer mktime() API from pure C header file. + // extern "C" time_t mktime(struct tm*); + [NativeMethod("time.h")] + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern long mktime(in tm tmValue); + + public static void Main() + { + // 2022/10/23 12:34:56 + var tmValue = new tm + { + tm_year = 2022 - 1900, + tm_mon = 10 - 1, + tm_mday = 23, + tm_hour = 12, + tm_min = 34, + tm_sec = 56, + tm_wday = 0, + tm_yday = 0, + tm_isdst = 0, + }; + + var result = mktime(tmValue); + + // 1666496096 + Console.WriteLine(result); + } + } +} diff --git a/samples/GettingStartedIL2C/TakeAdvantageWithIL2CInvoke/TakeAdvantageWithIL2CInvoke.csproj b/samples/GettingStartedIL2C/TakeAdvantageWithIL2CInvoke/TakeAdvantageWithIL2CInvoke.csproj new file mode 100644 index 00000000..f7c702ce --- /dev/null +++ b/samples/GettingStartedIL2C/TakeAdvantageWithIL2CInvoke/TakeAdvantageWithIL2CInvoke.csproj @@ -0,0 +1,22 @@ + + + + Exe + net6.0 + + + -s + + + + + + + + + + + + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..575e46b6 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,46 @@ + + + + + + + true + true + true + + IL2C + IL2C + Copyright (c) Kouji Matsui + A translator implementation of .NET intermediate language to C language. + + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) + Apache-2.0 + https://github.com/kekyo/IL2C.git + IL2C.100.png + il2c;cil;msil;translate;transpile;aot;ecma335;c;c++;win32;uefi;wdm;multi-platform;systems-programming + .pdb + $(NoWarn);NU1605;NU1701;NU5105 + + + + portable + false + false + + + + embedded + true + true + + + + + + + + + + + diff --git a/src/IL2C.Build/IL2C.Build.csproj b/src/IL2C.Build/IL2C.Build.csproj new file mode 100644 index 00000000..28981309 --- /dev/null +++ b/src/IL2C.Build/IL2C.Build.csproj @@ -0,0 +1,29 @@ + + + + net462;netcoreapp2.1;netcoreapp2.2;netcoreapp3.1;net5.0;net6.0 + Exe + enable + + il2c + IL2C.Program + IL2C.Build.nuspec + true + false + + + + + + + + + + + + + + + + + diff --git a/src/IL2C.Build/IL2C.Build.nuspec b/src/IL2C.Build/IL2C.Build.nuspec new file mode 100644 index 00000000..da5ec109 --- /dev/null +++ b/src/IL2C.Build/IL2C.Build.nuspec @@ -0,0 +1,43 @@ + + + + + IL2C.Build + $PackageVersion$ + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) + false + Apache-2.0 + https://licenses.nuget.org/Apache-2.0 + IL2C.100.png + https://github.com/kekyo/IL2C.git + A translator implementation of .NET intermediate language to C language. + $PackageReleaseNotes$ + Copyright (c) Kouji Matsui + il2c cil msil translate transpile aot ecma335 c c++ win32 uefi wdm multi-platform systems-programming + + true + + + + + + + + + + + + + + + + diff --git a/src/IL2C.Build/Program.cs b/src/IL2C.Build/Program.cs new file mode 100644 index 00000000..eea28463 --- /dev/null +++ b/src/IL2C.Build/Program.cs @@ -0,0 +1,186 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +using Mono.Options; + +using IL2C.Drivers; +using IL2C.Metadata; + +#pragma warning disable CS0219 + +namespace IL2C +{ + // warning CS0649: Field is never assigned to, and will always have its default value `null' +#pragma warning disable 0649 + + public static class Program + { + private enum DrivingModes + { + Translation = 1, + Compilation = 2, + Both = 3, + } + + public static async Task Main(string[] args) + { + try + { + var drivingMode = DrivingModes.Both; + var debugInformationOptions = DebugInformationOptions.None; + var produceCpp = false; + var enableBundler = false; + var targetPlatform = TargetPlatforms.Generic; + var refDirs = new string[0]; + var outputNativeDirPath = default(string); + var nativeCompiler = default(string); + var nativeCompilerFlags = ""; + var nativeLinkingFlags = ""; + var nativeArchiver = default(string); + var outputNativeExecutableFileName = default(string); + var outputNativeArchiveFileName = default(string); + var additionalIncludeDirs = new string[0]; + var libraryPaths = new string[0]; + var mainTemplatePath = default(string); + var logLevel = LogLevels.Information; + var logtfm = default(string); + var launchDebugger = false; + var help = false; + + var options = new OptionSet() + { + { "mode=", "Driving mode [both|translation|compilation]", v => drivingMode = Enum.TryParse(v, true, out var dm) ? dm : DrivingModes.Both }, + { "debug=", "Emit debug informations [none|commentonly|full]", v => debugInformationOptions = Enum.TryParse(v, true, out var t) ? t : DebugInformationOptions.None }, + { "produceCpp=", "Produce C++ extension files (apply extension *.cpp instead *.c, body will not change)", v => produceCpp = bool.TryParse(v, out var pc) ? pc : false }, + { "bundler=", "Produce bundler source file", v => enableBundler = bool.TryParse(v, out var eb) ? eb : false }, + { "target=", "Target platform [generic|ue4]", v => targetPlatform = Enum.TryParse(v, true, out var tp) ? tp : TargetPlatforms.Generic }, + { "refDirs=", "Reference assembly paths (semi-colon separated)", v => refDirs = v.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) }, + { "compiler=", "Native compiler driver file", v => nativeCompiler = v }, + { "compilerFlags=", "Native compiler flags", v => nativeCompilerFlags = v }, + { "linkingFlags=", "Native compiler linking flags", v => nativeLinkingFlags = v }, + { "archiver=", "Native archiver file", v => nativeArchiver = v }, + { "includeDirs=", "Compilation additional include directory path", v => additionalIncludeDirs = v.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) }, + { "libs=", "Compilation library path", v => libraryPaths = v.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) }, + { "outputNativeArchive=", "Output native archive file name", v => outputNativeArchiveFileName = v }, + { "outputNativeExecutable=", "Output native executable file name", v => outputNativeExecutableFileName = v }, + { "outputNativeDir=", "Output native binary directory path", v => outputNativeDirPath = v }, + { "mainTemplate=", "Native main template path", v => mainTemplatePath = v }, + { "logLevel=", "Log level [debug|trace|information|warning|error|silent]", v => logLevel = Enum.TryParse(v, true, out var ll) ? ll : LogLevels.Information }, + { "logtfm=", "Log header tfm", v => logtfm = v }, + { "launchDebugger", "Launch debugger", _ => launchDebugger = true }, + { "h|help", "Print this help", _ => help = true }, + }; + + var extra = options.Parse(args); + if (help || (extra.Count < 2)) + { + Console.Out.WriteLine($"IL2C.Build [{ThisAssembly.AssemblyVersion}]"); + Console.Out.WriteLine(" A translator for ECMA-335 CIL/MSIL to C language."); + Console.Out.WriteLine(" Copyright (c) Kouji Matsui."); + Console.Out.WriteLine("usage: il2c.exe [options] "); + options.WriteOptionDescriptions(Console.Out); + } + else + { + var outputBaseDirPath = extra[0]; + var inputPaths = extra.Skip(1); + + using var logger = new TextWriterLogger( + logLevel, Console.Out, logtfm); + + logger.Information($"Started."); + + if (launchDebugger) + { + Debugger.Launch(); + } + + // TODO: refs, trace + + IMethodInformation? mainEntryPoint = null; + string inputCompilationDirPath; + if ((drivingMode & DrivingModes.Translation) == DrivingModes.Translation) + { + var translationOptions = new TranslationOptions( + true, enableBundler, targetPlatform, debugInformationOptions); +#if DEBUG + var results = new List(); + foreach (var assemblyPath in inputPaths) + { + var r = await SimpleTranslator.TranslateAsync( + logger, + outputBaseDirPath, + produceCpp, + translationOptions, + assemblyPath); + results.Add(r); + } +#else + var results = await Task.WhenAll( + inputPaths.Select(assemblyPath => + SimpleTranslator.TranslateAsync( + logger, + outputBaseDirPath, + produceCpp, + translationOptions, + assemblyPath).AsTask())). + ConfigureAwait(false); +#endif + mainEntryPoint = results.FirstOrDefault(); + inputCompilationDirPath = outputBaseDirPath; + } + else + { + inputCompilationDirPath = inputPaths.First(); + } + + if ((drivingMode & DrivingModes.Compilation) == DrivingModes.Compilation && + !string.IsNullOrWhiteSpace(nativeCompiler) && + !string.IsNullOrWhiteSpace(nativeArchiver) && + !string.IsNullOrWhiteSpace(outputNativeArchiveFileName)) + { + var toolchainOptions = new ToolchainOptions( + nativeCompiler!, nativeCompilerFlags, nativeLinkingFlags, nativeArchiver!, + additionalIncludeDirs, libraryPaths, mainTemplatePath); + var artifactPathOptions = new ArtifactPathOptions( + outputNativeArchiveFileName!, outputNativeExecutableFileName); + + await NativeBinaryBuilder.CompileToNativeAsync( + logger, + toolchainOptions, + artifactPathOptions, + mainEntryPoint, + inputCompilationDirPath, + string.IsNullOrWhiteSpace(outputNativeDirPath) ? + inputCompilationDirPath : outputNativeDirPath!); + } + } + + return 0; + } + catch (OptionException ex) + { + Console.Error.WriteLine(ex.Message); + return Marshal.GetHRForException(ex); + } + catch (Exception ex) + { + Console.Error.WriteLine(ex); + return Marshal.GetHRForException(ex); + } + } + } +} diff --git a/src/IL2C.Build/Properties/AssemblyInfo.cs b/src/IL2C.Build/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..77e346b8 --- /dev/null +++ b/src/IL2C.Build/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; diff --git a/src/IL2C.Build/Properties/launchSettings.json b/src/IL2C.Build/Properties/launchSettings.json new file mode 100644 index 00000000..9d9b118c --- /dev/null +++ b/src/IL2C.Build/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "IL2C": { + "commandName": "Project", + "commandLineArgs": "--debug=commentonly $(ProjectDir)../samples/Calculator/Generated $(ProjectDir)../samples/Calculator/Calculator.Core/bin/Debug/netstandard2.0/Calculator.Core.dll" + } + } +} \ No newline at end of file diff --git a/src/IL2C.Build/build/IL2C.Build.props b/src/IL2C.Build/build/IL2C.Build.props new file mode 100644 index 00000000..9bd9dc1c --- /dev/null +++ b/src/IL2C.Build/build/IL2C.Build.props @@ -0,0 +1,155 @@ + + + + + <_IL2C_RuntimeName>dotnet + <_IL2C_ExecutableName>il2c.dll + + + <_IL2C_RuntimeName> + <_IL2C_ExecutableName>il2c.exe + + + <_IL2C_RuntimeName>mono + <_IL2C_ExecutableName>il2c.exe + + + + <_IL2C_GCC_Compiler Condition="'$(OS)' == 'Windows_NT'">gcc.exe + <_IL2C_GCC_Compiler Condition="'$(OS)' != 'Windows_NT'">gcc + <_IL2C_GCC_DefaultFlags>-pipe -g -Wall -Werror -Wstrict-prototypes -Wno-unused + <_IL2C_GCC_DebugFlags>-D_DEBUG + <_IL2C_GCC_ReleaseFlags>-fdata-sections -ffunction-sections -Wl,--gc-sections -DNDEBUG + <_IL2C_GCC_DisableOptimizingFlags>-O0 + <_IL2C_GCC_EnableOptimizingFlags>-Ofast -fomit-frame-pointer -march=native -mtune=native + <_IL2C_GCC_Archiver Condition="'$(OS)' == 'Windows_NT'">ar.exe + <_IL2C_GCC_Archiver Condition="'$(OS)' != 'Windows_NT'">ar + <_IL2C_GCC_PosixRequiredFlags>-pthread + + + + $(MSBuildThisFileDirectory).. + $(Configuration) + $(IL2CConfiguration) + il2c + + + + + + + + + RoslynCodeTaskFactory + + + + + CodeTaskFactory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/IL2C.Build/build/IL2C.Build.targets b/src/IL2C.Build/build/IL2C.Build.targets new file mode 100644 index 00000000..6970eabc --- /dev/null +++ b/src/IL2C.Build/build/IL2C.Build.targets @@ -0,0 +1,178 @@ + + + + + + + + true + true + Full + false + false + Generic + Information + false + + + + + + + <_IL2C_PlatformName>$(MicrosoftNETBuildTasksTFM) + + + <_IL2C_PlatformName Condition="$(BundledNETCoreAppTargetFrameworkVersion) >= 5.0">net$(BundledNETCoreAppTargetFrameworkVersion) + <_IL2C_PlatformName Condition="$(BundledNETCoreAppTargetFrameworkVersion) < 5.0">netcoreapp$(BundledNETCoreAppTargetFrameworkVersion) + + + <_IL2C_PlatformName>netcoreapp2.0 + + + <_IL2C_PlatformName>net462 + + + + <_IL2C_ToolingDir>$([System.IO.Path]::Combine('$(IL2CBuildBaseDir)','tools','$(_IL2C_PlatformName)')) + + + + + + + + + + $(TargetFileName) + $([System.IO.Path]::Combine('$(ProjectDir)','$(OutputPath)','$(IL2CTargetAssemblyFileName)')) + $([System.String]::Concat('$(IL2CAssemblyPaths)',';','$(IL2CTargetAssemblyPath)').split(';')) + $(IL2CTargetAssemblyPath) + $([System.IO.Path]::Combine('$(ProjectDir)','$(OutputPath)','$(IL2COutputPath)')) + $(TargetName) + + + + + $(_IL2C_RuntimeName) + $([System.IO.Path]::GetFullPath('$(_IL2C_ToolingDir)')) + $([System.IO.Path]::Combine('$(IL2CBuildToolingDir)','$(_IL2C_ExecutableName)')) + + + + + + + + $(_IL2C_GCC_Compiler) + $(_IL2C_GCC_DefaultFlags) + $(_IL2C_GCC_DebugFlags) + $(_IL2C_GCC_ReleaseFlags) + $(_IL2C_GCC_DisableOptimizingFlags) + $(_IL2C_GCC_EnableOptimizingFlags) + $(_IL2C_GCC_PosixRequiredFlags) + + + $(_IL2C_GCC_Archiver) + + + + + <_IL2C_BuildLogOption>--logLevel=$(IL2CBuildLogLevel) --logtfm="$(TargetFramework)" + + + + + <_IL2C_NativeCompilerAllFlags>$(IL2CNativeCompilerDefaultFlags) $(IL2CNativeCompilerRequiredFlags) $(IL2CNativeCompilerConditionalFlags) $(IL2CNativeCompilerOptimizingFlags) $(IL2CNativeCompilerOptionalFlags) + + <_IL2C_CalculateContentHash Content="$(IL2CNativeCompiler) $(_IL2C_NativeCompilerAllFlags) $(_IL2C_NativeArchiverOption)"> + + + + <_IL2C_CandidateRuntimeLibraryBasePath>$([System.IO.Path]::Combine('$(_IL2C_RuntimeLibraryCacheBaseDirPath)','$(_IL2C_RuntimeLibraryBaseDirName)')) + <_IL2C_CandidateRuntimeLibraryPath>$([System.IO.Path]::Combine('$(_IL2C_CandidateRuntimeLibraryBasePath)','$(_IL2C_RuntimeLibraryCacheFileName)')) + $(_IL2C_CandidateRuntimeLibraryPath);$(IL2CNativeLibPath) + $(_IL2C_CandidateRuntimeLibraryPath) + + + + + <_IL2C_OutputNativeArchiveFileName>$(IL2COutputNativeName).a + <_IL2C_OutputNativeExecutableFileName Condition="('$(OutputType)' != 'Library') AND ('$(OS)' == 'Windows_NT')">$(IL2COutputNativeName).exe + <_IL2C_OutputNativeExecutableFileName Condition="('$(OutputType)' != 'Library') AND ('$(OS)' != 'Windows_NT')">$(IL2COutputNativeName) + + + + + <_IL2C_DrivingMode>both + <_IL2C_NativeCompilerOption>--compiler="$(IL2CNativeCompiler)" + <_IL2C_NativeCompilerFlagsOption>--compilerFlags="$(_IL2C_NativeCompilerAllFlags)" + <_IL2C_NativeLinkingFlagsOption Condition="'$(IL2CNativeLinkingFlags)' != ''">--linkingFlags="$(IL2CNativeLinkingFlags)" + <_IL2C_NativeArchiverOption>--archiver="$(IL2CNativeArchiver)" + <_IL2C_NativeIncludeDirOption>--includeDirs="$(IL2CNativeIncludeDir)" + <_IL2C_NativeLibPathOption>--libs="$(IL2CNativeLibPath)" + <_IL2C_OutputNativeArchiveFileNameOption>--outputNativeArchive="$(_IL2C_OutputNativeArchiveFileName)" + <_IL2C_OutputNativeExecutableFileNameOption Condition="'$(_IL2C_OutputNativeExecutableFileName)' != ''">--outputNativeExecutable="$(_IL2C_OutputNativeExecutableFileName)" + <_IL2C_NativeMainTemplatePathOption Condition="'$(OutputType)' != 'Library'">--mainTemplate="$(IL2CNativeMainTemplatePath)" + <_IL2C_LaunchDebuggerOption Condition="$(IL2CBuildLaunchDebugger)">--launchDebugger + <_IL2C_NativeOptions>$(_IL2C_NativeCompilerOption) $(_IL2C_NativeCompilerFlagsOption) $(_IL2C_NativeLinkingFlagsOption) $(_IL2C_NativeArchiverOption) $(_IL2C_NativeIncludeDirOption) $(_IL2C_NativeLibPathOption) $(_IL2C_OutputNativeArchiveFileNameOption) $(_IL2C_OutputNativeExecutableFileNameOption) $(_IL2C_NativeMainTemplatePathOption) $(_IL2C_LaunchDebuggerOption) + + + <_IL2C_DrivingMode>translation + + + + <_IL2C_GetCombinedReferencesBasePath References="@(ReferencePath)"> + + + + + + + + + + + + <_IL2C_TemporaryDirPathForRuntimeLibrary>$([System.IO.Path]::Combine('$(_IL2C_RuntimeLibraryCacheBaseDirPath)','$([System.Guid]::NewGuid().ToString())')) + <_IL2C_BuildRuntimeLibraryOptions>$(_IL2C_NativeCompilerOption) $(_IL2C_NativeCompilerFlagsOption) $(_IL2C_NativeArchiverOption) $(_IL2C_NativeIncludeDirOption) $(_IL2C_RaiseDebugBreakOption) --outputNativeArchive="$(_IL2C_RuntimeLibraryCacheFileName)" --outputNativeDir="$(_IL2C_TemporaryDirPathForRuntimeLibrary)" + + + + + <_IL2C_Build_MoveDirectory + From="$(_IL2C_TemporaryDirPathForRuntimeLibrary)" + To="$(_IL2C_CandidateRuntimeLibraryBasePath)" /> + + + + + + + + + + + + + + + + + + diff --git a/src/IL2C.Build/buildMultiTargeting/IL2C.Build.props b/src/IL2C.Build/buildMultiTargeting/IL2C.Build.props new file mode 100644 index 00000000..1cedb221 --- /dev/null +++ b/src/IL2C.Build/buildMultiTargeting/IL2C.Build.props @@ -0,0 +1,13 @@ + + + + diff --git a/src/IL2C.Build/buildMultiTargeting/IL2C.Build.targets b/src/IL2C.Build/buildMultiTargeting/IL2C.Build.targets new file mode 100644 index 00000000..d70eff5a --- /dev/null +++ b/src/IL2C.Build/buildMultiTargeting/IL2C.Build.targets @@ -0,0 +1,13 @@ + + + + diff --git a/IL2C.Core/AssemblyPreparer.cs b/src/IL2C.Core/AssemblyPreparer.cs similarity index 93% rename from IL2C.Core/AssemblyPreparer.cs rename to src/IL2C.Core/AssemblyPreparer.cs index 12389a6e..236ba0e4 100644 --- a/IL2C.Core/AssemblyPreparer.cs +++ b/src/IL2C.Core/AssemblyPreparer.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -59,7 +49,7 @@ private static IEnumerable DecodeAndEnumerateILBodies( } var code = decodeContext.CurrentCode; - if (Utilities.TryGetILConverter(code.OpCode, out var ilc) == false) + if (TypeUtilities.TryGetILConverter(code.OpCode, out var ilc) == false) { throw new InvalidProgramSequenceException( "Invalid opcode: Method={0}, OpCode={1}, Offset={2}", diff --git a/IL2C.Core/AssemblyWriter.cs b/src/IL2C.Core/AssemblyWriter.cs similarity index 79% rename from IL2C.Core/AssemblyWriter.cs rename to src/IL2C.Core/AssemblyWriter.cs index a92bcf51..0ef28919 100644 --- a/IL2C.Core/AssemblyWriter.cs +++ b/src/IL2C.Core/AssemblyWriter.cs @@ -1,26 +1,16 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable -using System; using System.Collections.Generic; -using IL2C.Metadata; using IL2C.Translators; using IL2C.Writers; diff --git a/IL2C.Core/CodeTextStorage.cs b/src/IL2C.Core/CodeTextStorage.cs similarity index 52% rename from IL2C.Core/CodeTextStorage.cs rename to src/IL2C.Core/CodeTextStorage.cs index f7b0bb2e..43b214e3 100644 --- a/IL2C.Core/CodeTextStorage.cs +++ b/src/IL2C.Core/CodeTextStorage.cs @@ -1,61 +1,53 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable -using IL2C.Internal; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using IL2C.Internal; + namespace IL2C { public class CodeTextStorage { - private readonly TextWriter logw; - private readonly string basePath; - private readonly bool enableCpp; + public readonly string BasePath; + + private readonly ILogger logger; + private readonly bool produceCpp; private readonly string indent; private readonly Stack scopeNames = new Stack(); - public CodeTextStorage(TextWriter logw, string basePath, bool enableCpp, string indent) + public CodeTextStorage(ILogger logger, string basePath, bool produceCpp, string indent) { - this.logw = logw; - this.basePath = basePath; - this.enableCpp = enableCpp; + this.logger = logger; + this.BasePath = Path.GetFullPath(basePath); + this.produceCpp = produceCpp; this.indent = indent; } public CodeTextWriter CreateTextWriter(string fileName, string ext) { var scopedPath = Path.Combine(scopeNames.Reverse().ToArray()); - var path = Path.Combine(basePath, scopedPath, fileName + ext); - var tw = this.OnCreateTextWriter(Path.GetFullPath(path)); - - logw.Write("IL2C: Writing: \"{0}\" ...", path); + var path = Path.Combine(this.BasePath, scopedPath, fileName + ext); + var tw = this.OnCreateTextWriter(path); - return new InternalCodeTextWriter(logw, tw, path, indent); + return new InternalCodeTextWriter(this.logger, tw, path, indent); } public CodeTextWriter CreateSourceCodeWriter(string fileName) { - return this.CreateTextWriter(fileName, enableCpp ? ".cpp" : ".c"); + return this.CreateTextWriter(fileName, produceCpp ? ".cpp" : ".c"); } public CodeTextWriter CreateHeaderWriter(string fileName) @@ -65,7 +57,7 @@ public CodeTextWriter CreateHeaderWriter(string fileName) protected virtual TextWriter OnCreateTextWriter(string path) { - var directoryPath = Path.GetDirectoryName(path); + var directoryPath = IOAccessor.SafeGetDirectoryName(path); try { if (!Directory.Exists(directoryPath)) @@ -83,34 +75,34 @@ protected virtual TextWriter OnCreateTextWriter(string path) public IDisposable EnterScope(string scopeName, bool splitScope = true) { - scopeNames.Push(splitScope ? Utilities.GetCLanguageScopedPath(scopeName) : scopeName); + scopeNames.Push(splitScope ? SymbolManipulator.GetCLanguageScopedPath(scopeName) : scopeName); return new ScopeDisposer(this); } private sealed class InternalCodeTextWriter : CodeTextWriter { - private TextWriter logw; + private ILogger? logger; - public InternalCodeTextWriter(TextWriter logw, TextWriter tw, string relatedPath, string indent) + public InternalCodeTextWriter(ILogger logger, TextWriter tw, string relatedPath, string indent) : base(tw, relatedPath, indent) { - this.logw = logw; + this.logger = logger; } public override void Dispose() { - if (logw != null) + if (this.logger != null) { base.Dispose(); - logw.WriteLine(" Done."); - logw = null; + this.logger.Trace($"Translated: \"{base.RelatedPath}\""); + this.logger = null; } } } private sealed class ScopeDisposer : IDisposable { - private CodeTextStorage parent; + private CodeTextStorage? parent; public ScopeDisposer(CodeTextStorage parent) { @@ -119,10 +111,10 @@ public ScopeDisposer(CodeTextStorage parent) public void Dispose() { - if (parent != null) + if (this.parent != null) { - parent.scopeNames.Pop(); - parent = null; + this.parent.scopeNames.Pop(); + this.parent = null; } } } diff --git a/IL2C.Core/CodeTextWriter.cs b/src/IL2C.Core/CodeTextWriter.cs similarity index 80% rename from IL2C.Core/CodeTextWriter.cs rename to src/IL2C.Core/CodeTextWriter.cs index e29dc12b..c3c64406 100644 --- a/IL2C.Core/CodeTextWriter.cs +++ b/src/IL2C.Core/CodeTextWriter.cs @@ -1,21 +1,13 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable using System; using System.Diagnostics; @@ -129,7 +121,7 @@ public static CodeTextWriter Create(Stream stream, string relatedPath, string in private sealed class Unshifter : IDisposable { - private CodeTextWriter parent; + private CodeTextWriter? parent; private int shiftCount; public Unshifter(CodeTextWriter parent, int shiftCount) @@ -140,11 +132,11 @@ public Unshifter(CodeTextWriter parent, int shiftCount) public void Dispose() { - if (parent != null) + if (this.parent != null) { - parent.UpdateIndent(shiftCount); - parent = null; - shiftCount = 0; + this.parent.UpdateIndent(shiftCount); + this.parent = null; + this.shiftCount = 0; } } } diff --git a/src/IL2C.Core/Drivers/NativeBinaryBuilder.cs b/src/IL2C.Core/Drivers/NativeBinaryBuilder.cs new file mode 100644 index 00000000..1eeea88e --- /dev/null +++ b/src/IL2C.Core/Drivers/NativeBinaryBuilder.cs @@ -0,0 +1,331 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using IL2C.Internal; +using IL2C.Metadata; + +namespace IL2C.Drivers +{ + public sealed class ToolchainOptions + { + public readonly string NativeCompiler; + public readonly string NativeCompilerFlags; + public readonly string NativeLinkingFlags; + public readonly string NativeArchiver; + public readonly string[] AdditionalIncludeDirs; + public readonly string[] LibraryPaths; + public readonly string? MainTemplatePath; + + public ToolchainOptions( + string nativeCompiler, + string nativeCompilerFlags, + string nativeLinkingFlags, + string nativeArchiver, + string[] additionalIncludeDirs, + string[] libraryPaths, + string? mainTemplatePath) + { + this.NativeCompiler = nativeCompiler; + this.NativeCompilerFlags = nativeCompilerFlags; + this.NativeLinkingFlags = nativeLinkingFlags; + this.NativeArchiver = nativeArchiver; + this.AdditionalIncludeDirs = additionalIncludeDirs; + this.LibraryPaths = libraryPaths; + this.MainTemplatePath = mainTemplatePath; + } + } + + public sealed class ArtifactPathOptions + { + public readonly string OutputNativeArchiveFileName; + public readonly string? OutputNativeExecutableFileName; + + public ArtifactPathOptions( + string outputNativeArchiveFileName, + string? outputNativeExecutableFileName) + { + this.OutputNativeExecutableFileName = outputNativeExecutableFileName; + this.OutputNativeArchiveFileName = outputNativeArchiveFileName; + } + } + + public static class NativeBinaryBuilder + { + private readonly struct CompilationResult + { + public readonly int ExitCode; + public readonly string Logs; + public readonly string OutputPath; + + public CompilationResult(int exitCode, string logs, string outputPath) + { + this.ExitCode = exitCode; + this.Logs = logs; + this.OutputPath = outputPath; + } + + public override string ToString() => + $"{this.ExitCode}: {this.Logs}"; + } + + private static async Task ExecuteCompilerAsync( + string sourceCodePath, + string outputStagingDirPath, + string outputFileName, + string[] nativeToolchainBasePaths, + string nativeCompiler, + string nativeCompilerFlags, + string includeDir, + string sourceDir, + bool isCompileOnly, + string? libraryPath, + string[] additionalIncludeDirs, + string[] additionalLibraryPaths) + { + var sourceCodeFileName = Path.GetFileNameWithoutExtension(sourceCodePath); + var outputBasePath = Path.Combine( + outputStagingDirPath, + IOAccessor.SafeGetDirectoryName(sourceCodePath.Substring(sourceDir.Length + 1))); + var outputPath = Path.Combine( + outputBasePath, + outputFileName); + var buildScriptPath = Path.Combine( + outputBasePath, + $"build_{sourceCodeFileName}"); + + await IOAccessor.SafeCreateDirectoryAsync( + outputBasePath, false). + ConfigureAwait(false); + + var result = await IOAccessor.ExecuteAsync( + outputBasePath, + buildScriptPath, + nativeToolchainBasePaths, + nativeCompiler, + new[] + { + nativeCompilerFlags, + isCompileOnly ? "-c" : "", + $"-I{IOAccessor.ToRelativePath(outputBasePath, includeDir)}", + $"-I{IOAccessor.ToRelativePath(outputBasePath, sourceDir)}", + }. + Concat(additionalIncludeDirs.Select(p => $"-I{IOAccessor.ToRelativePath(outputBasePath, p)}")). + Concat(new[] + { + "-o", IOAccessor.ToRelativePath(outputBasePath, outputPath), + IOAccessor.ToRelativePath(outputBasePath, sourceCodePath), + }). + Concat(libraryPath is { } lp ? new[] { IOAccessor.ToRelativePath(outputBasePath, lp) } : new string[0]). + Concat(additionalLibraryPaths.Select(p => IOAccessor.ToRelativePath(outputBasePath, p))). + ToArray()). + ConfigureAwait(false); + + return new CompilationResult(result.ExitCode, result.Logs, outputPath); + } + + private static ValueTask ExecuteArchiverAsync( + string[] objectPaths, + string outputPath, + string[] nativeCompilerBasePaths, + string nativeArchiver) + { + var outputBasePath = IOAccessor.SafeGetDirectoryName(outputPath); + var buildScriptPath = Path.Combine( + outputBasePath, + $"build_{Path.GetFileNameWithoutExtension(outputPath)}"); + + return IOAccessor.ExecuteAsync( + outputBasePath, + buildScriptPath, + nativeCompilerBasePaths, + nativeArchiver, + new[] + { + "rcs", + IOAccessor.ToRelativePath(outputBasePath, outputPath), + }. + Concat(objectPaths.Select(p => IOAccessor.ToRelativePath(outputBasePath, p))). + ToArray()); + } + + public static async ValueTask CompileToNativeAsync( + ILogger logger, + ToolchainOptions toolchainOptions, + ArtifactPathOptions artifactPathOptions, + IMethodInformation? mainEntryPoint, + string sourceCodeDirPath, + string outputDirPath) + { + var sourceCodeDirFullPath = Path.GetFullPath(sourceCodeDirPath); + var outputDirFullPath = Path.GetFullPath(outputDirPath); + var outputNativeArchiveFullPath = Path.GetFullPath( + Path.Combine( + outputDirFullPath, + artifactPathOptions.OutputNativeArchiveFileName)); + var nativeToolchainBasePath = IOAccessor.SafeGetDirectoryName( + toolchainOptions.NativeCompiler); + var nativeToolchainBasePaths = + string.IsNullOrWhiteSpace(nativeToolchainBasePath) ? + new string[0] : + new[] { Path.GetFullPath(nativeToolchainBasePath) }; + + logger.Information($"Preparing for compilation native binary: \"{sourceCodeDirFullPath}\" ..."); + + await IOAccessor.SafeCreateDirectoryAsync( + outputDirFullPath, outputDirFullPath != sourceCodeDirFullPath). + ConfigureAwait(false); + + var outputStagingBaseDirPath = Path.Combine(outputDirFullPath, "obj"); + await IOAccessor.SafeCreateDirectoryAsync( + outputStagingBaseDirPath, true). + ConfigureAwait(false); + + var includeDir = Path.Combine(sourceCodeDirFullPath, "include"); + var sourceDir = Path.Combine(sourceCodeDirFullPath, "src"); + var sourceCodePaths = + Directory.EnumerateFiles( + sourceDir, "*.*", SearchOption.AllDirectories). + Where(p => + Path.GetExtension(p) switch { ".c" => true, ".cpp" => true, _ => false, } && + !Path.GetFileNameWithoutExtension(p).EndsWith("_bundle")). // Except bundler + Select(p => Path.Combine(sourceCodeDirFullPath, p)). + ToArray(); + + ///////////////////////////////////////////////////////////// + // Compiling step: + + logger.Information($"Compiling native binary into \"{outputNativeArchiveFullPath}\" ..."); + + // Compile in small pieces: + // Because LTO (LTCG) is not always enable, it is better to subdivide object files + // to reduce the amount of code when linking. +#if DEBUG + var crs = new List(); + foreach (var sourceCodePath in sourceCodePaths) + { + logger.Trace($"Compiling source code: \"{sourceCodePath}\" ..."); + var r = await ExecuteCompilerAsync( + sourceCodePath, + outputStagingBaseDirPath, + Path.GetFileNameWithoutExtension(sourceCodePath) + ".o", + nativeToolchainBasePaths, + toolchainOptions.NativeCompiler, + toolchainOptions.NativeCompilerFlags, + includeDir, + sourceDir, + true, + null, + toolchainOptions.AdditionalIncludeDirs, + new string[0]). + ConfigureAwait(false); + crs.Add(r); + } +#else + var crs = await Task.WhenAll( + sourceCodePaths. + Select(sourceCodePath => + { + logger.Trace($"Compiling source code: \"{sourceCodePath}\" ..."); + return ExecuteCompilerAsync( + sourceCodePath, + outputStagingBaseDirPath, + Path.GetFileNameWithoutExtension(sourceCodePath) + ".o", + nativeToolchainBasePaths, + toolchainOptions.NativeCompiler, + toolchainOptions.NativeCompilerFlags, + includeDir, + sourceDir, + true, + null, + toolchainOptions.AdditionalIncludeDirs, + new string[0]); + })). + ConfigureAwait(false); +#endif + var cr = crs.FirstOrDefault(r => r.ExitCode != 0); + if (cr.ExitCode != 0) + { + throw new Exception($"{Path.GetFileName(toolchainOptions.NativeCompiler)}: {cr}"); + } + + var ar = await ExecuteArchiverAsync( + crs.Select(cr => cr.OutputPath).ToArray(), + outputNativeArchiveFullPath, + nativeToolchainBasePaths, + toolchainOptions.NativeArchiver). + ConfigureAwait(false); + + if (ar.ExitCode != 0) + { + throw new Exception($"{Path.GetFileName(toolchainOptions.NativeArchiver)}: {ar}"); + } + + ///////////////////////////////////////////////////////////// + // Linking step: + + if (artifactPathOptions.OutputNativeExecutableFileName is { } && + mainEntryPoint is { } && + toolchainOptions.MainTemplatePath is { }) + { + var outputNativeExecutableFullPath = Path.GetFullPath( + Path.Combine( + outputDirFullPath, + artifactPathOptions.OutputNativeExecutableFileName)); + + logger.Information($"Linking native binary \"{outputNativeExecutableFullPath}\""); + + var mainSourceCodePath = Path.Combine( + outputDirFullPath, + Path.GetFileNameWithoutExtension(outputNativeExecutableFullPath) + ".c"); + + var mainBody = new StringBuilder( + await IOAccessor.ReadAllTextAsync(toolchainOptions.MainTemplatePath, new UTF8Encoding(false, true)). + ConfigureAwait(false)); + + mainBody.Replace("{headerName}", mainEntryPoint.DeclaringModule.DeclaringAssembly.Name + ".h"); + mainBody.Replace("{mainIsVoid}", mainEntryPoint.ReturnType.IsVoidType ? "1" : "0"); + mainBody.Replace("{mainSymbol}", mainEntryPoint.CLanguageFunctionFullName); + + await IOAccessor.WriteAllTextAsync(mainSourceCodePath, mainBody.ToString(), new UTF8Encoding(false, true)). + ConfigureAwait(false); + + var crf = await ExecuteCompilerAsync( + mainSourceCodePath, + outputDirFullPath, + outputNativeExecutableFullPath, + nativeToolchainBasePaths, + toolchainOptions.NativeCompiler, + toolchainOptions.NativeCompilerFlags + " " + toolchainOptions.NativeLinkingFlags, + includeDir, + sourceDir, + false, + outputNativeArchiveFullPath, + toolchainOptions.AdditionalIncludeDirs, + toolchainOptions.LibraryPaths). + ConfigureAwait(false); + + if (crf.ExitCode != 0) + { + throw new Exception($"{Path.GetFileName(toolchainOptions.NativeCompiler)}: {crf}"); + } + + logger.Information($"Built native binary: \"{outputNativeExecutableFullPath}\" ..."); + } + } + } +} diff --git a/src/IL2C.Core/Drivers/SimpleTranslator.cs b/src/IL2C.Core/Drivers/SimpleTranslator.cs new file mode 100644 index 00000000..321f8ce0 --- /dev/null +++ b/src/IL2C.Core/Drivers/SimpleTranslator.cs @@ -0,0 +1,106 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System.IO; +using System.Threading.Tasks; + +using IL2C.Internal; +using IL2C.Metadata; + +namespace IL2C.Drivers +{ + public sealed class TranslationOptions + { + public readonly bool ReadSymbols; + public readonly bool EnableBundler; + public readonly TargetPlatforms TargetPlatform; + public readonly DebugInformationOptions DebugInformationOption; + + public TranslationOptions( + bool readSymbols, + bool enableBundler, + TargetPlatforms targetPlatform, + DebugInformationOptions debugInformationOption) + { + this.ReadSymbols = readSymbols; + this.EnableBundler = enableBundler; + this.TargetPlatform = targetPlatform; + this.DebugInformationOption = debugInformationOption; + } + } + + public static class SimpleTranslator + { + public static async ValueTask TranslateAsync( + ILogger logger, + CodeTextStorage storage, + TranslationOptions options, + string assemblyPath) + { + logger.Information($"Preparing assembly: \"{Path.GetFullPath(assemblyPath)}\" ..."); + + await IOAccessor.SafeCreateDirectoryAsync( + storage.BasePath, true). + ConfigureAwait(false); + + var translateContext = new TranslateContext( + assemblyPath, options.ReadSymbols, options.TargetPlatform); + var preparedFunctions = AssemblyPreparer.Prepare( + translateContext); + + logger.Information($"Translating assembly: \"{Path.GetFullPath(assemblyPath)}\" ..."); + + // TODO: Makes asynchronously operation. + + using (var _ = storage.EnterScope("include")) + { + AssemblyWriter.WriteHeader( + storage, + translateContext, + preparedFunctions); + } + + using (var _ = storage.EnterScope("src")) + { + AssemblyWriter.WriteSourceCode( + storage, + translateContext, + preparedFunctions, + options.EnableBundler, + options.DebugInformationOption); + } + + logger.Information($"Translated assembly: Stored into \"{Path.GetFullPath(storage.BasePath)}\""); + + return translateContext.MetadataContext.EntryPoint; + } + + public static ValueTask TranslateAsync( + ILogger logger, + string outputBaseDirPath, + bool produceCpp, + TranslationOptions options, + string assemblyPath) + { + var storage = new CodeTextStorage( + logger, + outputBaseDirPath, + produceCpp, + " "); + + return TranslateAsync( + logger, + storage, + options, + assemblyPath); + } + } +} diff --git a/src/IL2C.Core/IL2C.Core.csproj b/src/IL2C.Core/IL2C.Core.csproj new file mode 100644 index 00000000..539be241 --- /dev/null +++ b/src/IL2C.Core/IL2C.Core.csproj @@ -0,0 +1,20 @@ + + + + net462;net48;netstandard2.0;netstandard2.1;netcoreapp2.2;netcoreapp3.1;net5.0;net6.0 + Library + + IL2C.Core + + + + + + + + + + + + + diff --git a/IL2C.Core/ILConveters/ArithmeticalConverters.cs b/src/IL2C.Core/ILConveters/ArithmeticalConverters.cs similarity index 93% rename from IL2C.Core/ILConveters/ArithmeticalConverters.cs rename to src/IL2C.Core/ILConveters/ArithmeticalConverters.cs index 6010bd4e..8e40e9dd 100644 --- a/IL2C.Core/ILConveters/ArithmeticalConverters.cs +++ b/src/IL2C.Core/ILConveters/ArithmeticalConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/BoxConverters.cs b/src/IL2C.Core/ILConveters/BoxConverters.cs similarity index 87% rename from IL2C.Core/ILConveters/BoxConverters.cs rename to src/IL2C.Core/ILConveters/BoxConverters.cs index d40a9b01..e3cef4cc 100644 --- a/IL2C.Core/ILConveters/BoxConverters.cs +++ b/src/IL2C.Core/ILConveters/BoxConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/BranchConverters.cs b/src/IL2C.Core/ILConveters/BranchConverters.cs similarity index 92% rename from IL2C.Core/ILConveters/BranchConverters.cs rename to src/IL2C.Core/ILConveters/BranchConverters.cs index cb36384b..572780ec 100644 --- a/IL2C.Core/ILConveters/BranchConverters.cs +++ b/src/IL2C.Core/ILConveters/BranchConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/CallConverters.cs b/src/IL2C.Core/ILConveters/CallConverters.cs similarity index 94% rename from IL2C.Core/ILConveters/CallConverters.cs rename to src/IL2C.Core/ILConveters/CallConverters.cs index 6b780479..1d25cc0e 100644 --- a/IL2C.Core/ILConveters/CallConverters.cs +++ b/src/IL2C.Core/ILConveters/CallConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; @@ -213,13 +203,13 @@ public static ExpressionEmitter Prepare( return (extractContext, _) => { var parameters = pairParameters.Select(parameter => - new Utilities.RightExpressionGivenParameter( + new SymbolManipulator.RightExpressionGivenParameter( parameter.variable.TargetType, parameter.variable, string.Format(parameter.format, extractContext.GetSymbolName(parameter.variable)))). ToArray(); - var parameterString = Utilities.GetGivenParameterDeclaration( + var parameterString = SymbolManipulator.GetGivenParameterDeclaration( parameters, extractContext, codeInformation); @@ -267,13 +257,13 @@ public static ExpressionEmitter Prepare( string.Empty; var parameters = pairParameters.Select(parameter => - new Utilities.RightExpressionGivenParameter( + new SymbolManipulator.RightExpressionGivenParameter( parameter.type, parameter.variable, string.Format(parameter.format, extractContext.GetSymbolName(parameter.variable)))). ToArray(); - var parameterString = Utilities.GetGivenParameterDeclaration( + var parameterString = SymbolManipulator.GetGivenParameterDeclaration( parameters, extractContext, codeInformation); diff --git a/IL2C.Core/ILConveters/ConditionalConverters.cs b/src/IL2C.Core/ILConveters/ConditionalConverters.cs similarity index 89% rename from IL2C.Core/ILConveters/ConditionalConverters.cs rename to src/IL2C.Core/ILConveters/ConditionalConverters.cs index bdbe2abe..43f50673 100644 --- a/IL2C.Core/ILConveters/ConditionalConverters.cs +++ b/src/IL2C.Core/ILConveters/ConditionalConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/ConvConverters.cs b/src/IL2C.Core/ILConveters/ConvConverters.cs similarity index 95% rename from IL2C.Core/ILConveters/ConvConverters.cs rename to src/IL2C.Core/ILConveters/ConvConverters.cs index b8d6435d..a9535ade 100644 --- a/IL2C.Core/ILConveters/ConvConverters.cs +++ b/src/IL2C.Core/ILConveters/ConvConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/ILConverter.cs b/src/IL2C.Core/ILConveters/ILConverter.cs similarity index 68% rename from IL2C.Core/ILConveters/ILConverter.cs rename to src/IL2C.Core/ILConveters/ILConverter.cs index 90997909..498e27c9 100644 --- a/IL2C.Core/ILConveters/ILConverter.cs +++ b/src/IL2C.Core/ILConveters/ILConverter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/ILConveters/ILConverters.cs b/src/IL2C.Core/ILConveters/ILConverters.cs similarity index 95% rename from IL2C.Core/ILConveters/ILConverters.cs rename to src/IL2C.Core/ILConveters/ILConverters.cs index 83ae8ab7..5cf362f7 100644 --- a/IL2C.Core/ILConveters/ILConverters.cs +++ b/src/IL2C.Core/ILConveters/ILConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/ILConveters/LdargConverters.cs b/src/IL2C.Core/ILConveters/LdargConverters.cs similarity index 83% rename from IL2C.Core/ILConveters/LdargConverters.cs rename to src/IL2C.Core/ILConveters/LdargConverters.cs index 9c062584..6a53845d 100644 --- a/IL2C.Core/ILConveters/LdargConverters.cs +++ b/src/IL2C.Core/ILConveters/LdargConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/LdcConverters.cs b/src/IL2C.Core/ILConveters/LdcConverters.cs similarity index 88% rename from IL2C.Core/ILConveters/LdcConverters.cs rename to src/IL2C.Core/ILConveters/LdcConverters.cs index db5f480c..0c95eaa6 100644 --- a/IL2C.Core/ILConveters/LdcConverters.cs +++ b/src/IL2C.Core/ILConveters/LdcConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; @@ -37,7 +27,7 @@ public static ExpressionEmitter Prepare( return (extractContext, _) => new[] { string.Format( "{0} = {1}", extractContext.GetSymbolName(symbol), - Utilities.GetCLanguageExpression(value)) }; + SymbolManipulator.GetCLanguageExpression(value)) }; } public static ExpressionEmitter Prepare( diff --git a/IL2C.Core/ILConveters/LdelemConverters.cs b/src/IL2C.Core/ILConveters/LdelemConverters.cs similarity index 92% rename from IL2C.Core/ILConveters/LdelemConverters.cs rename to src/IL2C.Core/ILConveters/LdelemConverters.cs index 1a9195a8..c427c109 100644 --- a/IL2C.Core/ILConveters/LdelemConverters.cs +++ b/src/IL2C.Core/ILConveters/LdelemConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/LdfldConverters.cs b/src/IL2C.Core/ILConveters/LdfldConverters.cs similarity index 91% rename from IL2C.Core/ILConveters/LdfldConverters.cs rename to src/IL2C.Core/ILConveters/LdfldConverters.cs index 5939acb5..cd4bc848 100644 --- a/IL2C.Core/ILConveters/LdfldConverters.cs +++ b/src/IL2C.Core/ILConveters/LdfldConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/ILConveters/LdftnConverters.cs b/src/IL2C.Core/ILConveters/LdftnConverters.cs similarity index 85% rename from IL2C.Core/ILConveters/LdftnConverters.cs rename to src/IL2C.Core/ILConveters/LdftnConverters.cs index 505bd18f..51a366ec 100644 --- a/IL2C.Core/ILConveters/LdftnConverters.cs +++ b/src/IL2C.Core/ILConveters/LdftnConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Linq; diff --git a/IL2C.Core/ILConveters/LdindConverters.cs b/src/IL2C.Core/ILConveters/LdindConverters.cs similarity index 86% rename from IL2C.Core/ILConveters/LdindConverters.cs rename to src/IL2C.Core/ILConveters/LdindConverters.cs index 3a9a5d59..7046d1e7 100644 --- a/IL2C.Core/ILConveters/LdindConverters.cs +++ b/src/IL2C.Core/ILConveters/LdindConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/LdlenConverters.cs b/src/IL2C.Core/ILConveters/LdlenConverters.cs similarity index 66% rename from IL2C.Core/ILConveters/LdlenConverters.cs rename to src/IL2C.Core/ILConveters/LdlenConverters.cs index 695e51c3..009eda8d 100644 --- a/IL2C.Core/ILConveters/LdlenConverters.cs +++ b/src/IL2C.Core/ILConveters/LdlenConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/LdlocConverters.cs b/src/IL2C.Core/ILConveters/LdlocConverters.cs similarity index 84% rename from IL2C.Core/ILConveters/LdlocConverters.cs rename to src/IL2C.Core/ILConveters/LdlocConverters.cs index 3a4c56c4..f4cbd5b5 100644 --- a/IL2C.Core/ILConveters/LdlocConverters.cs +++ b/src/IL2C.Core/ILConveters/LdlocConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/LdtokenConverters.cs b/src/IL2C.Core/ILConveters/LdtokenConverters.cs similarity index 78% rename from IL2C.Core/ILConveters/LdtokenConverters.cs rename to src/IL2C.Core/ILConveters/LdtokenConverters.cs index 03e2fbe4..7df43723 100644 --- a/IL2C.Core/ILConveters/LdtokenConverters.cs +++ b/src/IL2C.Core/ILConveters/LdtokenConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/LogicalConverters.cs b/src/IL2C.Core/ILConveters/LogicalConverters.cs similarity index 86% rename from IL2C.Core/ILConveters/LogicalConverters.cs rename to src/IL2C.Core/ILConveters/LogicalConverters.cs index 76231fc2..a0d19f5b 100644 --- a/IL2C.Core/ILConveters/LogicalConverters.cs +++ b/src/IL2C.Core/ILConveters/LogicalConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/NewConverters.cs b/src/IL2C.Core/ILConveters/NewConverters.cs similarity index 89% rename from IL2C.Core/ILConveters/NewConverters.cs rename to src/IL2C.Core/ILConveters/NewConverters.cs index efe5a1e4..dbfd4b68 100644 --- a/IL2C.Core/ILConveters/NewConverters.cs +++ b/src/IL2C.Core/ILConveters/NewConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -86,13 +76,13 @@ public override ExpressionEmitter Prepare( var type = ctor.DeclaringType; ILocalVariableInformation thisSymbol = null; - var pairParameters = new LinkedList(); + var pairParameters = new LinkedList(); foreach (var parameter in ctor.Parameters.Reverse()) { // Except this parameter if (pairParameters.Count < (ctor.Parameters.Length) - 1) { - pairParameters.AddFirst(new Utilities.RightExpressionGivenParameter( + pairParameters.AddFirst(new SymbolManipulator.RightExpressionGivenParameter( parameter.TargetType, decodeContext.PopStack())); } @@ -104,7 +94,7 @@ public override ExpressionEmitter Prepare( // Instance from get_uninitialized_object thisSymbol = decodeContext.PushStack(type, ctor); - pairParameters.AddFirst(new Utilities.RightExpressionGivenParameter( + pairParameters.AddFirst(new SymbolManipulator.RightExpressionGivenParameter( type, thisSymbol)); } @@ -141,7 +131,7 @@ public override ExpressionEmitter Prepare( return (extractContext, _) => { - var parameterString = Utilities.GetGivenParameterDeclaration( + var parameterString = SymbolManipulator.GetGivenParameterDeclaration( pairParameters.Skip(1).ToArray(), extractContext, codeInformation); return new[] @@ -178,7 +168,7 @@ public override ExpressionEmitter Prepare( return (extractContext, _) => { - var parameterString = Utilities.GetGivenParameterDeclaration( + var parameterString = SymbolManipulator.GetGivenParameterDeclaration( pairParameters.Skip(1).ToArray(), extractContext, codeInformation); return new[] @@ -196,7 +186,7 @@ public override ExpressionEmitter Prepare( return (extractContext, _) => { - var parameterString = Utilities.GetGivenParameterDeclaration( + var parameterString = SymbolManipulator.GetGivenParameterDeclaration( pairParameters.ToArray(), extractContext, codeInformation); // newobj opcode can handle value type with parameter applied constructor. diff --git a/IL2C.Core/ILConveters/OperandTypeConverters.cs b/src/IL2C.Core/ILConveters/OperandTypeConverters.cs similarity index 74% rename from IL2C.Core/ILConveters/OperandTypeConverters.cs rename to src/IL2C.Core/ILConveters/OperandTypeConverters.cs index 171d44e9..105932c9 100644 --- a/IL2C.Core/ILConveters/OperandTypeConverters.cs +++ b/src/IL2C.Core/ILConveters/OperandTypeConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/ILConveters/PrefixConverters.cs b/src/IL2C.Core/ILConveters/PrefixConverters.cs similarity index 50% rename from IL2C.Core/ILConveters/PrefixConverters.cs rename to src/IL2C.Core/ILConveters/PrefixConverters.cs index 50242c76..c7bf8517 100644 --- a/IL2C.Core/ILConveters/PrefixConverters.cs +++ b/src/IL2C.Core/ILConveters/PrefixConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/ILConveters/StelemConverters.cs b/src/IL2C.Core/ILConveters/StelemConverters.cs similarity index 91% rename from IL2C.Core/ILConveters/StelemConverters.cs rename to src/IL2C.Core/ILConveters/StelemConverters.cs index de9142cb..8d6721e8 100644 --- a/IL2C.Core/ILConveters/StelemConverters.cs +++ b/src/IL2C.Core/ILConveters/StelemConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/StfldConverters.cs b/src/IL2C.Core/ILConveters/StfldConverters.cs similarity index 89% rename from IL2C.Core/ILConveters/StfldConverters.cs rename to src/IL2C.Core/ILConveters/StfldConverters.cs index dfe39b5c..88a00bf3 100644 --- a/IL2C.Core/ILConveters/StfldConverters.cs +++ b/src/IL2C.Core/ILConveters/StfldConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/ILConveters/StindConverters.cs b/src/IL2C.Core/ILConveters/StindConverters.cs similarity index 82% rename from IL2C.Core/ILConveters/StindConverters.cs rename to src/IL2C.Core/ILConveters/StindConverters.cs index 6ebba82e..f3863073 100644 --- a/IL2C.Core/ILConveters/StindConverters.cs +++ b/src/IL2C.Core/ILConveters/StindConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/ILConveters/StlocConverters.cs b/src/IL2C.Core/ILConveters/StlocConverters.cs similarity index 84% rename from IL2C.Core/ILConveters/StlocConverters.cs rename to src/IL2C.Core/ILConveters/StlocConverters.cs index 41fa7f3d..5618422e 100644 --- a/IL2C.Core/ILConveters/StlocConverters.cs +++ b/src/IL2C.Core/ILConveters/StlocConverters.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/src/IL2C.Core/ILogger.cs b/src/IL2C.Core/ILogger.cs new file mode 100644 index 00000000..f5b497f1 --- /dev/null +++ b/src/IL2C.Core/ILogger.cs @@ -0,0 +1,154 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System; +using System.ComponentModel; +using System.IO; +using System.Threading.Tasks; + +namespace IL2C +{ + public enum LogLevels + { + Debug = 1, + Trace, + Information, + Warning, + Error, + Silent = 100, + } + + public interface ILogger + { + ValueTask OutputLogAsync( + LogLevels logLevel, FormattableString? message, Exception? ex); + } + + public static class LoggerExtension + { + public static void Debug(this ILogger logger, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Debug, message, null); + + public static void Trace(this ILogger logger, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Trace, message, null); + + public static void Information(this ILogger logger, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Information, message, null); + + public static void Warning(this ILogger logger, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Warning, message, null); + public static void Warning(this ILogger logger, Exception ex) => + _ = logger.OutputLogAsync(LogLevels.Warning, null, ex); + public static void Warning(this ILogger logger, Exception ex, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Warning, message, ex); + + public static void Error(this ILogger logger, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Error, message, null); + public static void Error(this ILogger logger, Exception ex) => + _ = logger.OutputLogAsync(LogLevels.Error, null, ex); + public static void Error(this ILogger logger, Exception ex, FormattableString message) => + _ = logger.OutputLogAsync(LogLevels.Error, message, ex); + + //////////////////////////////////////////////// + + public static ValueTask DebugAsync(this ILogger logger, FormattableString message) => + logger.OutputLogAsync(LogLevels.Debug, message, null); + + public static ValueTask TraceAsync(this ILogger logger, FormattableString message) => + logger.OutputLogAsync(LogLevels.Trace, message, null); + + public static ValueTask InformationAsync(this ILogger logger, FormattableString message) => + logger.OutputLogAsync(LogLevels.Information, message, null); + + public static ValueTask WarningAsync(this ILogger logger, FormattableString message) => + logger.OutputLogAsync(LogLevels.Warning, message, null); + public static ValueTask WarningAsync(this ILogger logger, Exception ex) => + logger.OutputLogAsync(LogLevels.Warning, null, ex); + public static ValueTask WarningAsync(this ILogger logger, Exception ex, FormattableString message) => + logger.OutputLogAsync(LogLevels.Warning, message, ex); + + public static ValueTask ErrorAsync(this ILogger logger, FormattableString message) => + logger.OutputLogAsync(LogLevels.Error, message, null); + public static ValueTask ErrorAsync(this ILogger logger, Exception ex) => + logger.OutputLogAsync(LogLevels.Error, null, ex); + public static ValueTask ErrorAsync(this ILogger logger, Exception ex, FormattableString message) => + logger.OutputLogAsync(LogLevels.Error, message, ex); + } + + public abstract class LoggerBase : ILogger + { + public readonly LogLevels BaseLevel; + + protected LoggerBase(LogLevels baseLevel) => + this.BaseLevel = baseLevel; + + public async ValueTask OutputLogAsync( + LogLevels logLevel, FormattableString? message, Exception? ex) + { + if (logLevel >= this.BaseLevel) + { + await this.OnOutputLogAsync(logLevel, message, ex). + ConfigureAwait(false); + } + } + + protected virtual string? ToString( + string? header, LogLevels logLevel, FormattableString? message, Exception? ex) + { + static string GetHeaderString(string? header) => + header is { } ? $",{header}" : ""; + static string GetLogLevelString(LogLevels logLevel) => + logLevel != LogLevels.Information ? $" {logLevel}:" : ""; + + switch (message, ex) + { + case ({ }, { }): + return $"IL2C [{ThisAssembly.AssemblyVersion}]{GetHeaderString(header)}:{GetLogLevelString(logLevel)} {message}, {ex}"; + case ({ }, null): + return $"IL2C [{ThisAssembly.AssemblyVersion}]{GetHeaderString(header)}:{GetLogLevelString(logLevel)} {message}"; + case (null, { }): + return $"IL2C [{ThisAssembly.AssemblyVersion}]{GetHeaderString(header)}:{GetLogLevelString(logLevel)} {ex}"; + default: + return null; + } + } + + protected abstract ValueTask OnOutputLogAsync( + LogLevels logLevel, FormattableString? message, Exception? ex); + } + + public sealed class TextWriterLogger : LoggerBase, IDisposable + { + public readonly TextWriter Writer; + + private readonly string? header; + + public TextWriterLogger(LogLevels baseLevel, TextWriter tw, string? header = null) : + base(baseLevel) + { + this.Writer = tw; + this.header = header; + } + + public void Dispose() => + this.Writer.Flush(); + + protected override async ValueTask OnOutputLogAsync( + LogLevels logLevel, FormattableString? message, Exception? ex) + { + if (base.ToString(this.header, logLevel, message, ex) is { } formatted) + { + await this.Writer.WriteLineAsync(formatted). + ConfigureAwait(false); + } + } + } +} diff --git a/IL2C.Core/Internal/EndiannessBinaryReader.cs b/src/IL2C.Core/Internal/EndiannessBinaryReader.cs similarity index 86% rename from IL2C.Core/Internal/EndiannessBinaryReader.cs rename to src/IL2C.Core/Internal/EndiannessBinaryReader.cs index b540169c..b9aa910f 100644 --- a/IL2C.Core/Internal/EndiannessBinaryReader.cs +++ b/src/IL2C.Core/Internal/EndiannessBinaryReader.cs @@ -1,21 +1,13 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable using System; using System.IO; diff --git a/src/IL2C.Core/Internal/ICombinedComparer.cs b/src/IL2C.Core/Internal/ICombinedComparer.cs new file mode 100644 index 00000000..5fe5ca97 --- /dev/null +++ b/src/IL2C.Core/Internal/ICombinedComparer.cs @@ -0,0 +1,20 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System.Collections.Generic; + +namespace IL2C.Internal +{ + internal interface ICombinedComparer + : IEqualityComparer, IComparer + { + } +} diff --git a/src/IL2C.Core/Internal/IOAccessor.cs b/src/IL2C.Core/Internal/IOAccessor.cs new file mode 100644 index 00000000..d1f3fd77 --- /dev/null +++ b/src/IL2C.Core/Internal/IOAccessor.cs @@ -0,0 +1,175 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Threading.Tasks; + +namespace IL2C.Internal +{ + internal readonly struct ExecuteResult + { + public readonly int ExitCode; + public readonly string Logs; + + public ExecuteResult(int exitCode, string logs) + { + this.ExitCode = exitCode; + this.Logs = logs; + } + + public override string ToString() => + $"{this.ExitCode}: {this.Logs}"; + } + + internal static class IOAccessor + { + public static string ToRelativePath(string baseDirPath, string path) + { + var length = baseDirPath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? + baseDirPath.Length : baseDirPath.Length + 1; + var candidate = path.StartsWith(baseDirPath) ? + path.Substring(length) : path; + return candidate.Length >= 1 ? candidate : "."; + } + + public static string SafeGetDirectoryName(string path) => + Path.GetDirectoryName(path) ?? "."; + + public static ValueTask SafeCreateDirectoryAsync(string path, bool clean) => + new ValueTask(Task.Run(() => + { + if (clean) + { + try + { + Directory.Delete(path, true); + } + catch + { + } + } + if (!Directory.Exists(path)) + { + try + { + Directory.CreateDirectory(path); + } + catch + { + } + } + })); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static ValueTask ReadAllTextAsync(string path, Encoding encoding) => + new ValueTask(File.ReadAllTextAsync(path, encoding)); + public static ValueTask WriteAllTextAsync(string path, string contents, Encoding encoding) => + new ValueTask(File.WriteAllTextAsync(path, contents, encoding)); +#else + public static ValueTask ReadAllTextAsync(string path, Encoding encoding) => + new ValueTask(Task.Run(() => File.ReadAllText(path, encoding))); + public static ValueTask WriteAllTextAsync(string path, string contents, Encoding encoding) => + new ValueTask(Task.Run(() => File.WriteAllText(path, contents, encoding))); +#endif + + public static async ValueTask ExecuteAsync( + string workingPath, string scriptName, string[] searchPaths, + string executablePath, string[] args) + { + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + await WriteAllTextAsync( + Path.Combine(workingPath, scriptName + ".bat"), + string.Join(Environment.NewLine, new[] + { + "@echo off", + string.Empty, + "rem IL2C: It is a pseudo script.", + string.Empty, + searchPaths.Length >= 1 ? + $"set PATH={string.Join(";",searchPaths)};%PATH%" : + "rem set PATH=;%PATH%", + string.Empty, + $"\"{executablePath}\" {string.Join(" ", args)}", + string.Empty, + }), + new UTF8Encoding(false, true)). + ConfigureAwait(false); + } + else + { + await WriteAllTextAsync( + Path.Combine(workingPath, scriptName + ".sh"), + string.Join(Environment.NewLine, new[] + { + "#!/bin/sh", + string.Empty, + "# IL2C: It is a pseudo script.", + string.Empty, + searchPaths.Length >= 1 ? + $"export PATH=\"{string.Join(":",searchPaths)}:$PATH\"" : + "#export PATH=\":$PATH\"", + string.Empty, + $"\"{executablePath}\" {string.Join(" ", args)}", + string.Empty, + }), + new UTF8Encoding(false, true)). + ConfigureAwait(false); + } + + using (var p = new Process()) + { + p.StartInfo.FileName = executablePath; + p.StartInfo.Arguments = string.Join(" ", args); + p.StartInfo.UseShellExecute = false; + p.StartInfo.CreateNoWindow = true; + p.StartInfo.ErrorDialog = false; + p.StartInfo.WorkingDirectory = workingPath; + +#if NET46_OR_GREATER || NETSTANDARD || NETCOREAPP + var pathEnv = p.StartInfo.Environment["PATH"]; + p.StartInfo.Environment["PATH"] = string.Join(";", searchPaths) + ";" + pathEnv; +#else + var pathEnv = p.StartInfo.EnvironmentVariables["PATH"]; + p.StartInfo.EnvironmentVariables["PATH"] = string.Join(";", searchPaths) + ";" + pathEnv; +#endif + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardError = true; + + var sb = new StringBuilder(); + p.OutputDataReceived += (sender, e) => { if (e.Data != null) lock (sb) sb.AppendLine(e.Data); }; + p.ErrorDataReceived += (sender, e) => { if (e.Data != null) lock (sb) sb.AppendLine(e.Data); }; + + var tcs = new TaskCompletionSource(); + p.Exited += (sender, e) => tcs.SetResult(p.ExitCode); + p.EnableRaisingEvents = true; + + p.Start(); + + p.BeginOutputReadLine(); + p.BeginErrorReadLine(); + + var exitCode = await tcs.Task. + ConfigureAwait(false); + + p.WaitForExit(); + + p.CancelOutputRead(); + p.CancelErrorRead(); + + return new ExecuteResult(exitCode, sb.ToString()); + } + } + } +} diff --git a/IL2C.Core/Internal/Utilities.cs b/src/IL2C.Core/Internal/SymbolManipulator.cs similarity index 64% rename from IL2C.Core/Internal/Utilities.cs rename to src/IL2C.Core/Internal/SymbolManipulator.cs index 99c0f71d..d48a0238 100644 --- a/IL2C.Core/Internal/Utilities.cs +++ b/src/IL2C.Core/Internal/SymbolManipulator.cs @@ -1,41 +1,29 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; -using System.IO; using System.Linq; using System.Reflection; using System.Text; -using Mono.Cecil.Cil; - -using IL2C.ILConverters; -using IL2C.Translators; using IL2C.Metadata; +using IL2C.Translators; namespace IL2C.Internal { - internal static class Utilities + internal static class SymbolManipulator { private static readonly string intMinValueExpression = string.Format("{0} - 1", int.MinValue + 1); private static readonly string longMinValueExpression = string.Format("{0}LL - 1LL", long.MinValue + 1); @@ -44,22 +32,6 @@ internal static class Utilities '.', ',', '@', '+', '-', '*', '/', '^', '\\', '#', '%', '&', '$', '?', '!', '=', '~', '|', '(', ')', '<', '>', '[', ']', '{', '}', '\'', '"', '`', ';', ':', ' ' }; - private static readonly Dictionary ilConverters; - - static Utilities() - { - ilConverters = typeof(ILConverter). - GetTypeInfo(). - Assembly. - DefinedTypes. - Where(type => type.IsSealed && typeof(ILConverter).GetTypeInfo().IsAssignableFrom(type)). - Select(type => (ILConverter)Activator.CreateInstance(type.AsType())). - ToDictionary(ilc => ilc.OpCode); - } - - public static bool TryGetILConverter(OpCode opCode, out ILConverter ilc) => - ilConverters.TryGetValue(opCode, out ilc); - public static string GetMangledName(string name) { var sb = new StringBuilder(name); @@ -77,7 +49,7 @@ public static string GetCLanguageScopedPath(params string[] scopeNames) => GetCLanguageScopedPath((IEnumerable)scopeNames); public static string GetCLanguageTypeName( - Type type, string symbolName = null, bool cArrayExpression = false) + Type type, string? symbolName = null, bool cArrayExpression = false) { var sn = (symbolName != null) ? (" " + symbolName) : string.Empty; @@ -85,7 +57,7 @@ public static string GetCLanguageTypeName( { return string.Format( "{0}*{1}", - GetCLanguageTypeName(type.GetElementType()), + GetCLanguageTypeName(type.GetElementType()!), sn); } @@ -95,19 +67,19 @@ public static string GetCLanguageTypeName( { return string.Format( "{0}{1}[]", - GetCLanguageTypeName(type.GetElementType(), null, true), + GetCLanguageTypeName(type.GetElementType()!, null, true), sn); } else { return string.Format( "{0}*{1}", - GetCLanguageTypeName(type.GetElementType(), null, true), + GetCLanguageTypeName(type.GetElementType()!, null, true), sn); } } - string typeName = null; + string typeName; if (type == typeof(bool)) { typeName = "bool"; @@ -174,20 +146,18 @@ public static string GetCLanguageTypeName( } else { - typeName = GetMangledName(type.FullName); + typeName = GetMangledName(type.FullName!); if (!type.IsValueType) { typeName += "*"; } } - Debug.Assert(typeName != null); - return typeName + sn; } #region GetCLanguageSizeOf - private static string InternalGetCLanguageSizeOfExpression(Type type) + private static string? InternalGetCLanguageSizeOfExpression(Type type) { if (type.IsEnum) { @@ -412,15 +382,15 @@ public static string GetCLanguageExpression(UIntPtr value) => public static string GetCLanguageExpression(Enum value) => Enum.IsDefined(value.GetType(), value) ? string.Format("{0}_{1}", - GetMangledName(value.GetType().FullName), + GetMangledName(value.GetType().FullName!), value) : string.Format("({0}){1}", - GetMangledName(value.GetType().FullName), + GetMangledName(value.GetType().FullName!), GetCLanguageExpression( value.GetType(). GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly). First(). - GetValue(value))); + GetValue(value)!)); public static string GetCLanguageExpression(Array arr) { @@ -447,7 +417,7 @@ public static string GetCLanguageExpression(object value) if (value is string) return GetCLanguageExpression((string)value); if (value is Enum) return GetCLanguageExpression((Enum)value); if (value is Array) return GetCLanguageExpression((Array)value); - return value.ToString(); + return value.ToString() ?? "NULL"; } #endregion @@ -459,107 +429,11 @@ public static string GetCSharpLanguageExpression(object value) if (value is char) return string.Format("'{0}'", value); if (value is Array) return string.Format( "{0}[{1}]", - value.GetType().GetElementType().Name, + value.GetType().GetElementType()!.Name, string.Join( ", ", ((IEnumerable)value).RuntimeCast().Select(GetCSharpLanguageExpression))); - return value.ToString(); - } - - public static Array ResourceDataToSpecificArray(byte[] values, Type elementType) - { - if (elementType == typeof(byte)) - { - return values; - } - - var ms = new MemoryStream(values); - var br = new EndiannessBinaryReader(ms, EndianSpecific.Little, Encoding.Unicode); - var temp = new ArrayList(); - - if (elementType == typeof(sbyte)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadSByte()); - } - } - else if (elementType == typeof(short)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadInt16()); - } - } - else if (elementType == typeof(int)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadInt32()); - } - } - else if (elementType == typeof(long)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadInt64()); - } - } - else if (elementType == typeof(ushort)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadUInt16()); - } - } - else if (elementType == typeof(uint)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadUInt32()); - } - } - else if (elementType == typeof(ulong)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadUInt64()); - } - } - else if (elementType == typeof(float)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadSingle()); - } - } - else if (elementType == typeof(double)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadDouble()); - } - } - else if (elementType == typeof(char)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadChar()); - } - } - else if (elementType == typeof(bool)) - { - while (!br.IsEOF) - { - temp.Add(br.ReadBoolean()); - } - } - else - { - Debug.Fail("Cannot convert"); - } - - return temp.ToArray(elementType); + return value.ToString() ?? "null"; } #region GetGivenParameterDeclaration @@ -567,10 +441,10 @@ public struct RightExpressionGivenParameter { public readonly ITypeInformation TargetType; public readonly IVariableInformation SymbolInformation; - public readonly string Expression; + public readonly string? Expression; public RightExpressionGivenParameter( - ITypeInformation targetType, IVariableInformation symbolinformation, string expression = null) + ITypeInformation targetType, IVariableInformation symbolinformation, string? expression = null) { this.TargetType = targetType; this.SymbolInformation = symbolinformation; @@ -609,166 +483,5 @@ public static string GetGivenParameterDeclaration( })); } #endregion - - #region Linq - public static IEnumerable RuntimeCast(this IEnumerable enumerable) - { - foreach (object value in enumerable) - { - yield return (T)value; - } - } - - public static IEnumerable Traverse(this T first, Func next, bool invokeNextFirst = false) - where T : class - { - T current = first; - if (invokeNextFirst) - { - if (current != null) - { - while (true) - { - current = next(current); - if (current == null) - { - break; - } - yield return current; - } - } - } - else - { - while (current != null) - { - yield return current; - current = next(current); - } - } - } - - public static IEnumerable Distinct( - this IEnumerable enumerable, - Func keySelector) - { - var took = new HashSet(); - foreach (var value in enumerable) - { - if (took.Add(keySelector(value))) - { - yield return value; - } - } - } - - private sealed class DistinctEqualityComparer : IEqualityComparer - { - private readonly Func getHashCode; - private readonly Func equals; - - public DistinctEqualityComparer( - Func getHashCode, - Func equals) - { - this.getHashCode = getHashCode; - this.equals = equals; - } - - public bool Equals(T x, T y) - { - return equals(x, y); - } - - public int GetHashCode(T obj) - { - return getHashCode(obj); - } - } - - public static IEnumerable Distinct( - this IEnumerable enumerable, - Func getHashCode, - Func equals) - { - var took = new HashSet(new DistinctEqualityComparer(getHashCode, equals)); - foreach (var value in enumerable) - { - if (took.Add(value)) - { - yield return value; - } - } - } - #endregion - - public static U UnsafeGetValue(this IReadOnlyDictionary dict, T key, U defaultValue = default(U)) => - dict.TryGetValue(key, out var value) ? value : defaultValue; - - public static U GetOrAdd(this Dictionary dict, T key, U value) - { - if (dict.TryGetValue(key, out var v) == false) - { - v = value; - dict.Add(key, v); - } - - return v; - } - - #region LooseTypeKindComparer - private sealed class LooseTypeKindComparerImpl - : IEqualityComparer - { - public LooseTypeKindComparerImpl() - { - } - - public new bool Equals(object x, object y) - { - if (object.ReferenceEquals(x, y)) - { - return true; - } - - var tx = x.GetType(); - var ty = y.GetType(); - if (!tx.Equals(ty)) - { - return false; - } - - if (x is string) - { - return x.Equals(y); - } - if ((x is IEnumerable) && (y is IEnumerable)) - { - var ex = ((IEnumerable)x).RuntimeCast(); - var ey = ((IEnumerable)y).RuntimeCast(); - return ex.SequenceEqual(ey, this); - } - - return x.Equals(y); - } - - public int GetHashCode(object obj) - { - if (obj is string) - { - return obj.GetHashCode(); - } - if (obj is IEnumerable) - { - return ((IEnumerable)obj). - RuntimeCast(). - Aggregate(0, (s, v) => s ^ this.GetHashCode(v)); - } - return obj.GetHashCode(); - } - } - - public static readonly IEqualityComparer LooseTypeKindComparer = new LooseTypeKindComparerImpl(); - #endregion } } diff --git a/src/IL2C.Core/Internal/TypeUtilities.cs b/src/IL2C.Core/Internal/TypeUtilities.cs new file mode 100644 index 00000000..f1d99dcd --- /dev/null +++ b/src/IL2C.Core/Internal/TypeUtilities.cs @@ -0,0 +1,194 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; + +using Mono.Cecil.Cil; + +using IL2C.ILConverters; + +namespace IL2C.Internal +{ + internal static class TypeUtilities + { + private static readonly Dictionary ilConverters; + + static TypeUtilities() + { + ilConverters = typeof(ILConverter). + GetTypeInfo(). + Assembly. + DefinedTypes. + Where(type => type.IsSealed && typeof(ILConverter).GetTypeInfo().IsAssignableFrom(type)). + Select(type => (ILConverter)Activator.CreateInstance(type.AsType())). + ToDictionary(ilc => ilc.OpCode); + } + + public static bool TryGetILConverter(OpCode opCode, out ILConverter ilc) => + ilConverters.TryGetValue(opCode, out ilc); + + public static Array ResourceDataToSpecificArray(byte[] values, Type elementType) + { + if (elementType == typeof(byte)) + { + return values; + } + + var ms = new MemoryStream(values); + var br = new EndiannessBinaryReader(ms, EndianSpecific.Little, Encoding.Unicode); + var temp = new ArrayList(); + + if (elementType == typeof(sbyte)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadSByte()); + } + } + else if (elementType == typeof(short)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadInt16()); + } + } + else if (elementType == typeof(int)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadInt32()); + } + } + else if (elementType == typeof(long)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadInt64()); + } + } + else if (elementType == typeof(ushort)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadUInt16()); + } + } + else if (elementType == typeof(uint)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadUInt32()); + } + } + else if (elementType == typeof(ulong)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadUInt64()); + } + } + else if (elementType == typeof(float)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadSingle()); + } + } + else if (elementType == typeof(double)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadDouble()); + } + } + else if (elementType == typeof(char)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadChar()); + } + } + else if (elementType == typeof(bool)) + { + while (!br.IsEOF) + { + temp.Add(br.ReadBoolean()); + } + } + else + { + Debug.Fail("Cannot convert"); + } + + return temp.ToArray(elementType); + } + + #region LooseTypeKindComparer + private sealed class LooseTypeKindComparerImpl + : IEqualityComparer + { + public LooseTypeKindComparerImpl() + { + } + + public new bool Equals(object x, object y) + { + if (object.ReferenceEquals(x, y)) + { + return true; + } + + var tx = x.GetType(); + var ty = y.GetType(); + if (!tx.Equals(ty)) + { + return false; + } + + if (x is string) + { + return x.Equals(y); + } + if ((x is IEnumerable) && (y is IEnumerable)) + { + var ex = ((IEnumerable)x).RuntimeCast(); + var ey = ((IEnumerable)y).RuntimeCast(); + return ex.SequenceEqual(ey, this); + } + + return x.Equals(y); + } + + public int GetHashCode(object obj) + { + if (obj is string) + { + return obj.GetHashCode(); + } + if (obj is IEnumerable) + { + return ((IEnumerable)obj). + RuntimeCast(). + Aggregate(0, (s, v) => s ^ this.GetHashCode(v)); + } + return obj.GetHashCode(); + } + } + + public static readonly IEqualityComparer LooseTypeKindComparer = new LooseTypeKindComparerImpl(); + #endregion + } +} diff --git a/src/IL2C.Core/Internal/Utilities.cs b/src/IL2C.Core/Internal/Utilities.cs new file mode 100644 index 00000000..7a0b223e --- /dev/null +++ b/src/IL2C.Core/Internal/Utilities.cs @@ -0,0 +1,126 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace IL2C.Internal +{ + internal static class Utilities + { + public static IEnumerable RuntimeCast(this IEnumerable enumerable) + { + foreach (object? value in enumerable) + { + yield return (T)value!; + } + } + + public static IEnumerable Traverse(this T first, Func next, bool invokeNextFirst = false) + where T : class + { + T current = first; + if (invokeNextFirst) + { + if (current != null) + { + while (true) + { + current = next(current); + if (current == null) + { + break; + } + yield return current; + } + } + } + else + { + while (current != null) + { + yield return current; + current = next(current); + } + } + } + + public static IEnumerable Distinct( + this IEnumerable enumerable, + Func keySelector) + { + var took = new HashSet(); + foreach (var value in enumerable) + { + if (took.Add(keySelector(value))) + { + yield return value; + } + } + } + + private sealed class DistinctEqualityComparer : IEqualityComparer + { + private readonly Func getHashCode; + private readonly Func equals; + + public DistinctEqualityComparer( + Func getHashCode, + Func equals) + { + this.getHashCode = getHashCode; + this.equals = equals; + } + + public bool Equals(T? x, T? y) + { + return equals(x, y); + } + + public int GetHashCode(T obj) + { + return getHashCode(obj); + } + } + + public static IEnumerable Distinct( + this IEnumerable enumerable, + Func getHashCode, + Func equals) + { + var took = new HashSet(new DistinctEqualityComparer(getHashCode, equals)); + foreach (var value in enumerable) + { + if (took.Add(value)) + { + yield return value; + } + } + } + + public static U UnsafeGetValue(this IReadOnlyDictionary dict, T key, U defaultValue = default(U)!) + where T : notnull => + dict.TryGetValue(key, out var value) ? value : defaultValue; + + public static U GetOrAdd(this Dictionary dict, T key, U value) + where T : notnull + { + if (dict.TryGetValue(key, out var v) == false) + { + v = value; + dict.Add(key, v); + } + + return v; + } + } +} diff --git a/src/IL2C.Core/InvalidProgramSequenceException.cs b/src/IL2C.Core/InvalidProgramSequenceException.cs new file mode 100644 index 00000000..cbeb5dc9 --- /dev/null +++ b/src/IL2C.Core/InvalidProgramSequenceException.cs @@ -0,0 +1,23 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +using System; + +namespace IL2C +{ + public sealed class InvalidProgramSequenceException : Exception + { + public InvalidProgramSequenceException(string format, params object[] args) + : base(string.Format(format, args)) + { + } + } +} diff --git a/IL2C.Core/Metadata/AssemblyDefinitionComparer.cs b/src/IL2C.Core/Metadata/AssemblyDefinitionComparer.cs similarity index 63% rename from IL2C.Core/Metadata/AssemblyDefinitionComparer.cs rename to src/IL2C.Core/Metadata/AssemblyDefinitionComparer.cs index 0b1f7a89..b1606f73 100644 --- a/IL2C.Core/Metadata/AssemblyDefinitionComparer.cs +++ b/src/IL2C.Core/Metadata/AssemblyDefinitionComparer.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Metadata/AssemblyInformation.cs b/src/IL2C.Core/Metadata/AssemblyInformation.cs similarity index 69% rename from IL2C.Core/Metadata/AssemblyInformation.cs rename to src/IL2C.Core/Metadata/AssemblyInformation.cs index 230ef5c7..abacf4a8 100644 --- a/IL2C.Core/Metadata/AssemblyInformation.cs +++ b/src/IL2C.Core/Metadata/AssemblyInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Mono.Cecil; diff --git a/IL2C.Core/Metadata/Attributes/CustomAttributeExtensions.cs b/src/IL2C.Core/Metadata/Attributes/CustomAttributeExtensions.cs similarity index 59% rename from IL2C.Core/Metadata/Attributes/CustomAttributeExtensions.cs rename to src/IL2C.Core/Metadata/Attributes/CustomAttributeExtensions.cs index 3d7602c1..65438fc3 100644 --- a/IL2C.Core/Metadata/Attributes/CustomAttributeExtensions.cs +++ b/src/IL2C.Core/Metadata/Attributes/CustomAttributeExtensions.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Linq; diff --git a/src/IL2C.Core/Metadata/Attributes/NativeCharSetInformation.cs b/src/IL2C.Core/Metadata/Attributes/NativeCharSetInformation.cs new file mode 100644 index 00000000..8bb5d379 --- /dev/null +++ b/src/IL2C.Core/Metadata/Attributes/NativeCharSetInformation.cs @@ -0,0 +1,17 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +namespace IL2C.Metadata.Attributes +{ + public enum NativeCharSetInformation + { + Unicode, + UTF8 + } +} diff --git a/IL2C.Core/Metadata/Attributes/NativeMethodAttributeInformation.cs b/src/IL2C.Core/Metadata/Attributes/NativeMethodAttributeInformation.cs similarity index 63% rename from IL2C.Core/Metadata/Attributes/NativeMethodAttributeInformation.cs rename to src/IL2C.Core/Metadata/Attributes/NativeMethodAttributeInformation.cs index 0cb9eef6..ae65c2b2 100644 --- a/IL2C.Core/Metadata/Attributes/NativeMethodAttributeInformation.cs +++ b/src/IL2C.Core/Metadata/Attributes/NativeMethodAttributeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/Metadata/Attributes/NativeTypeAttributeInformation.cs b/src/IL2C.Core/Metadata/Attributes/NativeTypeAttributeInformation.cs similarity index 52% rename from IL2C.Core/Metadata/Attributes/NativeTypeAttributeInformation.cs rename to src/IL2C.Core/Metadata/Attributes/NativeTypeAttributeInformation.cs index 354d91eb..e3b7302e 100644 --- a/IL2C.Core/Metadata/Attributes/NativeTypeAttributeInformation.cs +++ b/src/IL2C.Core/Metadata/Attributes/NativeTypeAttributeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Mono.Cecil; diff --git a/IL2C.Core/Metadata/Attributes/NativeValueAttributeInformation.cs b/src/IL2C.Core/Metadata/Attributes/NativeValueAttributeInformation.cs similarity index 52% rename from IL2C.Core/Metadata/Attributes/NativeValueAttributeInformation.cs rename to src/IL2C.Core/Metadata/Attributes/NativeValueAttributeInformation.cs index 39aa6807..72b03820 100644 --- a/IL2C.Core/Metadata/Attributes/NativeValueAttributeInformation.cs +++ b/src/IL2C.Core/Metadata/Attributes/NativeValueAttributeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Mono.Cecil; diff --git a/IL2C.Core/Metadata/BasePathAssemblyResolver.cs b/src/IL2C.Core/Metadata/BasePathAssemblyResolver.cs similarity index 50% rename from IL2C.Core/Metadata/BasePathAssemblyResolver.cs rename to src/IL2C.Core/Metadata/BasePathAssemblyResolver.cs index 3ed8ee67..868a9b45 100644 --- a/IL2C.Core/Metadata/BasePathAssemblyResolver.cs +++ b/src/IL2C.Core/Metadata/BasePathAssemblyResolver.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Mono.Cecil; diff --git a/IL2C.Core/Metadata/CodeInformation.cs b/src/IL2C.Core/Metadata/CodeInformation.cs similarity index 92% rename from IL2C.Core/Metadata/CodeInformation.cs rename to src/IL2C.Core/Metadata/CodeInformation.cs index 8e85f281..bbb912e3 100644 --- a/IL2C.Core/Metadata/CodeInformation.cs +++ b/src/IL2C.Core/Metadata/CodeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections; diff --git a/IL2C.Core/Metadata/FieldInformation.cs b/src/IL2C.Core/Metadata/FieldInformation.cs similarity index 87% rename from IL2C.Core/Metadata/FieldInformation.cs rename to src/IL2C.Core/Metadata/FieldInformation.cs index 64fe9747..be6faaea 100644 --- a/IL2C.Core/Metadata/FieldInformation.cs +++ b/src/IL2C.Core/Metadata/FieldInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Linq; using System.Runtime.InteropServices; diff --git a/src/IL2C.Core/Metadata/IOperandPrintable.cs b/src/IL2C.Core/Metadata/IOperandPrintable.cs new file mode 100644 index 00000000..00186439 --- /dev/null +++ b/src/IL2C.Core/Metadata/IOperandPrintable.cs @@ -0,0 +1,18 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; + +namespace IL2C.Metadata +{ + internal interface IOperandPrintable + { + string PrintableString { get; } + } +} diff --git a/IL2C.Core/Metadata/LocalVariableInformation.cs b/src/IL2C.Core/Metadata/LocalVariableInformation.cs similarity index 60% rename from IL2C.Core/Metadata/LocalVariableInformation.cs rename to src/IL2C.Core/Metadata/LocalVariableInformation.cs index 0b4d0eb0..5fcafded 100644 --- a/IL2C.Core/Metadata/LocalVariableInformation.cs +++ b/src/IL2C.Core/Metadata/LocalVariableInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/Metadata/MemberInformation.cs b/src/IL2C.Core/Metadata/MemberInformation.cs similarity index 75% rename from IL2C.Core/Metadata/MemberInformation.cs rename to src/IL2C.Core/Metadata/MemberInformation.cs index 1837674f..2766ff54 100644 --- a/IL2C.Core/Metadata/MemberInformation.cs +++ b/src/IL2C.Core/Metadata/MemberInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using IL2C.Internal; @@ -61,7 +51,7 @@ public MemberInformation(TReference member, ModuleInformation module) public override string MangledUniqueName => this.Member.GetMangledUniqueName(); public override string MangledName => - Utilities.GetMangledName(this.Name); + SymbolManipulator.GetMangledName(this.Name); public override string FriendlyName => this.UniqueName; diff --git a/IL2C.Core/Metadata/MemberReferenceComparer.cs b/src/IL2C.Core/Metadata/MemberReferenceComparer.cs similarity index 63% rename from IL2C.Core/Metadata/MemberReferenceComparer.cs rename to src/IL2C.Core/Metadata/MemberReferenceComparer.cs index e6f9087d..b41c3a26 100644 --- a/IL2C.Core/Metadata/MemberReferenceComparer.cs +++ b/src/IL2C.Core/Metadata/MemberReferenceComparer.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Metadata/MetadataContext.cs b/src/IL2C.Core/Metadata/MetadataContext.cs similarity index 96% rename from IL2C.Core/Metadata/MetadataContext.cs rename to src/IL2C.Core/Metadata/MetadataContext.cs index b9416e97..94c3c9de 100644 --- a/IL2C.Core/Metadata/MetadataContext.cs +++ b/src/IL2C.Core/Metadata/MetadataContext.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -58,6 +48,8 @@ public interface IMetadataContext ITypeInformation BooleanType { get; } ITypeInformation RuntimeFieldHandle { get; } + + IMethodInformation EntryPoint { get; } } internal sealed class MetadataContext @@ -142,11 +134,16 @@ internal MetadataContext(string assemblyPath, bool readSymbols) this.BooleanType = this.GetOrAddType(resolvedCoreModule.TypeSystem.Boolean); this.RuntimeFieldHandle = this.GetOrAddType(resolvedCoreModule.GetType("System.RuntimeFieldHandle")); + + this.EntryPoint = mainAssembly.EntryPoint is { } entryPoint ? + this.GetOrAddMethod(entryPoint) : null; } public IAssemblyInformation MainAssembly { get; } public IEnumerable Assemblies => assemblies.Values; + public IMethodInformation EntryPoint { get; } + #region IAssemblyInformation internal AssemblyInformation GetOrAddAssembly( AssemblyDefinition assemblyDefinition) diff --git a/IL2C.Core/Metadata/MetadataInformation.cs b/src/IL2C.Core/Metadata/MetadataInformation.cs similarity index 81% rename from IL2C.Core/Metadata/MetadataInformation.cs rename to src/IL2C.Core/Metadata/MetadataInformation.cs index b231e3e1..dc3de0d3 100644 --- a/IL2C.Core/Metadata/MetadataInformation.cs +++ b/src/IL2C.Core/Metadata/MetadataInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using IL2C.Internal; using System; @@ -57,9 +47,9 @@ protected MetadataInformation(MetadataContext metadataContext) public abstract string FriendlyName { get; } public virtual string MangledUniqueName => - Utilities.GetMangledName(this.UniqueName); + SymbolManipulator.GetMangledName(this.UniqueName); public virtual string MangledName => - Utilities.GetMangledName(this.Name); + SymbolManipulator.GetMangledName(this.Name); public string DebuggerDisplayString { diff --git a/IL2C.Core/Metadata/MetadataUtilities.cs b/src/IL2C.Core/Metadata/MetadataUtilities.cs similarity index 96% rename from IL2C.Core/Metadata/MetadataUtilities.cs rename to src/IL2C.Core/Metadata/MetadataUtilities.cs index 611dea31..70a7ad2e 100644 --- a/IL2C.Core/Metadata/MetadataUtilities.cs +++ b/src/IL2C.Core/Metadata/MetadataUtilities.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -80,7 +70,7 @@ private static string GetMemberName( MemberReference member, bool onlyMemberName, MemberElementFormats memberFormat) { var memberName = memberFormat.IsMangledName ? - Utilities.GetMangledName(TrimGenericIdentifier(member.Name)) : + SymbolManipulator.GetMangledName(TrimGenericIdentifier(member.Name)) : TrimGenericIdentifier(member.Name); if (onlyMemberName) @@ -104,7 +94,7 @@ private static string GetMemberName( (member as TypeReference)?.Namespace; if (memberFormat.IsMangledName && (namespaceName != null)) { - namespaceName = Utilities.GetMangledName(namespaceName); + namespaceName = SymbolManipulator.GetMangledName(namespaceName); } return string.Join( diff --git a/IL2C.Core/Metadata/MethodInformation.cs b/src/IL2C.Core/Metadata/MethodInformation.cs similarity index 96% rename from IL2C.Core/Metadata/MethodInformation.cs rename to src/IL2C.Core/Metadata/MethodInformation.cs index 72318e73..f1c03701 100644 --- a/IL2C.Core/Metadata/MethodInformation.cs +++ b/src/IL2C.Core/Metadata/MethodInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Metadata/ModuleInformation.cs b/src/IL2C.Core/Metadata/ModuleInformation.cs similarity index 66% rename from IL2C.Core/Metadata/ModuleInformation.cs rename to src/IL2C.Core/Metadata/ModuleInformation.cs index 9a98d6ce..a5a1f844 100644 --- a/IL2C.Core/Metadata/ModuleInformation.cs +++ b/src/IL2C.Core/Metadata/ModuleInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Mono.Cecil; using System; diff --git a/IL2C.Core/Metadata/ModuleReferenceComparer.cs b/src/IL2C.Core/Metadata/ModuleReferenceComparer.cs similarity index 62% rename from IL2C.Core/Metadata/ModuleReferenceComparer.cs rename to src/IL2C.Core/Metadata/ModuleReferenceComparer.cs index 1b2cbe81..f9dba2c9 100644 --- a/IL2C.Core/Metadata/ModuleReferenceComparer.cs +++ b/src/IL2C.Core/Metadata/ModuleReferenceComparer.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Metadata/ParameterInformation.cs b/src/IL2C.Core/Metadata/ParameterInformation.cs similarity index 66% rename from IL2C.Core/Metadata/ParameterInformation.cs rename to src/IL2C.Core/Metadata/ParameterInformation.cs index 05975924..8a94ee71 100644 --- a/IL2C.Core/Metadata/ParameterInformation.cs +++ b/src/IL2C.Core/Metadata/ParameterInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Linq; diff --git a/IL2C.Core/Metadata/Specialized/BoxedValueTypeInformation.cs b/src/IL2C.Core/Metadata/Specialized/BoxedValueTypeInformation.cs similarity index 89% rename from IL2C.Core/Metadata/Specialized/BoxedValueTypeInformation.cs rename to src/IL2C.Core/Metadata/Specialized/BoxedValueTypeInformation.cs index c7e82917..39115b9d 100644 --- a/IL2C.Core/Metadata/Specialized/BoxedValueTypeInformation.cs +++ b/src/IL2C.Core/Metadata/Specialized/BoxedValueTypeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using IL2C.Internal; @@ -140,9 +130,9 @@ public string GetCLanguageTypeName( public string FriendlyName => this.UniqueName; public string MangledUniqueName => - Utilities.GetMangledName(this.UniqueName); + SymbolManipulator.GetMangledName(this.UniqueName); public string MangledName => - Utilities.GetMangledName(this.Name); + SymbolManipulator.GetMangledName(this.Name); public IMetadataContext Context => throw new NotImplementedException(); diff --git a/IL2C.Core/Metadata/Specialized/UntypedReferenceTypeInformation.cs b/src/IL2C.Core/Metadata/Specialized/UntypedReferenceTypeInformation.cs similarity index 91% rename from IL2C.Core/Metadata/Specialized/UntypedReferenceTypeInformation.cs rename to src/IL2C.Core/Metadata/Specialized/UntypedReferenceTypeInformation.cs index 2553b384..3e4be701 100644 --- a/IL2C.Core/Metadata/Specialized/UntypedReferenceTypeInformation.cs +++ b/src/IL2C.Core/Metadata/Specialized/UntypedReferenceTypeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/IL2C.Core/Metadata/TypeInformation.cs b/src/IL2C.Core/Metadata/TypeInformation.cs similarity index 97% rename from IL2C.Core/Metadata/TypeInformation.cs rename to src/IL2C.Core/Metadata/TypeInformation.cs index 53ec4e1e..42cef416 100644 --- a/IL2C.Core/Metadata/TypeInformation.cs +++ b/src/IL2C.Core/Metadata/TypeInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Metadata/VariableInformation.cs b/src/IL2C.Core/Metadata/VariableInformation.cs similarity index 76% rename from IL2C.Core/Metadata/VariableInformation.cs rename to src/IL2C.Core/Metadata/VariableInformation.cs index fa3ad640..9090f4c6 100644 --- a/IL2C.Core/Metadata/VariableInformation.cs +++ b/src/IL2C.Core/Metadata/VariableInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using IL2C.Internal; using System; @@ -59,7 +49,7 @@ protected VariableInformation( public object HintInformation { get; } public string UnsafeCLanguageSymbolName => - Utilities.GetMangledName(symbolName); + SymbolManipulator.GetMangledName(symbolName); public bool Equals(IVariableInformation rhs) { diff --git a/src/IL2C.Core/Properties/AssemblyInfo.cs b/src/IL2C.Core/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..5189bc6a --- /dev/null +++ b/src/IL2C.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,14 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: InternalsVisibleTo("IL2C.Core.Test.Fixture")] diff --git a/IL2C.Core/TranslateContext.cs b/src/IL2C.Core/TranslateContext.cs similarity index 93% rename from IL2C.Core/TranslateContext.cs rename to src/IL2C.Core/TranslateContext.cs index 46579c27..e369cc98 100644 --- a/IL2C.Core/TranslateContext.cs +++ b/src/IL2C.Core/TranslateContext.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -47,19 +37,13 @@ public sealed class TranslateContext private readonly Dictionary constStrings = new Dictionary(); private readonly Dictionary fields)> declaredValues = - new Dictionary fields)>(Utilities.LooseTypeKindComparer); + new Dictionary fields)>(TypeUtilities.LooseTypeKindComparer); private readonly Dictionary> declaredValueHintTypes = new Dictionary>(); private Func prefixGenerator; private string currentExceptionNestedFrameIndexName; #endregion - #region Constructors - public TranslateContext(Assembly assembly, bool readSymbols, TargetPlatforms targetPlatform) - : this(assembly.Location, readSymbols, targetPlatform) - { - } - public TranslateContext(string assemblyPath, bool readSymbols, TargetPlatforms targetPlatform) { var context = new MetadataContext(assemblyPath, readSymbols); @@ -67,7 +51,6 @@ public TranslateContext(string assemblyPath, bool readSymbols, TargetPlatforms t this.Assembly = context.MainAssembly; this.TargetPlatform = targetPlatform; } - #endregion public IMetadataContext MetadataContext { get; } diff --git a/IL2C.Core/Translators/DecodeContext.cs b/src/IL2C.Core/Translators/DecodeContext.cs similarity index 95% rename from IL2C.Core/Translators/DecodeContext.cs rename to src/IL2C.Core/Translators/DecodeContext.cs index df3d6c0c..952b64f9 100644 --- a/IL2C.Core/Translators/DecodeContext.cs +++ b/src/IL2C.Core/Translators/DecodeContext.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Translators/IExtractContext.cs b/src/IL2C.Core/Translators/IExtractContext.cs similarity index 76% rename from IL2C.Core/Translators/IExtractContext.cs rename to src/IL2C.Core/Translators/IExtractContext.cs index ce1d058e..c8e5826f 100644 --- a/IL2C.Core/Translators/IExtractContext.cs +++ b/src/IL2C.Core/Translators/IExtractContext.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Translators/IPrepareContext.cs b/src/IL2C.Core/Translators/IPrepareContext.cs similarity index 55% rename from IL2C.Core/Translators/IPrepareContext.cs rename to src/IL2C.Core/Translators/IPrepareContext.cs index df91ffa3..aa04dd51 100644 --- a/IL2C.Core/Translators/IPrepareContext.cs +++ b/src/IL2C.Core/Translators/IPrepareContext.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Mono.Cecil; diff --git a/src/IL2C.Core/Translators/Label.cs b/src/IL2C.Core/Translators/Label.cs new file mode 100644 index 00000000..c544da00 --- /dev/null +++ b/src/IL2C.Core/Translators/Label.cs @@ -0,0 +1,26 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable + +namespace IL2C.Translators +{ + public struct Label + { + public readonly int Offset; + + public Label(int offset) + { + this.Offset = offset; + } + + public override string ToString() => + string.Format("IL_{0:x4}", this.Offset); + } +} diff --git a/IL2C.Core/Translators/PreparedILBody.cs b/src/IL2C.Core/Translators/PreparedILBody.cs similarity index 76% rename from IL2C.Core/Translators/PreparedILBody.cs rename to src/IL2C.Core/Translators/PreparedILBody.cs index 97bbeaa2..78b0df7a 100644 --- a/IL2C.Core/Translators/PreparedILBody.cs +++ b/src/IL2C.Core/Translators/PreparedILBody.cs @@ -1,21 +1,13 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable using System; diff --git a/IL2C.Core/Translators/PreparedInformations.cs b/src/IL2C.Core/Translators/PreparedInformations.cs similarity index 62% rename from IL2C.Core/Translators/PreparedInformations.cs rename to src/IL2C.Core/Translators/PreparedInformations.cs index 1dc00d84..f4cae157 100644 --- a/IL2C.Core/Translators/PreparedInformations.cs +++ b/src/IL2C.Core/Translators/PreparedInformations.cs @@ -1,21 +1,13 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable using System; using System.Collections.Generic; @@ -40,7 +32,7 @@ internal PreparedInformations( public int Count => this.Functions.Count; - public bool TryGet(string methodName, out PreparedMethodInformation preparedFunction) + public bool TryGet(string methodName, out PreparedMethodInformation? preparedFunction) { preparedFunction = this.Functions .Where(entry => entry.Key.UniqueName == methodName) diff --git a/IL2C.Core/Translators/PreparedMethodInformation.cs b/src/IL2C.Core/Translators/PreparedMethodInformation.cs similarity index 69% rename from IL2C.Core/Translators/PreparedMethodInformation.cs rename to src/IL2C.Core/Translators/PreparedMethodInformation.cs index 8d4bd1bc..69dc21ed 100644 --- a/IL2C.Core/Translators/PreparedMethodInformation.cs +++ b/src/IL2C.Core/Translators/PreparedMethodInformation.cs @@ -1,21 +1,13 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// + +#nullable enable using System; using System.Collections.Generic; diff --git a/IL2C.Core/Writers/DebugInformationWriteController.cs b/src/IL2C.Core/Writers/DebugInformationWriteController.cs similarity index 79% rename from IL2C.Core/Writers/DebugInformationWriteController.cs rename to src/IL2C.Core/Writers/DebugInformationWriteController.cs index 2afda055..6a2bb821 100644 --- a/IL2C.Core/Writers/DebugInformationWriteController.cs +++ b/src/IL2C.Core/Writers/DebugInformationWriteController.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.IO; using System.Linq; diff --git a/IL2C.Core/Writers/ExceptionHandlerController.cs b/src/IL2C.Core/Writers/ExceptionHandlerController.cs similarity index 91% rename from IL2C.Core/Writers/ExceptionHandlerController.cs rename to src/IL2C.Core/Writers/ExceptionHandlerController.cs index b9be2c7c..7e3df23e 100644 --- a/IL2C.Core/Writers/ExceptionHandlerController.cs +++ b/src/IL2C.Core/Writers/ExceptionHandlerController.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/IL2C.Core/Writers/FunctionWriter.cs b/src/IL2C.Core/Writers/FunctionWriter.cs similarity index 98% rename from IL2C.Core/Writers/FunctionWriter.cs rename to src/IL2C.Core/Writers/FunctionWriter.cs index 7981af0d..ed435bdc 100644 --- a/IL2C.Core/Writers/FunctionWriter.cs +++ b/src/IL2C.Core/Writers/FunctionWriter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Linq; using System.Diagnostics; @@ -304,7 +294,7 @@ private static void InternalConvertFromFunction( (codeStream.ExceptionHandlers.Length >= 1) ? "volatile " : string.Empty, local.TargetType.CLanguageTypeName, name, - Utilities.GetCLanguageExpression(local.TargetType.InternalStaticEmptyValue)); + SymbolManipulator.GetCLanguageExpression(local.TargetType.InternalStaticEmptyValue)); } else { diff --git a/IL2C.Core/Writers/HeaderWriter.cs b/src/IL2C.Core/Writers/HeaderWriter.cs similarity index 94% rename from IL2C.Core/Writers/HeaderWriter.cs rename to src/IL2C.Core/Writers/HeaderWriter.cs index 3d06d29b..678cfc8b 100644 --- a/IL2C.Core/Writers/HeaderWriter.cs +++ b/src/IL2C.Core/Writers/HeaderWriter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -159,7 +149,7 @@ public static void WriteCommonHeader( string assemblyName) { IExtractContext extractContext = translateContext; - var assemblyMangledName = Utilities.GetMangledName(assemblyName); + var assemblyMangledName = SymbolManipulator.GetMangledName(assemblyName); using (var twHeader = storage.CreateHeaderWriter(assemblyName)) { @@ -231,7 +221,7 @@ public static void WriteCommonHeader( twHeader.WriteLine( "#include \"{0}/{1}/{2}.h\"", assemblyName, - Utilities.GetCLanguageScopedPath(type.ScopeName), + SymbolManipulator.GetCLanguageScopedPath(type.ScopeName), type.Name); } twHeader.SplitLine(); @@ -251,7 +241,7 @@ public static void WriteCommonHeader( twHeader.WriteLine( "#include \"{0}/{1}/{2}.h\"", assemblyName, - Utilities.GetCLanguageScopedPath(type.ScopeName), + SymbolManipulator.GetCLanguageScopedPath(type.ScopeName), type.Name); } twHeader.SplitLine(); @@ -270,7 +260,8 @@ public static void WriteCommonInternalHeader( { IExtractContext extractContext = translateContext; var annotatedAssemblyName = assemblyName + "_internal"; - var annotatedAssemblyMangledName = Utilities.GetMangledName(annotatedAssemblyName); + var annotatedAssemblyMangledName = + SymbolManipulator.GetMangledName(annotatedAssemblyName); using (var twHeader = storage.CreateHeaderWriter(annotatedAssemblyName)) { @@ -334,7 +325,7 @@ public static void WriteCommonInternalHeader( Debug.Assert(targetType.IsArray); var elementType = targetType.ElementType.ResolveToRuntimeType(); - var values = Utilities.ResourceDataToSpecificArray(information.ResourceData, elementType); + var values = TypeUtilities.ResourceDataToSpecificArray(information.ResourceData, elementType); var lhs = targetType.GetCLanguageTypeName(information.SymbolName, true); twHeader.WriteLine( @@ -418,7 +409,7 @@ public static void WriteHeaders( { using (var twHeader = storage.CreateHeaderWriter(type.Name)) { - var scopeName = Utilities.GetMangledName(type.ScopeName); + var scopeName = SymbolManipulator.GetMangledName(type.ScopeName); twHeader.WriteLine( "// [14-1] This is {0} native code translated by IL2C, do not edit.", diff --git a/IL2C.Core/Writers/SourceCodeWriter.cs b/src/IL2C.Core/Writers/SourceCodeWriter.cs similarity index 95% rename from IL2C.Core/Writers/SourceCodeWriter.cs rename to src/IL2C.Core/Writers/SourceCodeWriter.cs index cf46848f..4e8dbda9 100644 --- a/IL2C.Core/Writers/SourceCodeWriter.cs +++ b/src/IL2C.Core/Writers/SourceCodeWriter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Collections.Generic; using System.Diagnostics; @@ -57,7 +47,7 @@ public static string WriteCommonInternalSourceCode( using (var twSource = storage.CreateSourceCodeWriter(assemblyName + "_internal")) { - var assemblyMangledName = Utilities.GetMangledName(assemblyName); + var assemblyMangledName = SymbolManipulator.GetMangledName(assemblyName); twSource.WriteLine( "// [15-1] This is {0} native code translated by IL2C, do not edit.", @@ -86,7 +76,7 @@ public static string WriteCommonInternalSourceCode( twSource.WriteLine( "IL2C_CONST_STRING({0}, {1});", symbolName, - Utilities.GetCLanguageExpression(value)); + SymbolManipulator.GetCLanguageExpression(value)); } twSource.SplitLine(); @@ -116,7 +106,7 @@ public static string WriteCommonInternalSourceCode( Debug.Assert(targetType.IsArray); var elementType = targetType.ElementType.ResolveToRuntimeType(); - var values = Utilities.ResourceDataToSpecificArray(information.ResourceData, elementType); + var values = TypeUtilities.ResourceDataToSpecificArray(information.ResourceData, elementType); var lhs = targetType.GetCLanguageTypeName(information.SymbolName, true); twSource.WriteLine( @@ -126,7 +116,7 @@ public static string WriteCommonInternalSourceCode( { twSource.WriteLine( "{0};", - Utilities.GetCLanguageExpression(values)); + SymbolManipulator.GetCLanguageExpression(values)); } } @@ -486,7 +476,7 @@ public static void WriteBundlerSourceCode( { using (var twSource = storage.CreateSourceCodeWriter(assemblyName + "_bundle")) { - var assemblyMangledName = Utilities.GetMangledName(assemblyName); + var assemblyMangledName = SymbolManipulator.GetMangledName(assemblyName); twSource.WriteLine( "// [15-3] This is {0} native code translated by IL2C, do not edit.", @@ -509,7 +499,7 @@ public static void WriteBundlerSourceCode( twSource.WriteLine( "#include \"{0}/{1}/{2}.c\"", assemblyName, - Utilities.GetCLanguageScopedPath(type.ScopeName), + SymbolManipulator.GetCLanguageScopedPath(type.ScopeName), type.Name); } diff --git a/IL2C.Core/Writers/TypeDependency.cs b/src/IL2C.Core/Writers/TypeDependency.cs similarity index 88% rename from IL2C.Core/Writers/TypeDependency.cs rename to src/IL2C.Core/Writers/TypeDependency.cs index 45c0614d..a97cf815 100644 --- a/IL2C.Core/Writers/TypeDependency.cs +++ b/src/IL2C.Core/Writers/TypeDependency.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Collections.Generic; using System.Diagnostics; diff --git a/IL2C.Core/Writers/TypeHelperWriter.cs b/src/IL2C.Core/Writers/TypeHelperWriter.cs similarity index 96% rename from IL2C.Core/Writers/TypeHelperWriter.cs rename to src/IL2C.Core/Writers/TypeHelperWriter.cs index f9a407b5..e241e744 100644 --- a/IL2C.Core/Writers/TypeHelperWriter.cs +++ b/src/IL2C.Core/Writers/TypeHelperWriter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Diagnostics; diff --git a/IL2C.Core/Writers/TypeWriter.cs b/src/IL2C.Core/Writers/TypeWriter.cs similarity index 95% rename from IL2C.Core/Writers/TypeWriter.cs rename to src/IL2C.Core/Writers/TypeWriter.cs index 74e5f8cd..4d200d94 100644 --- a/IL2C.Core/Writers/TypeWriter.cs +++ b/src/IL2C.Core/Writers/TypeWriter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -160,7 +150,7 @@ public static void WriteTypeDefinitions( declaredType.CLanguageTypeName, declaredType.MangledUniqueName, field.Name, - Utilities.GetCLanguageExpression(field.DeclaredValue)); + SymbolManipulator.GetCLanguageExpression(field.DeclaredValue)); } tw.SplitLine(); } diff --git a/src/IL2C.Interop/IL2C.Interop.csproj b/src/IL2C.Interop/IL2C.Interop.csproj new file mode 100644 index 00000000..60f9e7e0 --- /dev/null +++ b/src/IL2C.Interop/IL2C.Interop.csproj @@ -0,0 +1,15 @@ + + + + net20;net35;net40-client;net45;net462;net48;netstandard1.0;netstandard2.0;netstandard2.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 + Library + enable + + IL2C.Interop + + + + + + + diff --git a/src/IL2C.Interop/NativeAttribute.cs b/src/IL2C.Interop/NativeAttribute.cs new file mode 100644 index 00000000..0f87ff25 --- /dev/null +++ b/src/IL2C.Interop/NativeAttribute.cs @@ -0,0 +1,31 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; +using System.Collections; + +namespace System.Runtime.InteropServices +{ + public abstract class NativeAttribute : Attribute + { + protected NativeAttribute(string includeFileName) + { + this.IncludeFileName = includeFileName; + } + + internal NativeAttribute(object arg0, IDictionary props) + { + this.IncludeFileName = (string)arg0; + this.SymbolName = (string?)props["SymbolName"]; + } + + public string IncludeFileName { get; } + public string? SymbolName { get; set; } + } +} diff --git a/src/IL2C.Interop/NativeCharSet.cs b/src/IL2C.Interop/NativeCharSet.cs new file mode 100644 index 00000000..91498c17 --- /dev/null +++ b/src/IL2C.Interop/NativeCharSet.cs @@ -0,0 +1,21 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; +using System.Collections.Generic; +using System.Text; + +namespace System.Runtime.InteropServices +{ + public enum NativeCharSet + { + Unicode, + UTF8 + } +} diff --git a/IL2C.Interop/NativeMethodAttribute.cs b/src/IL2C.Interop/NativeMethodAttribute.cs similarity index 51% rename from IL2C.Interop/NativeMethodAttribute.cs rename to src/IL2C.Interop/NativeMethodAttribute.cs index 65ff2858..034bada4 100644 --- a/IL2C.Interop/NativeMethodAttribute.cs +++ b/src/IL2C.Interop/NativeMethodAttribute.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections; @@ -33,12 +23,12 @@ public NativeMethodAttribute(string includeFileName) internal NativeMethodAttribute(object arg0, IDictionary props) : base(arg0, props) { - this.LibraryFileName = (string)props["LibraryFileName"]; + this.LibraryFileName = (string?)props["LibraryFileName"]; var charSet = props["CharSet"]; if (charSet is NativeCharSet) this.CharSet = (NativeCharSet)charSet; } - public string LibraryFileName { get; set; } + public string? LibraryFileName { get; set; } public NativeCharSet CharSet { get; set; } } } diff --git a/src/IL2C.Interop/NativePointer.cs b/src/IL2C.Interop/NativePointer.cs new file mode 100644 index 00000000..cc7c46c6 --- /dev/null +++ b/src/IL2C.Interop/NativePointer.cs @@ -0,0 +1,23 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; + +namespace System.Runtime.InteropServices +{ + public struct NativePointer + { + private readonly IntPtr pointer; + + private NativePointer(IntPtr value) => this.pointer = value; + + public static implicit operator NativePointer(IntPtr value) => new NativePointer(value); + public static implicit operator IntPtr(NativePointer value) => value.pointer; + } +} diff --git a/IL2C.Interop/NativeTypeAttribute.cs b/src/IL2C.Interop/NativeTypeAttribute.cs similarity index 51% rename from IL2C.Interop/NativeTypeAttribute.cs rename to src/IL2C.Interop/NativeTypeAttribute.cs index b5fe4316..53b619a1 100644 --- a/IL2C.Interop/NativeTypeAttribute.cs +++ b/src/IL2C.Interop/NativeTypeAttribute.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections; diff --git a/src/IL2C.Interop/NativeValueAttribute.cs b/src/IL2C.Interop/NativeValueAttribute.cs new file mode 100644 index 00000000..1ec10567 --- /dev/null +++ b/src/IL2C.Interop/NativeValueAttribute.cs @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System; +using System.Collections; + +namespace System.Runtime.InteropServices +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple=false, Inherited=false)] + public sealed class NativeValueAttribute : NativeAttribute + { + public NativeValueAttribute(string includeFileName) + : base(includeFileName) + { + } + + internal NativeValueAttribute(object arg0, IDictionary props) + : base(arg0, props) + { + } + } +} diff --git a/src/IL2C.Interop/Properties/AssemblyInfo.cs b/src/IL2C.Interop/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..4627f77f --- /dev/null +++ b/src/IL2C.Interop/Properties/AssemblyInfo.cs @@ -0,0 +1,14 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: InternalsVisibleTo("IL2C.Core")] diff --git a/IL2C.Runtime/.gitignore b/src/IL2C.Runtime/.gitignore similarity index 64% rename from IL2C.Runtime/.gitignore rename to src/IL2C.Runtime/.gitignore index 0e50c9c2..3e8162d6 100644 --- a/IL2C.Runtime/.gitignore +++ b/src/IL2C.Runtime/.gitignore @@ -1,2 +1,3 @@ build.cmake/ lib/ +libcache/ diff --git a/IL2C.Runtime/CMakeLists.txt b/src/IL2C.Runtime/CMakeLists.txt similarity index 100% rename from IL2C.Runtime/CMakeLists.txt rename to src/IL2C.Runtime/CMakeLists.txt diff --git a/IL2C.Runtime/IL2C.Runtime.Artifacts.zaspec b/src/IL2C.Runtime/IL2C.Runtime.Artifacts.zaspec similarity index 100% rename from IL2C.Runtime/IL2C.Runtime.Artifacts.zaspec rename to src/IL2C.Runtime/IL2C.Runtime.Artifacts.zaspec diff --git a/IL2C.Runtime/IL2C.Runtime.nuspec b/src/IL2C.Runtime/IL2C.Runtime.nuspec similarity index 57% rename from IL2C.Runtime/IL2C.Runtime.nuspec rename to src/IL2C.Runtime/IL2C.Runtime.nuspec index edb76bfa..3ce4c582 100644 --- a/IL2C.Runtime/IL2C.Runtime.nuspec +++ b/src/IL2C.Runtime/IL2C.Runtime.nuspec @@ -3,23 +3,24 @@ IL2C.Runtime $version$ - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) + Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) false Apache-2.0 + IL2C.100.png https://github.com/kekyo/IL2C.git A translator implementation of .NET intermediate language to C language. - Copyright (c) 2017-2019 Kouji Matsui + Copyright (c) Kouji Matsui il2c native cil msil translate transpile aot ecma335 c c++ win32 uefi wdm multi-platform systems-programming + true - - - - - - - + + + + + + diff --git a/IL2C.Runtime/IL2C.Runtime.vcxproj b/src/IL2C.Runtime/IL2C.Runtime.vcxproj similarity index 95% rename from IL2C.Runtime/IL2C.Runtime.vcxproj rename to src/IL2C.Runtime/IL2C.Runtime.vcxproj index a5750288..40d8389f 100644 --- a/IL2C.Runtime/IL2C.Runtime.vcxproj +++ b/src/IL2C.Runtime/IL2C.Runtime.vcxproj @@ -22,6 +22,10 @@ + + + + @@ -42,21 +46,18 @@ false - - false - false - 15.0 + 17.0 {182A62A4-47AC-4290-8EA5-250AE8131613} Win32Proj IL2CRuntime $(LatestTargetPlatformVersion) StaticLibrary - v142 + v143 false $(ProjectDir)bin\$(Platform)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ diff --git a/IL2C.Runtime/LICENSE b/src/IL2C.Runtime/LICENSE similarity index 100% rename from IL2C.Runtime/LICENSE rename to src/IL2C.Runtime/LICENSE diff --git a/IL2C.Runtime/README.md b/src/IL2C.Runtime/README.md similarity index 79% rename from IL2C.Runtime/README.md rename to src/IL2C.Runtime/README.md index 45c8ddcb..8f81914d 100644 --- a/IL2C.Runtime/README.md +++ b/src/IL2C.Runtime/README.md @@ -1,22 +1,12 @@ ```c -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// ``` # What's this? @@ -36,7 +26,7 @@ You can build easier to choice another distribution for these situations: ## Linking step -* Target for combination between Windows/UEFI and 32/64bit using Visual C++ 2017/2019 +* Target for combination between Windows/UEFI and 32/64bit using Visual C++ 2022 * You can use NuGet package named `IL2C.Runtime.msvc`. * It'll make automatic configuration for VC environments. * Target for Windows 32bit using MinGW/MSYS gcc4 diff --git a/src/IL2C.Runtime/build/IL2C.Runtime.msvc.props b/src/IL2C.Runtime/build/IL2C.Runtime.msvc.props new file mode 100644 index 00000000..8baf30f5 --- /dev/null +++ b/src/IL2C.Runtime/build/IL2C.Runtime.msvc.props @@ -0,0 +1,15 @@ + + + + $(MSBuildThisFileDirectory).. + + diff --git a/IL2C.Runtime/build/IL2C.Runtime.msvc.targets b/src/IL2C.Runtime/build/IL2C.Runtime.msvc.targets similarity index 81% rename from IL2C.Runtime/build/IL2C.Runtime.msvc.targets rename to src/IL2C.Runtime/build/IL2C.Runtime.msvc.targets index 8437d473..101db976 100644 --- a/IL2C.Runtime/build/IL2C.Runtime.msvc.targets +++ b/src/IL2C.Runtime/build/IL2C.Runtime.msvc.targets @@ -1,4 +1,13 @@ - + diff --git a/src/IL2C.Runtime/build/IL2C.Runtime.props b/src/IL2C.Runtime/build/IL2C.Runtime.props new file mode 100644 index 00000000..97099fa5 --- /dev/null +++ b/src/IL2C.Runtime/build/IL2C.Runtime.props @@ -0,0 +1,20 @@ + + + + $([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)','..')) + <_IL2C_RuntimeIncludeBaseDirPath>$([System.IO.Path]::Combine('$(IL2CRuntimeBasePath)','include')) + <_IL2C_RuntimeSourceBaseDirPath>$([System.IO.Path]::Combine('$(IL2CRuntimeBasePath)','src')) + <_IL2C_RuntimeLibraryCacheBaseDirPath>$([System.IO.Path]::Combine('$(IL2CRuntimeBasePath)','libcache')) + <_IL2C_RuntimeLibraryCacheFileName>libil2c.a + <_IL2C_StandardNativeMainTemplatePath>$([System.IO.Path]::Combine('$(IL2CRuntimeBasePath)','src','_main_template.c_')) + + diff --git a/src/IL2C.Runtime/build/IL2C.Runtime.targets b/src/IL2C.Runtime/build/IL2C.Runtime.targets new file mode 100644 index 00000000..8007896c --- /dev/null +++ b/src/IL2C.Runtime/build/IL2C.Runtime.targets @@ -0,0 +1,22 @@ + + + + + + $([System.IO.Path]::Combine('$(IL2CRuntimeBasePath)','include'));$(IL2CNativeIncludeDir) + $([System.IO.Path]::Combine('$(IL2CRuntimeBasePath)','include')) + $(_IL2C_StandardNativeMainTemplatePath) + + + + diff --git a/IL2C.Runtime/cmake/gcc-linux.cmake b/src/IL2C.Runtime/cmake/gcc-linux.cmake similarity index 100% rename from IL2C.Runtime/cmake/gcc-linux.cmake rename to src/IL2C.Runtime/cmake/gcc-linux.cmake diff --git a/IL2C.Runtime/cmake/gcc4-win-mingw32.cmake b/src/IL2C.Runtime/cmake/gcc4-win-mingw32.cmake similarity index 100% rename from IL2C.Runtime/cmake/gcc4-win-mingw32.cmake rename to src/IL2C.Runtime/cmake/gcc4-win-mingw32.cmake diff --git a/IL2C.Runtime/cmake/msvc-uefi.cmake b/src/IL2C.Runtime/cmake/msvc-uefi.cmake similarity index 100% rename from IL2C.Runtime/cmake/msvc-uefi.cmake rename to src/IL2C.Runtime/cmake/msvc-uefi.cmake diff --git a/IL2C.Runtime/cmake/msvc-win.cmake b/src/IL2C.Runtime/cmake/msvc-win.cmake similarity index 100% rename from IL2C.Runtime/cmake/msvc-win.cmake rename to src/IL2C.Runtime/cmake/msvc-win.cmake diff --git a/IL2C.Runtime/include/CMakeLists.txt b/src/IL2C.Runtime/include/CMakeLists.txt similarity index 100% rename from IL2C.Runtime/include/CMakeLists.txt rename to src/IL2C.Runtime/include/CMakeLists.txt diff --git a/src/IL2C.Runtime/include/IL2C.Interop.h b/src/IL2C.Runtime/include/IL2C.Interop.h new file mode 100644 index 00000000..6361b0ea --- /dev/null +++ b/src/IL2C.Runtime/include/IL2C.Interop.h @@ -0,0 +1,19 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef IL2C_Interop_dll_H__ +#define IL2C_Interop_dll_H__ + +#pragma once + +// IL2C.Interop.dll contains mostly usable IL2C/Invoke definitions +// with private knowledge. +#include + +#endif diff --git a/src/IL2C.Runtime/include/System.Console.h b/src/IL2C.Runtime/include/System.Console.h new file mode 100644 index 00000000..704af723 --- /dev/null +++ b/src/IL2C.Runtime/include/System.Console.h @@ -0,0 +1,17 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef System_Console_dll_H__ +#define System_Console_dll_H__ + +#pragma once + +#include + +#endif diff --git a/src/IL2C.Runtime/include/System.Private.CoreLib.h b/src/IL2C.Runtime/include/System.Private.CoreLib.h new file mode 100644 index 00000000..b6993e6c --- /dev/null +++ b/src/IL2C.Runtime/include/System.Private.CoreLib.h @@ -0,0 +1,17 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef System_Private_CoreLib_dll_H__ +#define System_Private_CoreLib_dll_H__ + +#pragma once + +#include + +#endif diff --git a/src/IL2C.Runtime/include/System.Runtime.h b/src/IL2C.Runtime/include/System.Runtime.h new file mode 100644 index 00000000..1e49da24 --- /dev/null +++ b/src/IL2C.Runtime/include/System.Runtime.h @@ -0,0 +1,17 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef System_Runtime_dll_H__ +#define System_Runtime_dll_H__ + +#pragma once + +#include + +#endif diff --git a/IL2C.Runtime/include/System/AppDomain.h b/src/IL2C.Runtime/include/System/AppDomain.h similarity index 66% rename from IL2C.Runtime/include/System/AppDomain.h rename to src/IL2C.Runtime/include/System/AppDomain.h index c3eeaf66..a73d93b0 100644 --- a/IL2C.Runtime/include/System/AppDomain.h +++ b/src/IL2C.Runtime/include/System/AppDomain.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_AppDomain_H__ #define System_AppDomain_H__ diff --git a/IL2C.Runtime/include/System/Array.h b/src/IL2C.Runtime/include/System/Array.h similarity index 80% rename from IL2C.Runtime/include/System/Array.h rename to src/IL2C.Runtime/include/System/Array.h index aaba1bae..c984410d 100644 --- a/IL2C.Runtime/include/System/Array.h +++ b/src/IL2C.Runtime/include/System/Array.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Array_H__ #define System_Array_H__ diff --git a/IL2C.Runtime/include/System/Boolean.h b/src/IL2C.Runtime/include/System/Boolean.h similarity index 61% rename from IL2C.Runtime/include/System/Boolean.h rename to src/IL2C.Runtime/include/System/Boolean.h index 22807f1a..5cd6396e 100644 --- a/IL2C.Runtime/include/System/Boolean.h +++ b/src/IL2C.Runtime/include/System/Boolean.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Boolean_H__ #define System_Boolean_H__ diff --git a/IL2C.Runtime/include/System/Byte.h b/src/IL2C.Runtime/include/System/Byte.h similarity index 60% rename from IL2C.Runtime/include/System/Byte.h rename to src/IL2C.Runtime/include/System/Byte.h index 7c53c275..1add5f5d 100644 --- a/IL2C.Runtime/include/System/Byte.h +++ b/src/IL2C.Runtime/include/System/Byte.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Byte_H__ #define System_Byte_H__ diff --git a/IL2C.Runtime/include/System/Char.h b/src/IL2C.Runtime/include/System/Char.h similarity index 60% rename from IL2C.Runtime/include/System/Char.h rename to src/IL2C.Runtime/include/System/Char.h index ddf356e5..bce6bc0e 100644 --- a/IL2C.Runtime/include/System/Char.h +++ b/src/IL2C.Runtime/include/System/Char.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Char_H__ #define System_Char_H__ diff --git a/IL2C.Runtime/include/System/Console.h b/src/IL2C.Runtime/include/System/Console.h similarity index 55% rename from IL2C.Runtime/include/System/Console.h rename to src/IL2C.Runtime/include/System/Console.h index a3e342ed..79388d20 100644 --- a/IL2C.Runtime/include/System/Console.h +++ b/src/IL2C.Runtime/include/System/Console.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Console_H__ #define System_Console_H__ @@ -36,6 +26,7 @@ IL2C_DECLARE_RUNTIME_TYPE(System_Console); extern /* static */ void System_Console_Write__System_String(System_String* value); extern /* static */ void System_Console_WriteLine(void); extern /* static */ void System_Console_WriteLine__System_Int32(int32_t value); +extern /* static */ void System_Console_WriteLine__System_Int64(int64_t value); extern /* static */ void System_Console_WriteLine__System_String(System_String* value); extern /* static */ System_String* System_Console_ReadLine(void); diff --git a/IL2C.Runtime/include/System/Delegate.h b/src/IL2C.Runtime/include/System/Delegate.h similarity index 76% rename from IL2C.Runtime/include/System/Delegate.h rename to src/IL2C.Runtime/include/System/Delegate.h index 602ceb3b..7c904041 100644 --- a/IL2C.Runtime/include/System/Delegate.h +++ b/src/IL2C.Runtime/include/System/Delegate.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Delegate_H__ #define System_Delegate_H__ diff --git a/IL2C.Runtime/include/System/Double.h b/src/IL2C.Runtime/include/System/Double.h similarity index 61% rename from IL2C.Runtime/include/System/Double.h rename to src/IL2C.Runtime/include/System/Double.h index 01808ea1..59e45cc5 100644 --- a/IL2C.Runtime/include/System/Double.h +++ b/src/IL2C.Runtime/include/System/Double.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Double_H__ #define System_Double_H__ diff --git a/IL2C.Runtime/include/System/Enum.h b/src/IL2C.Runtime/include/System/Enum.h similarity index 58% rename from IL2C.Runtime/include/System/Enum.h rename to src/IL2C.Runtime/include/System/Enum.h index b002ea20..a59621da 100644 --- a/IL2C.Runtime/include/System/Enum.h +++ b/src/IL2C.Runtime/include/System/Enum.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Enum_H__ #define System_Enum_H__ diff --git a/IL2C.Runtime/include/System/EventArgs.h b/src/IL2C.Runtime/include/System/EventArgs.h similarity index 54% rename from IL2C.Runtime/include/System/EventArgs.h rename to src/IL2C.Runtime/include/System/EventArgs.h index 42957fc1..d129c141 100644 --- a/IL2C.Runtime/include/System/EventArgs.h +++ b/src/IL2C.Runtime/include/System/EventArgs.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_EventArgs_H__ #define System_EventArgs_H__ diff --git a/IL2C.Runtime/include/System/Exception.h b/src/IL2C.Runtime/include/System/Exception.h similarity index 65% rename from IL2C.Runtime/include/System/Exception.h rename to src/IL2C.Runtime/include/System/Exception.h index fb766cab..46646d15 100644 --- a/IL2C.Runtime/include/System/Exception.h +++ b/src/IL2C.Runtime/include/System/Exception.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Exception_H__ #define System_Exception_H__ diff --git a/IL2C.Runtime/include/System/FormatException.h b/src/IL2C.Runtime/include/System/FormatException.h similarity index 60% rename from IL2C.Runtime/include/System/FormatException.h rename to src/IL2C.Runtime/include/System/FormatException.h index c8c6a702..9c9e72a7 100644 --- a/IL2C.Runtime/include/System/FormatException.h +++ b/src/IL2C.Runtime/include/System/FormatException.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_FormatException_H__ #define System_FormatException_H__ diff --git a/IL2C.Runtime/include/System/GC.h b/src/IL2C.Runtime/include/System/GC.h similarity index 55% rename from IL2C.Runtime/include/System/GC.h rename to src/IL2C.Runtime/include/System/GC.h index 44042c6b..05b0a8e5 100644 --- a/IL2C.Runtime/include/System/GC.h +++ b/src/IL2C.Runtime/include/System/GC.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_GC_H__ #define System_GC_H__ diff --git a/IL2C.Runtime/include/System/IDisposable.h b/src/IL2C.Runtime/include/System/IDisposable.h similarity index 53% rename from IL2C.Runtime/include/System/IDisposable.h rename to src/IL2C.Runtime/include/System/IDisposable.h index 18d42531..142c4157 100644 --- a/IL2C.Runtime/include/System/IDisposable.h +++ b/src/IL2C.Runtime/include/System/IDisposable.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_IDisposable_H__ #define System_IDisposable_H__ diff --git a/IL2C.Runtime/include/System/IFormatProvider.h b/src/IL2C.Runtime/include/System/IFormatProvider.h similarity index 55% rename from IL2C.Runtime/include/System/IFormatProvider.h rename to src/IL2C.Runtime/include/System/IFormatProvider.h index b17beb61..1b041aab 100644 --- a/IL2C.Runtime/include/System/IFormatProvider.h +++ b/src/IL2C.Runtime/include/System/IFormatProvider.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_IFormatProvider_H__ #define System_IFormatProvider_H__ diff --git a/IL2C.Runtime/include/System/IFormattable.h b/src/IL2C.Runtime/include/System/IFormattable.h similarity index 56% rename from IL2C.Runtime/include/System/IFormattable.h rename to src/IL2C.Runtime/include/System/IFormattable.h index e3fd7157..25df11a5 100644 --- a/IL2C.Runtime/include/System/IFormattable.h +++ b/src/IL2C.Runtime/include/System/IFormattable.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_IFormattable_H__ #define System_IFormattable_H__ diff --git a/IL2C.Runtime/include/System/IndexOutOfRangeException.h b/src/IL2C.Runtime/include/System/IndexOutOfRangeException.h similarity index 62% rename from IL2C.Runtime/include/System/IndexOutOfRangeException.h rename to src/IL2C.Runtime/include/System/IndexOutOfRangeException.h index 374e6524..94d08052 100644 --- a/IL2C.Runtime/include/System/IndexOutOfRangeException.h +++ b/src/IL2C.Runtime/include/System/IndexOutOfRangeException.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_IndexOutOfRangeException_H__ #define System_IndexOutOfRangeException_H__ diff --git a/IL2C.Runtime/include/System/Int16.h b/src/IL2C.Runtime/include/System/Int16.h similarity index 61% rename from IL2C.Runtime/include/System/Int16.h rename to src/IL2C.Runtime/include/System/Int16.h index 6fc251e5..b094e4de 100644 --- a/IL2C.Runtime/include/System/Int16.h +++ b/src/IL2C.Runtime/include/System/Int16.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Int16_H__ #define System_Int16_H__ diff --git a/IL2C.Runtime/include/System/Int32.h b/src/IL2C.Runtime/include/System/Int32.h similarity index 61% rename from IL2C.Runtime/include/System/Int32.h rename to src/IL2C.Runtime/include/System/Int32.h index 8c57eb64..ac2dd0b9 100644 --- a/IL2C.Runtime/include/System/Int32.h +++ b/src/IL2C.Runtime/include/System/Int32.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Int32_H__ #define System_Int32_H__ diff --git a/IL2C.Runtime/include/System/Int64.h b/src/IL2C.Runtime/include/System/Int64.h similarity index 61% rename from IL2C.Runtime/include/System/Int64.h rename to src/IL2C.Runtime/include/System/Int64.h index f1b79d16..41081faf 100644 --- a/IL2C.Runtime/include/System/Int64.h +++ b/src/IL2C.Runtime/include/System/Int64.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Int64_H__ #define System_Int64_H__ diff --git a/IL2C.Runtime/include/System/IntPtr.h b/src/IL2C.Runtime/include/System/IntPtr.h similarity index 69% rename from IL2C.Runtime/include/System/IntPtr.h rename to src/IL2C.Runtime/include/System/IntPtr.h index ec30deeb..c6b12ac5 100644 --- a/IL2C.Runtime/include/System/IntPtr.h +++ b/src/IL2C.Runtime/include/System/IntPtr.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_IntPtr_H__ #define System_IntPtr_H__ diff --git a/IL2C.Runtime/include/System/InvalidCastException.h b/src/IL2C.Runtime/include/System/InvalidCastException.h similarity index 61% rename from IL2C.Runtime/include/System/InvalidCastException.h rename to src/IL2C.Runtime/include/System/InvalidCastException.h index a69746ce..64b02e15 100644 --- a/IL2C.Runtime/include/System/InvalidCastException.h +++ b/src/IL2C.Runtime/include/System/InvalidCastException.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_InvalidCastException_H__ #define System_InvalidCastException_H__ diff --git a/IL2C.Runtime/include/System/MulticastDelegate.h b/src/IL2C.Runtime/include/System/MulticastDelegate.h similarity index 66% rename from IL2C.Runtime/include/System/MulticastDelegate.h rename to src/IL2C.Runtime/include/System/MulticastDelegate.h index a5081fc7..7602509c 100644 --- a/IL2C.Runtime/include/System/MulticastDelegate.h +++ b/src/IL2C.Runtime/include/System/MulticastDelegate.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_MulticastDelegate_H__ #define System_MulticastDelegate_H__ diff --git a/IL2C.Runtime/include/System/NullReferenceException.h b/src/IL2C.Runtime/include/System/NullReferenceException.h similarity index 62% rename from IL2C.Runtime/include/System/NullReferenceException.h rename to src/IL2C.Runtime/include/System/NullReferenceException.h index 98c7a275..77e13111 100644 --- a/IL2C.Runtime/include/System/NullReferenceException.h +++ b/src/IL2C.Runtime/include/System/NullReferenceException.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_NullReferenceException_H__ #define System_NullReferenceException_H__ diff --git a/IL2C.Runtime/include/System/Object.h b/src/IL2C.Runtime/include/System/Object.h similarity index 70% rename from IL2C.Runtime/include/System/Object.h rename to src/IL2C.Runtime/include/System/Object.h index 5fad5794..2751cdcc 100644 --- a/IL2C.Runtime/include/System/Object.h +++ b/src/IL2C.Runtime/include/System/Object.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Object_H__ #define System_Object_H__ diff --git a/IL2C.Runtime/include/System/Runtime/CompilerServices/RuntimeHelpers.h b/src/IL2C.Runtime/include/System/Runtime/CompilerServices/RuntimeHelpers.h similarity index 57% rename from IL2C.Runtime/include/System/Runtime/CompilerServices/RuntimeHelpers.h rename to src/IL2C.Runtime/include/System/Runtime/CompilerServices/RuntimeHelpers.h index 682cea8c..29d38eb1 100644 --- a/IL2C.Runtime/include/System/Runtime/CompilerServices/RuntimeHelpers.h +++ b/src/IL2C.Runtime/include/System/Runtime/CompilerServices/RuntimeHelpers.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Runtime_CompilerServices_RuntimeHelpers_H__ #define System_Runtime_CompilerServices_RuntimeHelpers_H__ diff --git a/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandle.h b/src/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandle.h similarity index 76% rename from IL2C.Runtime/include/System/Runtime/InteropServices/GCHandle.h rename to src/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandle.h index 73d32b6c..2a4f81b9 100644 --- a/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandle.h +++ b/src/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandle.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Runtime_InteropServices_GCHandle_H__ #define System_Runtime_InteropServices_GCHandle_H__ diff --git a/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandleType.h b/src/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandleType.h similarity index 61% rename from IL2C.Runtime/include/System/Runtime/InteropServices/GCHandleType.h rename to src/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandleType.h index 0ed5007f..67e131c6 100644 --- a/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandleType.h +++ b/src/IL2C.Runtime/include/System/Runtime/InteropServices/GCHandleType.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Runtime_InteropServices_GCHandleType_H__ #define System_Runtime_InteropServices_GCHandleType_H__ diff --git a/IL2C.Runtime/include/System/Runtime/InteropServices/NativePointer.h b/src/IL2C.Runtime/include/System/Runtime/InteropServices/NativePointer.h similarity index 62% rename from IL2C.Runtime/include/System/Runtime/InteropServices/NativePointer.h rename to src/IL2C.Runtime/include/System/Runtime/InteropServices/NativePointer.h index a8d2fb91..43d44584 100644 --- a/IL2C.Runtime/include/System/Runtime/InteropServices/NativePointer.h +++ b/src/IL2C.Runtime/include/System/Runtime/InteropServices/NativePointer.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Runtime_InteropServices_NativePointer_H__ #define System_Runtime_InteropServices_NativePointer_H__ diff --git a/IL2C.Runtime/include/System/RuntimeFieldHandle.h b/src/IL2C.Runtime/include/System/RuntimeFieldHandle.h similarity index 50% rename from IL2C.Runtime/include/System/RuntimeFieldHandle.h rename to src/IL2C.Runtime/include/System/RuntimeFieldHandle.h index 0c531924..290e252b 100644 --- a/IL2C.Runtime/include/System/RuntimeFieldHandle.h +++ b/src/IL2C.Runtime/include/System/RuntimeFieldHandle.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_RuntimeFieldHandle_H__ #define System_RuntimeFieldHandle_H__ diff --git a/IL2C.Runtime/include/System/SByte.h b/src/IL2C.Runtime/include/System/SByte.h similarity index 61% rename from IL2C.Runtime/include/System/SByte.h rename to src/IL2C.Runtime/include/System/SByte.h index a6505830..223258a9 100644 --- a/IL2C.Runtime/include/System/SByte.h +++ b/src/IL2C.Runtime/include/System/SByte.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_SByte_H__ #define System_SByte_H__ diff --git a/IL2C.Runtime/include/System/Single.h b/src/IL2C.Runtime/include/System/Single.h similarity index 61% rename from IL2C.Runtime/include/System/Single.h rename to src/IL2C.Runtime/include/System/Single.h index 56abc5f3..13a6bb59 100644 --- a/IL2C.Runtime/include/System/Single.h +++ b/src/IL2C.Runtime/include/System/Single.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Single_H__ #define System_Single_H__ diff --git a/IL2C.Runtime/include/System/String.h b/src/IL2C.Runtime/include/System/String.h similarity index 90% rename from IL2C.Runtime/include/System/String.h rename to src/IL2C.Runtime/include/System/String.h index b0c8d5de..9bb62602 100644 --- a/IL2C.Runtime/include/System/String.h +++ b/src/IL2C.Runtime/include/System/String.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_String_H__ #define System_String_H__ diff --git a/IL2C.Runtime/include/System/Threading/Interlocked.h b/src/IL2C.Runtime/include/System/Threading/Interlocked.h similarity index 51% rename from IL2C.Runtime/include/System/Threading/Interlocked.h rename to src/IL2C.Runtime/include/System/Threading/Interlocked.h index bb4fe98b..2bf66235 100644 --- a/IL2C.Runtime/include/System/Threading/Interlocked.h +++ b/src/IL2C.Runtime/include/System/Threading/Interlocked.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Threading_Interlocked_H__ #define System_Threading_Interlocked_H__ diff --git a/IL2C.Runtime/include/System/Threading/Monitor.h b/src/IL2C.Runtime/include/System/Threading/Monitor.h similarity index 60% rename from IL2C.Runtime/include/System/Threading/Monitor.h rename to src/IL2C.Runtime/include/System/Threading/Monitor.h index 9fab0e7a..e1ce04bf 100644 --- a/IL2C.Runtime/include/System/Threading/Monitor.h +++ b/src/IL2C.Runtime/include/System/Threading/Monitor.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Threading_Monitor_H__ #define System_Threading_Monitor_H__ diff --git a/IL2C.Runtime/include/System/Threading/ParameterizedThreadStart.h b/src/IL2C.Runtime/include/System/Threading/ParameterizedThreadStart.h similarity index 60% rename from IL2C.Runtime/include/System/Threading/ParameterizedThreadStart.h rename to src/IL2C.Runtime/include/System/Threading/ParameterizedThreadStart.h index e2d159f4..4711163f 100644 --- a/IL2C.Runtime/include/System/Threading/ParameterizedThreadStart.h +++ b/src/IL2C.Runtime/include/System/Threading/ParameterizedThreadStart.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Threading_ParameterizedThreadStart_H__ #define System_Threading_ParameterizedThreadStart_H__ diff --git a/IL2C.Runtime/include/System/Threading/Thread.h b/src/IL2C.Runtime/include/System/Threading/Thread.h similarity index 73% rename from IL2C.Runtime/include/System/Threading/Thread.h rename to src/IL2C.Runtime/include/System/Threading/Thread.h index cf95ca7d..617644ac 100644 --- a/IL2C.Runtime/include/System/Threading/Thread.h +++ b/src/IL2C.Runtime/include/System/Threading/Thread.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Threading_Thread_H__ #define System_Threading_Thread_H__ diff --git a/IL2C.Runtime/include/System/Threading/ThreadStart.h b/src/IL2C.Runtime/include/System/Threading/ThreadStart.h similarity index 56% rename from IL2C.Runtime/include/System/Threading/ThreadStart.h rename to src/IL2C.Runtime/include/System/Threading/ThreadStart.h index ab25dd2b..e7ab829b 100644 --- a/IL2C.Runtime/include/System/Threading/ThreadStart.h +++ b/src/IL2C.Runtime/include/System/Threading/ThreadStart.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Threading_ThreadStart_H__ #define System_Threading_ThreadStart_H__ diff --git a/IL2C.Runtime/include/System/Type.h b/src/IL2C.Runtime/include/System/Type.h similarity index 68% rename from IL2C.Runtime/include/System/Type.h rename to src/IL2C.Runtime/include/System/Type.h index c667fc0f..fb763f18 100644 --- a/IL2C.Runtime/include/System/Type.h +++ b/src/IL2C.Runtime/include/System/Type.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_Type_H__ #define System_Type_H__ diff --git a/IL2C.Runtime/include/System/UInt16.h b/src/IL2C.Runtime/include/System/UInt16.h similarity index 61% rename from IL2C.Runtime/include/System/UInt16.h rename to src/IL2C.Runtime/include/System/UInt16.h index 354aeee6..4a3d59f5 100644 --- a/IL2C.Runtime/include/System/UInt16.h +++ b/src/IL2C.Runtime/include/System/UInt16.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_UInt16_H__ #define System_UInt16_H__ diff --git a/IL2C.Runtime/include/System/UInt32.h b/src/IL2C.Runtime/include/System/UInt32.h similarity index 61% rename from IL2C.Runtime/include/System/UInt32.h rename to src/IL2C.Runtime/include/System/UInt32.h index 2ef34095..d334d410 100644 --- a/IL2C.Runtime/include/System/UInt32.h +++ b/src/IL2C.Runtime/include/System/UInt32.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_UInt32_H__ #define System_UInt32_H__ diff --git a/IL2C.Runtime/include/System/UInt64.h b/src/IL2C.Runtime/include/System/UInt64.h similarity index 61% rename from IL2C.Runtime/include/System/UInt64.h rename to src/IL2C.Runtime/include/System/UInt64.h index 6f1baf81..c015397c 100644 --- a/IL2C.Runtime/include/System/UInt64.h +++ b/src/IL2C.Runtime/include/System/UInt64.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_UInt64_H__ #define System_UInt64_H__ diff --git a/IL2C.Runtime/include/System/UIntPtr.h b/src/IL2C.Runtime/include/System/UIntPtr.h similarity index 65% rename from IL2C.Runtime/include/System/UIntPtr.h rename to src/IL2C.Runtime/include/System/UIntPtr.h index c7e298bc..7e01a3a8 100644 --- a/IL2C.Runtime/include/System/UIntPtr.h +++ b/src/IL2C.Runtime/include/System/UIntPtr.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_UIntPtr_H__ #define System_UIntPtr_H__ diff --git a/IL2C.Runtime/include/System/UnhandledExceptionEventArgs.h b/src/IL2C.Runtime/include/System/UnhandledExceptionEventArgs.h similarity index 67% rename from IL2C.Runtime/include/System/UnhandledExceptionEventArgs.h rename to src/IL2C.Runtime/include/System/UnhandledExceptionEventArgs.h index c62fdef5..28400efd 100644 --- a/IL2C.Runtime/include/System/UnhandledExceptionEventArgs.h +++ b/src/IL2C.Runtime/include/System/UnhandledExceptionEventArgs.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_UnhandledExceptionEventArgs_H__ #define System_UnhandledExceptionEventArgs_H__ diff --git a/IL2C.Runtime/include/System/UnhandledExceptionEventHandler.h b/src/IL2C.Runtime/include/System/UnhandledExceptionEventHandler.h similarity index 59% rename from IL2C.Runtime/include/System/UnhandledExceptionEventHandler.h rename to src/IL2C.Runtime/include/System/UnhandledExceptionEventHandler.h index a9da413b..3f93b468 100644 --- a/IL2C.Runtime/include/System/UnhandledExceptionEventHandler.h +++ b/src/IL2C.Runtime/include/System/UnhandledExceptionEventHandler.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_UnhandledExceptionEventHandler_H__ #define System_UnhandledExceptionEventHandler_H__ diff --git a/IL2C.Runtime/include/System/ValueType.h b/src/IL2C.Runtime/include/System/ValueType.h similarity index 60% rename from IL2C.Runtime/include/System/ValueType.h rename to src/IL2C.Runtime/include/System/ValueType.h index 78916064..af5b1523 100644 --- a/IL2C.Runtime/include/System/ValueType.h +++ b/src/IL2C.Runtime/include/System/ValueType.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef System_ValueType_H__ #define System_ValueType_H__ diff --git a/IL2C.Runtime/include/il2c.h b/src/IL2C.Runtime/include/il2c.h similarity index 96% rename from IL2C.Runtime/include/il2c.h rename to src/IL2C.Runtime/include/il2c.h index 922eb40a..42893774 100644 --- a/IL2C.Runtime/include/il2c.h +++ b/src/IL2C.Runtime/include/il2c.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef IL2C_H__ #define IL2C_H__ diff --git a/src/IL2C.Runtime/include/mscorlib.h b/src/IL2C.Runtime/include/mscorlib.h new file mode 100644 index 00000000..90180960 --- /dev/null +++ b/src/IL2C.Runtime/include/mscorlib.h @@ -0,0 +1,17 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef mscorlib_dll_H__ +#define mscorlib_dll_H__ + +#pragma once + +#include + +#endif diff --git a/IL2C.Runtime/src/CMakeLists.txt b/src/IL2C.Runtime/src/CMakeLists.txt similarity index 100% rename from IL2C.Runtime/src/CMakeLists.txt rename to src/IL2C.Runtime/src/CMakeLists.txt diff --git a/IL2C.Runtime/src/Core/il2c.c b/src/IL2C.Runtime/src/Core/il2c.c similarity index 97% rename from IL2C.Runtime/src/Core/il2c.c rename to src/IL2C.Runtime/src/Core/il2c.c index e2a59818..0ee73597 100644 --- a/IL2C.Runtime/src/Core/il2c.c +++ b/src/IL2C.Runtime/src/Core/il2c.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Core/il2c_allocator.c b/src/IL2C.Runtime/src/Core/il2c_allocator.c similarity index 97% rename from IL2C.Runtime/src/Core/il2c_allocator.c rename to src/IL2C.Runtime/src/Core/il2c_allocator.c index a34787a8..64455558 100644 --- a/IL2C.Runtime/src/Core/il2c_allocator.c +++ b/src/IL2C.Runtime/src/Core/il2c_allocator.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Core/il2c_debug.c b/src/IL2C.Runtime/src/Core/il2c_debug.c similarity index 94% rename from IL2C.Runtime/src/Core/il2c_debug.c rename to src/IL2C.Runtime/src/Core/il2c_debug.c index a282d54b..1ce3e4f7 100644 --- a/IL2C.Runtime/src/Core/il2c_debug.c +++ b/src/IL2C.Runtime/src/Core/il2c_debug.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include #include "../Platform/debugbreak.h" diff --git a/IL2C.Runtime/src/Core/il2c_exception.c b/src/IL2C.Runtime/src/Core/il2c_exception.c similarity index 96% rename from IL2C.Runtime/src/Core/il2c_exception.c rename to src/IL2C.Runtime/src/Core/il2c_exception.c index 7cf0db15..e3da99d0 100644 --- a/IL2C.Runtime/src/Core/il2c_exception.c +++ b/src/IL2C.Runtime/src/Core/il2c_exception.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Core/il2c_gc.c b/src/IL2C.Runtime/src/Core/il2c_gc.c similarity index 98% rename from IL2C.Runtime/src/Core/il2c_gc.c rename to src/IL2C.Runtime/src/Core/il2c_gc.c index f5eb6328..022644cd 100644 --- a/IL2C.Runtime/src/Core/il2c_gc.c +++ b/src/IL2C.Runtime/src/Core/il2c_gc.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Core/il2c_thread.c b/src/IL2C.Runtime/src/Core/il2c_thread.c similarity index 90% rename from IL2C.Runtime/src/Core/il2c_thread.c rename to src/IL2C.Runtime/src/Core/il2c_thread.c index 724b5f2a..cd7f1497 100644 --- a/IL2C.Runtime/src/Core/il2c_thread.c +++ b/src/IL2C.Runtime/src/Core/il2c_thread.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/arduino.c b/src/IL2C.Runtime/src/Platform/arduino.c similarity index 81% rename from IL2C.Runtime/src/Platform/arduino.c rename to src/IL2C.Runtime/src/Platform/arduino.c index 097995f6..353bb213 100644 --- a/IL2C.Runtime/src/Platform/arduino.c +++ b/src/IL2C.Runtime/src/Platform/arduino.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include ////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/arduino.h b/src/IL2C.Runtime/src/Platform/arduino.h similarity index 58% rename from IL2C.Runtime/src/Platform/arduino.h rename to src/IL2C.Runtime/src/Platform/arduino.h index 6cc19aa0..a4317365 100644 --- a/IL2C.Runtime/src/Platform/arduino.h +++ b/src/IL2C.Runtime/src/Platform/arduino.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/debugbreak.h b/src/IL2C.Runtime/src/Platform/debugbreak.h similarity index 85% rename from IL2C.Runtime/src/Platform/debugbreak.h rename to src/IL2C.Runtime/src/Platform/debugbreak.h index f5e96f4e..d6e62105 100644 --- a/IL2C.Runtime/src/Platform/debugbreak.h +++ b/src/IL2C.Runtime/src/Platform/debugbreak.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef DEBUG_BREAK_H #define DEBUG_BREAK_H diff --git a/IL2C.Runtime/src/Platform/efi/README b/src/IL2C.Runtime/src/Platform/efi/README similarity index 100% rename from IL2C.Runtime/src/Platform/efi/README rename to src/IL2C.Runtime/src/Platform/efi/README diff --git a/IL2C.Runtime/src/Platform/efi/amd64/efibind.h b/src/IL2C.Runtime/src/Platform/efi/amd64/efibind.h similarity index 92% rename from IL2C.Runtime/src/Platform/efi/amd64/efibind.h rename to src/IL2C.Runtime/src/Platform/efi/amd64/efibind.h index bbbbff83..fc204989 100644 --- a/IL2C.Runtime/src/Platform/efi/amd64/efibind.h +++ b/src/IL2C.Runtime/src/Platform/efi/amd64/efibind.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #pragma pack() diff --git a/IL2C.Runtime/src/Platform/efi/amd64/pe.h b/src/IL2C.Runtime/src/Platform/efi/amd64/pe.h similarity index 97% rename from IL2C.Runtime/src/Platform/efi/amd64/pe.h rename to src/IL2C.Runtime/src/Platform/efi/amd64/pe.h index 84552ec4..d267a84f 100644 --- a/IL2C.Runtime/src/Platform/efi/amd64/pe.h +++ b/src/IL2C.Runtime/src/Platform/efi/amd64/pe.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/amd64/pe.h 292625 2015-12-22 20:40:34Z emaste $ */ /* diff --git a/IL2C.Runtime/src/Platform/efi/arm/efibind.h b/src/IL2C.Runtime/src/Platform/efi/arm/efibind.h similarity index 84% rename from IL2C.Runtime/src/Platform/efi/arm/efibind.h rename to src/IL2C.Runtime/src/Platform/efi/arm/efibind.h index 98ad7b1c..6c8bf585 100644 --- a/IL2C.Runtime/src/Platform/efi/arm/efibind.h +++ b/src/IL2C.Runtime/src/Platform/efi/arm/efibind.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef _EFI_BIND_H_ #define _EFI_BIND_H_ diff --git a/IL2C.Runtime/src/Platform/efi/arm64/efibind.h b/src/IL2C.Runtime/src/Platform/efi/arm64/efibind.h similarity index 90% rename from IL2C.Runtime/src/Platform/efi/arm64/efibind.h rename to src/IL2C.Runtime/src/Platform/efi/arm64/efibind.h index 2c16e218..5cbcd2df 100644 --- a/IL2C.Runtime/src/Platform/efi/arm64/efibind.h +++ b/src/IL2C.Runtime/src/Platform/efi/arm64/efibind.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #pragma pack() diff --git a/IL2C.Runtime/src/Platform/efi/efi.h b/src/IL2C.Runtime/src/Platform/efi/efi.h similarity index 68% rename from IL2C.Runtime/src/Platform/efi/efi.h rename to src/IL2C.Runtime/src/Platform/efi/efi.h index 573a8b30..e63133c3 100644 --- a/IL2C.Runtime/src/Platform/efi/efi.h +++ b/src/IL2C.Runtime/src/Platform/efi/efi.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // Build flags on input diff --git a/IL2C.Runtime/src/Platform/efi/efi_nii.h b/src/IL2C.Runtime/src/Platform/efi/efi_nii.h similarity index 82% rename from IL2C.Runtime/src/Platform/efi/efi_nii.h rename to src/IL2C.Runtime/src/Platform/efi/efi_nii.h index ee711827..960ad6b8 100644 --- a/IL2C.Runtime/src/Platform/efi/efi_nii.h +++ b/src/IL2C.Runtime/src/Platform/efi/efi_nii.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efi_nii.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFI_NII_H diff --git a/IL2C.Runtime/src/Platform/efi/efiapi.h b/src/IL2C.Runtime/src/Platform/efi/efiapi.h similarity index 97% rename from IL2C.Runtime/src/Platform/efi/efiapi.h rename to src/IL2C.Runtime/src/Platform/efi/efiapi.h index 8aaee12d..e221e799 100644 --- a/IL2C.Runtime/src/Platform/efi/efiapi.h +++ b/src/IL2C.Runtime/src/Platform/efi/efiapi.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efiapi.h 312772 2017-01-25 19:55:35Z dim $ */ #ifndef _EFI_API_H diff --git a/src/IL2C.Runtime/src/Platform/efi/efichar.h b/src/IL2C.Runtime/src/Platform/efi/efichar.h new file mode 100644 index 00000000..46c1eb87 --- /dev/null +++ b/src/IL2C.Runtime/src/Platform/efi/efichar.h @@ -0,0 +1,16 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef _BOOT_EFI_EFICHAR_H_ +#define _BOOT_EFI_EFICHAR_H_ + +int ucs2_to_utf8(const efi_char *, char **); +int utf8_to_ucs2(const char *, efi_char **, size_t *); + +#endif /* _BOOT_EFI_EFICHAR_H_ */ diff --git a/IL2C.Runtime/src/Platform/efi/eficon.h b/src/IL2C.Runtime/src/Platform/efi/eficon.h similarity index 93% rename from IL2C.Runtime/src/Platform/efi/eficon.h rename to src/IL2C.Runtime/src/Platform/efi/eficon.h index 432c1656..c0345410 100644 --- a/IL2C.Runtime/src/Platform/efi/eficon.h +++ b/src/IL2C.Runtime/src/Platform/efi/eficon.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/eficon.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFI_CON_H diff --git a/IL2C.Runtime/src/Platform/efi/eficonsctl.h b/src/IL2C.Runtime/src/Platform/efi/eficonsctl.h similarity index 81% rename from IL2C.Runtime/src/Platform/efi/eficonsctl.h rename to src/IL2C.Runtime/src/Platform/efi/eficonsctl.h index e5cdb30c..28585472 100644 --- a/IL2C.Runtime/src/Platform/efi/eficonsctl.h +++ b/src/IL2C.Runtime/src/Platform/efi/eficonsctl.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* * Original Module Name: ConsoleControl.h diff --git a/IL2C.Runtime/src/Platform/efi/efidebug.h b/src/IL2C.Runtime/src/Platform/efi/efidebug.h similarity index 81% rename from IL2C.Runtime/src/Platform/efi/efidebug.h rename to src/IL2C.Runtime/src/Platform/efi/efidebug.h index d519c858..120c0d6a 100644 --- a/IL2C.Runtime/src/Platform/efi/efidebug.h +++ b/src/IL2C.Runtime/src/Platform/efi/efidebug.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efidebug.h 292625 2015-12-22 20:40:34Z emaste $ */ #ifndef _EFI_DEBUG_H diff --git a/IL2C.Runtime/src/Platform/efi/efidef.h b/src/IL2C.Runtime/src/Platform/efi/efidef.h similarity index 88% rename from IL2C.Runtime/src/Platform/efi/efidef.h rename to src/IL2C.Runtime/src/Platform/efi/efidef.h index ac83a0e4..cc0a6547 100644 --- a/IL2C.Runtime/src/Platform/efi/efidef.h +++ b/src/IL2C.Runtime/src/Platform/efi/efidef.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efidef.h 292625 2015-12-22 20:40:34Z emaste $ */ #ifndef _EFI_DEF_H diff --git a/IL2C.Runtime/src/Platform/efi/efidevp.h b/src/IL2C.Runtime/src/Platform/efi/efidevp.h similarity index 95% rename from IL2C.Runtime/src/Platform/efi/efidevp.h rename to src/IL2C.Runtime/src/Platform/efi/efidevp.h index 7ab8098f..4c8a44d7 100644 --- a/IL2C.Runtime/src/Platform/efi/efidevp.h +++ b/src/IL2C.Runtime/src/Platform/efi/efidevp.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efidevp.h 295320 2016-02-05 15:35:33Z smh $ */ #ifndef _DEVPATH_H diff --git a/IL2C.Runtime/src/Platform/efi/efierr.h b/src/IL2C.Runtime/src/Platform/efi/efierr.h similarity index 78% rename from IL2C.Runtime/src/Platform/efi/efierr.h rename to src/IL2C.Runtime/src/Platform/efi/efierr.h index 72ba7c01..2daaf0de 100644 --- a/IL2C.Runtime/src/Platform/efi/efierr.h +++ b/src/IL2C.Runtime/src/Platform/efi/efierr.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efierr.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFI_ERR_H diff --git a/IL2C.Runtime/src/Platform/efi/efifpswa.h b/src/IL2C.Runtime/src/Platform/efi/efifpswa.h similarity index 66% rename from IL2C.Runtime/src/Platform/efi/efifpswa.h rename to src/IL2C.Runtime/src/Platform/efi/efifpswa.h index 4b5916e4..6a0884ba 100644 --- a/IL2C.Runtime/src/Platform/efi/efifpswa.h +++ b/src/IL2C.Runtime/src/Platform/efi/efifpswa.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efifpswa.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFI_FPSWA_H diff --git a/IL2C.Runtime/src/Platform/efi/efifs.h b/src/IL2C.Runtime/src/Platform/efi/efifs.h similarity index 82% rename from IL2C.Runtime/src/Platform/efi/efifs.h rename to src/IL2C.Runtime/src/Platform/efi/efifs.h index 80f5ed7a..a3c2843d 100644 --- a/IL2C.Runtime/src/Platform/efi/efifs.h +++ b/src/IL2C.Runtime/src/Platform/efi/efifs.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efifs.h 292625 2015-12-22 20:40:34Z emaste $ */ #ifndef _EFI_FS_H diff --git a/IL2C.Runtime/src/Platform/efi/efigop.h b/src/IL2C.Runtime/src/Platform/efi/efigop.h similarity index 78% rename from IL2C.Runtime/src/Platform/efi/efigop.h rename to src/IL2C.Runtime/src/Platform/efi/efigop.h index 0303fe5c..be132e19 100644 --- a/IL2C.Runtime/src/Platform/efi/efigop.h +++ b/src/IL2C.Runtime/src/Platform/efi/efigop.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef _EFIGOP_H #define _EFIGOP_H diff --git a/IL2C.Runtime/src/Platform/efi/efilib.h b/src/IL2C.Runtime/src/Platform/efi/efilib.h similarity index 66% rename from IL2C.Runtime/src/Platform/efi/efilib.h rename to src/IL2C.Runtime/src/Platform/efi/efilib.h index bf8ccb74..cf3c69b3 100644 --- a/IL2C.Runtime/src/Platform/efi/efilib.h +++ b/src/IL2C.Runtime/src/Platform/efi/efilib.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef _LOADER_EFILIB_H #define _LOADER_EFILIB_H diff --git a/IL2C.Runtime/src/Platform/efi/efinet.h b/src/IL2C.Runtime/src/Platform/efi/efinet.h similarity index 93% rename from IL2C.Runtime/src/Platform/efi/efinet.h rename to src/IL2C.Runtime/src/Platform/efi/efinet.h index 34ed5626..c461ff02 100644 --- a/IL2C.Runtime/src/Platform/efi/efinet.h +++ b/src/IL2C.Runtime/src/Platform/efi/efinet.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efinet.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFINET_H diff --git a/IL2C.Runtime/src/Platform/efi/efipart.h b/src/IL2C.Runtime/src/Platform/efi/efipart.h similarity index 73% rename from IL2C.Runtime/src/Platform/efi/efipart.h rename to src/IL2C.Runtime/src/Platform/efi/efipart.h index 5274fe50..f1cdc37a 100644 --- a/IL2C.Runtime/src/Platform/efi/efipart.h +++ b/src/IL2C.Runtime/src/Platform/efi/efipart.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efipart.h 292625 2015-12-22 20:40:34Z emaste $ */ #ifndef _EFI_PART_H diff --git a/IL2C.Runtime/src/Platform/efi/efipciio.h b/src/IL2C.Runtime/src/Platform/efi/efipciio.h similarity index 97% rename from IL2C.Runtime/src/Platform/efi/efipciio.h rename to src/IL2C.Runtime/src/Platform/efi/efipciio.h index a7ed6d87..8b7fc741 100644 --- a/IL2C.Runtime/src/Platform/efi/efipciio.h +++ b/src/IL2C.Runtime/src/Platform/efi/efipciio.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef __PCI_IO_H__ #define __PCI_IO_H__ diff --git a/IL2C.Runtime/src/Platform/efi/efiprot.h b/src/IL2C.Runtime/src/Platform/efi/efiprot.h similarity index 95% rename from IL2C.Runtime/src/Platform/efi/efiprot.h rename to src/IL2C.Runtime/src/Platform/efi/efiprot.h index 29be00ea..c977d676 100644 --- a/IL2C.Runtime/src/Platform/efi/efiprot.h +++ b/src/IL2C.Runtime/src/Platform/efi/efiprot.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efiprot.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFI_PROT_H diff --git a/IL2C.Runtime/src/Platform/efi/efipxebc.h b/src/IL2C.Runtime/src/Platform/efi/efipxebc.h similarity index 95% rename from IL2C.Runtime/src/Platform/efi/efipxebc.h rename to src/IL2C.Runtime/src/Platform/efi/efipxebc.h index 2ad1de73..ae2a29fa 100644 --- a/IL2C.Runtime/src/Platform/efi/efipxebc.h +++ b/src/IL2C.Runtime/src/Platform/efi/efipxebc.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efipxebc.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFIPXEBC_H diff --git a/IL2C.Runtime/src/Platform/efi/efiser.h b/src/IL2C.Runtime/src/Platform/efi/efiser.h similarity index 85% rename from IL2C.Runtime/src/Platform/efi/efiser.h rename to src/IL2C.Runtime/src/Platform/efi/efiser.h index c79590c9..ec651406 100644 --- a/IL2C.Runtime/src/Platform/efi/efiser.h +++ b/src/IL2C.Runtime/src/Platform/efi/efiser.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efiser.h 293724 2016-01-12 02:17:39Z smh $ */ #ifndef _EFI_SER_H diff --git a/IL2C.Runtime/src/Platform/efi/efistdarg.h b/src/IL2C.Runtime/src/Platform/efi/efistdarg.h similarity index 64% rename from IL2C.Runtime/src/Platform/efi/efistdarg.h rename to src/IL2C.Runtime/src/Platform/efi/efistdarg.h index 2433a724..065c49cb 100644 --- a/IL2C.Runtime/src/Platform/efi/efistdarg.h +++ b/src/IL2C.Runtime/src/Platform/efi/efistdarg.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/efistdarg.h 163898 2006-11-02 02:42:48Z marcel $ */ #ifndef _EFISTDARG_H_ diff --git a/IL2C.Runtime/src/Platform/efi/efiuga.h b/src/IL2C.Runtime/src/Platform/efi/efiuga.h similarity index 89% rename from IL2C.Runtime/src/Platform/efi/efiuga.h rename to src/IL2C.Runtime/src/Platform/efi/efiuga.h index cf8714fe..e66d42aa 100644 --- a/IL2C.Runtime/src/Platform/efi/efiuga.h +++ b/src/IL2C.Runtime/src/Platform/efi/efiuga.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #ifndef __UGA_DRAW_H__ #define __UGA_DRAW_H__ diff --git a/IL2C.Runtime/src/Platform/efi/i386/efibind.h b/src/IL2C.Runtime/src/Platform/efi/i386/efibind.h similarity index 92% rename from IL2C.Runtime/src/Platform/efi/i386/efibind.h rename to src/IL2C.Runtime/src/Platform/efi/i386/efibind.h index 6e459877..ed12bdf0 100644 --- a/IL2C.Runtime/src/Platform/efi/i386/efibind.h +++ b/src/IL2C.Runtime/src/Platform/efi/i386/efibind.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// #pragma pack() diff --git a/IL2C.Runtime/src/Platform/efi/i386/pe.h b/src/IL2C.Runtime/src/Platform/efi/i386/pe.h similarity index 97% rename from IL2C.Runtime/src/Platform/efi/i386/pe.h rename to src/IL2C.Runtime/src/Platform/efi/i386/pe.h index 0361e862..e4153067 100644 --- a/IL2C.Runtime/src/Platform/efi/i386/pe.h +++ b/src/IL2C.Runtime/src/Platform/efi/i386/pe.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// /* $FreeBSD: releng/11.1/sys/boot/efi/include/i386/pe.h 292625 2015-12-22 20:40:34Z emaste $ */ /* diff --git a/IL2C.Runtime/src/Platform/fmod.c b/src/IL2C.Runtime/src/Platform/fmod.c similarity index 82% rename from IL2C.Runtime/src/Platform/fmod.c rename to src/IL2C.Runtime/src/Platform/fmod.c index 02596d35..4376d3cf 100644 --- a/IL2C.Runtime/src/Platform/fmod.c +++ b/src/IL2C.Runtime/src/Platform/fmod.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include #if defined(IL2C_USE_FMOD) diff --git a/IL2C.Runtime/src/Platform/freertos.c b/src/IL2C.Runtime/src/Platform/freertos.c similarity index 73% rename from IL2C.Runtime/src/Platform/freertos.c rename to src/IL2C.Runtime/src/Platform/freertos.c index d2800da7..d1c6369e 100644 --- a/IL2C.Runtime/src/Platform/freertos.c +++ b/src/IL2C.Runtime/src/Platform/freertos.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include ////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/freertos.h b/src/IL2C.Runtime/src/Platform/freertos.h similarity index 75% rename from IL2C.Runtime/src/Platform/freertos.h rename to src/IL2C.Runtime/src/Platform/freertos.h index 5d86743b..b978e554 100644 --- a/IL2C.Runtime/src/Platform/freertos.h +++ b/src/IL2C.Runtime/src/Platform/freertos.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/gcc.h b/src/IL2C.Runtime/src/Platform/gcc.h similarity index 72% rename from IL2C.Runtime/src/Platform/gcc.h rename to src/IL2C.Runtime/src/Platform/gcc.h index 09d8064b..9c57443b 100644 --- a/IL2C.Runtime/src/Platform/gcc.h +++ b/src/IL2C.Runtime/src/Platform/gcc.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/heap.c b/src/IL2C.Runtime/src/Platform/heap.c similarity index 88% rename from IL2C.Runtime/src/Platform/heap.c rename to src/IL2C.Runtime/src/Platform/heap.c index ce9d18cc..7bed2693 100644 --- a/IL2C.Runtime/src/Platform/heap.c +++ b/src/IL2C.Runtime/src/Platform/heap.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include #if defined(_MSC_VER) diff --git a/IL2C.Runtime/src/Platform/heap.h b/src/IL2C.Runtime/src/Platform/heap.h similarity index 82% rename from IL2C.Runtime/src/Platform/heap.h rename to src/IL2C.Runtime/src/Platform/heap.h index 0c1f806a..1f4c2512 100644 --- a/IL2C.Runtime/src/Platform/heap.h +++ b/src/IL2C.Runtime/src/Platform/heap.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/linux.c b/src/IL2C.Runtime/src/Platform/linux.c similarity index 82% rename from IL2C.Runtime/src/Platform/linux.c rename to src/IL2C.Runtime/src/Platform/linux.c index d7dcad16..71cdfc00 100644 --- a/IL2C.Runtime/src/Platform/linux.c +++ b/src/IL2C.Runtime/src/Platform/linux.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include ////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/linux.h b/src/IL2C.Runtime/src/Platform/linux.h similarity index 57% rename from IL2C.Runtime/src/Platform/linux.h rename to src/IL2C.Runtime/src/Platform/linux.h index 65213807..228589bd 100644 --- a/IL2C.Runtime/src/Platform/linux.h +++ b/src/IL2C.Runtime/src/Platform/linux.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/msvc.h b/src/IL2C.Runtime/src/Platform/msvc.h similarity index 70% rename from IL2C.Runtime/src/Platform/msvc.h rename to src/IL2C.Runtime/src/Platform/msvc.h index 9770bdf8..1ef36e50 100644 --- a/IL2C.Runtime/src/Platform/msvc.h +++ b/src/IL2C.Runtime/src/Platform/msvc.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/src/IL2C.Runtime/src/Platform/no-threading.c b/src/IL2C.Runtime/src/Platform/no-threading.c new file mode 100644 index 00000000..779b8fa7 --- /dev/null +++ b/src/IL2C.Runtime/src/Platform/no-threading.c @@ -0,0 +1,19 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#include + +/////////////////////////////////////////////////// +// Lack for threading support + +#if defined(IL2C_NO_THREADING) + +intptr_t g_TLS0; + +#endif diff --git a/IL2C.Runtime/src/Platform/no-threading.h b/src/IL2C.Runtime/src/Platform/no-threading.h similarity index 72% rename from IL2C.Runtime/src/Platform/no-threading.h rename to src/IL2C.Runtime/src/Platform/no-threading.h index 7ac57d91..a975b692 100644 --- a/IL2C.Runtime/src/Platform/no-threading.h +++ b/src/IL2C.Runtime/src/Platform/no-threading.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/pthread.c b/src/IL2C.Runtime/src/Platform/pthread.c similarity index 78% rename from IL2C.Runtime/src/Platform/pthread.c rename to src/IL2C.Runtime/src/Platform/pthread.c index d8d2d332..ed27c4bf 100644 --- a/IL2C.Runtime/src/Platform/pthread.c +++ b/src/IL2C.Runtime/src/Platform/pthread.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include ////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/pthread.h b/src/IL2C.Runtime/src/Platform/pthread.h similarity index 74% rename from IL2C.Runtime/src/Platform/pthread.h rename to src/IL2C.Runtime/src/Platform/pthread.h index bebb67e3..7bff58c7 100644 --- a/IL2C.Runtime/src/Platform/pthread.h +++ b/src/IL2C.Runtime/src/Platform/pthread.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/strings.c b/src/IL2C.Runtime/src/Platform/strings.c similarity index 95% rename from IL2C.Runtime/src/Platform/strings.c rename to src/IL2C.Runtime/src/Platform/strings.c index 3a7ba0ff..209a8051 100644 --- a/IL2C.Runtime/src/Platform/strings.c +++ b/src/IL2C.Runtime/src/Platform/strings.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include ////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/strings.h b/src/IL2C.Runtime/src/Platform/strings.h similarity index 75% rename from IL2C.Runtime/src/Platform/strings.h rename to src/IL2C.Runtime/src/Platform/strings.h index 70882b2e..7278bc8a 100644 --- a/IL2C.Runtime/src/Platform/strings.h +++ b/src/IL2C.Runtime/src/Platform/strings.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/uefi.c b/src/IL2C.Runtime/src/Platform/uefi.c similarity index 94% rename from IL2C.Runtime/src/Platform/uefi.c rename to src/IL2C.Runtime/src/Platform/uefi.c index 965f3ea6..ec4b00dc 100644 --- a/IL2C.Runtime/src/Platform/uefi.c +++ b/src/IL2C.Runtime/src/Platform/uefi.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////// // UEFI diff --git a/IL2C.Runtime/src/Platform/uefi.h b/src/IL2C.Runtime/src/Platform/uefi.h similarity index 69% rename from IL2C.Runtime/src/Platform/uefi.h rename to src/IL2C.Runtime/src/Platform/uefi.h index 642cc551..02083162 100644 --- a/IL2C.Runtime/src/Platform/uefi.h +++ b/src/IL2C.Runtime/src/Platform/uefi.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/uefi_Win32.asm b/src/IL2C.Runtime/src/Platform/uefi_Win32.asm similarity index 100% rename from IL2C.Runtime/src/Platform/uefi_Win32.asm rename to src/IL2C.Runtime/src/Platform/uefi_Win32.asm diff --git a/IL2C.Runtime/src/Platform/uefi_x64.asm b/src/IL2C.Runtime/src/Platform/uefi_x64.asm similarity index 100% rename from IL2C.Runtime/src/Platform/uefi_x64.asm rename to src/IL2C.Runtime/src/Platform/uefi_x64.asm diff --git a/IL2C.Runtime/src/Platform/wdm.c b/src/IL2C.Runtime/src/Platform/wdm.c similarity index 65% rename from IL2C.Runtime/src/Platform/wdm.c rename to src/IL2C.Runtime/src/Platform/wdm.c index a717778e..52babd0e 100644 --- a/IL2C.Runtime/src/Platform/wdm.c +++ b/src/IL2C.Runtime/src/Platform/wdm.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include ////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/wdm.h b/src/IL2C.Runtime/src/Platform/wdm.h similarity index 76% rename from IL2C.Runtime/src/Platform/wdm.h rename to src/IL2C.Runtime/src/Platform/wdm.h index 84e05279..62efe9f4 100644 --- a/IL2C.Runtime/src/Platform/wdm.h +++ b/src/IL2C.Runtime/src/Platform/wdm.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/Platform/windows.c b/src/IL2C.Runtime/src/Platform/windows.c similarity index 89% rename from IL2C.Runtime/src/Platform/windows.c rename to src/IL2C.Runtime/src/Platform/windows.c index bad3ca67..438eb1d4 100644 --- a/IL2C.Runtime/src/Platform/windows.c +++ b/src/IL2C.Runtime/src/Platform/windows.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include /////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/Platform/windows.h b/src/IL2C.Runtime/src/Platform/windows.h similarity index 78% rename from IL2C.Runtime/src/Platform/windows.h rename to src/IL2C.Runtime/src/Platform/windows.h index 4b1ffedf..4b3204b5 100644 --- a/IL2C.Runtime/src/Platform/windows.h +++ b/src/IL2C.Runtime/src/Platform/windows.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/IL2C.Runtime/src/System/AppDomain.c b/src/IL2C.Runtime/src/System/AppDomain.c similarity index 86% rename from IL2C.Runtime/src/System/AppDomain.c rename to src/IL2C.Runtime/src/System/AppDomain.c index a2e3232f..437db373 100644 --- a/IL2C.Runtime/src/System/AppDomain.c +++ b/src/IL2C.Runtime/src/System/AppDomain.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Array.c b/src/IL2C.Runtime/src/System/Array.c similarity index 91% rename from IL2C.Runtime/src/System/Array.c rename to src/IL2C.Runtime/src/System/Array.c index 450c1c96..7195e3c6 100644 --- a/IL2C.Runtime/src/System/Array.c +++ b/src/IL2C.Runtime/src/System/Array.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Boolean.c b/src/IL2C.Runtime/src/System/Boolean.c similarity index 83% rename from IL2C.Runtime/src/System/Boolean.c rename to src/IL2C.Runtime/src/System/Boolean.c index 8856fdc2..62a4f95a 100644 --- a/IL2C.Runtime/src/System/Boolean.c +++ b/src/IL2C.Runtime/src/System/Boolean.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Byte.c b/src/IL2C.Runtime/src/System/Byte.c similarity index 83% rename from IL2C.Runtime/src/System/Byte.c rename to src/IL2C.Runtime/src/System/Byte.c index 48f839fa..0813c06e 100644 --- a/IL2C.Runtime/src/System/Byte.c +++ b/src/IL2C.Runtime/src/System/Byte.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Char.c b/src/IL2C.Runtime/src/System/Char.c similarity index 80% rename from IL2C.Runtime/src/System/Char.c rename to src/IL2C.Runtime/src/System/Char.c index a9133c75..07b8818b 100644 --- a/IL2C.Runtime/src/System/Char.c +++ b/src/IL2C.Runtime/src/System/Char.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Console.c b/src/IL2C.Runtime/src/System/Console.c similarity index 69% rename from IL2C.Runtime/src/System/Console.c rename to src/IL2C.Runtime/src/System/Console.c index ab029c78..8dc04ed5 100644 --- a/IL2C.Runtime/src/System/Console.c +++ b/src/IL2C.Runtime/src/System/Console.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// @@ -24,6 +33,13 @@ void System_Console_WriteLine__System_Int32(int32_t value) il2c_writeline(buffer); } +void System_Console_WriteLine__System_Int64(int64_t value) +{ + wchar_t buffer[24]; + il2c_i64tow(value, buffer, 10); + il2c_writeline(buffer); +} + void System_Console_WriteLine__System_String(System_String* value) { if (value != NULL) diff --git a/IL2C.Runtime/src/System/Delegate.c b/src/IL2C.Runtime/src/System/Delegate.c similarity index 96% rename from IL2C.Runtime/src/System/Delegate.c rename to src/IL2C.Runtime/src/System/Delegate.c index 1ae082c8..656c992b 100644 --- a/IL2C.Runtime/src/System/Delegate.c +++ b/src/IL2C.Runtime/src/System/Delegate.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Double.c b/src/IL2C.Runtime/src/System/Double.c similarity index 86% rename from IL2C.Runtime/src/System/Double.c rename to src/IL2C.Runtime/src/System/Double.c index 0c361049..e0d6492e 100644 --- a/IL2C.Runtime/src/System/Double.c +++ b/src/IL2C.Runtime/src/System/Double.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Enum.c b/src/IL2C.Runtime/src/System/Enum.c similarity index 74% rename from IL2C.Runtime/src/System/Enum.c rename to src/IL2C.Runtime/src/System/Enum.c index a903d3de..6fc0f006 100644 --- a/IL2C.Runtime/src/System/Enum.c +++ b/src/IL2C.Runtime/src/System/Enum.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/EventArgs.c b/src/IL2C.Runtime/src/System/EventArgs.c similarity index 51% rename from IL2C.Runtime/src/System/EventArgs.c rename to src/IL2C.Runtime/src/System/EventArgs.c index 8a39cefe..1c14f76f 100644 --- a/IL2C.Runtime/src/System/EventArgs.c +++ b/src/IL2C.Runtime/src/System/EventArgs.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Exception.c b/src/IL2C.Runtime/src/System/Exception.c similarity index 83% rename from IL2C.Runtime/src/System/Exception.c rename to src/IL2C.Runtime/src/System/Exception.c index 780de903..8beaa182 100644 --- a/IL2C.Runtime/src/System/Exception.c +++ b/src/IL2C.Runtime/src/System/Exception.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/FormatException.c b/src/IL2C.Runtime/src/System/FormatException.c similarity index 51% rename from IL2C.Runtime/src/System/FormatException.c rename to src/IL2C.Runtime/src/System/FormatException.c index de555405..78872763 100644 --- a/IL2C.Runtime/src/System/FormatException.c +++ b/src/IL2C.Runtime/src/System/FormatException.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/GC.c b/src/IL2C.Runtime/src/System/GC.c similarity index 76% rename from IL2C.Runtime/src/System/GC.c rename to src/IL2C.Runtime/src/System/GC.c index 32146366..b49d42e7 100644 --- a/IL2C.Runtime/src/System/GC.c +++ b/src/IL2C.Runtime/src/System/GC.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" #include diff --git a/src/IL2C.Runtime/src/System/IDisposable.c b/src/IL2C.Runtime/src/System/IDisposable.c new file mode 100644 index 00000000..38ae3dfe --- /dev/null +++ b/src/IL2C.Runtime/src/System/IDisposable.c @@ -0,0 +1,20 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#include "il2c_private.h" +#include + +///////////////////////////////////////////////////////////// +// System.IDisposable + +///////////////////////////////////////////////// +// VTable and runtime type info declarations + +IL2C_RUNTIME_TYPE_INTERFACE_BEGIN(System_IDisposable, "System.IDisposable", 0) +IL2C_RUNTIME_TYPE_END(); diff --git a/src/IL2C.Runtime/src/System/IFormatProvider.c b/src/IL2C.Runtime/src/System/IFormatProvider.c new file mode 100644 index 00000000..5c4d2352 --- /dev/null +++ b/src/IL2C.Runtime/src/System/IFormatProvider.c @@ -0,0 +1,19 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#include "il2c_private.h" + +///////////////////////////////////////////////////////////// +// System.IFormatProvider + +///////////////////////////////////////////////// +// VTable and runtime type info declarations + +IL2C_RUNTIME_TYPE_INTERFACE_BEGIN(System_IFormatProvider, "System.IFormatProvider", 0) +IL2C_RUNTIME_TYPE_END(); diff --git a/src/IL2C.Runtime/src/System/IFormattable.c b/src/IL2C.Runtime/src/System/IFormattable.c new file mode 100644 index 00000000..942a6397 --- /dev/null +++ b/src/IL2C.Runtime/src/System/IFormattable.c @@ -0,0 +1,19 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#include "il2c_private.h" + +///////////////////////////////////////////////////////////// +// System.IFormattable + +///////////////////////////////////////////////// +// VTable and runtime type info declarations + +IL2C_RUNTIME_TYPE_INTERFACE_BEGIN(System_IFormattable, "System.IFormattable", 0) +IL2C_RUNTIME_TYPE_END(); diff --git a/IL2C.Runtime/src/System/IndexOutOfRangeException.c b/src/IL2C.Runtime/src/System/IndexOutOfRangeException.c similarity index 53% rename from IL2C.Runtime/src/System/IndexOutOfRangeException.c rename to src/IL2C.Runtime/src/System/IndexOutOfRangeException.c index 4079db71..00e5f735 100644 --- a/IL2C.Runtime/src/System/IndexOutOfRangeException.c +++ b/src/IL2C.Runtime/src/System/IndexOutOfRangeException.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Int16.c b/src/IL2C.Runtime/src/System/Int16.c similarity index 83% rename from IL2C.Runtime/src/System/Int16.c rename to src/IL2C.Runtime/src/System/Int16.c index 8d0e788f..ac7a8f6a 100644 --- a/IL2C.Runtime/src/System/Int16.c +++ b/src/IL2C.Runtime/src/System/Int16.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Int32.c b/src/IL2C.Runtime/src/System/Int32.c similarity index 81% rename from IL2C.Runtime/src/System/Int32.c rename to src/IL2C.Runtime/src/System/Int32.c index 0957124a..77b53b13 100644 --- a/IL2C.Runtime/src/System/Int32.c +++ b/src/IL2C.Runtime/src/System/Int32.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Int64.c b/src/IL2C.Runtime/src/System/Int64.c similarity index 81% rename from IL2C.Runtime/src/System/Int64.c rename to src/IL2C.Runtime/src/System/Int64.c index 3a1f20e5..932456e9 100644 --- a/IL2C.Runtime/src/System/Int64.c +++ b/src/IL2C.Runtime/src/System/Int64.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/IntPtr.c b/src/IL2C.Runtime/src/System/IntPtr.c similarity index 79% rename from IL2C.Runtime/src/System/IntPtr.c rename to src/IL2C.Runtime/src/System/IntPtr.c index b849a6a4..7b3f54c6 100644 --- a/IL2C.Runtime/src/System/IntPtr.c +++ b/src/IL2C.Runtime/src/System/IntPtr.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/InvalidCastException.c b/src/IL2C.Runtime/src/System/InvalidCastException.c similarity index 54% rename from IL2C.Runtime/src/System/InvalidCastException.c rename to src/IL2C.Runtime/src/System/InvalidCastException.c index f6b7f40a..b23714c6 100644 --- a/IL2C.Runtime/src/System/InvalidCastException.c +++ b/src/IL2C.Runtime/src/System/InvalidCastException.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/MulticastDelegate.c b/src/IL2C.Runtime/src/System/MulticastDelegate.c similarity index 57% rename from IL2C.Runtime/src/System/MulticastDelegate.c rename to src/IL2C.Runtime/src/System/MulticastDelegate.c index a7ac9cf8..22155405 100644 --- a/IL2C.Runtime/src/System/MulticastDelegate.c +++ b/src/IL2C.Runtime/src/System/MulticastDelegate.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/NullReferenceException.c b/src/IL2C.Runtime/src/System/NullReferenceException.c similarity index 53% rename from IL2C.Runtime/src/System/NullReferenceException.c rename to src/IL2C.Runtime/src/System/NullReferenceException.c index 00ec0048..9f3f057c 100644 --- a/IL2C.Runtime/src/System/NullReferenceException.c +++ b/src/IL2C.Runtime/src/System/NullReferenceException.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Object.c b/src/IL2C.Runtime/src/System/Object.c similarity index 84% rename from IL2C.Runtime/src/System/Object.c rename to src/IL2C.Runtime/src/System/Object.c index 3cec9333..a855882c 100644 --- a/IL2C.Runtime/src/System/Object.c +++ b/src/IL2C.Runtime/src/System/Object.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Runtime/CompilerServices/RuntimeHelpers.c b/src/IL2C.Runtime/src/System/Runtime/CompilerServices/RuntimeHelpers.c similarity index 74% rename from IL2C.Runtime/src/System/Runtime/CompilerServices/RuntimeHelpers.c rename to src/IL2C.Runtime/src/System/Runtime/CompilerServices/RuntimeHelpers.c index e4977458..eadd3590 100644 --- a/IL2C.Runtime/src/System/Runtime/CompilerServices/RuntimeHelpers.c +++ b/src/IL2C.Runtime/src/System/Runtime/CompilerServices/RuntimeHelpers.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Runtime/InteropServices/GCHandle.c b/src/IL2C.Runtime/src/System/Runtime/InteropServices/GCHandle.c similarity index 91% rename from IL2C.Runtime/src/System/Runtime/InteropServices/GCHandle.c rename to src/IL2C.Runtime/src/System/Runtime/InteropServices/GCHandle.c index 8ad5baac..7b45482f 100644 --- a/IL2C.Runtime/src/System/Runtime/InteropServices/GCHandle.c +++ b/src/IL2C.Runtime/src/System/Runtime/InteropServices/GCHandle.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" #include diff --git a/IL2C.Runtime/src/System/Runtime/InteropServices/NativePointer.c b/src/IL2C.Runtime/src/System/Runtime/InteropServices/NativePointer.c similarity index 55% rename from IL2C.Runtime/src/System/Runtime/InteropServices/NativePointer.c rename to src/IL2C.Runtime/src/System/Runtime/InteropServices/NativePointer.c index 04805f82..258b681a 100644 --- a/IL2C.Runtime/src/System/Runtime/InteropServices/NativePointer.c +++ b/src/IL2C.Runtime/src/System/Runtime/InteropServices/NativePointer.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" #include diff --git a/IL2C.Runtime/src/System/SByte.c b/src/IL2C.Runtime/src/System/SByte.c similarity index 83% rename from IL2C.Runtime/src/System/SByte.c rename to src/IL2C.Runtime/src/System/SByte.c index 445dc542..f996276a 100644 --- a/IL2C.Runtime/src/System/SByte.c +++ b/src/IL2C.Runtime/src/System/SByte.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Single.c b/src/IL2C.Runtime/src/System/Single.c similarity index 85% rename from IL2C.Runtime/src/System/Single.c rename to src/IL2C.Runtime/src/System/Single.c index 722c8215..7acc5c14 100644 --- a/IL2C.Runtime/src/System/Single.c +++ b/src/IL2C.Runtime/src/System/Single.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/String.c b/src/IL2C.Runtime/src/System/String.c similarity index 98% rename from IL2C.Runtime/src/System/String.c rename to src/IL2C.Runtime/src/System/String.c index 05ce85c4..e39c38d2 100644 --- a/IL2C.Runtime/src/System/String.c +++ b/src/IL2C.Runtime/src/System/String.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Threading/Interlocked.c b/src/IL2C.Runtime/src/System/Threading/Interlocked.c similarity index 57% rename from IL2C.Runtime/src/System/Threading/Interlocked.c rename to src/IL2C.Runtime/src/System/Threading/Interlocked.c index b7c5ef73..43b24164 100644 --- a/IL2C.Runtime/src/System/Threading/Interlocked.c +++ b/src/IL2C.Runtime/src/System/Threading/Interlocked.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Threading/Monitor.c b/src/IL2C.Runtime/src/System/Threading/Monitor.c similarity index 97% rename from IL2C.Runtime/src/System/Threading/Monitor.c rename to src/IL2C.Runtime/src/System/Threading/Monitor.c index 66a32527..3404c2f4 100644 --- a/IL2C.Runtime/src/System/Threading/Monitor.c +++ b/src/IL2C.Runtime/src/System/Threading/Monitor.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Threading/ParameterizedThreadStart.c b/src/IL2C.Runtime/src/System/Threading/ParameterizedThreadStart.c similarity index 76% rename from IL2C.Runtime/src/System/Threading/ParameterizedThreadStart.c rename to src/IL2C.Runtime/src/System/Threading/ParameterizedThreadStart.c index 9eedb0d2..4024bb72 100644 --- a/IL2C.Runtime/src/System/Threading/ParameterizedThreadStart.c +++ b/src/IL2C.Runtime/src/System/Threading/ParameterizedThreadStart.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Threading/Thread.c b/src/IL2C.Runtime/src/System/Threading/Thread.c similarity index 96% rename from IL2C.Runtime/src/System/Threading/Thread.c rename to src/IL2C.Runtime/src/System/Threading/Thread.c index ce147c83..881c058a 100644 --- a/IL2C.Runtime/src/System/Threading/Thread.c +++ b/src/IL2C.Runtime/src/System/Threading/Thread.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Threading/ThreadStart.c b/src/IL2C.Runtime/src/System/Threading/ThreadStart.c similarity index 74% rename from IL2C.Runtime/src/System/Threading/ThreadStart.c rename to src/IL2C.Runtime/src/System/Threading/ThreadStart.c index 7505201f..e6bb781b 100644 --- a/IL2C.Runtime/src/System/Threading/ThreadStart.c +++ b/src/IL2C.Runtime/src/System/Threading/ThreadStart.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/Type.c b/src/IL2C.Runtime/src/System/Type.c similarity index 87% rename from IL2C.Runtime/src/System/Type.c rename to src/IL2C.Runtime/src/System/Type.c index e7b24231..da3ac8fa 100644 --- a/IL2C.Runtime/src/System/Type.c +++ b/src/IL2C.Runtime/src/System/Type.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/UInt16.c b/src/IL2C.Runtime/src/System/UInt16.c similarity index 83% rename from IL2C.Runtime/src/System/UInt16.c rename to src/IL2C.Runtime/src/System/UInt16.c index 967ed644..c6a6a005 100644 --- a/IL2C.Runtime/src/System/UInt16.c +++ b/src/IL2C.Runtime/src/System/UInt16.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/UInt32.c b/src/IL2C.Runtime/src/System/UInt32.c similarity index 81% rename from IL2C.Runtime/src/System/UInt32.c rename to src/IL2C.Runtime/src/System/UInt32.c index 208b21bc..eb12381f 100644 --- a/IL2C.Runtime/src/System/UInt32.c +++ b/src/IL2C.Runtime/src/System/UInt32.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/UInt64.c b/src/IL2C.Runtime/src/System/UInt64.c similarity index 81% rename from IL2C.Runtime/src/System/UInt64.c rename to src/IL2C.Runtime/src/System/UInt64.c index 7407344c..c3ffde39 100644 --- a/IL2C.Runtime/src/System/UInt64.c +++ b/src/IL2C.Runtime/src/System/UInt64.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/UIntPtr.c b/src/IL2C.Runtime/src/System/UIntPtr.c similarity index 78% rename from IL2C.Runtime/src/System/UIntPtr.c rename to src/IL2C.Runtime/src/System/UIntPtr.c index ce999208..2f8fc9c5 100644 --- a/IL2C.Runtime/src/System/UIntPtr.c +++ b/src/IL2C.Runtime/src/System/UIntPtr.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/UnhandledExceptionEventArgs.c b/src/IL2C.Runtime/src/System/UnhandledExceptionEventArgs.c similarity index 76% rename from IL2C.Runtime/src/System/UnhandledExceptionEventArgs.c rename to src/IL2C.Runtime/src/System/UnhandledExceptionEventArgs.c index 96c6ac4c..112fba7f 100644 --- a/IL2C.Runtime/src/System/UnhandledExceptionEventArgs.c +++ b/src/IL2C.Runtime/src/System/UnhandledExceptionEventArgs.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/UnhandledExceptionEventHandler.c b/src/IL2C.Runtime/src/System/UnhandledExceptionEventHandler.c similarity index 77% rename from IL2C.Runtime/src/System/UnhandledExceptionEventHandler.c rename to src/IL2C.Runtime/src/System/UnhandledExceptionEventHandler.c index d33ecf7a..ca3af686 100644 --- a/IL2C.Runtime/src/System/UnhandledExceptionEventHandler.c +++ b/src/IL2C.Runtime/src/System/UnhandledExceptionEventHandler.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/IL2C.Runtime/src/System/ValueType.c b/src/IL2C.Runtime/src/System/ValueType.c similarity index 88% rename from IL2C.Runtime/src/System/ValueType.c rename to src/IL2C.Runtime/src/System/ValueType.c index ce37a50c..5bdc0e6c 100644 --- a/IL2C.Runtime/src/System/ValueType.c +++ b/src/IL2C.Runtime/src/System/ValueType.c @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + #include "il2c_private.h" ///////////////////////////////////////////////////////////// diff --git a/src/IL2C.Runtime/src/_main_template.c_ b/src/IL2C.Runtime/src/_main_template.c_ new file mode 100644 index 00000000..066e7bbd --- /dev/null +++ b/src/IL2C.Runtime/src/_main_template.c_ @@ -0,0 +1,38 @@ +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +#include +#include <{headerName}> + +#ifdef __cplusplus +extern "C" +#endif +int main(int argc, char** argv) +{ + ((void)argc); + ((void)argv); + +#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG) + _crtBreakAlloc = -1; +#endif + + il2c_initialize(); + +#if {mainIsVoid} + {mainSymbol}(); + + il2c_shutdown(); + return 0; +#else + const int r = {mainSymbol}(); + + il2c_shutdown(); + return r; +#endif +} diff --git a/IL2C.Runtime/src/il2c_private.h b/src/IL2C.Runtime/src/il2c_private.h similarity index 92% rename from IL2C.Runtime/src/il2c_private.h rename to src/IL2C.Runtime/src/il2c_private.h index 1172ab09..9ade999f 100644 --- a/IL2C.Runtime/src/il2c_private.h +++ b/src/IL2C.Runtime/src/il2c_private.h @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // It uses for internal purpose only. diff --git a/src/PlayGround/Calculator.Core/Calculator.Core.csproj b/src/PlayGround/Calculator.Core/Calculator.Core.csproj new file mode 100644 index 00000000..94afc79d --- /dev/null +++ b/src/PlayGround/Calculator.Core/Calculator.Core.csproj @@ -0,0 +1,33 @@ + + + + + + + + + + netstandard2.0 + + Calculator.Core + Calculator + + + + + + + + + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + + + diff --git a/src/PlayGround/Calculator.Core/PolishNotation.cs b/src/PlayGround/Calculator.Core/PolishNotation.cs new file mode 100644 index 00000000..be36314c --- /dev/null +++ b/src/PlayGround/Calculator.Core/PolishNotation.cs @@ -0,0 +1,236 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: InternalsVisibleTo("Calculator.Core.Tests")] + +namespace Calculator +{ + public abstract class AbstractNode + { + public readonly int NextIndex; + + protected AbstractNode(int nextIndex) + { + this.NextIndex = nextIndex; + } + } + + public class OperatorNode : AbstractNode + { + public readonly char Operator; + + public OperatorNode(char oper, int nextIndex) : base(nextIndex) + { + this.Operator = oper; + } + } + + public abstract class ReducibleNode : AbstractNode + { + protected ReducibleNode(int nextIndex) : base(nextIndex) + { + } + + public abstract int Reduce(); + } + + public class NumericNode : ReducibleNode + { + public readonly int Numeric; + + public NumericNode(int numeric, int nextIndex) : base(nextIndex) + { + this.Numeric = numeric; + } + + public override int Reduce() + { + return this.Numeric; + } + } + + public class ExpressionNode : ReducibleNode + { + public readonly OperatorNode Operator; + public readonly ReducibleNode Left; + public readonly ReducibleNode Right; + + public ExpressionNode(OperatorNode oper, ReducibleNode left, ReducibleNode right, int nextIndex) : base(nextIndex) + { + this.Operator = oper; + this.Left = left; + this.Right = right; + } + + public override int Reduce() + { + var leftResult = this.Left.Reduce(); + var rightResult = this.Right.Reduce(); + if (this.Operator.Operator == '+') + { + return leftResult + rightResult; + } + if (this.Operator.Operator == '-') + { + return leftResult - rightResult; + } + if (this.Operator.Operator == '*') + { + return leftResult * rightResult; + } + if (this.Operator.Operator == '/') + { + return leftResult / rightResult; + } + + // Invalid + return 0; + } + } + + public class PolishNotation + { + internal static int SkipWhiteSpace(string line, int startIndex) + { + var index = startIndex; + while (index < line.Length) + { + var ch = line[index]; + if ((ch != ' ') && (ch != '\t')) + { + break; + } + index++; + } + + return index; + } + + internal static OperatorNode ParseOperator(string line, int startIndex) + { + if (startIndex >= line.Length) + { + return null; + } + + var index = startIndex; + var ch = line[index]; + if ((ch != '+') && (ch != '-') && (ch != '*') && (ch != '/')) + { + return null; + } + index++; + + index = SkipWhiteSpace(line, index); + return new OperatorNode(ch, index); + } + + internal static NumericNode ParseNumeric(string line, int startIndex) + { + if (startIndex >= line.Length) + { + return null; + } + + var index = startIndex; + while (index < line.Length) + { + var ch = line[index]; + if (ch == ' ') + { + break; + } + index++; + } + + if (index == startIndex) + { + return null; + } + + var token = line.Substring(startIndex, index - startIndex); + if (int.TryParse(token, out var numeric) == false) + { + return null; + } + + index = SkipWhiteSpace(line, index); + return new NumericNode(numeric, index); + } + + internal static ExpressionNode ParseExpression(string line, int startIndex) + { + if (startIndex >= line.Length) + { + return null; + } + + var oper = ParseOperator(line, startIndex); + if (oper == null) + { + return null; + } + + ReducibleNode left = ParseNumeric(line, oper.NextIndex); + if (left == null) + { + left = ParseExpression(line, oper.NextIndex); + if (left == null) + { + return null; + } + } + + ReducibleNode right = ParseNumeric(line, left.NextIndex); + if (right == null) + { + right = ParseExpression(line, left.NextIndex); + if (right == null) + { + return null; + } + } + + var index = SkipWhiteSpace(line, right.NextIndex); + return new ExpressionNode(oper, left, right, index); + } + + public static void Main() + { + Console.WriteLine("Polish notation calculator."); + Console.WriteLine("This is proof of concept for IL2C."); + Console.WriteLine("https://github.com/kekyo/IL2C"); + Console.WriteLine(); + Console.WriteLine("Type \"exit\" to exit."); + Console.WriteLine("Example: \"+ 2 3\""); + Console.WriteLine("Example: \"* + 2 3 6\""); + + while (true) + { + Console.WriteLine(); + Console.Write("PN> "); + var line = Console.ReadLine(); + if (string.IsNullOrWhiteSpace(line) == false) + { + if (line == "exit") + { + return; + } + + var expr = ParseExpression(line, 0); + if (expr == null) + { + Console.WriteLine("Syntax error."); + continue; + } + + var result = expr.Reduce(); + + Console.Write("Reuslt="); + Console.WriteLine(result); + } + } + } + } +} diff --git a/src/PlayGround/Calculator/Calculator.csproj b/src/PlayGround/Calculator/Calculator.csproj new file mode 100644 index 00000000..acacac29 --- /dev/null +++ b/src/PlayGround/Calculator/Calculator.csproj @@ -0,0 +1,41 @@ + + + + + + + + + + net48;net6.0 + Exe + + Calculator + Calculator + + -Os + + + + + + + + + + + + + + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + + + diff --git a/src/PlayGround/HelloWorld/HelloWorld.csproj b/src/PlayGround/HelloWorld/HelloWorld.csproj new file mode 100644 index 00000000..84c73899 --- /dev/null +++ b/src/PlayGround/HelloWorld/HelloWorld.csproj @@ -0,0 +1,26 @@ + + + + + + + + + + Exe + net6.0 + + + -s + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + + + diff --git a/src/PlayGround/HelloWorld/Program.cs b/src/PlayGround/HelloWorld/Program.cs new file mode 100644 index 00000000..b6190ec6 --- /dev/null +++ b/src/PlayGround/HelloWorld/Program.cs @@ -0,0 +1,10 @@ +using System; + +namespace HelloWorld +{ + public static class Program + { + public static void Main() => + Console.WriteLine("Hello world with IL2C!"); + } +} diff --git a/src/PlayGround/ShowMessageBoxOnWindows/Program.cs b/src/PlayGround/ShowMessageBoxOnWindows/Program.cs new file mode 100644 index 00000000..74ce553b --- /dev/null +++ b/src/PlayGround/ShowMessageBoxOnWindows/Program.cs @@ -0,0 +1,29 @@ +using System; +using System.Runtime.InteropServices; + +namespace GettingStartedIL2C +{ + public static class Program + { + public enum MessageBoxOptions : uint + { + MB_OK = 0, + MB_OKCANCEL, + MB_ABORTRETRYIGNORE, + MB_YESNOCANCEL, + MB_YESNO, + MB_RETRYCANCEL, + MB_CANCELTRYCONTINUE, + } + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + public static extern int MessageBoxW( + IntPtr hWnd, string text, string caption, MessageBoxOptions options); + + public static int Main() => + MessageBoxW( + IntPtr.Zero, + "Hello world with IL2C!", "Getting started IL2C", + MessageBoxOptions.MB_YESNOCANCEL); + } +} diff --git a/src/PlayGround/ShowMessageBoxOnWindows/ShowMessageBoxOnWindows.csproj b/src/PlayGround/ShowMessageBoxOnWindows/ShowMessageBoxOnWindows.csproj new file mode 100644 index 00000000..eadb7893 --- /dev/null +++ b/src/PlayGround/ShowMessageBoxOnWindows/ShowMessageBoxOnWindows.csproj @@ -0,0 +1,32 @@ + + + + + + + + + + + WinExe + + net6.0 + + + + false + + + -s + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + + + diff --git a/src/PlayGround/TakeAdvantageWithIL2CInvoke/Program.cs b/src/PlayGround/TakeAdvantageWithIL2CInvoke/Program.cs new file mode 100644 index 00000000..e0c888fe --- /dev/null +++ b/src/PlayGround/TakeAdvantageWithIL2CInvoke/Program.cs @@ -0,0 +1,55 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// It is intruduced what/how to do 'IL2C/Invoke'. +namespace TakeAdvantageWithIL2CInvoke +{ + // Refer tm struct type from pure C header file. + // IL2C/Invoke doesn't need to adjust any field offset/packing. + // Managed side declarations are pure stub. + [NativeType("time.h", SymbolName = "struct tm")] + internal struct tm + { + public int tm_sec; + public int tm_min; + public int tm_hour; + public int tm_mday; + public int tm_mon; + public int tm_year; + public int tm_wday; + public int tm_yday; + public int tm_isdst; + } + + public static class Program + { + // Refer mktime() API from pure C header file. + // extern "C" time_t mktime(struct tm*); + [NativeMethod("time.h")] + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern long mktime(in tm tmValue); + + public static void Main() + { + // 2022/10/23 12:34:56 + var tmValue = new tm + { + tm_year = 2022 - 1900, + tm_mon = 10 - 1, + tm_mday = 23, + tm_hour = 12, + tm_min = 34, + tm_sec = 56, + tm_wday = 0, + tm_yday = 0, + tm_isdst = 0, + }; + + var result = mktime(tmValue); + + // 1666496096 + Console.WriteLine(result); + } + } +} diff --git a/src/PlayGround/TakeAdvantageWithIL2CInvoke/TakeAdvantageWithIL2CInvoke.csproj b/src/PlayGround/TakeAdvantageWithIL2CInvoke/TakeAdvantageWithIL2CInvoke.csproj new file mode 100644 index 00000000..6c1f7960 --- /dev/null +++ b/src/PlayGround/TakeAdvantageWithIL2CInvoke/TakeAdvantageWithIL2CInvoke.csproj @@ -0,0 +1,32 @@ + + + + + + + + + + Exe + net6.0 + + + -s + + + + + + + + + + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\src\IL2C.Build\bin\$(Configuration)\$(_IL2C_PlatformName)')) + + + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props new file mode 100644 index 00000000..3d1a0e55 --- /dev/null +++ b/tests/Directory.Build.props @@ -0,0 +1,12 @@ + + + + + + + false + portable + False + + + diff --git a/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj b/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj index d6020938..d8b82d48 100644 --- a/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj +++ b/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj @@ -1,48 +1,29 @@  - - net48;netstandard2.0 - false + + net48;netstandard2.0 + Library + False + enable - Library - False - true - PackageReference - false - IL2C.Core.Test.BasicTypes - IL2C.BasicTypes - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - True - latest - full - true - AnyCPU - + IL2C.Core.Test.BasicTypes + IL2C.BasicTypes + - - - + + + - - - - - + + + + - - - - + + + - - + + diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.cs b/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.cs index adbd4956..f44df82c 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.cs b/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.cs index fc4120ee..17f0b542 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.cs b/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.cs index a7719a72..cd237f29 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Delegate/System_Delegate.cs b/tests/IL2C.Core.Test.BasicTypes/System_Delegate/System_Delegate.cs index 222f8cd2..4df67e9c 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Delegate/System_Delegate.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Delegate/System_Delegate.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs b/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs index 5c4ea6fb..9664dda9 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.cs b/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.cs index fd4af82b..f65dfbb4 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.cs b/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.cs index e445bfc2..445e60e9 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.cs b/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.cs index 6888b2e0..35aa2595 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.cs b/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.cs index 82f76cfd..55b93ad0 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.cs b/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.cs index 13ec852c..57f4a444 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.cs b/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.cs index 8644e2c3..1da34d49 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs b/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs index afaef7a4..095bde21 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.cs b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.cs index f83c75b8..aa02d763 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; @@ -32,7 +22,7 @@ namespace IL2C.BasicTypes [TestCase(8, "Length", "ABCDEFGH")] [TestCase(false, "IsNullOrWhiteSpace", "ABCDEFGH")] [TestCase(true, "IsNullOrWhiteSpace", "")] - [TestCase(true, "IsNullOrWhiteSpace", null)] + [TestCase(true, "IsNullOrWhiteSpace", null!)] [TestCase(true, "Equals1", "ABC", "ABC")] [TestCase(false, "Equals1", "ABC", "ABCDEF")] [TestCase(false, "Equals1", "ABC", "DEF")] diff --git a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format1.cs b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format1.cs index c7124ae5..d20c7ff7 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format1.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format2.cs b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format2.cs index 75a6ff02..7021c9ff 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format2.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format3.cs b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format3.cs index 496ade9d..53415fb8 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format3.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format3.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format_Params.cs b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format_Params.cs index 0527f109..2c77f749 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format_Params.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String_Format_Params.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Type/System_Type.cs b/tests/IL2C.Core.Test.BasicTypes/System_Type/System_Type.cs index ac6687b9..a62a522d 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Type/System_Type.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Type/System_Type.cs @@ -1,22 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.cs b/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.cs index faff4207..c89cf51f 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.cs b/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.cs index 4b29a081..93c7da37 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.cs b/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.cs index 00c0026e..28dfd893 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.cs b/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.cs index 72ed1842..11987779 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj b/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj index 6bb3be15..15b8eb78 100644 --- a/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj +++ b/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj @@ -1,35 +1,11 @@  - - net48;netstandard2.0 - false + + net48;netstandard2.0 + Library + enable - Library - true - PackageReference - false - IL2C.Core.Test.Common - IL2C - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - True - latest - full - true - AnyCPU - false - - - - - - + IL2C.Core.Test.Common + diff --git a/tests/IL2C.Core.Test.Common/TestCaseAttribute.cs b/tests/IL2C.Core.Test.Common/TestCaseAttribute.cs index 733a0dd3..31cc7051 100644 --- a/tests/IL2C.Core.Test.Common/TestCaseAttribute.cs +++ b/tests/IL2C.Core.Test.Common/TestCaseAttribute.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Linq; @@ -33,12 +23,12 @@ public enum TestCaseAsserts [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public sealed class TestCaseAttribute : Attribute { - public TestCaseAttribute(object expected, string methodName, params object[] args) + public TestCaseAttribute(object? expected, string methodName, params object?[] args) { this.MethodName = methodName; this.AdditionalMethodNames = new string[0]; this.Expected = expected; - this.Arguments = args ?? new object[] { null }; // HACK + this.Arguments = args ?? new object?[] { null }; // HACK this.Assert = TestCaseAsserts.PerfectMatch; this.IncludeBaseTypes = false; this.IncludeTypes = Type.EmptyTypes; @@ -46,12 +36,12 @@ public TestCaseAttribute(object expected, string methodName, params object[] arg } // This overload contains additional methods, those are used from the test method (first methodName is target.) - public TestCaseAttribute(object expected, string[] methodNames, params object[] args) + public TestCaseAttribute(object? expected, string[] methodNames, params object?[] args) { this.MethodName = methodNames[0]; // test method this.AdditionalMethodNames = methodNames.Skip(1).ToArray(); // additionals this.Expected = expected; - this.Arguments = args ?? new object[] { null }; // HACK + this.Arguments = args ?? new object?[] { null }; // HACK this.Assert = TestCaseAsserts.PerfectMatch; this.IncludeBaseTypes = false; this.IncludeTypes = Type.EmptyTypes; @@ -60,8 +50,8 @@ public TestCaseAttribute(object expected, string[] methodNames, params object[] public string MethodName { get; } public string[] AdditionalMethodNames { get; } - public object Expected { get; } - public object[] Arguments { get; } + public object? Expected { get; } + public object?[] Arguments { get; } public TestCaseAsserts Assert { get; set; } public bool IncludeBaseTypes { get; set; } diff --git a/tests/IL2C.Core.Test.Common/TestIdAttribute.cs b/tests/IL2C.Core.Test.Common/TestIdAttribute.cs index 9b79fb58..548d52e2 100644 --- a/tests/IL2C.Core.Test.Common/TestIdAttribute.cs +++ b/tests/IL2C.Core.Test.Common/TestIdAttribute.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; diff --git a/tests/IL2C.Core.Test.Fixture/CoreTestTargetTest.cs b/tests/IL2C.Core.Test.Fixture/CoreTestTargetTest.cs index 3ee5f23a..a85a879c 100644 --- a/tests/IL2C.Core.Test.Fixture/CoreTestTargetTest.cs +++ b/tests/IL2C.Core.Test.Fixture/CoreTestTargetTest.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using NUnit.Framework; using System.Diagnostics; diff --git a/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj b/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj index 39094674..3385005f 100644 --- a/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj +++ b/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj @@ -1,68 +1,48 @@ - + - - net48;net5.0 - false + + net48;net6.0 + Library - Library - true - PackageReference - True - false - IL2C.Core.Test.Fixture - IL2C - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2017 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - latest - full - true - AnyCPU - + IL2C.Core.Test.Fixture + IL2C + - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + + + - - - - - - + + + + + + + diff --git a/tests/IL2C.Core.Test.Fixture/Internal/CMakeDriver.cs b/tests/IL2C.Core.Test.Fixture/Internal/CMakeDriver.cs index 05fb473a..5766b135 100644 --- a/tests/IL2C.Core.Test.Fixture/Internal/CMakeDriver.cs +++ b/tests/IL2C.Core.Test.Fixture/Internal/CMakeDriver.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/tests/IL2C.Core.Test.Fixture/Internal/CMakeListsSimpleParser.cs b/tests/IL2C.Core.Test.Fixture/Internal/CMakeListsSimpleParser.cs index 2d4aef90..dce31ae2 100644 --- a/tests/IL2C.Core.Test.Fixture/Internal/CMakeListsSimpleParser.cs +++ b/tests/IL2C.Core.Test.Fixture/Internal/CMakeListsSimpleParser.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/tests/IL2C.Core.Test.Fixture/Internal/ILVerifier.cs b/tests/IL2C.Core.Test.Fixture/Internal/ILVerifier.cs index bc472550..5c7ee46f 100644 --- a/tests/IL2C.Core.Test.Fixture/Internal/ILVerifier.cs +++ b/tests/IL2C.Core.Test.Fixture/Internal/ILVerifier.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using ILVerify; using Internal.IL; diff --git a/tests/IL2C.Core.Test.Fixture/Internal/ILVerifierNameFormatter.cs b/tests/IL2C.Core.Test.Fixture/Internal/ILVerifierNameFormatter.cs index 0b79b260..3e175428 100644 --- a/tests/IL2C.Core.Test.Fixture/Internal/ILVerifierNameFormatter.cs +++ b/tests/IL2C.Core.Test.Fixture/Internal/ILVerifierNameFormatter.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using Internal.TypeSystem; using System; diff --git a/tests/IL2C.Core.Test.Fixture/Internal/StatisticsDocumentGenerators.cs b/tests/IL2C.Core.Test.Fixture/Internal/StatisticsDocumentGenerators.cs index d92cf45a..0016f92d 100644 --- a/tests/IL2C.Core.Test.Fixture/Internal/StatisticsDocumentGenerators.cs +++ b/tests/IL2C.Core.Test.Fixture/Internal/StatisticsDocumentGenerators.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.IO; diff --git a/tests/IL2C.Core.Test.Fixture/NUnitDynamicTestHandlers.cs b/tests/IL2C.Core.Test.Fixture/NUnitDynamicTestHandlers.cs index 74626f62..f1e60d79 100644 --- a/tests/IL2C.Core.Test.Fixture/NUnitDynamicTestHandlers.cs +++ b/tests/IL2C.Core.Test.Fixture/NUnitDynamicTestHandlers.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using IL2C.Internal; using System; @@ -133,7 +123,7 @@ private NUnit.Framework.Internal.TestMethod BuildTestMethod( var name = string.Format( "{0}({1})", testCase.Name, - string.Join(",", testCase.Arguments.Select(Utilities.GetCSharpLanguageExpression))); + string.Join(",", testCase.Arguments.Select(SymbolManipulator.GetCSharpLanguageExpression))); testMethod.Name = name; testMethod.FullName = string.Format( "{0}.{1}.{2}", diff --git a/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt b/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt index 9d377321..203a39cf 100644 --- a/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt +++ b/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.8) -include(${CMAKE_CURRENT_LIST_DIR}/../../../../../../IL2C.Runtime/cmake/${CMAKE_TARGET_SCRIPT_NAME}) +include(${CMAKE_CURRENT_LIST_DIR}/../../../../../../src/IL2C.Runtime/cmake/${CMAKE_TARGET_SCRIPT_NAME}) project(test C) diff --git a/tests/IL2C.Core.Test.Fixture/Templates/test.c b/tests/IL2C.Core.Test.Fixture/Templates/test.c index 901c94bb..7ac290c7 100644 --- a/tests/IL2C.Core.Test.Fixture/Templates/test.c +++ b/tests/IL2C.Core.Test.Fixture/Templates/test.c @@ -1,4 +1,13 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// // IL2C Test: {testName} #if defined(_MSC_VER) && defined(_WIN32) diff --git a/tests/IL2C.Core.Test.Fixture/Templates/test.vcxproj b/tests/IL2C.Core.Test.Fixture/Templates/test.vcxproj index 93cbe43c..00cbb4f9 100644 --- a/tests/IL2C.Core.Test.Fixture/Templates/test.vcxproj +++ b/tests/IL2C.Core.Test.Fixture/Templates/test.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,13 +25,13 @@ - 15.0 + 17.0 {182A62A4-47AC-4290-8EA5-250AE8131613} Win32Proj IL2CRuntime $(LatestTargetPlatformVersion) Application - v142 + v143 false $(ProjectDir)bin\$(Platform)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ @@ -57,7 +57,7 @@ true true false - .;..\..\..\..\..\..\IL2C.Runtime\include + .;..\..\..\..\..\..\src\IL2C.Runtime\include 4100;4197;4206 false All @@ -87,7 +87,7 @@ true true true - ..\..\..\..\..\..\IL2C.Runtime\lib\$(Configuration)\libil2c-msvc-win-$(Platform)-rts.lib;%(AdditionalDependencies) + ..\..\..\..\..\..\src\IL2C.Runtime\lib\$(Configuration)\libil2c-msvc-win-$(Platform)-rts.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration diff --git a/tests/IL2C.Core.Test.Fixture/Templates/test_void.c b/tests/IL2C.Core.Test.Fixture/Templates/test_void.c index 3431c4a9..6761c5e5 100644 --- a/tests/IL2C.Core.Test.Fixture/Templates/test_void.c +++ b/tests/IL2C.Core.Test.Fixture/Templates/test_void.c @@ -1,4 +1,13 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// +// IL2C - A translator for ECMA-335 CIL/MSIL to C language. +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +// +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 +// +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// // IL2C Test: {testName} #if defined(_MSC_VER) && defined(_WIN32) diff --git a/tests/IL2C.Core.Test.Fixture/TestCaseInformation.cs b/tests/IL2C.Core.Test.Fixture/TestCaseInformation.cs index 21e5d369..f99fbaed 100644 --- a/tests/IL2C.Core.Test.Fixture/TestCaseInformation.cs +++ b/tests/IL2C.Core.Test.Fixture/TestCaseInformation.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Reflection; diff --git a/tests/IL2C.Core.Test.Fixture/TestFramework.cs b/tests/IL2C.Core.Test.Fixture/TestFramework.cs index b5266e00..8ae36612 100644 --- a/tests/IL2C.Core.Test.Fixture/TestFramework.cs +++ b/tests/IL2C.Core.Test.Fixture/TestFramework.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -24,13 +14,11 @@ using System.Linq; using System.Threading.Tasks; -using NUnit.Framework; - -using IL2C.Metadata; using IL2C.Internal; +using IL2C.Metadata; + +using NUnit.Framework; using NUnit.Framework.Internal; -using NUnit.Framework.Interfaces; -using ILVerify; #pragma warning disable CS0436 @@ -61,6 +49,7 @@ public static class TestFramework "..", "..", "..", + "src", "IL2C.Runtime")); private static string GetCLangaugeSafeConversionExpression( @@ -68,7 +57,7 @@ private static string GetCLangaugeSafeConversionExpression( { if (constantType != null) { - if (Utilities.GetCLanguageTypeName(constantType) == argumentType.CLanguageTypeName) + if (SymbolManipulator.GetCLanguageTypeName(constantType) == argumentType.CLanguageTypeName) { return constantExpression; } @@ -82,7 +71,7 @@ private static string GetCLangaugeSafeConversionExpression( { return string.Format("(System_Object*)il2c_box(&{0}, {1})", constantExpression, - Utilities.GetMangledName(constantType.FullName)); + SymbolManipulator.GetMangledName(constantType.FullName)); } } @@ -245,8 +234,9 @@ public static async Task ExecuteTestAsync(TestCaseInformation caseInfo) caseInfo.Id, caseInfo.UniqueName); - var logw = new StringWriter(); - var storage = new CodeTextStorage(logw, translatedPath, false, " "); + var tw = new StringWriter(); + var logger = new TextWriterLogger(LogLevels.Debug, tw); + var storage = new CodeTextStorage(logger, translatedPath, false, " "); AssemblyWriter.WriteHeader( storage, @@ -275,7 +265,7 @@ await TestUtilities.CopyResourceToStreamAsync( p.ParameterName, p.TargetType, arg?.GetType(), - Utilities.GetCLanguageExpression(arg)) + SymbolManipulator.GetCLanguageExpression(arg)) ). ToArray(); var argumentList = constants. @@ -293,7 +283,7 @@ await TestUtilities.CopyResourceToStreamAsync( argument.SymbolName, argument.TargetType, argument.ExpressionType, - Utilities.GetCLanguageExpression(expectedType.InternalStaticEmptyValue))). + SymbolManipulator.GetCLanguageExpression(expectedType.InternalStaticEmptyValue))). ToArray(); if (!(expectedType.IsVoidType || (caseInfo.Assert == TestCaseAsserts.CauseBreak))) @@ -305,7 +295,7 @@ await TestUtilities.CopyResourceToStreamAsync( "expected", expectedType, caseInfo.Expected?.GetType(), - Utilities.GetCLanguageExpression(caseInfo.Expected)), + SymbolManipulator.GetCLanguageExpression(caseInfo.Expected)), }). ToArray(); arguments = constants. @@ -321,14 +311,14 @@ await TestUtilities.CopyResourceToStreamAsync( argument.SymbolName, argument.TargetType, argument.ExpressionType, - Utilities.GetCLanguageExpression(argument.TargetType.InternalStaticEmptyValue))). + SymbolManipulator.GetCLanguageExpression(argument.TargetType.InternalStaticEmptyValue))). Concat(new Constant[] { new Constant( "_actual", expectedType, caseInfo.Expected?.GetType(), - Utilities.GetCLanguageExpression(expectedType.InternalStaticEmptyValue)), + SymbolManipulator.GetCLanguageExpression(expectedType.InternalStaticEmptyValue)), }). ToArray(); } @@ -349,7 +339,7 @@ await TestUtilities.CopyResourceToStreamAsync( { "type", targetMethod.ReturnType.CLanguageTypeName}, { "constants", string.Join(" ", constants. Select(entry => string.Format("{0} {1} = {2};", - (entry.ExpressionType != null) ? Utilities.GetCLanguageTypeName(entry.ExpressionType) : entry.TargetType.CLanguageTypeName, + (entry.ExpressionType != null) ? SymbolManipulator.GetCLanguageTypeName(entry.ExpressionType) : entry.TargetType.CLanguageTypeName, entry.SymbolName, entry.Expression))) }, { "locals", string.Join(" ", locals. diff --git a/tests/IL2C.Core.Test.Fixture/TestUtilities.cs b/tests/IL2C.Core.Test.Fixture/TestUtilities.cs index 610d1243..8390a27b 100644 --- a/tests/IL2C.Core.Test.Fixture/TestUtilities.cs +++ b/tests/IL2C.Core.Test.Fixture/TestUtilities.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/tests/IL2C.Core.Test.ILConverters/Add/Add.cs b/tests/IL2C.Core.Test.ILConverters/Add/Add.cs index c3372ecc..27bf027a 100644 --- a/tests/IL2C.Core.Test.ILConverters/Add/Add.cs +++ b/tests/IL2C.Core.Test.ILConverters/Add/Add.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/And/And.cs b/tests/IL2C.Core.Test.ILConverters/And/And.cs index 8e23735b..b67b76e3 100644 --- a/tests/IL2C.Core.Test.ILConverters/And/And.cs +++ b/tests/IL2C.Core.Test.ILConverters/And/And.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box.cs b/tests/IL2C.Core.Test.ILConverters/Box/Box.cs index 1ae0755a..9f85c060 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box.cs +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum.cs b/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum.cs index 9a514988..56359c9d 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum.cs +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Narrowing.cs b/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Narrowing.cs index 40563cdf..c154f529 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Narrowing.cs +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Narrowing.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Widing.cs b/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Widing.cs index 06c678d7..1905b4b7 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Widing.cs +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Enum_Widing.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.cs b/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.cs index 242f7e38..80df4b4f 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.cs +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.cs b/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.cs index f7b98ecd..4f9cbc31 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.cs +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Br/Br.cs b/tests/IL2C.Core.Test.ILConverters/Br/Br.cs index e743ba9f..d70173a7 100644 --- a/tests/IL2C.Core.Test.ILConverters/Br/Br.cs +++ b/tests/IL2C.Core.Test.ILConverters/Br/Br.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Br_s/Br_s.cs b/tests/IL2C.Core.Test.ILConverters/Br_s/Br_s.cs index 6d80f8af..8f97107a 100644 --- a/tests/IL2C.Core.Test.ILConverters/Br_s/Br_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Br_s/Br_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Break/Break.cs b/tests/IL2C.Core.Test.ILConverters/Break/Break.cs index d35cca68..42dfbc63 100644 --- a/tests/IL2C.Core.Test.ILConverters/Break/Break.cs +++ b/tests/IL2C.Core.Test.ILConverters/Break/Break.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Brfalse/Brfalse.cs b/tests/IL2C.Core.Test.ILConverters/Brfalse/Brfalse.cs index 661f09ce..b410b96c 100644 --- a/tests/IL2C.Core.Test.ILConverters/Brfalse/Brfalse.cs +++ b/tests/IL2C.Core.Test.ILConverters/Brfalse/Brfalse.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; @@ -31,7 +21,7 @@ namespace IL2C.ILConverters [TestCase("DEF", "IntPtrValue", 0)] [TestCase("ABC", "IntPtrValue", -100)] [TestCase("ABC", "ObjectValue", "")] - [TestCase("DEF", "ObjectValue", null)] + [TestCase("DEF", "ObjectValue", null!)] public sealed class Brfalse { [MethodImpl(MethodImplOptions.ForwardRef)] diff --git a/tests/IL2C.Core.Test.ILConverters/Brfalse_s/Brfalse_s.cs b/tests/IL2C.Core.Test.ILConverters/Brfalse_s/Brfalse_s.cs index a3703831..35db9937 100644 --- a/tests/IL2C.Core.Test.ILConverters/Brfalse_s/Brfalse_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Brfalse_s/Brfalse_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; @@ -31,7 +21,7 @@ namespace IL2C.ILConverters [TestCase("DEF", "IntPtrValue", 0)] [TestCase("ABC", "IntPtrValue", -100)] [TestCase("ABC", "ObjectValue", "")] - [TestCase("DEF", "ObjectValue", null)] + [TestCase("DEF", "ObjectValue", null!)] public sealed class Brfalse_s { [MethodImpl(MethodImplOptions.ForwardRef)] diff --git a/tests/IL2C.Core.Test.ILConverters/Brtrue/Brtrue.cs b/tests/IL2C.Core.Test.ILConverters/Brtrue/Brtrue.cs index a2b4dc34..1bb52911 100644 --- a/tests/IL2C.Core.Test.ILConverters/Brtrue/Brtrue.cs +++ b/tests/IL2C.Core.Test.ILConverters/Brtrue/Brtrue.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; @@ -31,7 +21,7 @@ namespace IL2C.ILConverters [TestCase("DEF", "IntPtrValue", 0)] [TestCase("ABC", "IntPtrValue", -100)] [TestCase("ABC", "ObjectValue", "")] - [TestCase("DEF", "ObjectValue", null)] + [TestCase("DEF", "ObjectValue", null!)] public sealed class Brtrue { [MethodImpl(MethodImplOptions.ForwardRef)] diff --git a/tests/IL2C.Core.Test.ILConverters/Brtrue_s/Brtrue_s.cs b/tests/IL2C.Core.Test.ILConverters/Brtrue_s/Brtrue_s.cs index 11287f46..fae5abcb 100644 --- a/tests/IL2C.Core.Test.ILConverters/Brtrue_s/Brtrue_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Brtrue_s/Brtrue_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; @@ -31,7 +21,7 @@ namespace IL2C.ILConverters [TestCase("DEF", "IntPtrValue", 0)] [TestCase("ABC", "IntPtrValue", -100)] [TestCase("ABC", "ObjectValue", "")] - [TestCase("DEF", "ObjectValue", null)] + [TestCase("DEF", "ObjectValue", null!)] public sealed class Brtrue_s { [MethodImpl(MethodImplOptions.ForwardRef)] diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call.cs index 4a3ce5e6..dd051215 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.cs index 1e322b3d..43d8e9d4 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.cs index d86ab2cb..e26ef9f4 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.cs index 98fca1bc..a20ae98f 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.cs index 8ee75612..1e544617 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.cs index fbe60e13..3e48ed46 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.cs index 2976549b..a4562b5d 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt.cs index b4b831f7..47f914c0 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.cs index ac0c7337..875c53f6 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.cs index 22109299..dda21d02 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.cs index 836efc62..84a5b226 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.cs index 071fd220..fe6e37e6 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.cs index f56a4e93..b2e1479f 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.cs index 83a0f5df..3fac0485 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.cs index e84c798f..0a3ab7d9 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.cs b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.cs index 0e8ff880..eaca689e 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.cs +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_i/Conv_i.cs b/tests/IL2C.Core.Test.ILConverters/Conv_i/Conv_i.cs index 493efbc6..132835fd 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_i/Conv_i.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_i/Conv_i.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_i1/Conv_i1.cs b/tests/IL2C.Core.Test.ILConverters/Conv_i1/Conv_i1.cs index 09d3aaa1..54a21a7a 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_i1/Conv_i1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_i1/Conv_i1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_i2/Conv_i2.cs b/tests/IL2C.Core.Test.ILConverters/Conv_i2/Conv_i2.cs index 56ecbf05..afd855bf 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_i2/Conv_i2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_i2/Conv_i2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_i4/Conv_i4.cs b/tests/IL2C.Core.Test.ILConverters/Conv_i4/Conv_i4.cs index 779114b1..e9ba333e 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_i4/Conv_i4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_i4/Conv_i4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_i8/Conv_i8.cs b/tests/IL2C.Core.Test.ILConverters/Conv_i8/Conv_i8.cs index a2487bb4..f6174598 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_i8/Conv_i8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_i8/Conv_i8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_r4/Conv_r4.cs b/tests/IL2C.Core.Test.ILConverters/Conv_r4/Conv_r4.cs index 654fc024..ced3024d 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_r4/Conv_r4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_r4/Conv_r4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_r8/Conv_r8.cs b/tests/IL2C.Core.Test.ILConverters/Conv_r8/Conv_r8.cs index dbd2803a..83e2981c 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_r8/Conv_r8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_r8/Conv_r8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_u/Conv_u.cs b/tests/IL2C.Core.Test.ILConverters/Conv_u/Conv_u.cs index 62f2b7de..a7ff850c 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_u/Conv_u.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_u/Conv_u.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_u1/Conv_u1.cs b/tests/IL2C.Core.Test.ILConverters/Conv_u1/Conv_u1.cs index 40414226..49a21edd 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_u1/Conv_u1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_u1/Conv_u1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_u2/Conv_u2.cs b/tests/IL2C.Core.Test.ILConverters/Conv_u2/Conv_u2.cs index 9d8eceaa..0543372c 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_u2/Conv_u2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_u2/Conv_u2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_u4/Conv_u4.cs b/tests/IL2C.Core.Test.ILConverters/Conv_u4/Conv_u4.cs index bb701b38..cece4147 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_u4/Conv_u4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_u4/Conv_u4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs b/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs index 4b0cfc95..010d3a88 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Div/Div.cs b/tests/IL2C.Core.Test.ILConverters/Div/Div.cs index f1561044..10e823f0 100644 --- a/tests/IL2C.Core.Test.ILConverters/Div/Div.cs +++ b/tests/IL2C.Core.Test.ILConverters/Div/Div.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Dup/Dup.cs b/tests/IL2C.Core.Test.ILConverters/Dup/Dup.cs index fe30d24d..ee592de9 100644 --- a/tests/IL2C.Core.Test.ILConverters/Dup/Dup.cs +++ b/tests/IL2C.Core.Test.ILConverters/Dup/Dup.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj b/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj index c4782c3d..c1a3b912 100644 --- a/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj +++ b/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj @@ -1,48 +1,28 @@  - - net48;netstandard2.0 - false + + net48;netstandard2.0 + Library + enable - Library - False - true - PackageReference - false - IL2C.Core.Test.ILConverters - IL2C.ILConverters - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - True - latest - full - true - AnyCPU - + IL2C.Core.Test.ILConverters + IL2C.ILConverters + - - - + + + - - - - - + + + + - - - - + + + - - + + diff --git a/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.cs b/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.cs index 8c26c83d..89890501 100644 --- a/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.cs +++ b/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarg/Ldarg.cs b/tests/IL2C.Core.Test.ILConverters/Ldarg/Ldarg.cs index 1f22f158..53b24c77 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarg/Ldarg.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarg/Ldarg.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarg_0/Ldarg_0.cs b/tests/IL2C.Core.Test.ILConverters/Ldarg_0/Ldarg_0.cs index 0e537c0c..81c0e553 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarg_0/Ldarg_0.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarg_0/Ldarg_0.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarg_1/Ldarg_1.cs b/tests/IL2C.Core.Test.ILConverters/Ldarg_1/Ldarg_1.cs index 7472cf99..cdf986aa 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarg_1/Ldarg_1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarg_1/Ldarg_1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarg_2/Ldarg_2.cs b/tests/IL2C.Core.Test.ILConverters/Ldarg_2/Ldarg_2.cs index c94f1020..9fe6df2f 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarg_2/Ldarg_2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarg_2/Ldarg_2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarg_3/Ldarg_3.cs b/tests/IL2C.Core.Test.ILConverters/Ldarg_3/Ldarg_3.cs index d9f45fb5..c04c372b 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarg_3/Ldarg_3.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarg_3/Ldarg_3.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarg_s/Ldarg_s.cs b/tests/IL2C.Core.Test.ILConverters/Ldarg_s/Ldarg_s.cs index 214bb650..a0b8c62a 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarg_s/Ldarg_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarg_s/Ldarg_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.cs b/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.cs index 413f9803..60d59aef 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4/Ldc_i4.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4/Ldc_i4.cs index 9cbd0b66..42553819 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4/Ldc_i4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4/Ldc_i4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_0/Ldc_i4_0.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_0/Ldc_i4_0.cs index edc15dcb..ae5aff94 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_0/Ldc_i4_0.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_0/Ldc_i4_0.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_1/Ldc_i4_1.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_1/Ldc_i4_1.cs index 289df73b..042b27da 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_1/Ldc_i4_1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_1/Ldc_i4_1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_2/Ldc_i4_2.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_2/Ldc_i4_2.cs index 66038484..d386e7fd 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_2/Ldc_i4_2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_2/Ldc_i4_2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_3/Ldc_i4_3.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_3/Ldc_i4_3.cs index 03e9ace5..14b625be 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_3/Ldc_i4_3.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_3/Ldc_i4_3.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_4/Ldc_i4_4.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_4/Ldc_i4_4.cs index 0a819d6a..f3702641 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_4/Ldc_i4_4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_4/Ldc_i4_4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_5/Ldc_i4_5.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_5/Ldc_i4_5.cs index ad0e2f1b..0cafec22 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_5/Ldc_i4_5.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_5/Ldc_i4_5.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_6/Ldc_i4_6.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_6/Ldc_i4_6.cs index 32fa5268..8f4a3f10 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_6/Ldc_i4_6.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_6/Ldc_i4_6.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_7/Ldc_i4_7.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_7/Ldc_i4_7.cs index 5e1fd826..84683ab1 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_7/Ldc_i4_7.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_7/Ldc_i4_7.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_8/Ldc_i4_8.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_8/Ldc_i4_8.cs index f3741839..8c0f38b0 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_8/Ldc_i4_8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_8/Ldc_i4_8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_m1/Ldc_i4_m1.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_m1/Ldc_i4_m1.cs index 0c3251e1..9560df46 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_m1/Ldc_i4_m1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_m1/Ldc_i4_m1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_s/Ldc_i4_s.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_s/Ldc_i4_s.cs index 4f7cbab8..b530c59d 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i4_s/Ldc_i4_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i4_s/Ldc_i4_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_i8/Ldc_i8.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_i8/Ldc_i8.cs index 571f7d3c..ec405eef 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_i8/Ldc_i8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_i8/Ldc_i8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_r4/Ldc_r4.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_r4/Ldc_r4.cs index c7f2ba6c..280421b6 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_r4/Ldc_r4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_r4/Ldc_r4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldc_r8/Ldc_r8.cs b/tests/IL2C.Core.Test.ILConverters/Ldc_r8/Ldc_r8.cs index 40b8ab4e..ba82ea63 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldc_r8/Ldc_r8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldc_r8/Ldc_r8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloc_0/Ldloc_0.cs b/tests/IL2C.Core.Test.ILConverters/Ldloc_0/Ldloc_0.cs index 128c07c9..af5918e1 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloc_0/Ldloc_0.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloc_0/Ldloc_0.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloc_1/Ldloc_1.cs b/tests/IL2C.Core.Test.ILConverters/Ldloc_1/Ldloc_1.cs index 6f75bb43..3e8a7336 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloc_1/Ldloc_1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloc_1/Ldloc_1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloc_2/Ldloc_2.cs b/tests/IL2C.Core.Test.ILConverters/Ldloc_2/Ldloc_2.cs index a222fac6..f1afacb8 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloc_2/Ldloc_2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloc_2/Ldloc_2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloc_3/Ldloc_3.cs b/tests/IL2C.Core.Test.ILConverters/Ldloc_3/Ldloc_3.cs index 3d1cb58b..6e0913e3 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloc_3/Ldloc_3.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloc_3/Ldloc_3.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloc_s/Ldloc_s.cs b/tests/IL2C.Core.Test.ILConverters/Ldloc_s/Ldloc_s.cs index 2a4579f8..358ac42f 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloc_s/Ldloc_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloc_s/Ldloc_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs b/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs index b82768f6..c360c117 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldnull/Ldnull.cs b/tests/IL2C.Core.Test.ILConverters/Ldnull/Ldnull.cs index 69140da7..2c93fc72 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldnull/Ldnull.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldnull/Ldnull.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldsfld/Ldsfld.cs b/tests/IL2C.Core.Test.ILConverters/Ldsfld/Ldsfld.cs index 0d40a60f..d37dc4a3 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldsfld/Ldsfld.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldsfld/Ldsfld.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldsflda/Ldsflda.cs b/tests/IL2C.Core.Test.ILConverters/Ldsflda/Ldsflda.cs index 45d44c5f..9b6065de 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldsflda/Ldsflda.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldsflda/Ldsflda.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ldstr/Ldstr.cs b/tests/IL2C.Core.Test.ILConverters/Ldstr/Ldstr.cs index 17fa6dd8..28e602a7 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldstr/Ldstr.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldstr/Ldstr.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Mul/Mul.cs b/tests/IL2C.Core.Test.ILConverters/Mul/Mul.cs index e8b2992b..ed981032 100644 --- a/tests/IL2C.Core.Test.ILConverters/Mul/Mul.cs +++ b/tests/IL2C.Core.Test.ILConverters/Mul/Mul.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Nop/Nop.cs b/tests/IL2C.Core.Test.ILConverters/Nop/Nop.cs index 26ecde56..6c307bdb 100644 --- a/tests/IL2C.Core.Test.ILConverters/Nop/Nop.cs +++ b/tests/IL2C.Core.Test.ILConverters/Nop/Nop.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Or/Or.cs b/tests/IL2C.Core.Test.ILConverters/Or/Or.cs index 04d6c9d9..7dd6d284 100644 --- a/tests/IL2C.Core.Test.ILConverters/Or/Or.cs +++ b/tests/IL2C.Core.Test.ILConverters/Or/Or.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Rem/Rem.cs b/tests/IL2C.Core.Test.ILConverters/Rem/Rem.cs index be6e8b13..63e0e733 100644 --- a/tests/IL2C.Core.Test.ILConverters/Rem/Rem.cs +++ b/tests/IL2C.Core.Test.ILConverters/Rem/Rem.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Ret/Ret.cs b/tests/IL2C.Core.Test.ILConverters/Ret/Ret.cs index f1d57a83..80308640 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ret/Ret.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ret/Ret.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem/Stelem.cs b/tests/IL2C.Core.Test.ILConverters/Stelem/Stelem.cs index 37e1d2dd..df29fc7e 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem/Stelem.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem/Stelem.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_i1/Stelem_i1.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_i1/Stelem_i1.cs index 45109e91..a4728600 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_i1/Stelem_i1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_i1/Stelem_i1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_i2/Stelem_i2.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_i2/Stelem_i2.cs index 00ac0624..42013e94 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_i2/Stelem_i2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_i2/Stelem_i2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_i4/Stelem_i4.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_i4/Stelem_i4.cs index 8f065756..b8f00935 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_i4/Stelem_i4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_i4/Stelem_i4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_i8/Stelem_i8.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_i8/Stelem_i8.cs index 2f1e0547..77262e13 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_i8/Stelem_i8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_i8/Stelem_i8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_r4/Stelem_r4.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_r4/Stelem_r4.cs index aa556208..18ac6947 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_r4/Stelem_r4.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_r4/Stelem_r4.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_r8/Stelem_r8.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_r8/Stelem_r8.cs index 88df79a2..6b769b8d 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_r8/Stelem_r8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_r8/Stelem_r8.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stelem_ref/Stelem_ref.cs b/tests/IL2C.Core.Test.ILConverters/Stelem_ref/Stelem_ref.cs index 7a38a8eb..a8c85c9e 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stelem_ref/Stelem_ref.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stelem_ref/Stelem_ref.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stloc_0/Stloc_0.cs b/tests/IL2C.Core.Test.ILConverters/Stloc_0/Stloc_0.cs index c31b6f90..66631641 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stloc_0/Stloc_0.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stloc_0/Stloc_0.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stloc_1/Stloc_1.cs b/tests/IL2C.Core.Test.ILConverters/Stloc_1/Stloc_1.cs index 2b159366..9d1585f9 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stloc_1/Stloc_1.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stloc_1/Stloc_1.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stloc_2/Stloc_2.cs b/tests/IL2C.Core.Test.ILConverters/Stloc_2/Stloc_2.cs index c50497b4..e43373b6 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stloc_2/Stloc_2.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stloc_2/Stloc_2.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stloc_3/Stloc_3.cs b/tests/IL2C.Core.Test.ILConverters/Stloc_3/Stloc_3.cs index c3e0e762..2e29578c 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stloc_3/Stloc_3.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stloc_3/Stloc_3.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stloc_s/Stloc_s.cs b/tests/IL2C.Core.Test.ILConverters/Stloc_s/Stloc_s.cs index 7a6ebefb..7ce9e9c1 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stloc_s/Stloc_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stloc_s/Stloc_s.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Stsfld/Stsfld.cs b/tests/IL2C.Core.Test.ILConverters/Stsfld/Stsfld.cs index 897acc84..cd698a3e 100644 --- a/tests/IL2C.Core.Test.ILConverters/Stsfld/Stsfld.cs +++ b/tests/IL2C.Core.Test.ILConverters/Stsfld/Stsfld.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; @@ -38,7 +28,7 @@ public static class Stsfld_Field public static float SingleValue; public static double DoubleValue; public static char CharValue; - public static string StringValue; + public static string? StringValue; } [TestCase(true, "Boolean", true, IncludeTypes = new[] { typeof(Stsfld_Field) })] diff --git a/tests/IL2C.Core.Test.ILConverters/Sub/Sub.cs b/tests/IL2C.Core.Test.ILConverters/Sub/Sub.cs index d93452d4..88203dd0 100644 --- a/tests/IL2C.Core.Test.ILConverters/Sub/Sub.cs +++ b/tests/IL2C.Core.Test.ILConverters/Sub/Sub.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.cs b/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.cs index 04446567..2f42bda9 100644 --- a/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.cs +++ b/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.ILConverters/Xor/Xor.cs b/tests/IL2C.Core.Test.ILConverters/Xor/Xor.cs index 32b04512..1595b1d6 100644 --- a/tests/IL2C.Core.Test.ILConverters/Xor/Xor.cs +++ b/tests/IL2C.Core.Test.ILConverters/Xor/Xor.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Runtime.CompilerServices; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ArrayTypes/ArrayTypes.cs b/tests/IL2C.Core.Test.RuntimeSystems/ArrayTypes/ArrayTypes.cs index ffd64f7b..e4fb96df 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ArrayTypes/ArrayTypes.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ArrayTypes/ArrayTypes.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/CSharpEvent.cs b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/CSharpEvent.cs index 3d0ba6c9..402a96f6 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/CSharpEvent.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/CSharpEvent.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// namespace IL2C.RuntimeSystems { @@ -43,7 +33,7 @@ public void Receiver3(int value) public sealed class CSharpEventImpl { - public event CSharpEventDelegate TestEvent; + public event CSharpEventDelegate? TestEvent; public void DoEvent(int value) { diff --git a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypes.cs b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypes.cs index cf7649e2..d01aae3a 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypes.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypes.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypesWIthVirtual.cs b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypesWIthVirtual.cs index 7f7fd577..ef4b10d3 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypesWIthVirtual.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/DelegateTypesWIthVirtual.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// namespace IL2C.RuntimeSystems { diff --git a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/MulticastDelegateTypes.cs b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/MulticastDelegateTypes.cs index f48a91c2..df2c3882 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/MulticastDelegateTypes.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/DelegateTypes/MulticastDelegateTypes.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// namespace IL2C.RuntimeSystems { diff --git a/tests/IL2C.Core.Test.RuntimeSystems/EnumTypes/EnumTypes.cs b/tests/IL2C.Core.Test.RuntimeSystems/EnumTypes/EnumTypes.cs index a08b8607..7613b370 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/EnumTypes/EnumTypes.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/EnumTypes/EnumTypes.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionHandling/ExceptionHandling.cs b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionHandling/ExceptionHandling.cs index a9d855d2..002f34e6 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionHandling/ExceptionHandling.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionHandling/ExceptionHandling.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; @@ -28,11 +18,11 @@ namespace IL2C.RuntimeSystems [TestCase(123, "RaiseAndCaughtLocal", false)] [TestCase(456, "RaiseAndCaughtLocal", true)] [TestCase("ABC", "RaiseCaughtAndAccessLocal", "ABC")] - [TestCase(null, "RaiseCaughtAndAccessLocal", null)] + [TestCase(null, "RaiseCaughtAndAccessLocal", null!)] [TestCase("ABC", "RaiseCaughtNarrowingLocal", "ABC")] - [TestCase(null, "RaiseCaughtNarrowingLocal", null)] + [TestCase(null, "RaiseCaughtNarrowingLocal", null!)] [TestCase("ABC", "RaiseCaughtWildcardLocal", "ABC")] - [TestCase(null, "RaiseCaughtWildcardLocal", null)] + [TestCase(null, "RaiseCaughtWildcardLocal", null!)] [TestCase(123, "RaiseAndCaughtMultipleHandlerLocal", 0)] [TestCase(456, "RaiseAndCaughtMultipleHandlerLocal", 1)] [TestCase(789, "RaiseAndCaughtMultipleHandlerLocal", 2)] @@ -71,7 +61,7 @@ public static int RaiseAndCaughtLocal(bool sw) return 123; } - public static string RaiseCaughtAndAccessLocal(string value) + public static string? RaiseCaughtAndAccessLocal(string value) { try { @@ -84,7 +74,7 @@ public static string RaiseCaughtAndAccessLocal(string value) return null; } - public static string RaiseCaughtNarrowingLocal(string value) + public static string? RaiseCaughtNarrowingLocal(string value) { try { @@ -97,7 +87,7 @@ public static string RaiseCaughtNarrowingLocal(string value) return null; } - public static string RaiseCaughtWildcardLocal(string value) + public static string? RaiseCaughtWildcardLocal(string value) { try { @@ -424,8 +414,8 @@ public static bool RaiseCaughtAndRethrowInsideLocal() { var ex1 = new Exception(); var ex2 = new Exception(); - Exception exi1_ = null; - Exception exi2_ = null; + Exception? exi1_ = null; + Exception? exi2_ = null; try { throw ex1; @@ -462,8 +452,8 @@ public static bool RaiseCaughtAndRethrowOutsideLocal() { var ex1 = new Exception(); var ex2 = new Exception(); - Exception exi1_ = null; - Exception exi2_ = null; + Exception? exi1_ = null; + Exception? exi2_ = null; try { throw ex1; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/ArrayIndexOutOfRangeExceptions.cs b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/ArrayIndexOutOfRangeExceptions.cs index 70581eb3..4307414f 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/ArrayIndexOutOfRangeExceptions.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/ArrayIndexOutOfRangeExceptions.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs index ddd5e981..611d6f7d 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/NullReferenceExceptions.cs b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/NullReferenceExceptions.cs index 9d788de6..1d90e95c 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/NullReferenceExceptions.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/NullReferenceExceptions.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; @@ -26,11 +16,11 @@ namespace IL2C.RuntimeSystems { [TestId("ExceptionThrownByCLI")] [TestCase(false, "NullReference", "ABC")] - [TestCase(true, "NullReference", null)] + [TestCase(true, "NullReference", null!)] [TestCase(false, "NullReferenceTwoTimes", "ABC")] // Test for re-register signal handler - [TestCase(true, "NullReferenceTwoTimes", null)] + [TestCase(true, "NullReferenceTwoTimes", null!)] [TestCase(false, "NullReferenceAtTheUnbox", (object)123)] - [TestCase(true, "NullReferenceAtTheUnbox", null)] + [TestCase(true, "NullReferenceAtTheUnbox", null!)] public sealed class NullReferenceExceptions { public static bool NullReference(object v) diff --git a/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.cs b/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.cs index d900fac6..e3f27e0e 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; @@ -111,7 +101,7 @@ public FinalzerImplementedWithPinned(FinalizerCalleeHolder holder) public class FinalzerImplementedWithResurrect { - public static FinalzerImplementedWithResurrect Instance; + public static FinalzerImplementedWithResurrect? Instance; public int Value; public FinalzerImplementedWithResurrect(int value) @@ -156,7 +146,7 @@ public StaticFieldInstanceType() public static class StaticFieldTracible { - public static StaticFieldInstanceType StaticFieldInstance; + public static StaticFieldInstanceType? StaticFieldInstance; } public sealed class DelegateMarkHandlerForObjRef @@ -314,7 +304,7 @@ public static int TraceStaticField(int value) GC.Collect(); GC.WaitForPendingFinalizers(); - return StaticFieldTracible.StaticFieldInstance.Value; + return StaticFieldTracible.StaticFieldInstance!.Value; } private static void RunCallFinalizer(FinalizerCalleeHolder holder) @@ -373,7 +363,7 @@ public static int DontCollectWithResurrect(int value) GC.Collect(); GC.WaitForPendingFinalizers(); - return FinalzerImplementedWithResurrect.Instance.Value; + return FinalzerImplementedWithResurrect.Instance!.Value; } private static void RunCallFinalizerWithReRegister(FinalizerCalleeHolder holder) diff --git a/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj b/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj index d6f20a1f..f029f455 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj +++ b/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj @@ -1,48 +1,28 @@  - - net48;netstandard2.0 - false + + net48;netstandard2.0 + Library + enable - Library - False - true - PackageReference - false - IL2C.Core.Test.RuntimeSystems - IL2C.RuntimeSystems - A translator implementation of .NET intermediate language to C language. - IL2C - IL2C - Copyright (c) 2019 Kouji Matsui - A translator implementation of .NET intermediate language to C language. - Kouji Matsui (@kozy_kekyo) - Kouji Matsui (@kozy_kekyo) - git - https://github.com/kekyo/IL2C.git - True - latest - full - true - AnyCPU - + IL2C.Core.Test.RuntimeSystems + IL2C.RuntimeSystems + - - - + + + - - - - - + + + + - - - - + + + - - + + diff --git a/tests/IL2C.Core.Test.RuntimeSystems/Interoperability/Interoperability.cs b/tests/IL2C.Core.Test.RuntimeSystems/Interoperability/Interoperability.cs index 76b7747d..47418dcf 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/Interoperability/Interoperability.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/Interoperability/Interoperability.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/Threading/Threading.cs b/tests/IL2C.Core.Test.RuntimeSystems/Threading/Threading.cs index c8dfda68..64f674ad 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/Threading/Threading.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/Threading/Threading.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializer.cs b/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializer.cs index b0f953c7..fd6f0bef 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializer.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializer.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; @@ -70,7 +60,7 @@ private static void DoRefInt32(ref int value) public static class TypeInitializer_None { public static readonly int Int32Value; - public static readonly string StringValue; + public static readonly string? StringValue; } public static class TypeInitializer_NonTrackingGCs @@ -193,7 +183,7 @@ public static int Int32_None() return TypeInitializer_None.Int32Value; } - public static string String_None() + public static string? String_None() { return TypeInitializer_None.StringValue; } diff --git a/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializerAtomicity.cs b/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializerAtomicity.cs index 56e8a052..3accd1c7 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializerAtomicity.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/TypeInitializer/TypeInitializerAtomicity.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.Threading; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeImplements.cs b/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeImplements.cs index dd24e7a7..39621b39 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeImplements.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeImplements.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritance.cs b/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritance.cs index 5fbf73f0..92061e8c 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritance.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritance.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritanceAndImplements.cs b/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritanceAndImplements.cs index 12119a18..8219c879 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritanceAndImplements.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/TypeRelations/TypeInheritanceAndImplements.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel; diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ValueTypes/ValueTypes.cs b/tests/IL2C.Core.Test.RuntimeSystems/ValueTypes/ValueTypes.cs index 8f93e106..2280fa74 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ValueTypes/ValueTypes.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ValueTypes/ValueTypes.cs @@ -1,21 +1,11 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // IL2C - A translator for ECMA-335 CIL/MSIL to C language. -// Copyright (c) 2016-2019 Kouji Matsui (@kozy_kekyo, @kekyo2) +// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -///////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// using System; using System.ComponentModel;