Browse Source

* Try to compile with mingw64 gdb

git-svn-id: trunk@16314 -
pierre 14 years ago
parent
commit
64af782aca
1 changed files with 12 additions and 0 deletions
  1. 12 0
      packages/gdbint/examples/mingw.pas

+ 12 - 0
packages/gdbint/examples/mingw.pas

@@ -35,15 +35,25 @@ uses gdbint; // force dependancies that hopefully make it execute at the right m
 Type
 Type
   TAtexitFunction = function(p:TCFUnction):longint cdecl;
   TAtexitFunction = function(p:TCFUnction):longint cdecl;
 
 
+{$ifdef win64}
+var __imp_atexit : TAtExitFunction; Cvar; external;  // "true" atexit in mingw libs.
+{$else not win64}
 var _imp__atexit : TAtExitFunction; Cvar; external;  // "true" atexit in mingw libs.
 var _imp__atexit : TAtExitFunction; Cvar; external;  // "true" atexit in mingw libs.
+{$endif not win64}
 
 
 function atexit(p:TCFunction):longint;cdecl; [public, alias : '_atexit'];
 function atexit(p:TCFunction):longint;cdecl; [public, alias : '_atexit'];
 
 
 begin
 begin
+{$ifdef win64}
+  atexit:=__imp_atexit(p);  // simply route to "true" atexit
+{$else not win64}
   atexit:=_imp__atexit(p);  // simply route to "true" atexit
   atexit:=_imp__atexit(p);  // simply route to "true" atexit
+{$endif not win64}
 end;
 end;
 
 
+{$ifdef win32}
 procedure __cpu_features_init; cdecl; external;
 procedure __cpu_features_init; cdecl; external;
+{$endif win32}
 procedure _pei386_runtime_relocator; cdecl; external;
 procedure _pei386_runtime_relocator; cdecl; external;
 procedure __main; cdecl;external;
 procedure __main; cdecl;external;
 
 
@@ -52,7 +62,9 @@ procedure doinit;
 begin
 begin
  // not (yet) done: set mingw exception handlers:
  // not (yet) done: set mingw exception handlers:
  // SetUnhandledExceptionFilter (_gnu_exception_handler);
  // SetUnhandledExceptionFilter (_gnu_exception_handler);
+{$ifdef win32}
   __cpu_features_init;        // load CPU features. Might be useful for debugger :-)
   __cpu_features_init;        // load CPU features. Might be useful for debugger :-)
+{$endif win32}
 
 
  // fpreset; 		      // don't do this, we init our own fp mask
  // fpreset; 		      // don't do this, we init our own fp mask