Open laoqiuqiu opened 1 year ago
This is currently controlled globally in the "Conversion Settings"> "Calling convention" settings. But experimental support for extended call conversion translation is available in my fork. see https://github.com/alexeydott/Chet/tree/master/Bin But remember, for conversion to work correctly, you need to specify directories with included files, as well as set command line parameters that define the target platform. For example, for windows it is --target=i686-pc-win32 --target=i686-pc-windows-msvc.
#define BUTTONS_OKA (LPSTR)1 // Ok
Parsed
BUTTONS_OKA = (LPSTR)1;
ought to be
BUTTONS_OKA = LPSTR(1);
Regarding call conversion - are your examples handled correctly? If yes - I will create a pullrequest to synchronize my code with the main branch and close this issue.
As for handling #define BUTTONS_OKA (LPSTR)1
-.
This is a different issue that needs to be separated from this issue. It is about how the THeaderTranslator.WriteConstantsRhs method works.
At the moment I don't see how to fix this without disturbing other macros (e.g.
#define COMPLEX_CONSTANT ((((INT_CONSTANT<<2)+INT_CONSTANT) | 0xFE) & 255))
.
PS There is a workaround - use the postprocessing script. For your case it would look like this ReplaceLine(1, "BUTTONS_OKA = (LPSTR)1;", " BUTTONS_OKA = LPSTR(1);", 0)
.
Parsed error
Change to
Parsed
cdecl
ought to bestdcall