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 /camlibs/polaroid | |
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 'camlibs/polaroid')
-rw-r--r-- | camlibs/polaroid/pdc320.h | 2 | ||||
-rw-r--r-- | camlibs/polaroid/pdc640.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/camlibs/polaroid/pdc320.h b/camlibs/polaroid/pdc320.h index 6208dc8f5..8a4bd5018 100644 --- a/camlibs/polaroid/pdc320.h +++ b/camlibs/polaroid/pdc320.h @@ -1,7 +1,7 @@ #ifndef CAMLIBS_POLAROID_PDC320_H #define CAMLIBS_POLAROID_PDC320_H -#include <jpeg.h> +#include <libgphoto2/jpeg.h> static const jpeg_quantization_table chrominance = { 3, 2, 2, 3, 5, 8, 10, 12, diff --git a/camlibs/polaroid/pdc640.c b/camlibs/polaroid/pdc640.c index 64924f4d8..64a1ad017 100644 --- a/camlibs/polaroid/pdc640.c +++ b/camlibs/polaroid/pdc640.c @@ -26,7 +26,7 @@ #include <gphoto2/gphoto2-library.h> #include <gphoto2/gphoto2-port-log.h> -#include <bayer.h> +#include <libgphoto2/bayer.h> #include "jd350e.h" #include "dlink350f.h" |