-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix c++11 0.27 #1194
Fix c++11 0.27 #1194
Changes from 7 commits
759ce9f
d994161
4da0a57
63a13e8
cd5c3e4
e0f65f7
65dde52
c423b91
3ebfee1
b22d1de
7928c63
0a06dc9
4060298
da91f04
f1182b8
9b3f47f
f775676
cd9ee99
9b6b403
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,7 @@ $ | |
#### geotag | ||
|
||
``` | ||
Usage: geotag {-help|-version|-dst|-dryrun|-ascii|-verbose|-adjust value|-tz value|-delta value}+ path+ | ||
Usage: geotag {-help|-version|-dst|-dryrun|-ascii|-remove|-verbose|-adjust value|-tz value|-delta value}+ path+ | ||
``` | ||
|
||
Geotag reads one or more GPX files and adds GPS Tages to images. _Code: [geotag.cpp](samples/geotag.cpp)_ | ||
|
@@ -208,6 +208,7 @@ If the path is a directory, geotag will read all the files in the directory. It | |
| -dst | Apply 1 hour adjustment for daylight saving time. | | ||
| -dryrun | Read arguments and print report. Does not modify images. | | ||
| -verbose | Report progress. | | ||
| -remove | Removes GPS tags from images. | | ||
| -adjust value | Add/subtract time from image data. | | ||
| -tz value | Specify time zone. For example PST = -8:00 | | ||
| -delta value | Correction between Image DataTime and GPS time. | | ||
|
@@ -643,4 +644,4 @@ Read an XMP packet from a file, parse and re-serialize it. | |
|
||
Robin Mills<br> | ||
[email protected]<br> | ||
Revised: 2019-06-20 | ||
Revised: 2020-05-01 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
14. [Thread Safety](#2-14) | ||
15. [Library Initialisation and Cleanup](#2-15) | ||
16. [Cross Platform Build and Test on Linux for MinGW](#2-16) | ||
17. [Building with C++11 and other compilers](#2-17) | ||
3. [License and Support](#3) | ||
1. [License](#3-1) | ||
2. [Support](#3-2) | ||
|
@@ -696,6 +697,24 @@ You will find that 3 tests fail at the end of the test suite. It is safe to ign | |
|
||
[TOC](#TOC) | ||
|
||
<div id="2-17"> | ||
|
||
### 2.17 Building with C++11 and other compilers | ||
|
||
Exiv2 uses the default compiler for your system. Exiv2 v0.27 was written to the C++ 1998 standard and will compile with C++11 and C++14. As auto_ptr support is no longer in C++17, you cannot build with that system. Exiv2 v0.28 and later do not use auto_ptr and are fully supported with all compilers. | ||
|
||
To generate a build with C++11: | ||
|
||
```bash | ||
$ cd <exiv2dir> | ||
$ mkdir build ; cd build | ||
$ cmake .. -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_FLAGS=-Wno-deprecated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! This is exactly how it should be used. I did not think about it before. |
||
``` | ||
|
||
The option -DCMAKE\_CXX\_FLAGS=-Wno-deprecated suppresses warnings from C++11 concerning auto_ptr which is deprecated. | ||
|
||
[TOC](#TOC) | ||
|
||
<div id="3"> | ||
|
||
## 3 License and Support | ||
|
@@ -1167,4 +1186,4 @@ $ sudo pkg install developer/gcc-7 | |
|
||
[TOC](#TOC) | ||
|
||
Written by Robin Mills<br>[email protected]<br>Updated: 2020-04-21 | ||
Written by Robin Mills<br>[email protected]<br>Updated: 2020-05-02 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,5 +93,15 @@ typedef int pid_t; | |
#endif | ||
////////////////////////////////////// | ||
|
||
// https://softwareengineering.stackexchange.com/questions/291141/how-to-handle-design-changes-for-auto-ptr-deprecation-in-c11 | ||
#include <memory> | ||
#if __cplusplus >= 201103L | ||
#include <sys/types.h> | ||
#include <unistd.h> | ||
template <typename T> | ||
using auto_ptr = std::unique_ptr<T>; | ||
#else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a clever trick, I did not think about that. I think you can remove lines 103 & 104 from here. We do not need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't remember what |
||
using std::auto_ptr; | ||
#endif | ||
|
||
#endif // _CONFIG_H_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,10 +91,6 @@ generate_export_header(exiv2lib | |
STATIC_DEFINE exiv2lib_STATIC | ||
) | ||
|
||
target_compile_features(exiv2lib_int PRIVATE cxx_std_98) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some other usages of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've got rid of all the |
||
target_compile_features(exiv2lib PRIVATE cxx_std_98) | ||
|
||
|
||
# Conditional addition of sources to library targets | ||
# --------------------------------------------------------- | ||
|
||
|
@@ -256,7 +252,6 @@ if(EXIV2_BUILD_EXIV2_COMMAND) | |
getopt.cpp getopt.hpp | ||
utils.cpp utils.hpp | ||
) | ||
target_compile_features(exiv2 PRIVATE cxx_std_98) | ||
|
||
set_target_properties( exiv2 PROPERTIES | ||
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace here the last part of the sentence: "supported with all compilers".
We should say that we require a C++ compiler with support for the C++11 standard.