Thanks for the info. It does make it a lot simpler now with the nodecorate
attribute.

However, I remember that back in 0.9.26 there was a different way. You
could use the __asm directive and then type the desired name of the
function, and it would override the name that the compiler tried to give
it. For example, For a function called TestFunc you could do this when
declaring your function.
__attribute((dllexport,stdcall)) int TestFunc(int arg1,int arg2)
__asm("TestFunc");
__attribute((dllexport,stdcall)) int TestFunc(int arg1,int arg2){
//do some stuff
}

The first line guaranties that the function called TestFunc in the source
code was called also called TestFunc (without any decoration) in the DLL
(though you could also use this technique it to rename it to anything you
wanted). That worked in 0.9.26, but I have discovered to my surprise, that
this no longer works in 0.9.27. This means source code written by users of
0.9.26 can't be directly compiled in 0.9.27. The code will NEED to be
edited to use the new attribute instead of the __asm directive, breaking
backward compatibility. Please fix this. Any code that compiled
successfully in a previous version of TCC should also compile without any
changes in the current version.I consider this breaking of backward
compatibility to be a bug.

On Mon, May 13, 2019 at 9:07 AM <[email protected]> wrote:

> Message: 2
> Date: Mon, 13 May 2019 12:29:14 +0100
> From: Jonathan Newman <[email protected]>
> To: [email protected]
> Subject: Re: [Tinycc-devel] How do I rename exported DLL function?
> Message-ID:
>         <CAN=
> [email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> I added a "nodecorate" attribute a while ago to handle this (it just
> suppresses the addition of "_" and "@n"). It would be nice to add support
> for reading .def files at some point...
>
>
>
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to