FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Onde estas o HB_SIZE
Posts: 253
Joined: Fri Feb 03, 2006 04:21 PM
Onde estas o HB_SIZE
Posted: Mon Oct 07, 2019 05:36 PM
Por favor experts em C,

estou tentando compilar o mysql.c e me falta a definição HB_SIZE conforme imagem abaixo.

Utilizo: Xharbour 1.2.1 (Simplex) Rev.6406
Borland 5.5 32 Bits

undefined symbol 'HB_SIZE'

falta algum "include" ?

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include "hbapi.h"
#include "hbapierr.h"
#include "hbapiitm.h"
#include "hbapifs.h"
#include "winsock2.h"
#include "mysql.h"


/* GC object handlers */

static HB_GARBAGE_FUNC( MYSQL_release )
{
   void ** ph = ( void ** ) Cargo;

   /* Check if pointer is not NULL to avoid multiple freeing */
   if( ph && * ph )
   {
      /* Destroy the object */
      mysql_close( ( MYSQL * ) * ph );

      /* set pointer to NULL to avoid multiple freeing */
      * ph = NULL;
   }
}

static void hb_MYSQL_ret( MYSQL * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAlloc( sizeof( MYSQL * ), MYSQL_release );

      * ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}

static MYSQL * hb_MYSQL_par( int iParam )
{
   void ** ph = ( void ** ) hb_parptrGC( MYSQL_release, iParam );

   return ph ? ( MYSQL * ) * ph : NULL;
}

static HB_GARBAGE_FUNC( MYSQL_RES_release )
{
   void ** ph = ( void ** ) Cargo;

   /* Check if pointer is not NULL to avoid multiple freeing */
   if( ph && * ph )
   {
      /* Destroy the object */
      mysql_free_result( ( MYSQL_RES * ) * ph );

      /* set pointer to NULL to avoid multiple freeing */
      * ph = NULL;
   }
}

static void hb_MYSQL_RES_ret( MYSQL_RES * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAlloc( sizeof( MYSQL_RES * ), MYSQL_RES_release );

      * ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}

static MYSQL_RES * hb_MYSQL_RES_par( int iParam )
{
   void ** ph = ( void ** ) hb_parptrGC( MYSQL_RES_release, iParam );

   return ph ? ( MYSQL_RES * ) * ph : NULL;
}

HB_FUNC( MYSQL_LIST_DBS ) /* MYSQL_RES * mysql_list_dbs( MYSQL *, char * wild ); */
{
   MYSQL * mysql = hb_MYSQL_par( 1 );

   if( mysql )
   {
      MYSQL_RES * mresult = mysql_list_dbs( mysql, NULL );
      HB_SIZE nr = ( HB_SIZE ) mysql_num_rows( mresult ); 
      PHB_ITEM aDBs = hb_itemArrayNew( nr );
      HB_SIZE i;

      for( i = 0; i < nr; ++i )
      {
         MYSQL_ROW mrow = mysql_fetch_row( mresult );
         hb_arraySetC( aDBs, i + 1, mrow[ 0 ] );
      }

      mysql_free_result( mresult );
      hb_itemReturnRelease( aDBs );
   }
   else
      hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}

#pragma ENDDUMP
Thanks,
Ari

FWH 2501 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Onde estas o HB_SIZE
Posted: Mon Oct 07, 2019 06:56 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Onde estas o HB_SIZE
Posted: Mon Oct 07, 2019 07:21 PM
Prueba con
Code (fw): Select all Collapse
#include "hbinit.h"
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion