Skip to content

Commit

Permalink
United FEATURE_READ_CUSTOMMODIFIERS and FEATURE_EMIT_CUSTOMMODIFIERS
Browse files Browse the repository at this point in the history
  • Loading branch information
zvirja authored and Alexandr Povar committed Aug 31, 2018
1 parent 026cfdd commit aa27233
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Symbol | NET35 | NET40 |
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_BINDINGLIST` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_DICTIONARYADAPTER_XML` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_EMIT_CUSTOMMODIFIERS` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_CUSTOMMODIFIERS` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_EVENTLOG` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_GAC` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_GET_REFERENCED_ASSEMBLIES` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
Expand All @@ -83,7 +83,7 @@ Symbol | NET35 | NET40 |
* `FEATURE_ASSEMBLYBUILDER_SAVE` - enabled support for saving the dynamically generated proxy assembly.
* `FEATURE_BINDINGLIST` - enables support features that make use of System.ComponentModel.BindingList.
* `FEATURE_DICTIONARYADAPTER_XML` - enable DictionaryAdapter Xml features.
* `FEATURE_EMIT_CUSTOMMODIFIERS` - enables emitting optional and required custom modifiers defined on parameters including return parameters. It seems like a defect in corefx not to expose these methods because they are still implemented.
* `FEATURE_CUSTOMMODIFIERS` - enables reading and emitting optional and required custom modifiers defined on parameters including return parameters. It seems like a defect in corefx not to expose these methods because they are still implemented.
* `FEATURE_EVENTLOG` - provides a diagnostics logger using the Windows Event Log.
* `FEATURE_GAC` - enables support for obtaining assemblies using an assembly long form name.
* `FEATURE_GET_REFERENCED_ASSEMBLIES` - enables code that takes advantage of System.Reflection.Assembly.GetReferencedAssemblies().
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<PropertyGroup>
<DiagnosticsConstants>DEBUG</DiagnosticsConstants>
<NetStandard13Constants>TRACE;FEATURE_NETCORE_REFLECTION_API;FEATURE_TEST_SERILOGINTEGRATION</NetStandard13Constants>
<NetStandard15Constants>$(NetStandard13Constants);FEATURE_READ_CUSTOMMODIFIERS;FEATURE_EMIT_CUSTOMMODIFIERS</NetStandard15Constants>
<CommonDesktopClrConstants>TRACE;FEATURE_APPDOMAIN;FEATURE_ASSEMBLYBUILDER_SAVE;FEATURE_BINDINGLIST;FEATURE_DICTIONARYADAPTER_XML;FEATURE_READ_CUSTOMMODIFIERS;FEATURE_EMIT_CUSTOMMODIFIERS;FEATURE_EVENTLOG;FEATURE_GAC;FEATURE_GET_REFERENCED_ASSEMBLIES;FEATURE_IDATAERRORINFO;FEATURE_ISUPPORTINITIALIZE;FEATURE_LISTSORT;FEATURE_REMOTING;FEATURE_SECURITY_PERMISSIONS;FEATURE_SERIALIZATION;FEATURE_SMTP;FEATURE_SYSTEM_CONFIGURATION;FEATURE_TARGETEXCEPTION;FEATURE_TEST_COM;FEATURE_TEST_SERILOGINTEGRATION</CommonDesktopClrConstants>
<NetStandard15Constants>$(NetStandard13Constants);FEATURE_CUSTOMMODIFIERS</NetStandard15Constants>
<CommonDesktopClrConstants>TRACE;FEATURE_APPDOMAIN;FEATURE_ASSEMBLYBUILDER_SAVE;FEATURE_BINDINGLIST;FEATURE_DICTIONARYADAPTER_XML;FEATURE_CUSTOMMODIFIERS;FEATURE_EVENTLOG;FEATURE_GAC;FEATURE_GET_REFERENCED_ASSEMBLIES;FEATURE_IDATAERRORINFO;FEATURE_ISUPPORTINITIALIZE;FEATURE_LISTSORT;FEATURE_REMOTING;FEATURE_SECURITY_PERMISSIONS;FEATURE_SERIALIZATION;FEATURE_SMTP;FEATURE_SYSTEM_CONFIGURATION;FEATURE_TARGETEXCEPTION;FEATURE_TEST_COM;FEATURE_TEST_SERILOGINTEGRATION</CommonDesktopClrConstants>
<DesktopClrConstants Condition="'$(OS)'=='Unix'">$(CommonDesktopClrConstants)</DesktopClrConstants>
<DesktopClrConstants Condition="'$(OS)'=='Windows_NT'">$(CommonDesktopClrConstants);FEATURE_TEST_PEVERIFY</DesktopClrConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if FEATURE_EMIT_CUSTOMMODIFIERS && FEATURE_ASSEMBLYBUILDER_SAVE
#if FEATURE_CUSTOMMODIFIERS && FEATURE_ASSEMBLYBUILDER_SAVE

namespace Castle.DynamicProxy.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Tests
using System.Data;
using System.Runtime.InteropServices;

#if FEATURE_EMIT_CUSTOMMODIFIERS
#if FEATURE_CUSTOMMODIFIERS
using System.Reflection;
using System.Runtime.CompilerServices;
#endif
Expand Down Expand Up @@ -115,7 +115,7 @@ public void CanProxyDataSet()
generator.CreateClassProxy(typeof (DataSet), new Type[0], new StandardInterceptor());
}

#if FEATURE_EMIT_CUSTOMMODIFIERS
#if FEATURE_CUSTOMMODIFIERS
private Type iHaveMethodWithModOptsType;

[OneTimeSetUp]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void Can_proxy_method_having_valuetyped_parameter_without_in_modifier()
proxy.Method(readOnlyStruct);
}

#if FEATURE_EMIT_CUSTOMMODIFIERS
#if FEATURE_CUSTOMMODIFIERS

// ^^^
// Because the `in` parameter modifier gets encoded as a modreq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private void SetSignature(Type returnType, ParameterInfo returnParameter, Type[]
Type[][] parametersRequiredCustomModifiers;
Type[][] parametersOptionalCustomModifiers;

#if FEATURE_EMIT_CUSTOMMODIFIERS
#if FEATURE_CUSTOMMODIFIERS
returnRequiredCustomModifiers = returnParameter.GetRequiredCustomModifiers();
Array.Reverse(returnRequiredCustomModifiers);

Expand Down
2 changes: 1 addition & 1 deletion src/Castle.Core/DynamicProxy/Generators/GeneratorUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bool IsReadOnly(ParameterInfo parameter)
return false;
}

#if FEATURE_READ_CUSTOMMODIFIERS
#if FEATURE_CUSTOMMODIFIERS
// This check allows to make the detection logic more robust on the platforms which support custom modifiers.
// The robustness is achieved by the fact, that usually the `IsReadOnlyAttribute` emitted by the compiler is internal to the assembly.
// Therefore, if clients use Reflection.Emit to create "a copy" of the methods with read-only members, they cannot re-use the existing attribute.
Expand Down

0 comments on commit aa27233

Please sign in to comment.