* harbour/src/rtl/valtype.c
* modified HB_ISEVALITEM() to use HB_IS_EVALITEM() macro
* harbour/src/pp/ppcore.c
! fixed typo in .ppt file handle - many thanks to Teo Fonrouge
for the information about the problem.
* harbour/include/hbthread.h
* harbour/src/vm/thread.c
+ added new C function:
HB_THREAD_NO hb_threadNO( void )
it returns unique thread number
* harbour/src/vm/classes.c
* cleaned static function names
* harbour/src/rdd/dbffpt/dbffpt1.c
* use RDDINFO() method instead of direct access to RDD TSD data
* harbour/src/rdd/dbfntx/dbfntx1.c
* harbour/src/rdd/dbfnsx/dbfnsx1.c
* changed initialization method - now RDD TSD data is initialized
by each thread which access it. It resolves the problem with
memo type in NSX and NTX RDDs - it was SMT/DBT in main thread
but in child threads default FPT driver was used.
* harbour/tests/speedtst.prg
! fixed xHarbour compilation - it was broken by HB_EOL()
* harbour/include/hbthread.h
* harbour/src/vm/thread.c
+ added internal functions hb_threadStateClone() and hb_threadStart()
* modified code to use new functions
* harbour/include/hbvm.h
* harbour/src/vm/hvm.c
+ added public function hb_vmThreadStart() which creates new thread
with HVM stack
+ added protection against executing hb_vmThreadRelease() for
not registered thread state
* harbour/include/hbvm.h
* harbour/src/vm/hvm.c
* added new public C function:
HB_BOOL hb_vmRequestReenterExt( void );
hb_vmRequestReenterExt() checks if given thread has registered HVM
stack and if not it creates new one otherwise it makes the same
operations as hb_vmRequestReenter(). It should be also used with
hb_vmRequestRestore() which checks if new stack was allocated and
if yes then it releases it.
For ST HVM hb_vmRequestReenterExt() works exactly like
hb_vmRequestReenter().
* harbour/include/hbthread.h
! typo in comment
* harbour/contrib/hbwin/win_svc.c
! fixed to work with MT HVM
+ accept function symbol (@func()) as 2-nd parameter of
WIN_SERVICESTART() function
* replaced one HB_TCHAR_*() function by Harbour STR API one.
(for full UNICODE support we should eliminate all HB_TCHAR_*()
functions)
* harbour/include/hbthread.h
* harbour/src/vm/hvm.c
* harbour/src/vm/thread.c
* on main thread exit unlock all main thread PRG mutexes before other
thread terminates and EXIT functions are executed.
* wake-up all thread waiting on subscribe operation when main thread
is terminated.
* include/hb_io.h
* include/hbthread.h
* include/hbsetup.h
* src/vm/thread.c
* src/vm/dynlibhb.c
* src/common/hbgete.c
* src/common/hbprintf.c
* src/rtl/gttrm/Makefile
* src/rtl/hbsocket.c
* src/rtl/filesys.c
* src/rtl/hbcom.c
* config/global.mk
- config/win/cygwin.mk
+ config/cygwin
+ config/cygwin/libs.mk
+ config/cygwin/gcc.mk
+ config/cygwin/global.mk
+ Applied cygwin patch from Tamas Tevesz.
The goal is to migrate win/cygwin to cygwin/gcc, IOW to make cygwin
a distinct platform (which is primarily unixy with option to access
winapi) as it should be.
Changes made by me compared to original patch:
- Fixed to HB_HOST_PLAT stay 'win'. Cygwin is not a host platform.
- Fixed to set HB_COMPILER to gcc and HB_PLATFORM to cygwin when cygwin
is detected on win platform.
- Consequently some changes in global.mk could be dropped.
- Deleted hbcom patches not related to cygwin.
- Removed hbmk2 patch until we solve the 'plat $ 'cygwin' problem.
* include/hbdefs.h
* src/rtl/hbsocket.c
* include/hbthread.h
* Moved header collision avoidance hack to the root of
the problem, right after '#include <stdint.h>'.
This way it's done centrally.
* config/vxworks/diab.mk
- Deleted fixed TOFIX.
* src/rtl/hbsocket.c
+ Enabled ioctl() calls for VxWorks.
! Worked around 'socklen_t' vs 'int' warnings with VxWorks.
(still remains some 'const char *' and 'caddr_t' vs 'char *
warnings, nothing serious though)
* include/hbthread.h
! Enabled HB_CRITICAL_NEED_INIT for VxWorks. Avoids the compiler
warnings caused by PTHREAD_COND_INITIALIZER having one less
structure member than initialized structure.
MT mode still doesn't work though.
* contrib/hbodbc/odbc.c
+ Added HB_ODBCVER() function to return build-time ODBC version
reported by ODBCVER macro.
* contrib/hbodbc/tests/testodbc.prg
+ Show ODBC version number.
- contrib/hbqt/doc/html
- Deleted. doc dirs now have to abide by the HBDOC rules posted
on the dev list, which means doc may contain (non-empty) language
dirs only. html should be generated by client app or by install
process.
* contrib/hbwin/hbwinole.h
! Patch by Tamas Tevesz, fixing NONAMELESSUNION issue for watcom.
* utils/hbtest/hbtest.prg
* utils/hbtest/rt_hvm.prg
* utils/hbtest/rt_hvma.prg
* utils/hbtest/rt_stra.prg
* utils/hbtest/rt_vars.ch
+ Enabled GTCGI for Harbour builds. This makes it independent
for GTs, to there is better chance to run it. Now it also
works on VxWorks.
+ Will now detect .dbf creation failure and continue gracefully
with a message and skipping all related tests.
* src/rtl/hbsocket.c
* external/minizip/ioapi.h
* include/hbthread.h
+ Added/cleaned hacks to avoid collision between VxWorks's own
system types.
* external/minizip/ioapi.h
! Disabled 64-bit FSIO for whole VxWorks.
* config/vxworks/gcc.mk
* config/vxworks/diab.mk
* config/vxworks/global.mk
+ _VX_CPU is now defined in vxworks/global.mk.
* src/common/hbarch.c
! Fixed hb_put_le_uint64() definition to match declaration.
* include/hbdefs.h
! Fixed compatibility type definitions in HB_LONG_LONG_OFF mode.
* include/hbsetup.h
+ Added bzero() declaration hack for vxworks.
* include/hbinit.h
+ Added support for diag compiler init function.
It requires the constructor to have public visibility.
* src/common/hbver.c
+ Changed to always display x.x.x.x format verison no for diab.
(in generic way).
* INSTALL
* Updated list of CPUs supported by vxworks.
* include/hbthread.h
! Hacked around collision between vxWorks headers.
* ChangeLog
! Fixed casing of vxWorks.
* utils/hbmk2/hbmk2.prg
+ Added vxworks/gcc libpaths.
! Fixed vxworks/gcc system lib list.
! Fixed ar to have postfix.
; All these are syncs with GNU Make.
* src/rtl/hbsocket.c
! Typos in previous vxworks patchs.
* config/global.mk
! Fixed forming automatic HB_INSTALL_PREFIX value in *nix cross-build
situations. (it's still wrong as it assumes nix->win cross-builds)
; Now vxworks/gcc/x86 build is clean.
There are iTODOs left, and
- this particular class of warnings, which seems
to be a bug down the <pthread.h> system header:
hbnetio\netiocli.c:155: warning: missing initializer
hbnetio\netiocli.c:155: warning: (near initialization for 's_netioMtx.mutexAttr.mutexAttrType')
- also this, each time FD_ZERO() and friends are used:
warning: implicit declaration of function 'bzero'
- "argument n of 'x' differ in signedness" and "discards qualifiers from pointer target type"
warnings in hbsocket.c code.
; TOFIX:
- Unrecoverable error 9998: Harbour terminal (GT) initialization failure
when running hbtest.
- GPF when running hbmk2 and hbrun. (hbformat, hbi18 startup fine)
* INSTALL
+ config/vxworks
+ config/vxworks/libs.mk
+ config/vxworks/gcc.mk
+ config/vxworks/diab.mk
+ config/vxworks/global.mk
+ Started experimental VxWorks port.
; NOTE: VxWorks port was made possible by Wind River Systems Inc.,
who were so kind to mail me a full VxWorks development
environment, for the purpose of porting Harbour to this
platform. Thank you very much guys.
[ The free license is valid for one month, so if anyone
is interested in helping in this project, I can help with
real tests, builds and information. BTW, the devenv is
Eclipse based plus cmdline, running on Windows (available
for Linux and Solaris, too) and the target VxWorks exes
run in a virtual environment. ]
* config/global.mk
+ Added autodetection of VxWorks platform.
* utils/hbmk2/hbmk2.prg
+ Added VxWorks support. It's incomplete yet.
! Fixed to quote *nix/gcc compiler family in
Windows-host cross-platform situations.
* src/vm/thread.c
* src/common/hbgete.c
* src/common/hbffind.c
* src/common/hbtrace.c
* src/common/hbdate.c
* src/rtl/gtstd/gtstd.c
* src/rtl/gttrm/Makefile
* src/rtl/hbsocket.c
* src/rtl/filesys.c
* src/rtl/diskspac.c
* src/rtl/cputime.c
* src/rtl/disksphb.c
* src/rtl/gtpca/gtpca.c
* src/rtl/net.c
* src/rtl/hbproces.c
* src/rtl/gtsys.c
* src/rtl/hbcom.c
* external/zlib/inflate.c
* external/jpeg/jmorecfg.h
* external/pcre/Makefile
* include/hbapifs.h
* include/hbthread.h
* include/hbdefs.h
* include/hbsetup.h
* contrib/xhb/hboutdbg.c
* contrib/xhb/hbsyslog.c
* contrib/xhb/hbserv.c
+ vxworks/gcc port. First phase.
; Please review.
; NOTE: - vxworks has no termios, for serial comm
support it has sioLib.h.
- vxworks supports another C compiler, which
was not tested yet.
- vxworks supports lots of CPUs, only x86 was
tested yet.
- There are still mutex related warnings to sort out.
- Some parts had to disabled, like HB_LIB*() functionality.
; TODO: Regenarate .difs in external/.
* src/vm/hashfunc.c
* Silenced warnings shown by vxworks/gcc.
* src/vm/dynlibhb.c
* include/hbthread.h
+ Added QNX support.
* src/rtl/hbzlib.c
! Added hack to fix missing zlibVersion() and zError()
functions from the zlib lib shipped with QNX 6.2.1.
+ config/qnx/libs.mk
+ Added QNX specific lib configuration.
* utils/hbmk2/hbmk2.prg
+ Added (untested) list of system libs for qnx/gcc.
* INSTALL
+ Added QNX reference to one more place.
; NOTE on QNX:
All binaries build cleanly, hbtest works.
; TOFIX/TODO:
- hbrun seems to misdetect the width of the terminal
- Clean some hack in QNX port
- platform autodetection
- retest whole port from vanilla SVN source, test MT
linkage.
; So now Harbour can run in cars, planes and spaceships.
* include/hbthread.h
! Added missing HB_EXPORT, and in some place 'extern'
qualifier to thread/atomic Harbour API declarations.
* ChangeLog
! Fixed entry header in previous commit (again).
* harbour/include/hbthread.h
* harbour/src/vm/thread.c
% use thread local memory to optimize _hb_gettid()
% use _hb_gettid() instead of _gettid() in OS2 GCC builds
* harbour/src/vm/hvm.c
% minor speed improvement
* harbour/src/vm/memvars.c
! cleaned local vars detaching code
* src/vm/extrap.c
* src/vm/dynlibhb.c
* src/common/hbgete.c
* src/common/hbffind.c
* src/common/hbver.c
* src/rtl/filesys.c
* src/rtl/diskspac.c
* src/rtl/gtos2/gtos2.c
* src/rtl/cputime.c
* src/rtl/disksphb.c
* include/hbthread.h
* contrib/hbmzip/hbmzip.c
! Fixed to setup all OS/2 INCL_* constants and
to #include os2.h by themselves, and not to rely
on Harbour headers to do this job for them.
; TODO: Do the same for dos.h.
* doc/hdr_tpl.txt
- Deleted local changelog.
! Fixes to .prg function docs
+ Update copyright year to 2010.
+ Added fact that $SEEALSO$ should be comma separated.
+ Added .c function example (far from perfect)
* examples/hbdoc2/tmplates.prg
* doc/hdr_tpl.txt
+ Added $VERSION$ tag. (pls update HBIDE. We haven't finalized
the format yet, to it's little bit premature to create
new and new parsers/generators for it yet)
* include/hbdefs.h
! Fixed to not unconditionally include OS/2 headers with
an arbitrary selection of INCL_ macros.
Now OS/2 headers will only be included if legacy types
are requested (off by default), and no INCL_ macros
are defined. This latter change may affect 3rd party
code written for OS/2, so I'm marking it INCOMPATIBLE.
* contrib/hbqt/generator/hbqtgen.prg
* contrib/hbqt/hbqt.h
* Changed to #include hbapi.h from hbqt.h. It needs it,
so this is the clean way. Changed generator to leave
out hbapi.h from each source file and refer to hbqt.h
only. (untested)
+ Added logic to #include OS/2 headers with some INCL_
macros defined, to make QT on OS/2 happy. (copied them
from the dev. list)
; TODO: Regenerate HBQT sources.
* utils/hbtest/hbtest.prg
! Cleaned old problem reported by Chen. It seems like
a feature which was never finished, and it's not even
hugely needed, so I deleted it.
* config/global.mk
+ Will now provide HB_COMP_PATH_PUB value for os2-gcc, os2-gccomf
compilers. This value can be used to manually form ld.exe
command line.
(NOTE: This may be deleted in the future, when sorting
out line-length limit problems for these compilers.
* harbour/include/hbsetup.h
* harbour/include/hbdefs.h
* harbour/include/hbthread.h
* harbour/src/common/hbver.c
* harbour/bin/hb-func.sh
* harbour/bin/postinst.sh
* harbour/config/linux/gcc.mk
+ harbour/config/linux/open64.mk
+ added support for Open64 C/C++ compiler in Linux builds
* harbour/src/common/hbver.c
* removed unnecessary casting compiler version number parameters
to 'short'
* extended the size of szBuf buffer as requested by Tamas
* harbour/include/hbthread.h
* minor cleanup in comment
* harbour/src/vm/dlmalloc.c
* use harbour spinlocks in windows builds to eliminate calling
InterlockedCompareExchange[Pointer]() function
* harbour/include/hbstack.h
! disabled TLS ASM inline code which seems to not work with Win9x.
* harbour/config/win/bcc.mk
* increased library page size for 64 to 96
* harbour/src/vm/thread.c
* harbour/include/hbthread.h
% removed 'BOOL fSync' parameter from hb_threadMutexCreate().
This parameter was added in the past to emulate xbase++ behavior
when oSignal:wait() is called from SYNC method but real life tests
shows that such feature works in xbase++ in different way then
it was initially described and Harbour code was updated to use
different solution making above parameter unusable.
* harbour/src/vm/hvm.c
* harbour/src/vm/thread.c
* harbour/src/vm/classes.c
* harbour/src/rtl/hbgtcore.c
* harbour/contrib/hbnetio/netiocli.c
* harbour/contrib/hbqt/hbqt_slots.cpp
* updated to use hb_threadMutexCreate() without parameters
* harbour/include/hbthread.h
* modified some internal structure definitions (used nameless unions)
to pacify possible warnings on structure initialization.
* make_gnu_os2.cmd
% Minor opt. I hope OS/2 accepts such 'if' command.
* include/hbthread.h
! Fix to poccarm build. Provided by Przemek.
* utils/hbmk2/hbmk2.prg
* config/wce/msvcarm.cf
* config/wce/global.cf
* config/wce/poccarm.cf
+ Added -DUNICODE for mingwarm. It didn't seem to require it so far,
but I thought it's better to define this for all wce compilers.
% Deleted -DHB_NO_WIN_CONSOLE. No longer exists in Harbour.
% Deleted /stack:65536,4096 linker option from wce/msvcarm.
I'm just guessing it's not needed.
+ -DUNICODE is now enforced through HB_BUILD_UNICODE=yes setting
in GNU Make for all wce compilers.
* harbour/include/hbthread.h
* added workaround for different CRITICAL_SECTION definitions in
some compiler header files
* harbour/source/vm/fm.c
* harbour/source/hbzlib/ChangeLog
* harbour/source/hbzlib/zutil.c
* use #pragma warning to pacify OpenWatcom warnings
* harbour/include/hbsetup.h
* harbour/include/hbthread.h
* harbour/include/hbatomic.h
* harbour/source/vm/thread.c
* added support for MT mode in WinCE builds using raw MS-Windows API
instead of CRTL wrappers. It's possible that it may badly interact
with some CRTLs functions we are using in our code so I do not know
it will work. Please test.
* harbour/config/os2/watcom.cf
* harbour/config/os2/dir.cf
* harbour/config/os2/install.cf
* small cleanup for builds with *nix like shells and cross builds
* harbour/contrib/rddads/Makefile
! disabld from OS2 builds - if ADS supports OS2 then please speak-up
* harbour/include/hbthread.h
* added small hack as workaround for missing OS2 declarations
* harbour/source/rtl/filesys.c
! fixed typo in OS2 builds
* harbour/source/rtl/hbproces.c
! fixed non GCC OS2 builds
* harbour/contrib/hbtpathy/tpos2.c
! fixed casting in OS2 builds
* harbour/contrib/xhb/hbserv.c
! disabled from OS2 non GCC builds
Now I can create OS2 OpenWatcom build in my Linux box using this simple
script:
#!/bin/sh
if [ -z "${WATCOM}" ]; then
export WATCOM="/opt/lng/watcom"
export INCLUDE="${WATCOM}/h:${WATCOM}/h/os2"
export PATH="${WATCOM}/binl:$PATH"
fi
export HB_ARCHITECTURE=os2
export HB_COMPILER=watcom
export HB_INSTALL_PREFIX="$(pwd)/hb-os2/watcom"
#cross build settings
# this should be fixed and we should use HB_PPGEN_PATH as direct
# reference to hbpp binaries and HB_COMP_PATH as direct reference
# to harbour binaries in all builds. Otherwise we have to create
# some hacks to create platform specific names for above binaries
# i.e. in *nixes links with .exe extension.
export HB_PPGEN_PATH="/tmp/cros-hb"
export HB_BIN_COMPILE="/tmp/cros-hb"
export HB_USER_PRGFLAGS="${HB_USER_PRGFLAGS} -D__PLATFORM__OS2"
export HB_USER_PRGFLAGS="${HB_USER_PRGFLAGS} -undef:__PLATFORM__UNIX"
export HB_USER_PRGFLAGS="${HB_USER_PRGFLAGS} -undef:__PLATFORM__LINUX"
# eliminate libraries which scans for local host header files
export HB_XBUILD=yes
./make_gnu.sh "$@"
It should work also in Windows with MSys.
This should resolve the problem with testing OS2 builds, at least
for OpenWatcom. I do not know if GCC for OS2 is available as cross
build environment.
I think that Viktor can quite easy adopt hbmk2 for OS2 cross compilation.
+ harbour/include/hbtask.h
+ harbour/source/vm/task.c
* harbour/include/hbthread.h
* harbour/include/hbatomic.h
* harbour/source/vm/thread.c
* harbour/source/vm/hvm.c
* harbour/source/vm/fm.c
* harbour/source/rtl/idle.c
* harbour/source/rtl/filesys.c
+ implemented OS independent task switching system - it gives PTHREAD
compatible basic API so it can be used in HVM as alternative MT support
which does not use any OS threads. As long as Harbour does not call
any blocking OS function then it's possible to create and execute
simultaneously many threads though only one CPU is used and switched
between HVM threads. It gives similar scalability to xbase++ threads
and also similar behavior in item protection at .prg level.
Now it's possible to use HVM threads in any OS.
Of course it does not mean that Harbour adds in some magic way
thread support to OS-es which does not support threads like DOS.
It only means that HVM supports threads for .prg code just like
in native MT environment as long as some C code does not block
task switching or process execution will not be frozen by sth, i.e.
executing other process (__run()) in single process OS like DOS.
In some cases it can be interesting alternative even in OS which
have native thread support.
All tests/mttest*.prg programs and speedtst --thread=<n> --scale
are executed correctly with new task switching just like with
OS native MT support.
Compilation with task switching in hbvmmt library can be forced
by HB_TASK_THREAD macro which also disable native OS threads
support.
For task context switching two alternative methods are used:
1) getcontext()/makecontext()/swapcontext() (SUSv2, POSIX.1-2001)
which is preferable because does not need any additional
hacks but not all OS-es supports these functions.
It's enabled by default in Linux builds.
2) setjmp()/longjmp() (POSIX, ISO 9899 (C99)) otherwise.
These functions are supported by most of C compilers
but there is no function to set new stack in saved context
so it's necessary to introduce for each architecure/C compiler
peace of code which makes it. Macro HB_TASK_STACK_INIT() in
task.c makes it. I defined this macro for x86@32 in DJGPP
Linux GCC and OpenWatcom builds. I tested OpenWatcom builds only
in DOS and Linux but probably it works in all x86@32 builds.
If someone is interesting in adding support for some other
platforms which does not support ucontext.h and 1-st methods
then please define above macro for them.
Have a fun with new toy ;-)
* harbour/source/vm/Makefile
* enabled hbvmmt in DJGPP and OpenWatcom DOS builds. It works well.
Viktor if possible please add support for -mt switch in hbmk2
in all builds even if we do not compile hbvmmt by default so
it can be used with DJGPP and OW and any other builds for which
someone enable hbtask.c though OS does not support threads.
* harbour/contrib/hbmzip/hbmzip.c
! fixed '[const] char|BYTE *' casting in DOS and OS2 builds
* harbour/include/hbclass.ch
+ extended support for xbase++ compatible method declaration:
[SYNC] METHOD <methodName1>[([<params>])] ;
[ , <methodNameN>[([<params>])] ]
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
* harbour/source/vm/classes.c
+ added alternative support for SYNC method which does not use
sync mutexes. The old method is still present. I'll remove it
when xbase++ users confirm that the new one exactly emulates
xbase++ behavior.
* harbour/source/vm/classes.c
* harbour/source/rtl/tthreadx.prg
* switch to alternative SYNC method implementation which seems to be
xbase++ compatible - please test
! fixed missing thread interrupt in recent modification for ::setInterval
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
* emulate POSIX thread conditional variables in Windows builds.
It should fix some possible bad behavior in MS-Windows Harbour
MT programs.
* harbour/source/rtl/hbinet.c
! fixed typo in HB_INETDATAREADY() - the second parameter (timeout)
was ignored.
* harbour/contrib/examples/uhttpd/uhttpdc.c
* fixed typo in conditional iMsec usage.
* harbour/contrib/examples/uhttpd/uhttpd.prg
* set default timeout for socket operations to 3 sec.
* use timeout parameter in HB_INETDATAREADY() and
increased default timeout for accept to 250 millisecs.
Please correct this modification if you prefer different values.
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
! added support for conditional variables working like in PTHREADS
in OS2 builds - it fixes the problem with possible dead lock or
starvation effect which can also cause dead lock in some cases.
OS2 users please test current code.
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
! fixed a bug on OS/2 MT implementation adding a new function,
_hb_cond_timed_wait() because when a semaphore gets posted it has
to be reset, otherwise it does not stop new threads entering it in a wait.