summaryrefslogtreecommitdiff
path: root/src/cairo-compiler-private.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix some MinGW warningsAdrian Johnson2021-09-021-1/+6
| | | | | | | | | | | | | | | | | The FT change is because my MinGW build is using a more recent version of FT. Remove the disabled _cairo_win32_scaled_font_text_to_glyphs() code to fix the defined but not used warning. _cairo_win32_scaled_font_text_to_glyphs() was diabled in d9408041aa with the comment: "Currently disable the win32-font text_to_glyphs(), until that one is updated. Or better yet, remove it and implement ucs4_to_index(). It's the toy font API afterall." _cairo_win32_scaled_font_ucs4_to_index() was added in d1c619bc7d.
* Fix malloc overflow check warningAdrian Johnson2021-08-241-0/+54
| | | | | | | | | | | | | | | To fix this warning: ../src/cairo-malloc-private.h:83:32: warning: comparison is always false due to limited range of data type [-Wtype-limits] 83 | ((size) != 0 && (size_t) (a) >= SIZE_MAX / (size_t) (size) ? NULL : \ | ^~ Create two new macros to do the overflow checks: _cairo_addl_size_t_overflow and _cairo_mul_size_t_overflow. Implement them using compiler builtins where available. Update cairo-malloc-private to use these fuctions and add an overflow test to test the functions.
* Fix some mingw warnings and correct the value of R_OKAdrian Johnson2021-08-071-1/+3
|
* Fix some win32 compile warningsAdrian Johnson2021-07-251-0/+1
|
* Drop the conditional inclusion of config.hEmmanuele Bassi2021-05-011-2/+0
| | | | | | | | | | | | We *always* generate this file, and we depend on its existence. The idea behind HAVE_CONFIG_H was being able to include random files from different projects, back in a time where "libraries" were literally just random files instead of actual shared objects. Since we're not in the '80s any more, and our build system(s) define HAVE_CONFIG_H *and* generate the config.h header file, we don't need a conditional guard around its inclusion.
* Fix build on Windows with recent versions of MSVCMathieu Duponchelle2020-07-311-2/+4
| | | | | | | - vsnprintf and snprintf are available since vs2015 - define ISREG if not provided - guard unistd.h include with HAVE_UNISTD_H - isnan() is available after vs2010
* compiler-private: Define what PLT stands forBryce Harrington2018-02-281-1/+1
|
* clang-cl: Use size of the pointer explicitlyJeff Muizelaar2014-07-091-1/+1
| | | | This works around http://llvm.org/PR20216.
* Don't use __FUNCTION__ as a string literalJeff Muizelaar2014-06-301-6/+4
| | | | | clang-cl doesn't support this and we don't gain much from using it.
* Avoid defining inline when compling C++ on MSVC.Ehsan Akhgari2011-10-171-0/+2
| | | | | | Cairo fails to build with VC11 because it tries to #define inline, which is a keyword in C++. VC11's xkeycheck.h catches this with an #error. https://bugzilla.mozilla.org/show_bug.cgi?id=694797
* gl: Rectangular fast pathChris Wilson2011-07-291-11/+2
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Do not open-code freed-poolAndrea Canciani2011-06-251-15/+0
| | | | | | | | | | Reuse the freed-pool system to reduce allocation pressure of context creation/destruction. As a side effect, this removes the use of ffs() on Win32, cleaning up some MSVC-specific code and fixing a mingw-related build issue. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=30277
* Hide private symbols on MacOSXAndrea Canciani2011-06-241-1/+3
| | | | | gcc provides the hidden visibility attribute on Darwin, which can be used to deny access to private cairo symbols.
* Avoid deprecated functions on win32Andrea Canciani2011-06-201-3/+8
| | | | | Some POSIX functions are deprecated in MSVC and should instead be used with an alternative name beginning with '_'.
* Revert "Add an implementation of fmax for use with MSVC"Andrea Canciani2011-03-191-14/+0
| | | | | | This reverts commit de2c5bfa19ce6b3fda50bca3445aabc040947bc9. fmax() is not used anymore and should not be used in future.
* Add an implementation of fmax for use with MSVCJeff Muizelaar2011-03-031-0/+14
|
* Add an implementation of ffs() for MSVCJeff Muizelaar2010-05-061-0/+15
|
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* compiler: Explain the slim hidden macros.M Joonas Pihlaja2010-02-251-0/+30
| | | | | | | The slim_hidden_* macro definitions are rather cryptic at first sight and I keep needing to rederive how they work just find out what they're supposed to do. This patch adds a comment explaining how they're used and work.
* Fix compilation on MacOS XAndrea Canciani2010-01-231-2/+2
| | | | | | Some functions declared in MacOS X headers use the always_inline attribute, thus defining it to be a different expression breaks the build.
* spans: Add a Bentley-Ottmann variant on the Tor scan converterChris Wilson2010-01-221-0/+11
| | | | | | | | | | | | | | | | | | | | This variant uses the Bentley-Ottmann algorithm to only maintain the active edge list upon edge events and so can efficiently skip areas where no change occurs. This means that it can be much quicker than the Tor algorithm (which is still used to compute the coverages from the active edges) for geometries consisting of long straight lines with few intersections. However due to the computational overhead of the Bentley-Ottmann event processing, for dense curvy paths, simply updating the active edge list in sync with computing the coverages is a win. Due to advantageous adaptive step size, the scan converter can be run at a much higher subsampling with little extra overhead compared with Tor, currently it uses a 256x256 subsampling grid to avoid any impedance mismatch with path precision. Given the current status of implementations, this scan converter [botor] is likely to be advantage where detecting large regions of unchanged span data will result in improved performance, for instance the drm backends which convert the scan data into rectangles.
* [win32] Use _hypot instead of hypotVladimir Vukicevic2009-03-211-0/+1
| | | | The hypot symbol is deprecated on Win32, and nonexistent on Windows CE
* [msvc] Fix definition of CAIRO_ENSURE_UNIQUE for non-x86Jeff Muizelaar2009-03-201-1/+1
| | | | | The current definition of CAIRO_ENSURE_UNIQUE uses x86 assembly so make sure we only compile it when targeting x86.
* Relanding: Add CAIRO_ENSURE_UNIQUE macro and use it in _cairo_error()Jeff Muizelaar2009-02-191-0/+24
| | | | | | | | | When using MSVC, _cairo_error() can be folded into other identical functions. If that happens, _cairo_error isn't really useful anymore. Using the CAIRO_ENSURE_UNIQUE macro makes sure this doesn't happen. Use __asm to serve as a line delimiter. This allows us to use the __asm{} block in a macro.
* Revert "Add CAIRO_ENSURE_UNIQUE macro and use it in _cairo_error()"Jeff Muizelaar2009-02-191-24/+0
| | | | | | | | This reverts commit 126824f5e6279f56dab0c040394b6c326b848cf7. It turns out MSVC doesn't handle line continuation characters in __asm{} blocks very well, so revert for now until I come up with something that works.
* Add CAIRO_ENSURE_UNIQUE macro and use it in _cairo_error()Jeff Muizelaar2009-02-191-0/+24
| | | | | | When using MSVC, _cairo_error() can be folded into other identical functions. If that happens, _cairo_error isn't really useful anymore. Using the CAIRO_ENSURE_UNIQUE macro makes sure this doesn't happen.
* Divert pclose to _pclose for MSVCJeff Muizelaar2009-02-121-0/+1
| | | | | | Commit bf62798b1284533e28b78717dac8070ca6d29e54 added a diversion for popen but not for pclose. This is needed for linking the boilerplate with the test suite.
* [compiler] likelihood macrosChris Wilson2008-11-191-4/+4
| | | | | | | | Behdad prefers these to be upper-case to be consistent with G_UNLIKELY and friends. However, as I intend to use these for nearly all instances of if(status), I suggest that we keep to the short and not so loud: if (unlikely (status)) return status;
* Add predicate likelihood macros.Chris Wilson2008-11-131-0/+17
| | | | | Define the couple of standard macros that we can use to guide gcc optimisations of which code path will be most likely taken.
* [check-doc-syntax.sh] Allow quoting.Chris Wilson2008-10-141-11/+11
| | | | | | func_regexp was incorrectly complaining that cairo_pure was a function without parenthesis. The simplest solution appeared to be allow quoting of 'cairo_pure'.
* Add documentation for function attributes 'pure' and 'const'.Chris Wilson2008-10-141-0/+20
| | | | | | | Carl suggested that cairo_pure and cairo_const are pretty opaque, even to the developer who added them, so it is extremely important that they have a good description so that they are used correctly and perhaps ported to other compilers.
* [wideint] Declare the wideint arithmetic functions as const.Chris Wilson2008-10-071-0/+2
| | | | | | 'const' is a stricter form of 'pure' in that functions declared with that attribute do not access any values other than their arguments (in contrast to 'pure' which is allowed to read from global memory).
* [wideint] Mark functions as pureChris Wilson2008-10-061-0/+6
| | | | | | | Take advantage of the gcc function attribute 'pure', which tells gcc that the function result only depends upon its arguments and it has zero side effects (e.g. it does not clobber memory). This gives gcc greater opportunity to rearrange and optimize the wideint arithmetic.
* Make sure (and check) that all private headers include some cairo header firstBehdad Esfahbod2008-09-191-0/+2
| | | | | | | | | | | | | | | 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.
* [cairo-compiler-private.h] Divert popen to _popen for MSVCChris Wilson2008-09-101-0/+1
| | | | | Microsoft uses _popen instead of popen - required to build the boilerplate but not actually used on Windows (by default)!
* Revamp the build system.Behdad Esfahbod2008-09-021-3/+3
| | | | | | | | | | | | | | | | | 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.
* [cairo-compiler-private.h] Clear definition of __attribute__Chris Wilson2008-08-171-0/+1
| | | | Avoid a redefinition error when playing silly tricks with 'cpp -U__GNUC__'.
* [cairo-compiler-private] Make it build with wineBehdad Esfahbod2008-05-281-1/+1
| | | | | | One can build cairo with wine easily now: ./configure CC=winegcc LD=winegcc
* Fix msvc compilation issue in cairo-compiler-private.hVladimir Vukicevic2008-03-031-1/+1
| | | | | __WIN32__ is not a standard define set by MSVC; we have to check for __WIN32__ (for mingw/gcc) and for _MSC_VER, for MSVC.
* Fix PDF ouput when cross-compiling with mingwJody Goldberg2008-02-281-1/+4
| | | | | | Need to use __WIN32__ instead of _MSC_VER to select _snprintf in place of snprintf when cross compiling. Otherwise all all %ld arguments get misprinted resulting in broken PDF output.
* [cairoint.h] Move MSC inline macros into cairo-compiler-private.hBehdad Esfahbod2008-01-201-0/+10
| | | | where they belong
* [check] Replace compiled symbol visibility checker with shell script.Chris Wilson2008-01-111-3/+2
| | | | | | | | | | | | Behdad Esfahbod objected to the execution of a compiled program to check symbol visibility as it makes cross-compilation more difficult. Instead of executing the program, this method conditionally exports a variable if cairo uses symbol hiding and scans the executable for that symbol in a similar manner to check-def.sh. This has the slight advantage of using the Makefile for performing the compilation, rather than attempting to invoke $(CPP) from a shell script within the test environment.
* [check] Skip def/plt tests if the compiler doesn't support symbol hiding.Chris Wilson2008-01-111-0/+3
| | | | | | | | Compile a trivial program such that it reports whether cairo is hiding its internal symbols and skip the tests that depend upon it. This prevents false errors, such as bug 12726, where the user is presented with a scary make check failure.
* Move GCC attributes wrapping into a separate header.Chris Wilson2007-09-251-0/+115
The wrapping of GCC attributes (such as cairo_private) needs to be visible to any header file, including those that avoid cairoint.h such as cairo-boilerplate. To achieve this we move the pre-processor magic to its own header file and include it as required.