Onde estas o HB_SIZE

Onde estas o HB_SIZE

Postby Ari » Mon Oct 07, 2019 5: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: Select all  Expand view


#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 2212 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
User avatar
Ari
 
Posts: 224
Joined: Fri Feb 03, 2006 4:21 pm
Location: São Paulo, SP - Brazil

Re: Onde estas o HB_SIZE

Postby karinha » Mon Oct 07, 2019 6:56 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7339
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Onde estas o HB_SIZE

Postby cnavarro » Mon Oct 07, 2019 7:21 pm

Prueba con
Code: Select all  Expand view

#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
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: nanoespinoza and 66 guests