Skip to content

Commit 00c27c7

Browse files
authored
Merge pull request #110 from saxbophone/develop
v0.19.2 - Improve 64-bit detection
2 parents b01b24a + 5db3cce commit 00c27c7

File tree

8 files changed

+13
-31
lines changed

8 files changed

+13
-31
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# begin basic metadata
2424
cmake_minimum_required(VERSION 3.0)
2525

26-
project(libsaxbospiral VERSION 0.19.1 LANGUAGES C)
26+
project(libsaxbospiral VERSION 0.19.2 LANGUAGES C)
2727
set(CMAKE_C_STANDARD 99)
2828
set(CMAKE_C_STANDARD_REQUIRED ON)
2929
set(
@@ -33,6 +33,14 @@ set(
3333
set(SAXBOSPIRAL_ESCAPED_VERSION_STRING "\"${SAXBOSPIRAL_VERSION_STRING}\"")
3434
# end basic metadata
3535

36+
# this is a 64-bit project, so check now to make sure we're 64-bit, issue warning if not
37+
if(CMAKE_SIZEOF_VOID_P LESS 8)
38+
message(
39+
WARNING
40+
"It looks like this system's architecture is not at least 64-bit.\n"
41+
"libsaxbospiral requires a system with an architecture of at least 64 bits!")
42+
endif()
43+
3644
# pass in version of library as preprocessor definitions
3745
add_definitions(-DSAXBOSPIRAL_VERSION_MAJOR=${PROJECT_VERSION_MAJOR})
3846
add_definitions(-DSAXBOSPIRAL_VERSION_MINOR=${PROJECT_VERSION_MINOR})

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Although this project doesn't work in sprints, there is a [*sprint board*](https
2020

2121
## Please Note
2222

23+
- This software only works on systems capable of running 64-bit code.
24+
2325
- This is a library only. If you're looking for something that is immediately usable for the end-user, you probably want to look at [sxbp](https://github.com/saxbophone/sxbp) instead, which is a command-line program I wrote which uses libsaxbospiral to render input binary files to PNG images.
2426

2527
- As libsaxbospiral is currently at major version 0, expect the library API to be unstable. I will endeavour as much as possible to make sure breaking changes increment the minor version number whilst in the version 0.x.x series and bugfixes increment the patch version number, but no heavy reliance should be placed on this.

saxbospiral/render.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
* You should have received a copy of the GNU Affero General Public License
2121
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
*/
23-
24-
// sanity check for support of 64-bit integers
25-
#if __SIZEOF_SIZE_T__ < 8
26-
#warning "Please compile this code for a target with 64-bit words or greater."
27-
#endif
28-
2923
#include <stdbool.h>
3024
#include <stdint.h>
3125
#include <stdlib.h>

saxbospiral/render.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
#ifndef SAXBOPHONE_SAXBOSPIRAL_RENDER_H
2424
#define SAXBOPHONE_SAXBOSPIRAL_RENDER_H
2525

26-
// sanity check for support of 64-bit integers
27-
#if __SIZEOF_SIZE_T__ < 8
28-
#warning "Please compile this code for a target with 64-bit words or greater."
29-
#endif
30-
3126
#include <stdbool.h>
3227
#include <stdint.h>
3328

saxbospiral/saxbospiral.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
#ifndef SAXBOPHONE_SAXBOSPIRAL_SAXBOSPIRAL_H
2525
#define SAXBOPHONE_SAXBOSPIRAL_SAXBOSPIRAL_H
2626

27-
// sanity check for support of 64-bit integers
28-
#if __SIZEOF_SIZE_T__ < 8
29-
#warning "Please compile this code for a target with 64-bit words or greater."
30-
#endif
31-
3227
#include <stdbool.h>
3328
#include <stddef.h>
3429
#include <stdint.h>

saxbospiral/serialise.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@
2121
* You should have received a copy of the GNU Affero General Public License
2222
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
*/
24-
25-
// sanity check for support of 64-bit integers
26-
#if __SIZEOF_SIZE_T__ < 8
27-
#warning "Please compile this code for a target with 64-bit words or greater."
28-
#endif
29-
3024
#include <stdint.h>
3125
#include <stdio.h>
3226
#include <stdlib.h>

saxbospiral/solve.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
* You should have received a copy of the GNU Affero General Public License
2323
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2424
*/
25-
26-
// sanity check for support of 64-bit integers
27-
#if __SIZEOF_SIZE_T__ < 8
28-
#warning "Please compile this code for a target with 64-bit words or greater."
29-
#endif
30-
3125
#include <stdbool.h>
3226
#include <stddef.h>
3327
#include <stdint.h>

tests.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ bool test_sxbp_load_spiral_rejects_too_small_data_section() {
483483
// success / failure variable
484484
bool result = true;
485485
// build buffer of bytes for input data
486-
sxbp_buffer_t buffer = { .size = 41, };
487-
buffer.bytes = calloc(1, buffer.size);
486+
sxbp_buffer_t buffer = { .size = 0xffffffffffffffffu, }; // max 64-bit uint
487+
buffer.bytes = calloc(1, 41); // set allocation size to actual data size
488488
// construct data header
489489
sprintf(
490490
(char*)buffer.bytes,

0 commit comments

Comments
 (0)