Commit Graph

170 Commits

Author SHA1 Message Date
Behdad Esfahbod 75e6498d9a Don't use M_PI
Fixes https://github.com/harfbuzz/harfbuzz/issues/4166

Happy Pi Day!
2023-03-14 12:41:46 -06:00
Behdad Esfahbod 5bc6ab006d Use __has_builtin for builtin checks instead of compiler versions
https://github.com/harfbuzz/harfbuzz/issues/4066#issuecomment-1439510188
2023-02-22 08:54:18 -07:00
Behdad Esfahbod 5b50b07717 [subset-cff] Make BCD writing locale-independent 2023-02-19 20:39:01 -07:00
Behdad Esfahbod 13c70066de Shut up gcc 13 -Wdangling-reference
Fixes https://github.com/harfbuzz/harfbuzz/issues/4043
2023-01-18 17:29:26 -07:00
Behdad Esfahbod 075fe33446 Enable -Wunsafe-loop-optimizations
I don't get any.
2023-01-12 17:14:42 -07:00
Behdad Esfahbod ed023f66df Enable -Wformat-signedness
And fix the codebase.
2023-01-12 17:04:24 -07:00
Behdad Esfahbod ae208963df Add hb-limits.hh 2022-12-26 12:30:39 -07:00
Behdad Esfahbod 60c6b7786d Disable -Wcast-function-type-strict
https://github.com/harfbuzz/harfbuzz/pull/3859#issuecomment-1295409126
2022-10-28 14:19:39 -06:00
Ryan VanderMeulen 1c0eeb7cb3 Don't try to set _USE_MATH_DEFINES if already defined 2022-06-16 09:28:33 -06:00
Behdad Esfahbod e9c0a74063 Fix clang -Wcomma warnings
Fixes https://github.com/harfbuzz/harfbuzz/issues/3656
2022-06-15 17:28:36 -06:00
Behdad Esfahbod 17c80035ad Revert "[cplusplus] Internally allow using hb_unique_ptr with hb_free()"
This reverts commit b5f621b08d.

A build was failing with clang 14 for Firefox apparently, sigh.

https://github.com/harfbuzz/harfbuzz/issues/3647
2022-06-09 04:17:38 -06:00
Behdad Esfahbod b5f621b08d [cplusplus] Internally allow using hb_unique_ptr with hb_free()
...for arbitrary types.
2022-06-05 08:15:31 -06:00
Behdad Esfahbod 3817bdfd7f [hb.hh] Include hb-cplusplus.hh 2022-06-02 18:22:05 +01:00
Behdad Esfahbod 484cc18732 [test-shape-threads] Set language 2022-05-30 05:09:53 -06:00
Behdad Esfahbod 9177953720 [atexit] Allow hb_atexit redefinition
Fixes https://github.com/harfbuzz/harfbuzz/issues/3412
2022-02-04 12:38:45 -06:00
Behdad Esfahbod 9bd7ba5019 Err on -Wbitwise-instead-of-logical
Part of https://github.com/harfbuzz/harfbuzz/pull/3256
2021-10-12 16:10:31 -07:00
Behdad Esfahbod e0d5fe740a Centralize math include
https://github.com/harfbuzz/harfbuzz/pull/3212
2021-09-17 06:41:07 -06:00
Behdad Esfahbod bda3238c89 Add fallback atexit implementation using template descrutors
Fixes https://github.com/harfbuzz/harfbuzz/issues/3197
2021-09-14 08:12:48 -04:00
Behdad Esfahbod ed1163208d Call atexit() via hb_atexit()
Part of https://github.com/harfbuzz/harfbuzz/issues/3197
2021-09-14 07:11:46 -04:00
Khaled Hosny 791a1bf3a4 Don’t disable getenv on Windows
The condition is inverted, regression from
40ec187dec.
2021-07-27 15:22:13 +02:00
Behdad Esfahbod 2337f0d047 Internally use hb_malloc/.../hb_free instead of malloc/.../free
Redefining those stock names as macros was conflicting with gcc 10
headers.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3044
2021-07-08 10:54:09 -07:00
Behdad Esfahbod ed2ee8a8c2 Revert "Disable -Wunused-macros under GCC"
This reverts commit 1b1413246b.

Err. It wasn't working. We already have that disabled in the files it
is warning about. Doesn't work.
2021-04-16 13:53:43 -06:00
Behdad Esfahbod 1b1413246b Disable -Wunused-macros under GCC
Since the pragram in hb-ot-shape-complex-indic-table.cc didn't seem to
silence GCC, eg:

../../src/hb-ot-shape-complex-indic-table.cc:55: warning: macro "ISC_TL" is not used [-Wunused-macros]
   55 | #define ISC_TL   INDIC_SYLLABIC_CATEGORY_TONE_LETTER                 /*    7 chars; Tone_Letter */

