Skip to content

Instantly share code, notes, and snippets.

View ronald112's full-sized avatar
🎱
struggling with code

ronald112

🎱
struggling with code
View GitHub Profile
@ronald112
ronald112 / CharByteFlag.h
Last active November 8, 2020 11:57
CharByteFlag
#pragma once
#define SET_BIT(value, bit_num) \
((1 << bit_num) | value)
#define CLEAR_BIT(value, bit_num) \
(~(1 << bit_num) & value)
#define CHECK_BIT(value, bit_num) \
(value & (1 << bit_num)) ? true : false
@ronald112
ronald112 / CMakeLists.txt
Created September 18, 2020 10:41
CMAKE MACRO and function to include all directories recursively
# MACRO to add all directories in result
MACRO(SUBDIRLIST result firstdir curdir)
file(GLOB ENDF6_SRC_TOP RELATIVE
${curdir} ${curdir}/*)
file(GLOB_RECURSE ENDF6_SRC_NESTED ${curdir}/*)
set(children ${ENDF6_SRC_TOP} ${ENDF6_SRC_NESTED})
SET(dirlist "${firstdir}")
FOREACH(child ${children})
IF(IS_DIRECTORY ${curdir}/${child})