diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-10-07 01:03:42 +0200 |
---|---|---|
committer | Marcus Meissner <meissner@suse.de> | 2021-10-11 09:20:50 +0200 |
commit | 767ee8bad421f7317718a1c6f138fb32d8432a7c (patch) | |
tree | ed207bdcbdea3ff25d405559034838121022d6e8 /libgphoto2/gamma.c | |
parent | 6e2779554662e37a1e53570e590c818ad99a96d9 (diff) | |
download | libgphoto2-767ee8bad421f7317718a1c6f138fb32d8432a7c.tar.gz |
Avoid accidental include file name collisions
There are five libgphoto2 internal *.h include files inside the
source tree's `libgphoto2/` folder. Internal means they are part
of the libgphoto2 implementation, and are not part of the public
libgphoto2 API or ABI. These files have names which are so
generic that it is difficult to see from a `#include` statement
that the included file is actually part of libgphoto2:
bayer-types.h
bayer.h
exif.h
gamma.h
jpeg.h
While building, an additional file is created inside the `libgphoto2/`
folder with a name which does hint to its relationship with libgphoto2:
gphoto2-endian.h
To reduce the probability of accidental conflicts with include files
which might also be called the same very generic name, this changes
the use of these include files to a preprocessor directive like
#include "libgphoto2/bayer.h>
instead of
#include "bayer.h"
To enforce the need for the "libgphoto2/" part in the #include
preprocessor directive, this also removes the respective `-I`
arguments for the `libgphoto2` subdir (both in source tree and in
build tree) from `*_CPPFLAGS`.
This change was inspired by `libgphoto2/` and `camlibs/stv0680/`
containing very different include files both called `bayer.h`.
Diffstat (limited to 'libgphoto2/gamma.c')
-rw-r--r-- | libgphoto2/gamma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgphoto2/gamma.c b/libgphoto2/gamma.c index c4a970ffe..ea571455b 100644 --- a/libgphoto2/gamma.c +++ b/libgphoto2/gamma.c @@ -22,7 +22,7 @@ */ #include "config.h" -#include "gamma.h" +#include "libgphoto2/gamma.h" #include <math.h> |