-
Notifications
You must be signed in to change notification settings - Fork 2.3k
openscenegraph: allow building with other jpeg implementations, fix c++17 msvc build, bump deps #18783
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
Closed
Closed
openscenegraph: allow building with other jpeg implementations, fix c++17 msvc build, bump deps #18783
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab61b84
fix
maksim-petukhou 0e66bca
Merge branch 'master' into fix-osg
maksim-petukhou eb186ac
Merge branch 'master' into fix-osg
maksim-petukhou 15e0eb2
Merge branch 'master' into fix-osg
maksim-petukhou 03aa872
Apply suggestions from code review
maksim-petukhou f2e36c7
review
maksim-petukhou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp | ||
| index 5c699c8b0..5c097cf66 100644 | ||
| --- a/src/osg/DisplaySettings.cpp | ||
| +++ b/src/osg/DisplaySettings.cpp | ||
| @@ -22,9 +22,6 @@ | ||
| #include <algorithm> | ||
| #include <string.h> | ||
|
|
||
| -using namespace osg; | ||
| -using namespace std; | ||
| - | ||
| #if defined(WIN32) && !defined(__CYGWIN__) | ||
| #include<windows.h> | ||
| extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } | ||
| @@ -32,6 +29,9 @@ extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } | ||
| extern "C" { int NvOptimusEnablement=0x00000001; } | ||
| #endif | ||
|
|
||
| +using namespace osg; | ||
| +using namespace std; | ||
| + | ||
| void DisplaySettings::setNvOptimusEnablement(int value) | ||
| { | ||
| NvOptimusEnablement = value; | ||
| diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp | ||
| index 263c82896..4247cc2af 100644 | ||
| --- a/src/osgPlugins/cfg/ConfigParser.cpp | ||
| +++ b/src/osgPlugins/cfg/ConfigParser.cpp | ||
| @@ -235,7 +235,7 @@ | ||
| #include "CameraConfig.h" | ||
|
|
||
|
|
||
| -using namespace std; | ||
| + | ||
| using namespace osgProducer; | ||
|
|
||
| static void ConfigParser_error( const char * ); | ||
| diff --git a/src/osgPlugins/cfg/ConfigParser.y b/src/osgPlugins/cfg/ConfigParser.y | ||
| index cf9adf507..5221be184 100644 | ||
| --- a/src/osgPlugins/cfg/ConfigParser.y | ||
| +++ b/src/osgPlugins/cfg/ConfigParser.y | ||
| @@ -34,7 +34,7 @@ | ||
| #include <Producer/CameraConfig> | ||
|
|
||
|
|
||
| -using namespace std; | ||
| + | ||
| using namespace Producer; | ||
|
|
||
| static void ConfigParser_error( const char * ); |
13 changes: 13 additions & 0 deletions
13
recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| diff --git a/src/osgUtil/tristripper/include/detail/graph_array.h b/src/osgUtil/tristripper/include/detail/graph_array.h | ||
| index dc1f38027..ce7000cc8 100644 | ||
| --- a/src/osgUtil/tristripper/include/detail/graph_array.h | ||
| +++ b/src/osgUtil/tristripper/include/detail/graph_array.h | ||
| @@ -446,7 +446,7 @@ inline void graph_array<N>::swap(graph_type & Right) | ||
| template <class N> | ||
| inline void unmark_nodes(graph_array<N> & G) | ||
| { | ||
| - std::for_each(G.begin(), G.end(), std::mem_fun_ref(&graph_array<N>::node::unmark)); | ||
| + for(typename graph_array<N>::node_iterator itr = G.begin(); itr != G.end(); ++itr) itr->unmark(); | ||
| } | ||
|
|
||
|
|
75 changes: 75 additions & 0 deletions
75
recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp | ||
| index fc1a448d4..3b883f19a 100644 | ||
| --- a/src/osgPlugins/dae/ReaderWriterDAE.cpp | ||
| +++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp | ||
| @@ -32,7 +32,7 @@ | ||
|
|
||
| #define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex) | ||
|
|
||
| -#if __cplusplus > 199711L | ||
| +#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) | ||
| #define smart_ptr std::unique_ptr | ||
| #else | ||
| #define smart_ptr std::auto_ptr | ||
| diff --git a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp | ||
| index 69826c456..9bba5532a 100644 | ||
| --- a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp | ||
| +++ b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp | ||
| @@ -10,6 +10,11 @@ | ||
|
|
||
| #define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10 | ||
|
|
||
| +#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) | ||
| + #define smart_ptr std::unique_ptr | ||
| +#else | ||
| + #define smart_ptr std::auto_ptr | ||
| +#endif | ||
|
|
||
| namespace osgFFmpeg { | ||
|
|
||
| @@ -23,8 +28,8 @@ FFmpegImageStream::FFmpegImageStream() : | ||
| { | ||
| setOrigin(osg::Image::TOP_LEFT); | ||
|
|
||
| - std::auto_ptr<FFmpegDecoder> decoder(new FFmpegDecoder); | ||
| - std::auto_ptr<CommandQueue> commands(new CommandQueue); | ||
| + smart_ptr<FFmpegDecoder> decoder(new FFmpegDecoder); | ||
| + smart_ptr<CommandQueue> commands(new CommandQueue); | ||
|
|
||
| m_decoder = decoder.release(); | ||
| m_commands = commands.release(); | ||
| diff --git a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp | ||
| index 298e02fcc..113c9c45f 100644 | ||
| --- a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp | ||
| +++ b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp | ||
| @@ -34,6 +34,12 @@ | ||
|
|
||
| #define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex) | ||
|
|
||
| +#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) | ||
| + #define smart_ptr std::unique_ptr | ||
| +#else | ||
| + #define smart_ptr std::auto_ptr | ||
| +#endif | ||
| + | ||
| // From easyrgb.com | ||
| float Hue_2_RGB( float v1, float v2, float vH ) | ||
| { | ||
| @@ -123,7 +129,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter | ||
|
|
||
| initGDAL(); | ||
|
|
||
| - std::auto_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); | ||
| + smart_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); | ||
| if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; | ||
|
|
||
| int dataWidth = dataset->GetRasterXSize(); | ||
| @@ -577,7 +583,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter | ||
|
|
||
| initGDAL(); | ||
|
|
||
| - std::auto_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); | ||
| + smart_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); | ||
| if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; | ||
|
|
||
| int dataWidth = dataset->GetRasterXSize(); |
24 changes: 24 additions & 0 deletions
24
recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| diff --git a/src/osgPlugins/obj/obj.cpp b/src/osgPlugins/obj/obj.cpp | ||
| index 859add652..3580e5181 100644 | ||
| --- a/src/osgPlugins/obj/obj.cpp | ||
| +++ b/src/osgPlugins/obj/obj.cpp | ||
| @@ -37,10 +37,15 @@ using namespace obj; | ||
|
|
||
| static std::string strip( const std::string& ss ) | ||
| { | ||
| - std::string result; | ||
| - result.assign( std::find_if( ss.begin(), ss.end(), std::not1( std::ptr_fun< int, int >( isspace ) ) ), | ||
| - std::find_if( ss.rbegin(), ss.rend(), std::not1( std::ptr_fun< int, int >( isspace ) ) ).base() ); | ||
| - return( result ); | ||
| + std::string::const_iterator it = ss.begin(); | ||
| + while (it != ss.end() && isspace(*it)) | ||
| + it++; | ||
| + | ||
| + std::string::const_reverse_iterator rit = ss.rbegin(); | ||
| + while (rit.base() != it && isspace(*rit)) | ||
| + rit++; | ||
| + | ||
| + return std::string(it, rit.base()); | ||
| } | ||
|
|
||
| /* |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please, add
patch_descriptionfor each one of these new patches.https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields