Git Product home page Git Product logo

Comments (6)

davidfowl avatar davidfowl commented on June 2, 2024

Ok after some hackery:

// System.Private.Interop, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a.MinCore
extern "C" int32_t GetLastError();
// System.Private.Interop, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a.MinCore
int32_t System_Private_Interop::Interop_MinCore::GetLastWin32Error()
{
    return ::GetLastError();
}

The conflicit:

// System.Private.CoreLib, Version=999.999.999.999, PublicKeyToken=b03f5f7f11d50a3a.mincore
extern "C" uint32_t GetLastError();
// System.Private.CoreLib, Version=999.999.999.999, PublicKeyToken=b03f5f7f11d50a3a.mincore
uint32_t System_Private_CoreLib::Interop_mincore::GetLastError()
{
    return ::GetLastError();
}

This might a useful thing to add with a --verbose flag. Thoughts? I could submit a PR 😄

from corert.

davidfowl avatar davidfowl commented on June 2, 2024

FormatMessageW

// System.Console, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a.mincore
extern "C" int32_t FormatMessageW(int32_t, intptr_t, uint32_t, int32_t, System_Private_CoreLib::System::Text::StringBuilder*, int32_t, System_Private_CoreLib::System::IntPtr__Array*);
// System.Console, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a.mincore
int32_t System_Console::Interop_mincore::FormatMessage(int32_t dwFlags, intptr_t lpSource, uint32_t dwMessageId, int32_t dwLanguageId, System_Private_CoreLib::System::Text::StringBuilder* lpBuffer, int32_t nSize, System_Private_CoreLib::System::IntPtr__Array* arguments)
{
    return ::FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, arguments);
}
// System.Private.Interop, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a.MinCore
extern "C" int32_t FormatMessageW(int32_t, intptr_t, uint32_t, uint32_t, uint16_t*, uint32_t, intptr_t);
// System.Private.Interop, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a.MinCore
int32_t System_Private_Interop::Interop_MinCore::FormatMessage(int32_t dwFlags, intptr_t lpSource, uint32_t dwMessageId, uint32_t dwLanguageId, uint16_t* lpBuffer, uint32_t nSize, intptr_t Arguments)
{
    return ::FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
}

from corert.

jkotas avatar jkotas commented on June 2, 2024

These colliding PInvoke definitions are pain - unfortunately, they are pretty common. I think we will need to deal with them by spitting them into separate .cpp files.

from corert.

davidfowl avatar davidfowl commented on June 2, 2024

Namespacing won't work?

from corert.

jkotas avatar jkotas commented on June 2, 2024

I do not think so. The PInvoke definitions have to be extern "C", and so C++ namespaces won't change anything about them. I would love to know if there is a trick that we can use.

from corert.

jkotas avatar jkotas commented on June 2, 2024

Fixed a while ago.

from corert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.