The only thing that I can think of which would provide the same behavior
is to define it as a function...

#if defined I_HAVE_A_LAME_COMPILER
terror TERROR_NOTALLOWED_func(){
  terror tmp;
  tmp.code=405;
  strcpy(tmp.msg,"Not Allowed");
  return tmp;
}
#define TERROR_NOTALLOWED TERROR_NOTALLOWED_func()
#else
#define TERROR_NOTALLOWED (terror) { 405, "Not Allowed" }
#endif


This *might* work

Justin

On Fri, 2002-12-13 at 15:57, Nicholas Blair wrote:
> Anyone know if there is another way to write this type of statement in
> C:
> 
> <from file="jabberd/lib/lib.h">
> 
> #define TERROR_NOTALLOWED     (terror) { 405, "Not Allowed" }
> 
> </from>
> 
> The Sun Forte compiler under Solaris don't seem to like this - anyone
> think of another way to define a constant struct?
> 
> Thanks,
> Nicholas Blair
> [EMAIL PROTECTED]
> 
> _______________________________________________
> jdev mailing list
> [EMAIL PROTECTED]
> http://mailman.jabber.org/listinfo/jdev



_______________________________________________
jdev mailing list
[EMAIL PROTECTED]
http://mailman.jabber.org/listinfo/jdev

Reply via email to