AcademySoftwareFoundation / AcademySoftwareFoundation/openexr

weak namespace and include guards

Open
#636 4 comments 0 reactions 0 assignees View on GitHub
good first issue help wanted
Dominant language
C
Stars
1.8k
Forks
700
Avg merge
3d 12h
Merged PRs (30d)
29

Description

Currently the OpenEXR Half Float implementation uses less expressive include guard `_HALF_H_`; makeing a slight modification ie: `OPENEXR_HALF_H` would allow better integration with other distantly related software packages such as [H5CPP](h5cpp.org) a general persistence library for modern C++.
```
#ifndef _HALF_H_
#define _HALF_H_
...
#endif
```
And a possible more descriptive, safer alternative:
```
#ifndef OPENEXR_HALF_H
#define OPENEXR_HALF_H
...
#endif
```
The suggested change would allow automatic detection of the Float16 header inclusion, providing a better experience to some of your users.

In addition the the include guards, the `class half { ... }` appears without namespace enclosure; would it be possible to place the class (or the better, all of them) within a namespace?
example:
```cpp
namespace oexr {
....
}
```
**Background:**
In this [HDF5 mailing list post](https://forum.hdfgroup.org/t/half-precision-floating-point-format-h5cpp-c/6532/5?u=steven) Dr Werner Benger suggested to add OpenEXR/Float16 support to HDF5 C++ or H5CPP. Currently this support has been added with explicit configuration option `-DWITH_OPENEXR_HALF`

best wishes:
steven

Contributor guide

Open the contributing guide

Research direction

Start by locating the OpenEXR Half Float implementation and its `_HALF_H_` include guard, then inspect the `class half` declaration and related declarations for existing users. Done means the guard is safely descriptive and the requested class or related declarations are consistently namespaced without breaking integration with H5CPP or other consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.