Menu

#242 Uses Clause Manager wrongly finds GetText identifier in ToolsApi

Closed
closed-fixed
None
5
2021-04-24
2021-04-03
No

When filtering for 'GetText' on the Identifier tab of the Uses Clause Manager the list contains GetText from the ToolsApi. This is wrong. There are several interfaces with a GetText method in that unit, but no plain function called GetText, so it should not show up.

Discussion

  • Thomas Mueller

    Thomas Mueller - 2021-04-03
    • summary: Uses Clause Manager wrongly finds GetText idnetifier in ToolsApi --> Uses Clause Manager wrongly finds GetText identifier in ToolsApi
     
  • Thomas Mueller

    Thomas Mueller - 2021-04-03
     
  • Thomas Mueller

    Thomas Mueller - 2021-04-03

    It's the declaration
    ~~~
    type
    TGetSrcLinesFunc = function (LineNum: Integer; ClientArg: Pointer): Integer {$IFDEF LINUX} cdecl; {$ENDIF} {$IFDEF MSWINDOWS} pascal; {$ENDIF}
    ~~~
    in line 2948 of Delphi 2007's toolsapi.pas that causes this.

     
    • Thomas Mueller

      Thomas Mueller - 2021-04-03

      The reason is that this code is not valid unless either LINUX or MSWINDOWS is declared.
      Without one of these we get:

      type
        TGetSrcLinesFunc = function (LineNum: Integer; ClientArg: Pointer): Integer
        IOTAProcess90 = interface(IOTAProcess70)
      

      And since there is no semicolon after the 'integer' this would not compile.

      This makes it rather difficult to fix in general even though in this particular case we could hard code MSWINDOWS. But that's not really helpful.

       
  • Thomas Mueller

    Thomas Mueller - 2021-04-24
    • status: open --> open-fixed
    • Group: New --> Closed
     
  • Thomas Mueller

    Thomas Mueller - 2021-04-24

    Fixed in revision #3505 by explicitly defining the symbol MSWINDOWS for ToolsApi.pas

     
  • Thomas Mueller

    Thomas Mueller - 2021-04-24
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB