bcc icon indicating copy to clipboard operation
bcc copied to clipboard

x86-stdcall support of shared libs - Aliases removed

Open GWRon opened this issue 3 years ago • 3 comments

When compiling shared libraries (DLL files) in the "stdcall" version - so like this:

Function MyFunc:Int() export "Win32"
End Function

The generated .def file only contains

LIBRARY testdll
EXPORTS
    MyFunc@0

But it used to be

LIBRARY testdll
EXPORTS
    MyFunc

    MyFunc@0 = MyFunc

This happens since the commit https://github.com/bmx-ng/bcc/commit/d2be2db1981058680a32cfd3710463e209072e12

The merge removed a part of the method TransDef in ctranslator.bmx: current:

	Method TransDef(app:TAppDecl)

		SetOutput("def")

		Emit "LIBRARY " + StripExt(StripDir(opt_filepath))
		Emit "EXPORTS"
		
		For Local decl:TFuncDecl=EachIn app.exportDefs
			Emit "~t" + TransExportDef(decl, opt_arch = "x86")
		Next

		Emit "~n"
	End Method

Before:

    Method TransDef(app:TAppDecl)

        SetOutput("def")

        Emit "LIBRARY " + StripExt(StripDir(opt_filepath))
        Emit "EXPORTS"

        For Local decl:TFuncDecl=EachIn app.exportDefs
            Emit "~t" + TransExportDef(decl, False)
        Next

        If opt_arch = "x86" Then
            Emit "~n"

            For Local decl:TFuncDecl=EachIn app.exportDefs
                If decl.attrs & DECL_API_STDCALL Then
                    Emit "~t" + TransExportDef(decl, True) + " = " + TransExportDef(decl, False)
                End If
            Next
        End If

        Emit "~n"
    End Method

GWRon avatar Mar 11 '21 19:03 GWRon