Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Define to place all CRC++ code within the ::CRCPP namespace. Not defined by defa
* `#define CRCPP_BRANCHLESS`<br>
Define to enable a branchless CRC implementation. The branchless implementation uses a single integer multiplication in the bit-by-bit calculation instead of a small conditional. The branchless implementation may be faster on processor architectures which support single-instruction integer multiplication. Not defined by default.
* `#define CRCPP_USE_CPP11`
Define to enables C++11 features (move semantics, constexpr, static_assert, etc.). Not defined by default.
Define to enables C++11 features (move semantics, constexpr, static_assert, etc.). Enabled by default when a C++11 compiler is detected (`__cplusplus >= 201103L`).
* `#define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS`
Define to include definitions for little-used CRCs. Not defined by default.

Expand Down
16 changes: 10 additions & 6 deletions inc/CRC.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
@file CRC.h
@author Daniel Bahr
@version 1.2.0.0
@version 1.2.1.0
@copyright
@parblock
CRC++
Copyright (c) 2022, Daniel Bahr
Copyright (c) 2022-2025, Daniel Bahr
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -58,6 +58,10 @@
#ifndef CRCPP_CRC_H_
#define CRCPP_CRC_H_

#if __cplusplus >= 201103L && !defined(CRCPP_USE_CPP11)
#define CRCPP_USE_CPP11
#endif

#include <climits> // Includes CHAR_BIT
#ifdef CRCPP_USE_CPP11
#include <cstddef> // Includes ::std::size_t
Expand Down Expand Up @@ -141,15 +145,15 @@ namespace CRCPP
#ifdef CRCPP_USE_CPP11
crcpp_constexpr int CRCPP_MAJOR_VERSION = 1;
crcpp_constexpr int CRCPP_MINOR_VERSION = 2;
crcpp_constexpr int CRCPP_PATCH_VERSION = 0;
crcpp_constexpr int CRCPP_PATCH_VERSION = 1;
crcpp_constexpr int CRCPP_REVISION_VERSION = 0;
crcpp_constexpr char CRCPP_COPYRIGHT[] = "Copyright (c) 2022, Daniel Bahr";
crcpp_constexpr char CRCPP_COPYRIGHT[] = "Copyright (c) 2022-2025, Daniel Bahr";
#else
#define CRCPP_MAJOR_VERSION 1
#define CRCPP_MINOR_VERSION 2
#define CRCPP_PATCH_VERSION 0
#define CRCPP_PATCH_VERSION 1
#define CRCPP_REVISION_VERSION 0
#define CRCPP_COPYRIGHT "Copyright (c) 2022, Daniel Bahr"
#define CRCPP_COPYRIGHT "Copyright (c) 2022-2025, Daniel Bahr"
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion test/prj/gcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $(TARGET): $(OBJ_FILES)
$(MKDIR) -p $(BINDIR)
$(LINKER) $(LDFLAGS) -o $@ $^

$(OUTDIR)/%.o: $(SRCDIR)/%.cpp
$(OUTDIR)/%.o: $(SRCDIR)/%.cpp $(INCDIR)/CRC.h
$(CXX) $(CXXFLAGS) -c -o $@ $<

$(OUTDIR):
Expand Down
4 changes: 2 additions & 2 deletions test/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
@file main.cpp
@author Daniel Bahr
@version 1.2.0.0
@version 1.2.1.0
@copyright
@parblock
CRC++
Copyright (c) 2022, Daniel Bahr
Copyright (c) 2022-2025, Daniel Bahr
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down