Add tests for ANSI BSTRs (#20985)
[platform/upstream/coreclr.git] / src / vm / ilmarshalers.h
index 7c7f9a6..6a67bf6 100644 (file)
@@ -607,12 +607,15 @@ public:
 
             // 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
 {