Jelajahi Sumber

--- Merging r16313 into '.':
U packages/fcl-image/src/fpreadpnm.pp
--- Merging r16314 into '.':
U packages/gdbint/examples/mingw.pas
--- Merging r16315 into '.':
U packages/gdbint/src/gdbint.pp
--- Merging r16316 into '.':
U ide/fpmingw.pas
--- Merging r16318 into '.':
U rtl/objpas/sysutils/sysutils.inc
--- Merging r16319 into '.':
U packages/gdbint/gen-gdblib-inc.sh
--- Merging r16332 into '.':
C packages/Makefile
U packages/opencl/fpmake.pp
U packages/opencl/src/cl.pp
U packages/Makefile.fpc
--- Merging r16334 into '.':
A packages/opencl/readme.txt
--- Merging r16335 into '.':
U rtl/wince/winsock2.pp
U rtl/win/winsock2.pp
Summary of conflicts:
Text conflicts: 1

# revisions: 16313,16314,16315,16316,16318,16319,16332,16334,16335
------------------------------------------------------------------------
r16313 | marco | 2010-11-07 15:13:35 +0100 (Sun, 07 Nov 2010) | 2 lines
Changed paths:
M /trunk/packages/fcl-image/src/fpreadpnm.pp

* fix for mantis 17840, rounding of bits/line

------------------------------------------------------------------------
------------------------------------------------------------------------
r16314 | pierre | 2010-11-08 16:37:09 +0100 (Mon, 08 Nov 2010) | 1 line
Changed paths:
M /trunk/packages/gdbint/examples/mingw.pas

* Try to compile with mingw64 gdb
------------------------------------------------------------------------
------------------------------------------------------------------------
r16315 | pierre | 2010-11-08 16:43:56 +0100 (Mon, 08 Nov 2010) | 5 lines
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

* Extract implicit libraries from ifdef NotImplemented
to enable use of gdblib.inc file without addition of these
implicit libraries
* Add win64 library list
* Increase jmp_buf size to 16*sizeof(longint), value used in mingw headers
------------------------------------------------------------------------
------------------------------------------------------------------------
r16316 | pierre | 2010-11-08 16:44:38 +0100 (Mon, 08 Nov 2010) | 1 line
Changed paths:
M /trunk/ide/fpmingw.pas

* Try to compile with mingw64 gdb
------------------------------------------------------------------------
------------------------------------------------------------------------
r16318 | sergei | 2010-11-09 10:52:42 +0100 (Tue, 09 Nov 2010) | 3 lines
Changed paths:
M /trunk/rtl/objpas/sysutils/sysutils.inc

* SysUtils unit, fixed return value of FileSetDate:
* return value of GetLastOSError if one is available, to be consistent with handle-based implementations and Delphi behavior.
* otherwise, return -1
------------------------------------------------------------------------
------------------------------------------------------------------------
r16319 | pierre | 2010-11-10 11:10:53 +0100 (Wed, 10 Nov 2010) | 1 line
Changed paths:
M /trunk/packages/gdbint/gen-gdblib-inc.sh

* Also recognize mingw gdb on -D__USE_MINGW_ACCESS option
------------------------------------------------------------------------
------------------------------------------------------------------------
r16332 | jonas | 2010-11-12 23:16:28 +0100 (Fri, 12 Nov 2010) | 2 lines
Changed paths:
M /trunk/packages/Makefile
M /trunk/packages/Makefile.fpc
M /trunk/packages/opencl/fpmake.pp
M /trunk/packages/opencl/src/cl.pp