disable it at compiler level.
2021-04-16 13:32:02 -06:00
Behdad Esfahbod 2397689387 Remove hb_success_t
Was not rolled-out yet.  So just expand.
2021-03-29 17:49:16 -06:00
Behdad Esfahbod 05e845c49a Make previous commit gcc-only 2021-03-29 16:02:10 -07:00
Behdad Esfahbod b5e4032392 -Wno-unused-result
GCC doesn't let one turn off the warning using "(void) foo()".
People have introduced macros that do "unused << foo()" instead.
Until we do something similar, silence gcc.

Clang on the other hand understands "(void) foo()".
2021-03-29 15:57:36 -07:00
Behdad Esfahbod 7cb22ba7eb
Include C headers with their C++ names (#2882)
Remove unnecessary includes.

Fixes build with some known broken SDKs (Nintendo Switch?)

https://en.cppreference.com/w/cpp/header

Fixes https://github.com/harfbuzz/harfbuzz/pull/2881
2021-03-01 11:44:06 -08:00
Behdad Esfahbod a3c35aee30 m Move HB_SCRIPT_MYANMAR_ZAWGYI 2021-02-20 15:45:34 -07:00
Behdad Esfahbod c55bf55154 Remove HB_CONST_FUNC and HB_PURE_FUNC
They are not necessary for inline functions.
2021-02-20 15:45:12 -07:00
Behdad Esfahbod cba9893ac5 m[algs] Move roundf() here 2021-02-20 15:44:47 -07:00
Behdad Esfahbod f0947717ff m[machinery] Move HB_VAR_ARRAY here 2021-02-20 15:44:25 -07:00
Behdad Esfahbod a89d9f25b4 m Err on -Wnarrowing instead of -Wc++11-narrowing
On clang, -Wnarrowing is synonym for -Wc++11-narrowing.
On gcc it isn't. So, use the widely-available one
2021-02-20 15:38:05 -07:00
Behdad Esfahbod 47f01c0726 m[algs] Move BEInt here 2021-02-20 15:14:50 -07:00
Behdad Esfahbod e5b7bc424d m Add default value to BEInt<> Size template parameter 2021-02-20 15:14:15 -07:00
Behdad Esfahbod 2caae4a59a m Move class traits 2021-02-20 15:13:52 -07:00
Behdad Esfahbod c2dbd6cc0f Remove static_assert of sizeof basic sized int types 2021-02-20 15:11:47 -07:00
Behdad Esfahbod e1706ffecd m [algs] Move flags here 2021-02-20 15:11:26 -07:00
Behdad Esfahbod 017f6b0d24 m Move static_assert_expr<> 2021-02-20 15:11:14 -07:00
Behdad Esfahbod 61f8d0e57d m Rename ASSERT_STATIC_EXPR_ZERO to static_assert_expr 2021-02-20 15:08:19 -07:00
Behdad Esfahbod 59cfffb1af m Change ASSERT_STATIC_EXPR_ZERO template arg type to bool 2021-02-20 15:07:28 -07:00
Behdad Esfahbod 1981d83d7f [constexpr] HB_MARK_AS_FLAG_T 2021-02-20 15:07:14 -07:00
Behdad Esfahbod a4a99de0eb [constexpr] bswap 2021-02-20 15:07:07 -07:00
Behdad Esfahbod f8ebe1dacd [constexpr] BEInt 2021-02-20 15:06:12 -07:00
Behdad Esfahbod 86993c09a1 Ignore -Wrange-loop-analysis
Fixes https://github.com/harfbuzz/harfbuzz/issues/2834
2021-02-19 17:10:06 -07:00
Ebrahim Byagowi 0ca3557048 Turn -Wunused-but-set-variable to warning
As #2555 turned out some glib headers are imposing that so let's turn it to warning
2020-08-12 00:38:00 +04:30
Ebrahim Byagowi 7c433ffde2
Add HB_CUSTOM_MALLOC definition
So one can use just HB_CUSTOM_MALLOC instead need for define each of hb_*alloc_impl
2020-07-15 09:38:12 +04:30
Hugo Beauzée-Luyssen 40ec187dec win32: Cleanup PARTITION handling
Use the WINAPI_PARTITION macro to filter desktop/app flavors.
We use a negated desktop check because the default (for mingw-w64 at
least) is to allow all API by combining desktop + app partitions.
This causes build failures if we were to filter using
WINAPI_PARTITION(WINAPI_FAMILY_APP) because it would always be true, but
those API also require Windows 8 or later, while we only require Vista

Fixes warnings like
../src/hb-blob.cc:572:47: warning: 'WINAPI_FAMILY_PC_APP' is not defined, evaluates to 0 [-Wundef]
 #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
                                              ^
../src/hb-blob.cc:572:86: warning: 'WINAPI_FAMILY_PHONE_APP' is not defined, evaluates to 0 [-Wundef]
 #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
2020-07-01 13:05:14 +04:30
Behdad Esfahbod a783840789 Always round up
Fixes https://github.com/harfbuzz/harfbuzz/issues/2496
2020-06-28 13:10:37 +04:30
Ebrahim Byagowi 385d64eef1 Add a not discardable bool type, hb_success_t 2020-05-07 10:26:45 +04:30
Behdad Esfahbod c37100e7d9 Clean up math.h and float.h includes 2020-04-18 16:02:55 -07:00