[Varnish] #450: Varnish 2.0.3 compile using SunStudio 12 (w/ latest patches applied)

Varnish varnish-bugs at projects.linpro.no
Tue Feb 17 17:06:17 CET 2009


#450: Varnish 2.0.3 compile using SunStudio 12 (w/ latest patches applied)
-------------------------------+--------------------------------------------
 Reporter:  whocares           |        Type:  defect
   Status:  new                |    Priority:  low   
Milestone:                     |   Component:  build 
  Version:  2.0                |    Severity:  normal
 Keywords:  SunStudio Solaris  |  
-------------------------------+--------------------------------------------
 Compiling varnish using !SunStudio 12 always did require some tweaking of
 the compiler options, but with varnish 2.0.3 the newly added SHA256 stuff
 completely breaks compilation with !SunStudio 12.

 I've identified two reasons for that.

 1) in /include/vsha256.h, !SunStudio chockes on this code:

 {{{
   __BEGIN_DECLS
   void    SHA256_Init(SHA256_CTX *);
   void    SHA256_Update(SHA256_CTX *, const void *, size_t);
   void    SHA256_Final(unsigned char [32], SHA256_CTX *);
   void    SHA256_Test(void);
   __END_DECLS
 }}}

 2) in /lib/libvarnish/vsha256.c, functions are declared with __inline

 I fixed both problems by adding the following code to the beginning of
 include/vsha256.h:

 {{{
 #ifdef __SUNPRO_C

 #ifdef __cplusplus
 # ifndef __BEGIN_DECLS
 # define __BEGIN_DECLS extern "C" {
 # endif
 # ifndef __END_DECLS
 # define __END_DECLS }
 # endif
 #else
 # ifndef __BEGIN_DECLS
 # define __BEGIN_DECLS
 # endif
 # ifndef __END_DECLS
 # define __END_DECLS
 # endif
 #endif

 #define __inline
 #endif
 }}}

 Maybe there's a better place to put that, but it works for me right now.

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/450>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list