Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit af2416b

Browse files
committed
Merge pull request #2039 from josteink/freebsd
Implement FreeBSD support in various projects
2 parents 8f390a7 + 87ca286 commit af2416b

File tree

4 files changed

+61
-3
lines changed

4 files changed

+61
-3
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System;
5+
using System.Runtime.InteropServices;
6+
7+
internal static partial class Interop
8+
{
9+
internal static partial class libc
10+
{
11+
[Flags]
12+
internal enum MemoryMappedFlags
13+
{
14+
MAP_FILE = 0x0,
15+
MAP_SHARED = 0x01,
16+
MAP_PRIVATE = 0x02,
17+
MAP_FIXED = 0x10,
18+
MAP_ANONYMOUS = 0x1000,
19+
}
20+
}
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.Runtime.InteropServices;
5+
6+
internal static partial class Interop
7+
{
8+
internal static partial class libc
9+
{
10+
internal static class SysConfNames
11+
{
12+
internal const int _SC_CLK_TCK = 3;
13+
internal const int _SC_PAGESIZE = 47;
14+
}
15+
}
16+
}

src/System.Diagnostics.Debug/src/System.Diagnostics.Debug.csproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<PropertyGroup>
@@ -16,6 +16,8 @@
1616
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1717
</PropertyGroup>
1818
<!-- Help VS understand available configurations -->
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'FreeBSD_Debug|AnyCPU' " />
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'FreeBSD_Release|AnyCPU' " />
1921
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Linux_Debug|AnyCPU' " />
2022
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Linux_Release|AnyCPU' " />
2123
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'OSX_Debug|AnyCPU' " />
@@ -80,6 +82,15 @@
8082
<Link>Common\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs</Link>
8183
</Compile>
8284
</ItemGroup>
85+
<!-- FreeBSD -->
86+
<ItemGroup Condition="'$(TargetsFreeBSD)' == 'true'">
87+
<Compile Include="$(CommonPath)\Interop\FreeBSD\Interop.Errors.cs">
88+
<Link>Common\Interop\FreeBSD\Interop.Errors.cs</Link>
89+
</Compile>
90+
<Compile Include="$(CommonPath)\Interop\FreeBSD\libc\Interop.OpenFlags.cs">
91+
<Link>Common\Interop\FreeBSD\Interop.OpenFlags.cs</Link>
92+
</Compile>
93+
</ItemGroup>
8394
<!-- Linux -->
8495
<ItemGroup Condition="'$(TargetsLinux)' == 'true'">
8596
<Compile Include="$(CommonPath)\Interop\Linux\Interop.Errors.cs">

src/System.Security.SecureString/src/System.Security.SecureString.csproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<PropertyGroup>
@@ -12,6 +12,8 @@
1212
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1313
</PropertyGroup>
1414
<!-- Help VS understand available configurations -->
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FreeBSD_Debug|AnyCPU'" />
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FreeBSD_Release|AnyCPU'" />
1517
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Linux_Debug|AnyCPU'" />
1618
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Linux_Release|AnyCPU'" />
1719
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'OSX_Debug|AnyCPU'" />
@@ -80,6 +82,14 @@
8082
<Link>Common\Interop\Unix\Interop.sysconf.cs</Link>
8183
</Compile>
8284
</ItemGroup>
85+
<ItemGroup Condition=" '$(TargetsFreeBSD)' == 'true' ">
86+
<Compile Include="$(CommonPath)\Interop\FreeBSD\libc\Interop.MemoryMappedFlags.cs">
87+
<Link>Common\Interop\FreeBSD\Interop.MemoryMappedFlags.cs</Link>
88+
</Compile>
89+
<Compile Include="$(CommonPath)\Interop\FreeBSD\libc\Interop.SysConfNames.cs">
90+
<Link>Common\Interop\FreeBSD\Interop.SysConfNames.cs</Link>
91+
</Compile>
92+
</ItemGroup>
8393
<ItemGroup Condition=" '$(TargetsLinux)' == 'true' ">
8494
<Compile Include="$(CommonPath)\Interop\Linux\libc\Interop.MemoryMappedFlags.cs">
8595
<Link>Common\Interop\Linux\Interop.MemoryMappedFlags.cs</Link>
@@ -100,4 +110,4 @@
100110
<None Include="project.json" />
101111
</ItemGroup>
102112
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
103-
</Project>
113+
</Project>

0 commit comments

Comments
 (0)