[opus] Visual Studio build of Opus-1.0.1-rc

public-hk public-hk at ind.rwth-aachen.de
Wed Aug 15 11:22:19 PDT 2012


Hi everone,

I currently try to test the Opus codec. It seems, however, that it is 
more easy to do that in Linux.
Nevertheless, I have compiled the sources in Visual Studio 2010. Here 
are some hints:

1) "static inline int function(...)" (combination of static and inline) 
does not work with Visual Studio 2010. I defined a macro which 
translates all "inline" to nothing.
2) I had to define some extra macros which probably are set in the 
configure-process in Linux, in particular USE_ALLOCA  and OPUS_BUILD

There is now one warning left which I am not sure about. The lines the 
compiler complains about are in "opus_private.h"

 > /* Make sure everything's aligned to sizeof(void *) bytes */
 > static inline int align(int i)
 > {
 >  return (i+sizeof(void *)-1)&-sizeof(void *);
 > }

I am not sure how this line is supposed to work. The warning statement is

"opus_private.h(81): warning C4146: unary minus operator applied to 
unsigned type, result still unsigned"

My solution for this to work propperly in Windows would be

 > /* Make sure everything's aligned to sizeof(void *) bytes */
 > static inline int align(int i)
 > {
 >     return (i+sizeof(void *)-1)&-((int)sizeof(void *));
 > }

but I am not sure. What do you think?

By the way, this release does not compile with Cygwin, in that case, I 
see undefined references.

Best regards

Hauke



More information about the opus mailing list