Add tests for ANSI BSTRs (#20985)
[platform/upstream/coreclr.git] / src / vm / ilmarshalers.h
index 5337b08..6a67bf6 100644 (file)
@@ -600,19 +600,22 @@ public:
                 nativeSize = wNativeSize;
             }
 
-#if defined(_TARGET_X86_) || (defined(_TARGET_AMD64_) && defined(_WIN64) && !defined(FEATURE_CORECLR))
+#if defined(_TARGET_X86_)
             // JIT32 and JIT64 (which is only used on the Windows Desktop CLR) has a problem generating
             // code for the pinvoke ILStubs which do a return using a struct type.  Therefore, we
             // change the signature of calli to return void and make the return buffer as first argument. 
 
             // for X86 and AMD64-Windows we bash the return type from struct to U1, U2, U4 or U8
             // and use byrefNativeReturn for all other structs.
+            // for UNIX_X86_ABI, we always need a return buffer argument for any size of structs.
             switch (nativeSize)
             {
+#ifndef UNIX_X86_ABI
                 case 1: typ = ELEMENT_TYPE_U1; break;
                 case 2: typ = ELEMENT_TYPE_U2; break;
                 case 4: typ = ELEMENT_TYPE_U4; break;
                 case 8: typ = ELEMENT_TYPE_U8; break;
+#endif
                 default: byrefNativeReturn = true; break;
             }
 #endif
@@ -2616,7 +2619,6 @@ protected:
     virtual void EmitConvertContentsNativeToCLR(ILCodeStream* pslILEmit);
 };
 
-#ifdef FEATURE_COMINTEROP
 class ILBSTRMarshaler : public ILOptimizedAllocMarshaler
 {
 public:
@@ -2645,7 +2647,6 @@ protected:
     virtual void EmitConvertContentsNativeToCLR(ILCodeStream* pslILEmit);
 };
 
-
 class ILAnsiBSTRMarshaler : public ILMarshaler
 {
 public:
@@ -2664,7 +2665,6 @@ protected:
     virtual bool NeedsClearNative();
     virtual void EmitClearNative(ILCodeStream* pslILEmit);
 };
-#endif // FEATURE_COMINTEROP
 
 class ILLayoutClassPtrMarshalerBase : public ILMarshaler
 {
@@ -2716,42 +2716,6 @@ protected:
 };
 
 
-#ifndef FEATURE_CORECLR
-class ILBlittableValueClassWithCopyCtorMarshaler : public ILMarshaler
-{
-public:
-    enum
-    {
-        c_fInOnly               = TRUE,
-        c_nativeSize            = VARIABLESIZE,
-        c_CLRSize               = sizeof(OBJECTREF),
-    };
-
-    LocalDesc GetManagedType()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return LocalDesc();
-    }
-
-    LocalDesc GetNativeType()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return LocalDesc();
-    }
-
-    static MarshalerOverrideStatus ArgumentOverride(NDirectStubLinker* psl,
-                                            BOOL               byref,
-                                            BOOL               fin,
-                                            BOOL               fout,
-                                            BOOL               fManagedToNative,
-                                            OverrideProcArgs*  pargs,
-                                            UINT*              pResID,
-                                            UINT               argidx,
-                                            UINT               nativeStackOffset);
-
-
-};
-#endif // !FEATURE_CORECLR
 
 
 class ILArgIteratorMarshaler : public ILMarshaler