2009-02-21 08:05 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* include/hbdefs.h
    + Added similar to HB_DONT_DEFINE_BOOL hack: HB_DONT_DEFINE_LONG.
      (needed until we clear up our types.)

  * contrib/hbfimage/fi_winfu.c
  * contrib/hbfimage/fi_wrp.c
  * contrib/hbfimage/Makefile
  * doc/whatsnew.txt
    % Deleted #includes/macro checks not necessary.
    ! Disabled body of fi_winfu.c when not compiled under
      Windows. This fixes one Linux compilation error.
    % Replaced HB_OS_WIN_USED with HB_DONT_DEFINE_BOOL and
      HB_DONT_DEFINE_LONG, moved foreign headers before
      Harbour headers, added non-Harbour Windows detection
      in fi_wrp.c (I'm not sure that is necessary), so that
      it now compiles on both Windows and non-Windows (Linux
      tested) systems.
    + Renabled on Linux in Makefile.
    ; Please review/test these changes.
This commit is contained in:
Viktor Szakats
2009-02-21 07:06:13 +00:00
parent a10ce79f88
commit 153d0aa5b6
6 changed files with 67 additions and 71 deletions

View File

@@ -8,12 +8,33 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-02-21 08:05 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* include/hbdefs.h
+ Added similar to HB_DONT_DEFINE_BOOL hack: HB_DONT_DEFINE_LONG.
(needed until we clear up our types.)
* contrib/hbfimage/fi_winfu.c
* contrib/hbfimage/fi_wrp.c
* contrib/hbfimage/Makefile
* doc/whatsnew.txt
% Deleted #includes/macro checks not necessary.
! Disabled body of fi_winfu.c when not compiled under
Windows. This fixes one Linux compilation error.
% Replaced HB_OS_WIN_USED with HB_DONT_DEFINE_BOOL and
HB_DONT_DEFINE_LONG, moved foreign headers before
Harbour headers, added non-Harbour Windows detection
in fi_wrp.c (I'm not sure that is necessary), so that
it now compiles on both Windows and non-Windows (Linux
tested) systems.
+ Renabled on Linux in Makefile.
; Please review/test these changes.
2009-02-20 17:23 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/gtwvg/wvgsink.c
! Fixes as per Przemek's observations.
;TOREVIEW : return( ( ULONG ) ( ( MyRealIEventHandler * ) this )->count < 0 ?
;TOREVIEW : return( ( ULONG ) ( ( MyRealIEventHandler * ) this )->count < 0 ?
( ( MyRealIEventHandler * ) this )->count : 0 );
Actually I was having some problem with some old active-x
Actually I was having some problem with some old active-x
and was trying to fix that, that is why, now I do not remeber...
2009-02-21 01:49 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

View File

@@ -9,8 +9,6 @@ LIBNAME=hbfimage
HB_INC_FREEIMAGE_OK =
ifneq ($(HB_ARCHITECTURE),dos)
# disabled until a proper solution isn't found for type collision
ifneq ($(HB_ARCHITECTURE),linux)
ifeq ($(HB_INC_FREEIMAGE),)
ifeq ($(HB_XBUILD),)
@@ -44,6 +42,3 @@ install::
else
include $(TOP)$(ROOT)config/none.cf
endif
else
include $(TOP)$(ROOT)config/none.cf
endif

View File

@@ -53,13 +53,11 @@
#define HB_OS_WIN_USED
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbstack.h"
#include "hbapierr.h"
#include "hbapifs.h"
#include "hbvm.h"
#if defined(HB_OS_WIN) && !defined(_WINDOWS_) && ( defined(__GNUC__) || defined(__POCC__) || defined(__XCC__) ) || defined(__WATCOMC__)
#if defined(HB_OS_WIN)
#if !defined(_WINDOWS_) && ( defined(__GNUC__) || defined(__POCC__) || defined(__XCC__) ) || defined(__WATCOMC__)
#define _WINDOWS_
#endif
@@ -67,16 +65,11 @@
#include "config.h"
#endif
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "FreeImage.h"
/* -------------------------------------------------------------------------- */
/* Convert from FreeImage to HBITMAP ---------------------------------------- */
/* -------------------------------------------------------------------------- */
#if ( defined(HB_OS_WIN) || defined(__WIN32__) )
/* implementation: HBITMAP bitmap = FI_FiToBitmap( FIBITMAP *dib ); */
HB_FUNC( FI_FITOBITMAP )
@@ -106,12 +99,9 @@ HB_FUNC( FI_FITOBITMAP )
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
}
}
@@ -128,25 +118,26 @@ HB_FUNC( FI_BITMAPTOFI )
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
FIBITMAP *dib;
FIBITMAP * dib;
HBITMAP bitmap;
/* Retrieve parameters */
bitmap = (HBITMAP) hb_parptr( 1 );
bitmap = ( HBITMAP ) hb_parptr( 1 );
/* run function */
dib = NULL;
if( bitmap ) {
BITMAP bm;
HDC hDC;
if( bitmap )
{
BITMAP bm;
HDC hDC;
GetObject( bitmap, sizeof(BITMAP), (LPSTR) &bm );
dib = FreeImage_Allocate(bm.bmWidth, bm.bmHeight, bm.bmBitsPixel, 0, 0, 0);
hDC = GetDC( NULL );
GetDIBits( hDC, bitmap, 0, FreeImage_GetHeight(dib),
FreeImage_GetBits(dib), FreeImage_GetInfo(dib), DIB_RGB_COLORS);
ReleaseDC( NULL, hDC );
GetObject( bitmap, sizeof(BITMAP), (LPSTR) &bm );
dib = FreeImage_Allocate(bm.bmWidth, bm.bmHeight, bm.bmBitsPixel, 0, 0, 0);
hDC = GetDC( NULL );
GetDIBits( hDC, bitmap, 0, FreeImage_GetHeight(dib),
FreeImage_GetBits(dib), FreeImage_GetInfo(dib), DIB_RGB_COLORS);
ReleaseDC( NULL, hDC );
}
/* return value */
@@ -156,12 +147,9 @@ HB_FUNC( FI_BITMAPTOFI )
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
}
}
@@ -183,21 +171,21 @@ HB_FUNC( FI_WINDRAW )
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
FIBITMAP *dib;
FIBITMAP * dib;
HDC hDC;
RECT rcDest;
int scanlines;
/* Retrieve parameters */
dib = ( FIBITMAP * ) hb_parptr( 1 );
hDC = (HDC) hb_parnl( 2 );
hDC = ( HDC ) hb_parnl( 2 );
rcDest.top = hb_parni( 3 );
rcDest.left = hb_parni( 4 );
rcDest.bottom = hb_parni( 5 );
rcDest.right = hb_parni( 6 );
/* run function */
SetStretchBltMode(hDC, COLORONCOLOR);
SetStretchBltMode( hDC, COLORONCOLOR );
scanlines = StretchDIBits(hDC, rcDest.left,
rcDest.top,
@@ -209,22 +197,17 @@ HB_FUNC( FI_WINDRAW )
/* return value */
hb_retni( scanlines );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ),
hb_paramError( 4 ), hb_paramError( 5 ), hb_paramError( 6 )
);
return;
}
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ),
hb_paramError( 4 ), hb_paramError( 5 ), hb_paramError( 6 ) );
}
}
/* -------------------------------------------------------------------------- */
#endif /* ( defined(HB_OS_WIN) || defined(__WIN32__) ) */
#endif /* defined(HB_OS_WIN) */

