Make qt_mac_ensureResponsible QT_BUILD_INTERNAL and Q_AUTOTEST_EXPORT

Its primary purpose was to be used by permission auto tests, so to
avoid App Store compatibility issues we disable it in non-dev builds.

Task-number: QTBUG-107167
Change-Id: Iaacec807808cfe52df0cf850b287e50da1bd59e5
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tor Arne Vestbø 2022-10-10 13:06:51 +02:00 committed by Assam Boudjelthia
parent 7502e57ca8
commit dd40306968
2 changed files with 7 additions and 1 deletions

View File

@ -35,11 +35,13 @@ extern "C" {
typedef uint32_t csr_config_t;
extern int csr_get_active_config(csr_config_t *) __attribute__((weak_import));
#ifdef QT_BUILD_INTERNAL
int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim)
__attribute__((availability(macos,introduced=10.14),weak_import));
pid_t responsibility_get_pid_responsible_for_pid(pid_t) __attribute__((weak_import));
char *** _NSGetArgv();
extern char **environ;
#endif
}
#endif
@ -384,6 +386,7 @@ std::optional<uint32_t> qt_mac_sipConfiguration()
return; \
}
#ifdef QT_BUILD_INTERNAL
void qt_mac_ensureResponsible()
{
#if !defined(QT_APPLE_NO_PRIVATE_APIS)
@ -421,6 +424,7 @@ void qt_mac_ensureResponsible()
posix_spawnattr_destroy(&attr);
#endif
}
#endif // QT_BUILD_INTERNAL
#endif

View File

@ -184,7 +184,9 @@ private:
Q_CORE_EXPORT bool qt_mac_applicationIsInDarkMode();
Q_CORE_EXPORT bool qt_mac_runningUnderRosetta();
Q_CORE_EXPORT std::optional<uint32_t> qt_mac_sipConfiguration();
Q_CORE_EXPORT void qt_mac_ensureResponsible();
#ifdef QT_BUILD_INTERNAL
Q_AUTOTEST_EXPORT void qt_mac_ensureResponsible();
#endif
#endif
#ifndef QT_NO_DEBUG_STREAM