@@ -203,7 +203,19 @@ interface
203203
204204implementation
205205
206- uses Strings;
206+ (*
207+ * We need an strlen() implementation for some operations on C-strings.
208+ * FPC ships one in the Strings unit; Delphi has one in the AnsiStrings unit.
209+ * Since FPC defines "DELPHI" when building in Delphi-compatibility mode,
210+ * check if "FPC" is defined to determine which compiler is used.
211+ *)
212+ uses
213+ { $IFDEF FPC}
214+ Strings
215+ { $ELSE}
216+ AnsiStrings
217+ { $ENDIF}
218+ ;
207219
208220// Macros from "sdl_version.h"
209221procedure SDL_VERSION (out x: TSDL_Version);
@@ -434,17 +446,17 @@ function SDL_SHAPEMODEALPHA(mode: TWindowShapeMode): Boolean;
434446// Note: We're using FPC's Strings.strlen() here, not SDL_strlen().
435447function SDL_iconv_utf8_locale (Const str: PAnsiChar): PAnsiChar; cdecl;
436448begin
437- Result := SDL_iconv_string(' ' , ' UTF-8' , str, Strings. strlen(str)+1 )
449+ Result := SDL_iconv_string(' ' , ' UTF-8' , str, strlen(str)+1 )
438450end ;
439451
440452function SDL_iconv_utf8_ucs2 (Const str: PAnsiChar): pcUint16; cdecl;
441453begin
442- Result := pcUint16(SDL_iconv_string(' UCS-2-INTERNAL' , ' UTF-8' , str, Strings. strlen(str)+1 ))
454+ Result := pcUint16(SDL_iconv_string(' UCS-2-INTERNAL' , ' UTF-8' , str, strlen(str)+1 ))
443455end ;
444456
445457function SDL_iconv_utf8_ucs4 (Const str: PAnsiChar): pcUint32; cdecl;
446458begin
447- Result := pcUint32(SDL_iconv_string(' UCS-4-INTERNAL' , ' UTF-8' , str, Strings. strlen(str)+1 ))
459+ Result := pcUint32(SDL_iconv_string(' UCS-4-INTERNAL' , ' UTF-8' , str, strlen(str)+1 ))
448460end ;
449461
450462// from "sdl_video.h"
0 commit comments