将MSVC代码移植到Linux Gcc以获取数组,字节,pin_ptr

时间:2019-03-24 19:20:16

标签: linux visual-c++

我正在尝试使用Visual Studio 2017和Linux交叉编译将MSVC转换为Linux Gcc。下面是我的MSVC代码:

#include "stdafx.h"
#include "vLoginId.h"
#using <mscorlib.dll> //I removed this line for Gcc

//compiler can't detect following namespace as they are CLR
using namespace System;
using namespace System::Runtime::InteropServices;
using namespace System::Collections::Generic;
//---------------
#pragma once

namespace MyNameSpace
{
    //public ref class LoginId //[Clang IntelliSense] Error: expected unqualified-id so I removed public ref and set on 
    class LoginId
    {
    public:
        //[Clang IntelliSense] Error: unknown type name 'array'
        static ULONGLONG Decode(array<Byte>^ data, int arg8) 
        //if I include <array> then array found but Byte got undeclare identifire
        {
            pin_ptr<Byte> pData = &data[0]; //pin_ptr is totally windows related what is equivalent for Linx
            vLoginId login;
            return login.Decode((ULONGLONG*)pData, data->Length / 8, arg8);
        }
    };
}

有人可以帮忙吗?

0 个答案:

没有答案