From 23d21a74b55eaf6d6d367097099e6b3bb78bae37 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 15 Feb 2018 02:52:15 +0200 Subject: [PATCH 1/3] Move collect_logs to .ci dir Next to other CI scripts. --- .collect_logs => .ci/collect-logs.sh | 0 .circleci/config.yml | 8 ++++---- .travis.yml | 6 +++--- appveyor.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename .collect_logs => .ci/collect-logs.sh (100%) diff --git a/.collect_logs b/.ci/collect-logs.sh similarity index 100% rename from .collect_logs rename to .ci/collect-logs.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 4788f0b0b..28b631600 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ jobs: - checkout - run: apt update && apt install -y ninja-build binutils libtool autoconf automake make cmake gcc g++ pkg-config ragel gtk-doc-tools libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev python python-pip - run: pip install fonttools - - run: ./autogen.sh && (make distcheck || (cd harfbuzz-* && ../.collect_logs && false)) && rm -rf harfbuzz-* + - run: ./autogen.sh && (make distcheck || (cd harfbuzz-* && ../.ci/collect-logs.sh && false)) && rm -rf harfbuzz-* - run: make distdir && cd harfbuzz-* && cmake -DHB_CHECK=ON -Bbuild -H. -GNinja && ninja -Cbuild && CTEST_OUTPUT_ON_FAILURE=1 ninja -Cbuild test && ninja -Cbuild install alpine: @@ -19,7 +19,7 @@ jobs: - checkout - run: apk update && apk add ragel make pkgconfig libtool autoconf automake gettext gcc g++ glib-dev freetype-dev cairo-dev - run: ./autogen.sh - - run: make && (make check || (./.collect_logs && false)) + - run: make && (make check || (.ci/collect-logs.sh && false)) archlinux: docker: @@ -28,7 +28,7 @@ jobs: - checkout - run: pacman --noconfirm -Syu freetype2 cairo icu gettext gobject-introspection gcc gcc-libs glib2 graphite pkg-config ragel python - run: ./autogen.sh --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 - - run: make && (make check || (./.collect_logs && false)) + - run: make && (make check || (.ci/collect-logs.sh && false)) fedora-outoftreebuild: docker: @@ -37,7 +37,7 @@ jobs: - checkout - run: dnf install -y pkg-config ragel gcc gcc-c++ automake autoconf libtool make which glib2-devel freetype-devel cairo-devel libicu-devel gobject-introspection-devel graphite2-devel redhat-rpm-config python || true - run: NOCONFIGURE=1 ./autogen.sh --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 - - run: mkdir build && cd build && ../configure && make && (make check || (./.collect_logs && false)) + - run: mkdir build && cd build && ../configure && make && (make check || (.ci/collect-logs.sh && false)) cmake-gcc: docker: diff --git a/.travis.yml b/.travis.yml index bbffda67c..a68ef7dc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ matrix: - ./autogen.sh - ./configure $CONFIGURE_OPTS --enable-gtk-doc - make - - make check || (./.collect_logs && false) + - make check || (.ci/collect-logs.sh && false) after_success: - bash .ci/run-coveralls.sh # for coveralls.io code coverage tracking - bash .ci/deploy-docs.sh @@ -43,7 +43,7 @@ matrix: - ./autogen.sh - ./configure $CONFIGURE_OPTS - make - - make check || (./.collect_logs && false) + - make check || (.ci/collect-logs.sh && false) - os: osx compiler: clang @@ -59,7 +59,7 @@ matrix: - ./autogen.sh - ./configure $CONFIGURE_OPTS --with-coretext - make - - make check || (./.collect_logs && false) + - make check || (.ci/collect-logs.sh && false) notifications: irc: "irc.freenode.org#harfbuzz" diff --git a/appveyor.yml b/appveyor.yml index c3caa3181..63e711fea 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,7 +44,7 @@ build_script: - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest --output-on-failure -C %configuration%' - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config,python2}"' - - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || (./.collect_logs && false)"' + - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || (.ci/collect-logs.sh && false)"' cache: - c:\tools\vcpkg\installed\ From 6c10328eb88b0641586f31a782b63f45eada5609 Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Thu, 15 Feb 2018 23:17:46 +0300 Subject: [PATCH 2/3] Use _BitScanForward and _BitScanReverse on MSVC --- src/hb-private.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hb-private.hh b/src/hb-private.hh index 6430ba8e3..22948ae54 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -51,6 +51,9 @@ #include #include +#if defined(_MSC_VER) +#include +#endif #define HB_PASTE1(a,b) a##b #define HB_PASTE(a,b) HB_PASTE1(a,b) @@ -352,6 +355,10 @@ _hb_bit_storage (unsigned int number) { #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) return likely (number) ? (sizeof (unsigned int) * 8 - __builtin_clz (number)) : 0; +#elif defined_MSC_VER) && defined(__OPTIMIZE__) + unsigned long where; + if (_BitScanReverse(&where, number)) return 1 + where; + return 0; #else unsigned int n_bits = 0; while (number) { @@ -368,6 +375,11 @@ _hb_ctz (unsigned int number) { #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) return likely (number) ? __builtin_ctz (number) : 0; +#elif defined_MSC_VER) && defined(__OPTIMIZE__) + unsigned long where; + if (_BitScanForward(&where, n)) return where; + return 0; +} #else unsigned int n_bits = 0; if (unlikely (!number)) return 0; From 139c9928f6152088fa6eee0279e33cb821aeb541 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Fri, 16 Feb 2018 13:27:26 +0330 Subject: [PATCH 3/3] Fix hb-private.hh compile issue --- src/hb-private.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-private.hh b/src/hb-private.hh index 22948ae54..0738b9950 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -355,7 +355,7 @@ _hb_bit_storage (unsigned int number) { #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) return likely (number) ? (sizeof (unsigned int) * 8 - __builtin_clz (number)) : 0; -#elif defined_MSC_VER) && defined(__OPTIMIZE__) +#elif defined(_MSC_VER) && defined(__OPTIMIZE__) unsigned long where; if (_BitScanReverse(&where, number)) return 1 + where; return 0; @@ -375,7 +375,7 @@ _hb_ctz (unsigned int number) { #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) return likely (number) ? __builtin_ctz (number) : 0; -#elif defined_MSC_VER) && defined(__OPTIMIZE__) +#elif defined(_MSC_VER) && defined(__OPTIMIZE__) unsigned long where; if (_BitScanForward(&where, n)) return where; return 0;