Age | Commit message (Collapse) | Author | Files | Lines |
|
Avoid pulling in the real pthread library if the application is single
threaded and not using pthreads, by linking against pthread-stubs
instead.
|
|
The WINVER defines should always be defined before including windows.h
|
|
Commit 535bcaa1 moved pthread after win32 to fix mingw build
problems. However this breaks cygwin builds.
On cygwin HAVE_WINDOWS_H is defined but _WIN32 is not. This was
causing windows.h to be included which defines _WIN32. As a result the
win32 code in cairo-misc.c was being compiled but the win32 declaration
in cairint.h was not included.
Fix this by using _WIN32 to enable the win32 mutex functions since
_WIN32 is defined by mingw, visual C++, and winegcc, but not
cygwin. On cygwin, posix functions are preferred as it is a unix
emulation environment.
|
|
Check for native mutex types before hooking into pthread, as this
workarounds broken builds on mingw that confuse us by including the
pthread header file.
|
|
As a fun itch to scratch, I've been fixing incorrect uses of the
contraction "it's" in comments within the mozilla source tree (tracked
in https://bugzilla.mozilla.org/show_bug.cgi?id=458167 ), and I ran
across 6 instances of this typo in mozilla's snapshot of cairo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Note bene that Behdad does not like people shouting.
|
|
Use '(void)expr;' instead of 'if (expr) ;' to avoid getting the warning.
'if (expr) {}' is an option, however '(void)expr;' seems like a more common
idiom and getting warnings for __attribute__((warn_unsed_result)) functions is
probably prefered.
|
|
After discussing the scaled font locking with Behdad, it transpired that it
is not sufficient for a font to be locked for the lifetime of a scaled glyph,
but that the scaled font's glyph cache must be frozen for the glyph'
lifetime. If the cache is not frozen, then there is a possibility that the
glyph may be evicted before the reference goes out of scope i.e. the glyph
becomes invalid whilst we are trying to use it.
Since the freezing of the cache is the stronger barrier, we remove the
locking/unlocking of the mutex from the backends and instead move the
mutex acquisition into the freeze/thaw routines. Then update the rule on
acquiring glyphs to enforce that the cache is frozen and review the usage
of freeze/thaw by all the backends to ensure that the cache is frozen for
the lifetime of the glyph.
|
|
Behdad prefers the latter to keep a clean namespace.
|
|
|
|
lockdep is a valgrind skin which performs pthread locking correctness
validation. In particular it allows one to write assert(HOLDS_LOCK(mutex))
which both documents the preconditions for a function and enforces them
when the program is run under lockdep.
As an aide to lockdep (as it works by intercepting the pthread functions),
all the mutexes should be initialised and destroyed using
pthread_mutex_init() and pthread_mutex_destroy() rather than using static
initializers and no-ops.
|
|
|
|
Minor syntax changes and improved check regexps.
|
|
This is where DLL initialization/finalization should be done for example.
Moved the one for win32. For OS/2 just left a comment as the code needs
more work.
This change simplifies building shared and static libraries in the win32
makefiles.
|
|
This ensures that each header includes all headers it depends on.
This is now enforced by "make check".
|
|
The macros CAIRO_BEGIN_DECLS and CAIRO_END_DECLS are declared in two
places: config.h and cairo.h. On Win32 build there is no config.h. So,
we can't rely on pulling CAIRO_BEGIN_DECLS from there. Hence, we now:
* Not add those declarations to config.h anymore,
* Test that every cairo private header includes some other cairo
header before any other includes.
These two are fairly enough to ensure that cairo.h is seen from all
private headers. There's still the case of headers not including
any header file at all. I'll fix that later.
|
|
Previously I made the mutex implementation code to use Windows mutexes
conditional on HAVE_WINDOWS_H. This was suppposed to be a more wine-friendly
version of checking for a Windows platform. However, it also meant that
when compiling without config.h, one had to stuff a #define for HAVE_WINDOWS_H
somewhere. Traditionally it was put in cairo-features-win32.h, and that
practice was carried over even after my build system rewrite.
Somewhere along the road I also decided that the mutex implementation header
does not need to include anything other than config.h. So the hacked up
HAVE_WINDOWS_H in cairo-features-win32.h was not being seen by its lone
user.
We now condition on any of HAVE_WINDOWS_H and _MSC_VER. So the hack can be
removed altogether.
|
|
Quick summary of changes:
- Move list of cairo source files out of src/Makefile.am and into
src/Sources.mk,
- Generate files src/Config.mk and src/Config.mk.win32 that choose
the right set of source files and headers based on configured
backends and features. This drastically simplifies building
using other build systems. The src/Makefile.win32 file needs
to be updated to reflect these changes.
- Add README files to various directories,
- Add toplevel HACKING file.
|
|
The rule is simple: <x.h> for system / other project includes,
"x.h" for local includes.
|
|
Essentially renaming cairo-mutex-type-private.h to cairo-mutex-impl-private.h
and changing all its namespace from cairo_mutex to cairo_mutex_impl.
cairo-mutex-type-private.h then does all the sanity checks on the
implementation that used to be in cairo-mutex-private.h. Plus, defines macros
for the cairo-mutex namespace to map to the cairo-mutex-impl namespace. This
extra mapping layer allows for add debugging facilities.
|