Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
bctoolbox
Commits
66d6ddff
Commit
66d6ddff
authored
2 years ago
by
Simon Morlat
Browse files
Options
Download
Patches
Plain Diff
Fix crash with tunnel on iOS 16
parent
223d5276
release/5.1
5.1.72
5.1.71
5.1.67
1 merge request
!201
Fix crash with tunnel on iOS 16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/bctoolbox/ios_utils.hh
+1
-1
include/bctoolbox/ios_utils.hh
src/CMakeLists.txt
+5
-1
src/CMakeLists.txt
src/utils/ios_utils.mm
+17
-0
src/utils/ios_utils.mm
with
23 additions
and
2 deletions
include/bctoolbox/ios_utils.hh
+
1
−
1
View file @
66d6ddff
...
...
@@ -19,7 +19,6 @@
#pragma once
#include
<memory>
#include
<functional>
namespace
bctoolbox
{
...
...
@@ -39,6 +38,7 @@ public:
void
endBackgroundTask
(
unsigned
long
id
);
bool
isApplicationStateActive
();
bool
isApp
();
int
getOSMajorVersion
()
const
;
static
IOSUtils
&
getUtils
();
IOSUtils
(
const
IOSUtils
&
)
=
delete
;
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
5
−
1
View file @
66d6ddff
...
...
@@ -139,7 +139,11 @@ if(ENABLE_SHARED)
)
endif
()
if
(
APPLE
)
target_link_libraries
(
bctoolbox PRIVATE
"-framework Foundation"
"-framework AVFoundation"
)
if
(
IOS
)
target_link_libraries
(
bctoolbox PRIVATE
"-framework UIKit"
"-framework Foundation"
"-framework AVFoundation"
)
else
()
target_link_libraries
(
bctoolbox PRIVATE
"-framework Foundation"
"-framework AVFoundation"
)
endif
()
target_include_directories
(
bctoolbox SYSTEM PRIVATE
${
ICONV_INCLUDE_DIRS
}
)
target_link_libraries
(
bctoolbox PRIVATE
${
ICONV_LIBRARIES
}
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
src/utils/ios_utils.mm
+
17
−
0
View file @
66d6ddff
...
...
@@ -19,6 +19,8 @@
#ifdef __APPLE__
#include
<TargetConditionals.h>
#import <Foundation/Foundation.h>
#include
<dlfcn.h>
...
...
@@ -27,6 +29,11 @@
#include
"bctoolbox/logging.h"
#include
"ios_utils_stub.hh"
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#endif
namespace
bctoolbox
{
std
::
unique_ptr
<
IOSUtils
>
IOSUtils
::
sInstance
=
nullptr
;
...
...
@@ -104,6 +111,16 @@ bool IOSUtils::isApplicationStateActive() {
return
mUtils
->
isApplicationStateActive
();
}
int
IOSUtils
::
getOSMajorVersion
()
const
{
#if TARGET_OS_IPHONE
NSArray
*
versionCompatibility
=
[[
UIDevice
currentDevice
].
systemVersion
componentsSeparatedByString
:
@"."
];
return
[[
versionCompatibility
objectAtIndex
:
0
]
intValue
];
#else
bctbx_error
(
"IOSUtils::getOSMajorVersion() not running on iOS"
);
return
0
;
#endif
}
unsigned
long
IOSUtilsStub
::
beginBackgroundTask
(
const
char
*
name
,
std
::
function
<
void
()
>
cb
)
{
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets