c-logger: changes to allow compilation on embedded platforms#10
Open
nicola-lunghi wants to merge 2 commits into
Open
c-logger: changes to allow compilation on embedded platforms#10nicola-lunghi wants to merge 2 commits into
nicola-lunghi wants to merge 2 commits into
Conversation
…nhancement ## Build System & CMake Modernization - Modernize CMake build system with proper structure and dependencies - Add WARNINGS_AS_ERRORS option for strict compilation - Reorganize CMakeLists.txt with options at top - Update CMake minimum version to 3.5 - Use GNUInstallDirs for cross-platform install paths - Improve build configuration with default type and enhanced flags - Add all source files to track dependencies properly ## Platform Abstraction & Cross-Platform Support - Implement comprehensive platform abstraction layer - Create logger_platform.h/c for platform-specific functions - Add platform abstractions for threading, file operations, and system calls - Implement cross-platform compatibility using HAVE_* defines - Add support for alternate platform implementations - Rename autogenerated config file from config.h to platform_config.h - Add platform abstraction for error reporting to solve chicken-egg problem ## Compiler & Code Quality Improvements - Migrate to C99 standard and enable C++ style comments - Resolve compiler warnings across entire codebase - Add _GNU_SOURCE define to enable GNU extensions - Fix sign comparison and truncation warnings - Fix strncat bound warnings with proper space calculation - Update examples and tests to resolve compilation warnings ## Cross-Platform Testing Infrastructure - Add comprehensive cross-platform testing infrastructure - Create advanced testing scripts for multiple platforms - Add platform customization instructions and documentation - Fix cross-platform testing infrastructure issues - Update test scripts to use build- prefix for directories - Add CMake cache cleanup to prevent conflicts - Resolve header include path issues in test builds ## Documentation & Examples - Add comprehensive multi-platform testing documentation - Add platform customization instructions to README - Update examples with proper error handling - Maintain 100% test success rate across all platforms ## Files Changed - 26 files modified with 1,390 insertions and 147 deletions - All tests pass with 100% success rate - Maintains backward compatibility while adding new features
- Add GitHub Actions workflow to replace Travis CI
* Tests on both GCC and Clang compilers
* Runs build.sh debug, make, make test
* Includes cross-platform compatibility tests
* Triggers on push/PR to main/master/develop branches
- Fix CMake time.h detection in PlatformChecks.cmake
* Add check_include_file(time.h HAVE_TIME_H)
* Update config.h.in template with HAVE_TIME_H define
- Add conditional time.h include in logger.c
* Prevents implicit function declaration errors
* Enables proper fallback when time.h is not available
- Improve error handling in all bash scripts
* Add 'set -euf -o pipefail' to build.sh, advanced-tests.sh,
test-missing-headers.sh, and glog-install.sh
* Change shebang from /bin/sh to /bin/bash where needed
* Ensures scripts fail fast on any error
- Verified all tests pass (5/5) and cross-platform tests work
- All examples run correctly with proper timestamp functionality
Author
|
Hi @yksz is this repo dead? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main idea here is to allow building the library on an embedded platform that doesn't have all the features that a normal system has like pthread.
here we allow to have a custom implementation of system functions