Subject: #define question
From: Rob Clack <[email-masked]>
To: [email-masked]
Date: Fri, 01 Aug 2003 09:30:59 +0100

Having just updated to cygwin 1.3.22-1 I'm now building my application 
and have a wierdness I hope someone can help with.

Deep in the nether regions of the code, I use IMalloc_Free which is a 
macro now defined in objidl.h.  I think in earlier versions of cygwin it 
was somewhere else.  In objidl.h, it's protected by an ifdef, so it 
looks like this:

#ifdef COBJMACROS
/
some stuff
/
#define IMalloc_Free(This, pv)     (This)->lpVtbl->Free(This,pv)

In my code, I have this:

#define COBJMACROS
#include <objidl.h>

Compiling, I get no errors until the link phase, at which point it 
complains that IMalloc_Free is undefined and points me at the lines in 
my code where I actually use the macro.  ie, either objidl.h isn't 
getting included at all, though I get no error there, or the macro isn't 
getting #defined, or it's getting undefined somewhere.  I've looked 
really hard for daft spelling errors and all that, without success.

Compiling with -E seems to show that it's just not getting done, though 
I fess I find the preprocessor output confusing, so I may be wrong on 
that one.  However, it _looks_ as though it's just not getting done by 
objidl.h, but that doesn't make sense either.

My temporary fix is to manually #define the macro immediately before I 
use it, but that's not really satisfactory, of course.

Anyone got any idea what's going on here?

Thanks
Rob
-- 
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Just self-replicating, compartmentalised, redox chemistry, really.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Rob Clack                        Acedb Development,  Informatics Group
  email: [email-masked]                Wellcome Trust Sanger Institute
  Tel: +44 1223 494780                   Wellcome Trust Genome Campus
  Fax: +44 1223 494919                   Hinxton  Cambridge    CB10 1SA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/