Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


There was only one occurence of snprintf I had to fix, so I guess it's
not worth as much to do this in this case? (I am however somewhat
confused at the moment as I discovered that there is an internal
firebird version of snprintf, and it's possible that the code using
snprintf that I fixed isn't intended to be compiled on windows -- I
certainly had this in another place where it seems the official build
system (msvs project files) set some flags to prevent building certain
parts under windows -- in any case I'll have to look at this in more
detail again to understand what's going on.)

In another place I had to replace isnan with _isnan, but that was
already within a WIN_NT ifdef (implying something changed since MSVS 7/8?).

In other news: it seems I've now finally successfully gotten the first
of three sections of the firebird build completed: the build process
builds "libfbstatic" and some tools first, then uses these tools to
generate various other files needed for the full build., and then builds
the "libfbembed" which we need. We're now on failing at the second stage
due to some issues with the tools not being able to lock the firebird
directory (no idea why yet -- it's some windows only code dealing with
file permissions / testing for existence of directories by pretending
they're a file and testing for a specific error? Could possibly be
related to using this on Windows 7 instead of whatever system it was
originally intended to be built on?)

On 01/07/13 06:17, Norbert Thiebaud wrote:
On Sun, Jun 30, 2013 at 2:05 PM, Andrzej J. R. Hunt <andrzej@ahunt.org> wrote:

Finally I've had to do things like replace snprintf with _snprintf --
currently decided using an ifdef -- this seems somewhat unclean but I'm
not sure of any better way to do this.
Usually this is done in a header either by implementing a static
inline wrapper or sometime a simple #define does it.
#ifdef Windows
#define snprintf _snprintf
#endif

The trick is to find the 'right' header to shove that in... or more
cleanly to have a separate 'compat' header and include it at the
judicious place, preferably an existing header that is already
included everywhere in the project...

The _last_ thing you want is to sprinkle
#ifdef Windows
_snprinft(....)
#else
snprintf(....)
#endif

all over the code.
for one this is ugly, for second and more important, very fragile...
any new version of the underlying code taht introduce a new snprintf
would break and require a new patch
whereas with a  header-based solution chance are good that it will
'just work' for future version.






Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.