{ +-------------------------------------------------------------+ }
{ |                                                             | }
{ |   GM-Software                                               | }
{ |   ===========                                               | }
{ |                                                             | }
{ |   Project: All Projects                                     | }
{ |                                                             | }
{ |   Description: General string definitions.                  | }
{ |                                                             | }
{ |                                                             | }
{ |   Copyright (C) - 2013 - Gerrit Moeller.                    | }
{ |                                                             | }
{ |   Source code distributed under MIT license.                | }
{ |                                                             | }
{ |   See: https://www.gm-software.de                           | }
{ |                                                             | }
{ +-------------------------------------------------------------+ }

{$INCLUDE GMCompilerSettings.inc}

unit GMStrDef;

interface

type

  {$IFDEF UNICODE}
   {$IFDEF DELPHI9}
    TGMString = UnicodeString;
    TGMChar = UnicodeChar;
    PGMChar = PUnicodeChar;
    PLPSTR = ^PUnicodeChar;
    PUnicodeString = ^UnicodeString;
   {$ELSE}
    TGMString = WideString;
    TGMChar = WideChar;
    PGMChar = PWideChar;
    PLPSTR = ^PWideChar;
   {$ENDIF}
  {$ELSE}
   TGMString = AnsiString;
   TGMChar = AnsiChar;
   PGMChar = PAnsiChar;
   PLPSTR = ^PAnsiChar;
  {$ENDIF}

  {$IFNDEF DELPHI9}
   UnicodeString = WideString;
   PUnicodeString = ^UnicodeString;
   PUnicodeChar = PWideChar;
  {$ENDIF}

   PPGMChar = ^PGMCHar;
   PGMString = ^TGMString;


   //
   // Api string type to be used across DLL boundaries
   // Normally an UnicodeString should crash when passing a DLL boundary, but it works with FreePascal
   //
   PApiStr = ^TApiString;
   TApiString = UnicodeString;

   PApiChar = ^TApiChar;
   TApiChar = WideChar; // <- Must match char type of TApiString


implementation

end.