I am now running into a situation where my development system is using
the latest release of BRL-CAD (7.16.4) and my remote team mate is
using an older one (7.12.6) and some function signatures have changed.
 Specifically,

   void rt_db_free_internal(struct rt_db_internal *ip, struct resource *resp);

became

  void rt_db_free_internal(struct rt_db_internal *ip);

and g++ 4.4.3 doesn't like that.  I have found no clean way to use a
compile-time cpp macro to distinguish the two versions but would
appreciate any ideas.  I know my team mate needs to upgrade, but that
isn't in the cards at the moment.

Note there is a PACKAGE_VERSION defined as a string but I don't think
you can use that at compile time (at least I haven't found a solution
looking at the cpp manual).

I think we need something like gcc and others use:

  #define BRLCAD_MAJOR_VERSION 7
  #define BRLCAD_MINOR_VERSION 16
  #define BRLCAD_PATCH_VERSION 4

>From the cpp manual (4.4.3), gcc defines three macros

  __GNUC__                           // major version
  __GNUC_MINOR__
  __GNUC_PATCHLEVEL__

and they show a couple of ways to test for a specific version.  I like
this method:

  #define GCC_VERSION (__GNUC__ * 10000 \
                                       + __GNUC_MINOR__ * 100 \
                                      + __GNUC_PATCHLEVEL__)

  /* Test for GCC > 3.2.0 */
  #if GCC_VERSION > 30200

or BRl-CAD could just take the easier, direct route:

  #define BRLCAD_VERSION    71604    // allows up to 100 minor
versions and 100 patch levels for each major version

For the moment I will use a kludge macro until I hear the magic solution.

Thanks.

-Tom

Thomas M. Browder, Jr.
Niceville, Florida
USA

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to