[Libreoffice] supported compilers?

Caolán McNamara caolanm at redhat.com
Tue Nov 2 07:26:03 PDT 2010


On Mon, 2010-11-01 at 20:56 +0200, Jani Monoses wrote:
> Is there a list of which compilers are supported and what versions 
> recommeneded for building LO?
> 
> I was thinking of the feasibility of using gcc's __builtin_constant_p in 
> a macro to differentiate fast and not so fast paths for createFromAscii 
> cases to keep the code uniform but still get the optimizations, but then 
> figured that would not work with Visual Studio.

Well, it's always possible to hook off an ifdef of course. e.g. 

#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
__builtin_constant_p magic
#else
normal stuff
#endif

My first thought was that this would be ideal to at a minimum jam into
the existing RTL_CONSTASCII_USTRINGPARAM to detect if someone used
RTL_CONSTASCII_USTRINGPARAM with something unsuitable.

e.g. the attached test.c where gcc will give a compile error on the
invalid line 13, but will be ok on the valid line 12. Unfortunately
__builtin_choose_expr isn't available for c++ so g++ always barfs on
the .cxx example.

There's definitely merit in some sort of cunning around
__builtin_constant_p

C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 382 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101102/a711b1f8/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cxx
Type: text/x-c++src
Size: 382 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101102/a711b1f8/attachment.cxx>


More information about the LibreOffice mailing list