[cairo] _cairo_win32_tmpfile()

Augusto Radtke radtke at radtke.com.br
Fri Sep 26 06:52:25 PDT 2008


> We used a relatively small set of Cygwin tools, including GNU make,
> plus the MSVC compiler extensively already.  So, the Makefile.win32
> setup in Cairo is perfect for us.  I have no solid evidence, but I
> suspect that this kind of setup is common for developers with
> cross-platform products; GNU-compatible Makefiles are about the only
> way to develop on Linux, Windows, and the Mac without big
> redundancies

My product is being developed for Windows and Mac OS X, I use native
building environment for both. MSVC project files on Windows and an
Xcode project file on Mac. I feel that I already put some energy
working on a software that build for both environments so that
maintaining a small project file for each version isn't too much
trouble. What I care about is compile cleanness and without too much
magic #defines to setup. Cairo is superb on that and better yet on
1.8.0, I only have to hand-engineer cairo-features.h and set
CAIRO_WIN32_STATIC_BUILD on Windows.

Another good example of what I mean by compile cleanness is Lua. It's
completely ANSI C safe so you only have to drop the files on a project
file and compile, without warnings or errors. Cairo is walking on that
direction.

> As an aside, I think that the hardest part about generating a Visual
> Studio project file will be picking which file format, since they seem
> to significantly change formats every release.  Picking the oldest
> version in common usage is probably the smart thing, since it will
> forward-convert.  (For the record, we use "Visual Studio .NET 2003,"
> a.k.a. Visual C++ 7.)

That would be a problem if you want to keep a clean source tree,
directly from git, because the forward conversion will generate a file
that isn't in touch with the repository, and you'll have to sync the
vcproj with the repository by hand if any compilation directive
changes or new files added or removed. I see some projects that keep
some project files for different versions of MSVC, it's a little more
to maintain but keep the users extremely on sync with the
repositories. I could help to maintain that, I just have to setup
different versions of MSVC, I'm with the 2008 right now.

Changing from water to wine, I'm facing a little problem when
compiling cairo as a static library, on cairo.h:

#ifndef cairo_public
# ifdef _MSC_VER
#  define cairo_public __declspec(dllimport)
# else
#  define cairo_public
# endif
#endif

Shouldn't that be checking for CAIRO_WIN32_STATIC_BUILD instead of
relying directly on _MSC_VER ? That seems to fix my compilation
problems here.
Comments?

Augusto


More information about the cairo mailing list