Skip to content

Commit

Permalink
Allow redundant defines in define aliases
Browse files Browse the repository at this point in the history
A bit ugly, but this seems necessary in order to allow defines that seem
reasonable to provide together, such as -DLFS_NO_LOG and -DLFS_NO_DEBUG.

This is useful for allowing define combinations that also work in older
builds.
  • Loading branch information
geky committed Jan 28, 2025
1 parent 30d9143 commit 6fb9211
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lfs_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,38 @@

// LFS_BIGGEST enables all opt-in features
#ifdef LFS_BIGGEST
#ifndef LFS_CKPROGS
#define LFS_CKPROGS
#endif
#ifndef LFS_CKFETCHES
#define LFS_CKFETCHES
#endif
#ifndef LFS_CKPARITY
#define LFS_CKPARITY
#endif
#ifndef LFS_CKDATACKSUMS
#define LFS_CKDATACKSUMS
#endif
#ifndef LFS_GC
#define LFS_GC
#endif
#endif

// LFS_NO_LOG disables all logging macros
#ifdef LFS_NO_LOG
#ifndef LFS_NO_DEBUG
#define LFS_NO_DEBUG
#endif
#ifndef LFS_NO_INFO
#define LFS_NO_INFO
#endif
#ifndef LFS_NO_WARN
#define LFS_NO_WARN
#endif
#ifndef LFS_NO_ERROR
#define LFS_NO_ERROR
#endif
#endif


// System includes
Expand Down

0 comments on commit 6fb9211

Please sign in to comment.