object-introspection/oi
Jake Hillion 67739840fe add portability.h (#386)
Summary:

Spin around our open/closed source checks. Previously we defined `OSS_ENABLE` in open source builds. This change defines `OI_META_INTERNAL` instead. This is nicer, as external users don't have to do anything special to get a working build.

Use this new macro to define a boolean constant in a new header `Portability.h`. This is inspired by Folly, and makes the internal build easier - definitions in Buck2 have to propagate up from a dependency instead of down from one. Annoyingly we can't use `if constexpr` for a lot of the previous `#ifdef` blocks as we conditionally include the headers. Longer term we could fix this by exposing a header interface but no source, allowing these to build but not be compiled in. For now I did something weird: I defined a function style macro in `Portability.h` based on the compile time macro. This forces you to have included `Portability.h` before using it to ensure the definition is everywhere. Open to feedback as I haven't seen anyone else do this.

Reviewed By: tyroguru

Differential Revision: D50000454
2023-10-24 03:03:16 -07:00
..
exporters capture_keys: include data in type path 2023-10-11 16:32:35 -07:00
support tomlplusplus: compile header once 2023-05-30 16:43:10 +02:00
type_graph Remove Primitive::Kind::Incomplete 2023-10-04 11:23:28 -06:00
types/test move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
CMakeLists.txt containers: add required features (#374) 2023-10-09 17:50:39 -04:00
CodeGen.cpp tbv2: fix exclusive size of elements in containers 2023-10-16 19:18:42 +01:00
CodeGen.h CodeGen: Store list of ContainerInfos in unique_ptrs for reference stability 2023-09-22 17:10:56 +01:00
Config.cpp support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
Config.h support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
ContainerInfo.cpp containers: add required features (#374) 2023-10-09 17:50:39 -04:00
ContainerInfo.h containers: add required features (#374) 2023-10-09 17:50:39 -04:00
ContainerTypeEnum.h Implement Container V2 for std::unordered_multiset 2023-08-30 18:45:00 +02:00
Descs.cpp move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
Descs.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
DrgnUtils.cpp ensure oi_name is never a nullptr (#165) 2023-06-12 16:47:34 -07:00
DrgnUtils.h DrgnUtils: Add isSizeComplete and underlyingType helper functions 2023-05-24 15:57:18 +01:00
EnumBitset.h containers: add required features (#374) 2023-10-09 17:50:39 -04:00
Features.cpp oil v2 2023-08-23 15:59:53 +01:00
Features.h oil v2 2023-08-23 15:59:53 +01:00
FuncGen.cpp jit logging: fix for codegen v1 2023-09-26 18:41:27 -07:00
FuncGen.h jit logging: fix for codegen v1 2023-09-26 18:41:27 -07:00
Headers.h Compile Time OIL for OIL v2 2023-08-30 04:28:02 -07:00
IntrospectionResult.cpp capture_keys: include data in type path 2023-10-11 16:32:35 -07:00
Metrics.cpp move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
Metrics.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OICache.cpp add portability.h (#386) 2023-10-24 03:03:16 -07:00
OICache.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OICodeGen.cpp jit logging: fix for codegen v1 2023-09-26 18:41:27 -07:00
OICodeGen.h OIUtils: Parse "capture_keys" section from configs 2023-09-28 19:42:49 -07:00
OICompiler.cpp Update to clang/llvm 15 (#342) 2023-09-14 06:02:32 -07:00
OICompiler.h Update to clang/llvm 15 (#342) 2023-09-14 06:02:32 -07:00
OID.cpp add portability.h (#386) 2023-10-24 03:03:16 -07:00
OIDebugger.cpp add portability.h (#386) 2023-10-24 03:03:16 -07:00
OIDebugger.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OIGenerator.cpp oilgen: accept multiple config files (#379) 2023-10-11 16:25:13 -07:00
OIGenerator.h oilgen: accept multiple config files (#379) 2023-10-11 16:25:13 -07:00
OILexer.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OILexer.l move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OILibrary.cpp oil v2 2023-08-23 15:59:53 +01:00
OILibraryImpl.cpp support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
OILibraryImpl.h oil v2 2023-08-23 15:59:53 +01:00
OIOpts.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
OIParser.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
OIParser.yy move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OITraceCode.cpp Implement Container V2 for fbstring 2023-09-27 18:16:36 -07:00
PaddingHunter.cpp Add missing cstdint include 2023-09-22 10:59:23 +01:00
PaddingHunter.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
Portability.h add portability.h (#386) 2023-10-24 03:03:16 -07:00
Serialize.cpp move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
Serialize.h clean up common.h 2023-06-09 13:15:17 +02:00
SymbolService.cpp oil v2 2023-08-23 15:59:53 +01:00
SymbolService.h oil v2 2023-08-23 15:59:53 +01:00
Syscall.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
TimeUtils.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
TrapInfo.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
TreeBuilder.cpp Implement Container V2 for std::unordered_multiset 2023-08-30 18:45:00 +02:00
TreeBuilder.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
TypeHierarchy.h clean up common.h 2023-06-09 13:15:17 +02:00
X86InstDefs.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00