I'm a little uneasy about changes to the API of the shared object/DLL. I will investigate #890 during the release process. So I have a plan to identify this if it's an issue. I think it's OK.
```
703 rmills@rmillsmm-local:~/gnu/github/exiv2/bmff/build $ nm --demangle lib/libexiv2.dylib | grep base64
00000000000384a0 T Exiv2::base64decode(char const*, char*, unsigned long)
0000000000038340 T Exiv2::base64encode(void const*, unsigned long, char*, unsigned long)
00000000001c33a0 s Exiv2::base64_encode
704 rmills@rmillsmm-local:~/gnu/github/exiv2/bmff/build $ nm -g --demangle lib/libexiv2.dylib | grep base64
00000000000384a0 T Exiv2::base64decode(char const*, char*, unsigned long)
0000000000038340 T Exiv2::base64encode(void const*, unsigned long, char*, unsigned long)
705 rmills@rmillsmm-local:~/gnu/github/exiv2/bmff/build $
```
Only GNU libc has implementation of the GNU variant of strerror_r, so
also for __GLIBC__ to determine which strerror_r implemenation to use.
This fixes build with musl libc, which makes some, but not all, GNU
extensions available with _GNU_SOURCE.
While taking an EnVar as the parameter is more clear it has the
disadvantage, that passing anything outside of the range of the
enumeration is undefined behavior. The compiler could then optimize
the range check in getEnv away (perfectly legal due to UB), leading
to buffer overreads.
V803 Decreased performance. In case 'userEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 405
V803 Decreased performance. In case 'authEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 410
V803 Decreased performance. In case 'hostEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 428
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 711
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 841
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 958
V803 Decreased performance. In case 'i' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 855
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. jpgimage.cpp 817
V803 Decreased performance. In case 'lib' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 508
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 563
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. xmpsidecar.cpp 138
- Define STRERROR_R_CHAR_P properly on CMake and use it on futils.cpp
- We use now _GNU_SOURCE to determine which version of strerror_r to use
- strError only throws if ret==ERANGE
- Remove STRERROR_R_CHAR_P. It has been never used
- sort defines in config.h.cmake
- Remove EXV_HAVE_DECL_STRERROR_R that is not used anymore
- Remove EXV_HAVE_STRERROR. C++98 always will have it
This change define explicitly the behavior that exiv2::getEnv should have
on response to unexpected inputs.
There are some other minor changes:
- Use _putenv_s for the unit tests on Windows
- Add todo comment
- Remove deprecated note about freeing memory
Image::read/writeMetadata and ImageFactory::open now throw Error in case of failure. Applications therefore now need an exception handler for the error handling of such function calls. This should result in shorter and simpler application code.