Skip to content
Permalink
Browse files

Merge pull request #2934 from sanssecours/🍏

Build: Fix Format Specifier for `st_size` on macOS
  • Loading branch information...
markus2330 committed Sep 8, 2019
2 parents b9d1777 + 569a516 commit 95907d80a1c6120da458dffe4c6d144d1fd0408c
Showing with 13 additions and 4 deletions.
  1. +4 −1 .cirrus.yml
  2. +2 −2 doc/news/_preparation_next_release.md
  3. +7 −1 src/include/CMakeLists.txt
@@ -56,6 +56,8 @@ mac_task:
- name: 🍎 Clang
osx_instance:
image: mojave-xcode-10.1
env:
ENABLE_LOGGER: ON

- name: 🍎 Clang ASAN
osx_instance:
@@ -148,6 +150,7 @@ mac_task:
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
-DCOMMON_FLAGS="${COMMON_FLAGS:--Werror}"
-DENABLE_ASAN="${ENABLE_ASAN:-OFF}"
-DENABLE_LOGGER="${ENABLE_LOGGER:-OFF}"
-DENABLE_DEBUG=ON
-DKDB_DB_FILE="${KDB_DB_FILE:-default.ecf}"
-DKDB_DB_INIT="${KDB_DB_INIT:-elektra.ecf}"
@@ -187,7 +190,7 @@ linux_task:
- name: 🔗 Check
container:
dockerfile: scripts/docker/cirrus/Dockerfile

clone_script: |
if [ -z "$CIRRUS_PR" ]; then
git clone --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
@@ -166,7 +166,7 @@ you up to date with the multi-language support provided by Elektra.
### CMake

- `kdbtypes.h` is now generated directly via a CMake `configure_file` call. _(Klemens Böswirth)_
- <<TODO>>
- The variable `ELEKTRA_STAT_ST_SIZE_F` now contains the correct format specifier for the `st_size` member of the `stat` struct on macOS. _(René Schwaiger)_
- <<TODO>>

### Compilation
@@ -189,7 +189,7 @@ you up to date with the multi-language support provided by Elektra.
### Cirrus

- The `🔗 Check` build job now merges PRs before checking links. _(Klemens Böswirth)_
- <<TODO>>
- We enabled logging in the build job `🍎 Clang`. This update makes sure that Elektra’s logging code compiles without warnings on macOS. _(René Schwaiger)_
- <<TODO>>

### Jenkins
@@ -86,7 +86,13 @@ else ()
set (ELEKTRA_TIME_USEC_F "\"%d\"")
endif ()

if (SIZEOF_STAT_ST_SIZE EQUAL SIZEOF_LONG)
# Unfortunately `long` and `long long` have the same size (8 bytes) on `amd64` architectures in macOS and Debian GNU/Linux. This means we
# can not differentiate these types only based on their size. Consequently we set the `long long` format specifier for `st_size` on macOS,
# and hope that all other operating systems, either use differently sized types for `long` and `long long`, or just use `long` as data type
# for `st_size`.
if (APPLE)
set (ELEKTRA_STAT_ST_SIZE_F "\"%llu\"")
elseif (SIZEOF_STAT_ST_SIZE EQUAL SIZEOF_LONG)
set (ELEKTRA_STAT_ST_SIZE_F "\"%lu\"")
elseif (SIZEOF_STAT_ST_SIZE EQUAL SIZEOF_LONG_LONG)
set (ELEKTRA_STAT_ST_SIZE_F "\"%llu\"")

0 comments on commit 95907d8

Please sign in to comment.
You can’t perform that action at this time.