View File

@@ -50,29 +50,26 @@
*
*/
#define HB_OS_WIN_USED
#define HB_DONT_DEFINE_BOOL
#define HB_DONT_DEFINE_LONG
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbstack.h"
#include "hbapierr.h"
#include "hbapifs.h"
#include "hbvm.h"
#if defined(HB_OS_WIN) && !defined(_WINDOWS_) && ( defined(__GNUC__) || defined(__POCC__) || defined(__XCC__) ) || defined(__WATCOMC__)
#define _WINDOWS_
#if defined(WINNT) || defined(_Windows) || defined(__NT__) || defined(_WIN32) || defined(__WINDOWS_386__) || defined(__WIN32__) || defined(__CYGWIN__)
#if !defined(_WINDOWS_) && ( defined(__GNUC__) || defined(__POCC__) || defined(__XCC__) ) || defined(__WATCOMC__)
#define _WINDOWS_
#endif
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "FreeImage.h"
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
/* ************************* WRAPPED FUNCTIONS ****************************** */
/* static for error handler (see below FI_SETOUTPUTMESSAGE ) */

View File

@@ -219,8 +219,6 @@ Known build issues
- Windows 64-bit builds may generate a large amount of type
conversion warnings. This is currently normal and will be
addressed in a future version.
- Contrib hbfimage won't currently compile on Linux systems.
This will be addressed in a future version.
- Contrib hbsqlit3 will not embed foreign sqlite3 library code
for Pelles C 4.5 and Open Watcom 1.7 due to fatal compile problems.
For these compilers you will have to supply sqlite3 library

View File

@@ -215,8 +215,10 @@
#undef USHORT /* 2 bytes unsigned */
typedef unsigned short int USHORT;
#undef LONG /* 4 or 8 bytes signed */
typedef long LONG;
#if ! defined( HB_DONT_DEFINE_LONG )
#undef LONG /* 4 or 8 bytes signed */
typedef long LONG;
#endif
#undef ULONG /* 4 or 8 bytes unsigned */
typedef unsigned long ULONG;