Skip to content

Commit

Permalink
[ogre] Fix function override problem in macos system. (microsoft#31106)
Browse files Browse the repository at this point in the history
* fix osx override error

* update version

* optimized syntax

* update version

* fix function

* update version
  • Loading branch information
jimwang118 authored May 2, 2023
1 parent 3edf135 commit bc2c3ee
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 7 deletions.
33 changes: 33 additions & 0 deletions ports/ogre/fix_override.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/PlugIns/EXRCodec/src/O_IStream.cpp b/PlugIns/EXRCodec/src/O_IStream.cpp
index 6f668d5..eba9ac7 100644
--- a/PlugIns/EXRCodec/src/O_IStream.cpp
+++ b/PlugIns/EXRCodec/src/O_IStream.cpp
@@ -39,11 +39,11 @@ bool O_IStream::read(char c[], int n) {
return _stream.eof();
}

-Int64 O_IStream::tellg() {
+uint64_t O_IStream::tellg() {
return _stream.getCurrentPtr() - _stream.getPtr();
}

-void O_IStream::seekg(Int64 pos) {
+void O_IStream::seekg(uint64_t pos) {
_stream.seek(pos);
}

diff --git a/PlugIns/EXRCodec/src/O_IStream.h b/PlugIns/EXRCodec/src/O_IStream.h
index 8eb09d8..dc301ae 100644
--- a/PlugIns/EXRCodec/src/O_IStream.h
+++ b/PlugIns/EXRCodec/src/O_IStream.h
@@ -46,8 +46,8 @@ public:
IStream (file_name), _stream(stream) {}

bool read (char c[], int n) override;
- Imf::Int64 tellg () override;
- void seekg (Imf::Int64 pos) override;
+ virtual uint64_t tellg () override;
+ virtual void seekg (uint64_t pos) override;
void clear () override;

private:
10 changes: 5 additions & 5 deletions ports/ogre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ if(VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_EMSCRIPTEN)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

set(PATCHLIB fix-dependencies.patch cfg-rel-paths.patch swig-python-polyfill.patch pkgconfig.patch same-install-rules-all-platforms.patch)
if(VCPKG_TARGET_IS_OSX)
list(APPEND PATCHLIB fix_override.patch) # upstream PR:https://github.com/OGRECave/ogre/pull/2831
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OGRECave/ogre
REF "v${VERSION}"
SHA512 d4022a454e0649a01182545f24094ba1f72127099a9b096e1b438238659629e93b1d79277d02acc0aceebdc3969aab0031de7f86390077bafc66ccfd86755430
HEAD_REF master
PATCHES
fix-dependencies.patch
cfg-rel-paths.patch
swig-python-polyfill.patch
pkgconfig.patch
same-install-rules-all-platforms.patch
${PATCHLIB}
)

file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake")
Expand Down
2 changes: 1 addition & 1 deletion ports/ogre/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ogre",
"version": "13.6.2",
"port-version": 1,
"port-version": 2,
"description": "3D Object-Oriented Graphics Rendering Engine",
"homepage": "https://github.com/OGRECave/ogre",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5726,7 +5726,7 @@
},
"ogre": {
"baseline": "13.6.2",
"port-version": 1
"port-version": 2
},
"ogre-next": {
"baseline": "2.3.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/ogre.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9a0701fa116eca04bd8a2446f6e44c732084857b",
"version": "13.6.2",
"port-version": 2
},
{
"git-tree": "b7ec525c0cd854d1da91a5a11cd05109693b9333",
"version": "13.6.2",
Expand Down

0 comments on commit bc2c3ee

Please sign in to comment.