moreinttypes 1.8.0
Minimal library of enhanced integer types for C
|
A minimal library of enhanced integer types for C
const
integers#include <moreinttypes/core.h> | data types*, math and string library |
#include <moreinttypes/utils.h> | math and string library only |
* Since version 1.5, the following types are provided: |
compatible with code targeting ANSI C (a GNU compiler supporting -ansi
is required)
Note A compiler supporting the C99 standard is required for building.
Using function macros (they wrap the "member functions")
Using free functions
Add the following to your project's CMakeLists.txt
:
Windows developers can use the Visual C++ compiler, edition 2015 or later.
Compiling with the MinGW toolchain or inside the MSYS2 environment will work also.
Linux devs can use gcc (version 4.9 and up) or clang (version 3.8 and up).
Default | ||
---|---|---|
-DMOREINTTYPES_BUILD_TESTS=OFF|ON | build and run unit tests | ON |
-DMOREINTTYPES_BUILD_EXAMPLES=OFF|ON | build sample programs | OFF |
-DMOREINTTYPES_BUILD_STATIC=OFF|ON | build a static library | OFF |
-DMOREINTTYPES_ENABLE_UBSAN=OFF|ON | enable the Undefined Behavior Sanitizer (GCC,Clang only) | OFF |
-DMOREINTTYPES_RUN_DEMO=OFF|ON | run a sample program immediately after the build (requires MOREINTTYPES_BUILD_EXAMPLES ) | OFF |
-DMOREINTTYPES_CHECK_WITH_VALGRIND=OFF|ON | run a memory leak check with valgrind, if installed | OFF |
Replaced by... | |
---|---|
-DBUILD_STATIC=OFF|ON | -DMOREINTTYPES_BUILD_STATIC |
-DENABLE_UBSAN=OFF|ON | -DMOREINTTYPES_ENABLE_UBSAN |
-DRUN_DEMO=OFF|ON | -DMOREINTTYPES_RUN_DEMO |
-DWITH_VALGRIND=OFF|ON | -DMOREINTTYPES_CHECK_WITH_VALGRIND |
The build steps are the same for all environments, with one exception:
cd libmoreinttypes-1.8.0
mkdir cmake-build && cd cmake-build
cmake ..
, or (to use a certain makefile generator) cmake .. -G"<name_of_generator>"
Note It's better to run cmake .. -G"NMake Makefiles"
when using the Visual C++ compiler. This will prevent cmake
from choosing a Visual Studio Generator by default.
make
or, if using MinGW:
mingw32-make
or, if using nmake:
nmake
As the admin user, run:
make install
or
mingw32-make install
or
nmake install
To build the the documentation and serve it at localhost:8000
, enter the doxygen
directory and run:
./gendocs
or, on Windows,
.\gendocs
Note Make sure doxygen and python are installed and visible to your system's PATH
.
This project took inspiration from the following sources:
Copyright (c) 2020 Robert Di Pardo and Contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.