* enable OpenCL for Linux (patch by Denis Golovan, mantis #17917)

------------------------------------------------------------------------
------------------------------------------------------------------------
r16334 | jonas | 2010-11-13 14:04:37 +0100 (Sat, 13 Nov 2010) | 2 lines
Changed paths:
A /trunk/packages/opencl/readme.txt

+ forgotten to add/commit in r16332

------------------------------------------------------------------------
------------------------------------------------------------------------
r16335 | michael | 2010-11-13 16:51:43 +0100 (Sat, 13 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/win/winsock2.pp
M /trunk/rtl/wince/winsock2.pp

* Correction of PAFProtocols (Ivan Shikhalev, bug ID #17924
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@16437 -

marco 15 tahun lalu
induk
melakukan
16d4164453

+ 1 - 0
.gitattributes

@@ -4171,6 +4171,7 @@ packages/opencl/Makefile.fpc svneol=native#text/plain
 packages/opencl/examples/basicsample.pas svneol=native#text/pascal
 packages/opencl/examples/clinfo.pp svneol=native#text/pascal
 packages/opencl/fpmake.pp svneol=native#text/pascal
+packages/opencl/readme.txt svneol=native#text/plain
 packages/opencl/src/cl.pp svneol=native#text/pascal
 packages/opencl/src/cl_gl.pp svneol=native#text/pascal
 packages/opengl/Makefile svneol=native#text/plain

+ 21 - 9
ide/fpmingw.pas

@@ -18,8 +18,8 @@ interface
 
 // mingw put atexit in binaries, so that it can have one atexit, and call it from
 // dll and .exe startup code.
-// This unit provides a similar service for when mingw code (read: libgdb and friends) are statically 
-// linked to FPC. 
+// This unit provides a similar service for when mingw code (read: libgdb and friends) are statically
+// linked to FPC.
 
 Type
   TCFunction = function:longint cdecl; // prototype of an handler to be registered with atexit
@@ -34,15 +34,25 @@ uses gdbint; // force dependancies that hopefully make it execute at the right m
 Type
   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.
+{$endif not win64}
 
 function atexit(p:TCFunction):longint;cdecl; [public, alias : '_atexit'];
 
 begin
+{$ifdef win64}
+  atexit:=__imp_atexit(p);  // simply route to "true" atexit
+{$else not win64}
   atexit:=_imp__atexit(p);  // simply route to "true" atexit
-end; 
+{$endif not win64}
+end;
 
+{$ifdef win32}
 procedure __cpu_features_init; cdecl; external;
+{$endif win32}
 procedure _pei386_runtime_relocator; cdecl; external;
 procedure __main; cdecl;external;
 
@@ -51,15 +61,17 @@ procedure doinit;
 begin
  // not (yet) done: set mingw exception handlers:
  // SetUnhandledExceptionFilter (_gnu_exception_handler);
+{$ifdef win32}
   __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
 
  //  _mingw32_init_mainargs ();  // mingw doesn't handle arguments not necessary.
  //  _mingw32_init_fmode ();     // Set default filemode. Is not done for libraries, so we don't.
 
- // Adust references to dllimported data that have non-zero offsets.  
-  _pei386_runtime_relocator;  // 
+ // Adust references to dllimported data that have non-zero offsets.
+  _pei386_runtime_relocator;  //
 
  // aligns stack here to 16 bytes
 
@@ -69,7 +81,7 @@ begin
       explicitly at app startup rather than rely on gcc to generate
       the call in main's  prologue, since main may be imported from a dll
       which has its own __do_global_ctors.  }
- //  __main;                   // should be libgcc initialization but this causes infinite loop. 
+ //  __main;                   // should be libgcc initialization but this causes infinite loop.
 end;
 
 procedure _cexit; cdecl; external;
@@ -79,7 +91,7 @@ begin
 {
    * Perform exit processing for the C library. This means
    * flushing output and calling 'atexit' registered functions.
-} 
+}
  _cexit ();
 end;
 
@@ -87,4 +99,4 @@ initialization
   doinit;
 finalization
   doatexit;
-end.
+end.

+ 63 - 54
packages/Makefile

@@ -265,7 +265,7 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph libc unixutil graph pxlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph libc unixutil graph pxlib
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv graph unzip gdbint
@@ -325,7 +325,7 @@ ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc gmp fcl-extra libxml
@@ -349,7 +349,7 @@ ifeq ($(FULL_TARGET),m68k-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
@@ -370,7 +370,7 @@ ifeq ($(FULL_TARGET),powerpc-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
@@ -382,7 +382,7 @@ ifeq ($(FULL_TARGET),sparc-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc gmp fcl-extra libxml
@@ -400,7 +400,7 @@ ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  palmunits
@@ -424,7 +424,7 @@ ifeq ($(FULL_TARGET),arm-symbian)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee graph
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
@@ -436,13 +436,13 @@ ifeq ($(FULL_TARGET),avr-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json fcl-js fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2 hermes  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp ptc libsee
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCSUBDIR=packages
@@ -1601,6 +1601,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -2582,6 +2583,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -2988,6 +2990,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -3323,6 +3326,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -3572,6 +3576,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -3949,6 +3954,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -4269,6 +4275,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -4478,6 +4485,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -4593,6 +4601,7 @@ TARGET_DIRS_TCL=1
 TARGET_DIRS_SYSLOG=1
 TARGET_DIRS_LIBCURL=1
 TARGET_DIRS_OPENGL=1
+TARGET_DIRS_OPENCL=1
 TARGET_DIRS_CAIRO=1
 TARGET_DIRS_GTK1=1
 TARGET_DIRS_GTK2=1
@@ -6925,6 +6934,51 @@ opengl:
 	$(MAKE) -C opengl all
 .PHONY: opengl_all opengl_debug opengl_smart opengl_release opengl_units opengl_examples opengl_shared opengl_install opengl_sourceinstall opengl_exampleinstall opengl_distinstall opengl_zipinstall opengl_zipsourceinstall opengl_zipexampleinstall opengl_zipdistinstall opengl_clean opengl_distclean opengl_cleanall opengl_info opengl_makefiles opengl
 endif
+ifdef TARGET_DIRS_OPENCL
+opencl_all:
+	$(MAKE) -C opencl all
+opencl_debug:
+	$(MAKE) -C opencl debug
+opencl_smart:
+	$(MAKE) -C opencl smart
+opencl_release:
+	$(MAKE) -C opencl release
+opencl_units:
+	$(MAKE) -C opencl units
+opencl_examples:
+	$(MAKE) -C opencl examples
+opencl_shared:
+	$(MAKE) -C opencl shared
+opencl_install:
+	$(MAKE) -C opencl install
+opencl_sourceinstall:
+	$(MAKE) -C opencl sourceinstall
+opencl_exampleinstall:
+	$(MAKE) -C opencl exampleinstall
+opencl_distinstall:
+	$(MAKE) -C opencl distinstall
+opencl_zipinstall:
+	$(MAKE) -C opencl zipinstall
+opencl_zipsourceinstall:
+	$(MAKE) -C opencl zipsourceinstall
+opencl_zipexampleinstall:
+	$(MAKE) -C opencl zipexampleinstall
+opencl_zipdistinstall:
+	$(MAKE) -C opencl zipdistinstall
+opencl_clean:
+	$(MAKE) -C opencl clean
+opencl_distclean:
+	$(MAKE) -C opencl distclean
+opencl_cleanall:
+	$(MAKE) -C opencl cleanall
+opencl_info:
+	$(MAKE) -C opencl info
+opencl_makefiles:
+	$(MAKE) -C opencl makefiles
+opencl:
+	$(MAKE) -C opencl all
+.PHONY: opencl_all opencl_debug opencl_smart opencl_release opencl_units opencl_examples opencl_shared opencl_install opencl_sourceinstall opencl_exampleinstall opencl_distinstall opencl_zipinstall opencl_zipsourceinstall opencl_zipexampleinstall opencl_zipdistinstall opencl_clean opencl_distclean opencl_cleanall opencl_info opencl_makefiles opencl
+endif
 ifdef TARGET_DIRS_CAIRO
 cairo_all:
 	$(MAKE) -C cairo all
@@ -8815,51 +8869,6 @@ winceunits:
 	$(MAKE) -C winceunits all
 .PHONY: winceunits_all winceunits_debug winceunits_smart winceunits_release winceunits_units winceunits_examples winceunits_shared winceunits_install winceunits_sourceinstall winceunits_exampleinstall winceunits_distinstall winceunits_zipinstall winceunits_zipsourceinstall winceunits_zipexampleinstall winceunits_zipdistinstall winceunits_clean winceunits_distclean winceunits_cleanall winceunits_info winceunits_makefiles winceunits
 endif
-ifdef TARGET_DIRS_OPENCL
-opencl_all:
-	$(MAKE) -C opencl all
-opencl_debug:
-	$(MAKE) -C opencl debug
-opencl_smart:
-	$(MAKE) -C opencl smart
-opencl_release:
-	$(MAKE) -C opencl release
-opencl_units:
-	$(MAKE) -C opencl units
-opencl_examples:
-	$(MAKE) -C opencl examples
-opencl_shared:
-	$(MAKE) -C opencl shared
-opencl_install:
-	$(MAKE) -C opencl install
-opencl_sourceinstall:
-	$(MAKE) -C opencl sourceinstall
-opencl_exampleinstall:
-	$(MAKE) -C opencl exampleinstall
-opencl_distinstall:
-	$(MAKE) -C opencl distinstall
-opencl_zipinstall:
-	$(MAKE) -C opencl zipinstall
-opencl_zipsourceinstall:
-	$(MAKE) -C opencl zipsourceinstall
-opencl_zipexampleinstall:
-	$(MAKE) -C opencl zipexampleinstall
-opencl_zipdistinstall:
-	$(MAKE) -C opencl zipdistinstall
-opencl_clean:
-	$(MAKE) -C opencl clean
-opencl_distclean:
-	$(MAKE) -C opencl distclean
-opencl_cleanall:
-	$(MAKE) -C opencl cleanall
-opencl_info:
-	$(MAKE) -C opencl info
-opencl_makefiles:
-	$(MAKE) -C opencl makefiles
-opencl:
-	$(MAKE) -C opencl all
-.PHONY: opencl_all opencl_debug opencl_smart opencl_release opencl_units opencl_examples opencl_shared opencl_install opencl_sourceinstall opencl_exampleinstall opencl_distinstall opencl_zipinstall opencl_zipsourceinstall opencl_zipexampleinstall opencl_zipdistinstall opencl_clean opencl_distclean opencl_cleanall opencl_info opencl_makefiles opencl
-endif
 ifdef TARGET_DIRS_REXX
 rexx_all:
 	$(MAKE) -C rexx all

+ 1 - 1
packages/Makefile.fpc

@@ -42,7 +42,7 @@ dirs_openbsd=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc
                gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 dirs_linux=fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick \
-               gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg \
+               gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl opencl cairo gtk1 gtk2 librsvg \
                a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra \
                imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 \
                pxlib numlib gmp ptc libsee

+ 1 - 1
packages/fcl-image/src/fpreadpnm.pp

@@ -136,7 +136,7 @@ var
 begin
   ReadHeader(Stream);
   Img.SetSize(FWidth,FHeight);
-  FScanLineSize:=FBitPP*((FWidth+7)shr 3);
+  FScanLineSize:=(FBitPP*FWidth+7) shr 3;  // (bits/line +7)
   GetMem(FScanLine,FScanLineSize);
   try
     for Row:=0 to img.Height-1 do

+ 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
   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.
+{$endif not win64}
 
 function atexit(p:TCFunction):longint;cdecl; [public, alias : '_atexit'];
 
 begin
+{$ifdef win64}
+  atexit:=__imp_atexit(p);  // simply route to "true" atexit
+{$else not win64}
   atexit:=_imp__atexit(p);  // simply route to "true" atexit
+{$endif not win64}
 end;
 
+{$ifdef win32}
 procedure __cpu_features_init; cdecl; external;
+{$endif win32}
 procedure _pei386_runtime_relocator; cdecl; external;
 procedure __main; cdecl;external;
 
@@ -52,7 +62,9 @@ procedure doinit;
 begin
  // not (yet) done: set mingw exception handlers:
  // SetUnhandledExceptionFilter (_gnu_exception_handler);
+{$ifdef win32}
   __cpu_features_init;        // load CPU features. Might be useful for debugger :-)
+{$endif win32}
 
  // fpreset; 		      // don't do this, we init our own fp mask
 

+ 3 - 0
packages/gdbint/gen-gdblib-inc.sh

@@ -134,6 +134,9 @@ BEGIN {
     use_mingw=1
     }
   }
+  if ( list[i] ~ /-D__USE_MINGW_/ ) {
+    use_mingw=1
+  }
   if ( list[i] ~ /lib[^ ]*\.so/ ) {
     dynamiclib = gensub (/([^ ]*)(lib[^ ]*\.so)/,"{$LINKLIB \\2} { found in \\1 }","g",list[i]);
     librarypath = gensub (/([^ ]*)(lib[^ ]*\.so)/,"{$LIBRARYPATH \\1} { for \\2 }","g",list[i]);

+ 68 - 11
packages/gdbint/src/gdbint.pp

@@ -194,8 +194,8 @@ interface
   {$endif i386}
 {$endif Solaris}
 
-{$ifdef NotImplemented}
 {$ifdef go32v2}
+{$ifdef NotImplemented}
   {$undef NotImplemented}
   {$LINKLIB gdb}
   {$ifdef GDB_HAS_SIM}
@@ -218,11 +218,13 @@ interface
   {$ifndef GDB_DISABLE_INTL}
     {$LINKLIB intl}
   {$endif ndef GDB_DISABLE_INTL}
+{$endif NotImplemented}
   {$LINKLIB dbg}
   {$LINKLIB c}
 {$endif go32v2}
 
 {$ifdef linux}
+{$ifdef NotImplemented}
   {$undef NotImplemented}
   {$LINKLIB libgdb.a}
   {$ifdef GDB_HAS_SIM}
@@ -243,6 +245,7 @@ interface
     {$LINKLIB python}
   {$endif GDB_USES_LIBPYTHON}
   {$LINKLIB ncurses}
+{$endif NotImplemented}
   {$LINKLIB m}
   {$LINKLIB dl}
   {$LINKLIB c}
@@ -250,6 +253,7 @@ interface
 {$endif linux}
 
 {$ifdef freebsd}
+{$ifdef NotImplemented}
   {$ifdef FreeBSD5}  //5.4+ ?
     {$linklib kvm}
   {$endif}
@@ -280,11 +284,13 @@ interface
   {$ifdef GDB_USES_LIBPYTHON}
     {$LINKLIB python}
   {$endif GDB_USES_LIBPYTHON}
+{$endif NotImplemented}
   {$LINKLIB c}
   {$LINKLIB gcc}
 {$endif freebsd}
 
 {$ifdef netbsd}
+{$ifdef NotImplemented}
   {$undef NotImplemented}
   {$LINKLIB gdb}
   {$ifdef GDB_HAS_SIM}
@@ -309,11 +315,13 @@ interface
     {$LINKLIB python}
   {$endif GDB_USES_LIBPYTHON}
   { does not seem to exist on netbsd LINKLIB dl}
+{$endif NotImplemented}
   {$LINKLIB c}
   {$LINKLIB gcc}
 {$endif netbsd}
 
 {$ifdef solaris}
+{$ifdef NotImplemented}
   {$undef NotImplemented}
   {$LINKLIB gdb}
   {$ifdef GDB_HAS_SIM}
@@ -337,6 +345,7 @@ interface
   {$ifdef GDB_USES_LIBPYTHON}
     {$LINKLIB python}
   {$endif GDB_USES_LIBPYTHON}
+{$endif NotImplemented}
   {$LINKLIB dl}
   {$LINKLIB socket}
   {$LINKLIB nsl}
@@ -344,6 +353,7 @@ interface
 {$endif solaris}
 
 {$ifdef openbsd}
+{$ifdef NotImplemented}
   {$undef NotImplemented}
   {$LINKLIB gdb}
   {$ifdef GDB_HAS_SIM}
@@ -370,11 +380,13 @@ interface
     {$LINKLIB python}
   {$endif GDB_USES_LIBPYTHON}
   { does not seem to exist on netbsd LINKLIB dl}
+{$endif NotImplemented}
   {$LINKLIB c}
   {$LINKLIB gcc}
 {$endif netbsd}
 
 {$ifdef win32}
+{$ifdef NotImplemented}
   {$undef NotImplemented}
   {$LINKLIB libgdb.a}
  {$ifdef GDB_HAS_SIM}
@@ -387,13 +399,6 @@ interface
   {$LINKLIB libiberty.a}
 
   {$ifdef USE_MINGW_GDB}
-    {$LINKLIB libm.a}
-    {$LINKLIB libmoldname.a}
-    {$LINKLIB libgcc.a}
-    {$LINKLIB libws2_32.a}
-    {$LINKLIB libmingwex.a}
-    {$LINKLIB libmingw32.a}
-    {$LINKLIB libmsvcrt.a}
     {$LINKLIB libdecnumber.a}
     {$ifdef GDB_USES_LIBDECNUMBER}
       {$LINKLIB decnumber}
@@ -416,6 +421,17 @@ interface
     {$ifdef GDB_USES_LIBPYTHON}
       {$LINKLIB python}
     {$endif GDB_USES_LIBPYTHON}
+  {$endif not USE_MINGW_GDB}
+{$endif NotImplemented}
+  {$ifdef USE_MINGW_GDB}
+    {$LINKLIB libm.a}
+    {$LINKLIB libmoldname.a}
+    {$LINKLIB libgcc.a}
+    {$LINKLIB libws2_32.a}
+    {$LINKLIB libmingwex.a}
+    {$LINKLIB libmingw32.a}
+    {$LINKLIB libmsvcrt.a}
+  {$else not USE_MINGW_GDB}
     {$LINKLIB gcc}
     {$LINKLIB cygwin} { alias of libm.a and libc.a }
   {$LINKLIB libintl.a}
@@ -425,7 +441,45 @@ interface
   {$LINKLIB user32}
 {$endif win32}
 
+{$ifdef win64}
+{$ifdef NotImplemented}
+  {$undef NotImplemented}
+  {$LINKLIB libgdb.a}
+ {$ifdef GDB_HAS_SIM}
+  {$LINKLIB libsim.a}
+ {$endif GDB_HAS_SIM}
+  {$LINKLIB libbfd.a}
+  {$LINKLIB libreadline.a}
+  {$LINKLIB libopcodes.a}
+  {$LINKLIB libhistory.a}
+  {$LINKLIB libiberty.a}
+  {$LINKLIB libintl.a}
+
+  {$LINKLIB libdecnumber.a}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
+  {$ifdef GDB_USES_EXPAT_LIB}
+    {$LINKLIB expat}
+  {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
+{$endif NotImplemented}
+  {$LINKLIB libm.a}
+  {$LINKLIB libmoldname.a}
+  {$LINKLIB libws2_32.a}
+  {$LINKLIB libmingwex.a}
+  {$LINKLIB libmingw32.a}
+  {$LINKLIB libmsvcrt.a}
+  {$LINKLIB libgcc.a}
+  {$LINKLIB libws2_32.a}
+  {$LINKLIB kernel32}
+  {$LINKLIB user32}
+{$endif win64}
+
 {$ifdef beos}
+{$ifdef NotImplemented}
   { still need some work... stollen from netbsd}
   {$undef NotImplemented}
   {$LINKLIB gdb}
@@ -451,13 +505,13 @@ interface
   {$ifdef GDB_USES_LIBPYTHON}
     {$LINKLIB python}
   {$endif GDB_USES_LIBPYTHON}
+{$endif NotImplemented}
   { does not seem to exist on netbsd LINKLIB dl}
   { $ LINKLIB c} // This is libroot under BeOS, and always linked
   {$LINKLIB debug}
   {$LINKLIB gcc}
 {$endif beos}
 
-{$endif NotImplemented}
 
 {$ifdef go32v2}
   {$define supportexceptions}
@@ -767,7 +821,8 @@ type
   case byte of
     0 :
     { greatest value found in cygwin machine/setjmp.h for i386 }
-    (unknown_field : array [1..13] of longint;);
+    { mingw uses int[16] C type for i386 }
+    (unknown_field : array [1..15] of longint;);
     1 :
     (eax,ebx,ecx,edx : longint;
     esi,edi,ebp,esp,eip : longint;);
@@ -2785,7 +2840,9 @@ end;
 procedure tgdbinterface.EndSession(code:longint);
 begin
   Debuggee_started:=false;
-  inferior_ptid.pid:=0;
+  { inferior_ptid.pid:=0;
+    This leads to an assertion failure
+    from generic_mount_inferior }
   DoEndSession(code);
   if assigned(signal_name) then
     strdispose(signal_name);

+ 1 - 1
packages/opencl/fpmake.pp

@@ -23,7 +23,7 @@ begin
     P.Email := '';
     P.Description := 'A OpenCL header';
     P.NeedLibC:= true;
-    P.OSes:=[win64,win32,darwin];
+    P.OSes:=[linux,win64,win32,darwin];
     P.CPUs:=[i386,x86_64];
 
     P.SourcePath.Add('src');

+ 4 - 0
packages/opencl/readme.txt

@@ -0,0 +1,4 @@
+Some remarks:
+
+-Linux version requires X server running and building with GUI staff in (GUI window application).
+ Tested under Linux v2.6.36 32bit, X server v1.8.2, ATI proprieraty drivers v10.10, ati stream sdk v2.2.

+ 8 - 2
packages/opencl/src/cl.pp

@@ -48,11 +48,17 @@ const
   OpenCLlib = 'OpenCL.dll';
   {$DEFINE extdecl := stdcall}
 {$ELSE}
-  //todo: LINUX
+  {$IFDEF LINUX}
+  {$DEFINE DYNLINK}
+const
+  OpenCLlib = 'libOpenCL.so';
+  {$DEFINE extdecl := cdecl}
+  {$ENDIF}
+
   {$IFDEF DARWIN}
   {$linkframework OpenCL}
-  {$ENDIF}
   {$DEFINE extdecl := cdecl}
+  {$ENDIF}
 {$ENDIF}
 
 {cl_platform.h}

+ 5 - 1
rtl/objpas/sysutils/sysutils.inc

@@ -84,7 +84,11 @@
         FileClose(fd);
       end
     else
-      Result:=fd;
+  {$ifdef HAS_OSERROR}
+      Result:=GetLastOSError;
+  {$else}
+      Result:=-1;
+  {$endif}
   end;
   {$endif}
 

+ 1 - 1
rtl/win/winsock2.pp

@@ -992,7 +992,7 @@ Type
                 iAddressFamily: Longint;
                 iProtocol: Longint;
         end {AFPROTOCOLS};
-        PAFProtocols = TAFProtocols;
+        PAFProtocols = ^TAFProtocols;
 
 {       Client Query API Typedefs }
 

+ 1 - 1
rtl/wince/winsock2.pp

@@ -958,7 +958,7 @@ Type
                 iAddressFamily: Longint;
                 iProtocol: Longint;
         end {AFPROTOCOLS};
-        PAFProtocols = TAFProtocols;
+        PAFProtocols = ^TAFProtocols;
 
 {       Client Query API Typedefs }