how to distinguish xhb.org or xhb.com with ifdef

Post Reply
dempty
Posts: 22
Joined: Mon May 19, 2008 8:54 pm

how to distinguish xhb.org or xhb.com with ifdef

Post by dempty »

Hi guys,

I started to migrate my system to work under xhb.com and sqlrdd, but I have to keep my old sql connection code, because for my clients who still using my old system version i must keep the support and i dont wanna separate my code for each version of xharbour.
So for do that i thought about distinguish in my code with ifdef...some think like this:

Code: Select all | Expand

   #ifdef __HARBOUR_COM__
      //sqlrdd connection
   #else
      //old sql connection
   #endif


Someone Has any idea how to distinguish that ?

thanks!
regards,

Diego Imenes
User avatar
Patrick Mast
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Re: how to distinguish xhb.org or xhb.com with ifdef

Post by Patrick Mast »

dempty wrote:I started to migrate my system to work under xhb.com and sqlrdd, but I have to keep my old sql connection code, because for my clients who still using my old system version i must keep the support and i dont wanna separate my code for each version of xharbour.
So for do that i thought about distinguish in my code with ifdef...some think like this:

Code: Select all | Expand

   #ifdef __HARBOUR_COM__
      //sqlrdd connection
   #else
      //old sql connection
   #endif


Someone Has any idea how to distinguish that ?

thanks!

Sorry, there is no __XHARBOUR_COM as xHarbour Builder uses xHarbour's core engines. I would add a define of my own like this:

#define __SQLRDD__

Than:

#ifdef __SQLRDD__
...
#endif

Patrick
Post Reply