aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@gmail.com>2018-11-14 08:21:38 -0800
committerGravatar GitHub <noreply@github.com>2018-11-14 08:21:38 -0800
commit87ad6f4676b9d2b53e32913ad584647d924422f7 (patch)
tree15731dd53d0bf63d643e66a7798830160d24c234
parent8d3e7a3f41c9d0b73d91ea98b2515f87cc36ced1 (diff)
Add deprecation markings on GTMServiceManagement. (#207)
Apple has deprecated ServiceManagment as of macOS 10.10 and iOS 8.0.
-rw-r--r--Foundation/GTMServiceManagement.c6
-rw-r--r--Foundation/GTMServiceManagement.h14
-rw-r--r--Foundation/GTMServiceManagementTest.m6
-rw-r--r--Foundation/GTMServiceManagementTestingHarness.c6
4 files changed, 25 insertions, 7 deletions
diff --git a/Foundation/GTMServiceManagement.c b/Foundation/GTMServiceManagement.c
index a57bc2a..de660f7 100644
--- a/Foundation/GTMServiceManagement.c
+++ b/Foundation/GTMServiceManagement.c
@@ -49,6 +49,10 @@
#include <sys/sysctl.h>
#endif
+#pragma clang diagnostic push
+// Ignore all of the deprecation warnings for GTMServiceManagement
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
typedef struct {
CFMutableDictionaryRef dict;
bool convert_non_standard_objects;
@@ -787,4 +791,6 @@ CFDictionaryRef GTMSMCopyAllJobDictionaries(void) {
return dict;
}
+#pragma clang diagnostic pop
+
#endif // if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
diff --git a/Foundation/GTMServiceManagement.h b/Foundation/GTMServiceManagement.h
index aea0cbf..e2b998e 100644
--- a/Foundation/GTMServiceManagement.h
+++ b/Foundation/GTMServiceManagement.h
@@ -33,32 +33,32 @@ GTM_EXTERN_C_BEGIN
// This reimplements some of the ServiceManagement framework on 10.5.
// Caller takes ownership of error if necessary.
-Boolean GTMSMJobSubmit(CFDictionaryRef job, CFErrorRef *error);
-Boolean GTMSMJobRemove(CFStringRef jobLabel, CFErrorRef *error);
+Boolean GTMSMJobSubmit(CFDictionaryRef job, CFErrorRef *error) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
+Boolean GTMSMJobRemove(CFStringRef jobLabel, CFErrorRef *error) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
// Caller takes ownership of the returned type.
// Note that the dictionary returned will have 0 for machports.
// To get a machport, use bootstrap_look_up, or NSMachBootstrapServer.
-CFDictionaryRef GTMSMJobCopyDictionary(CFStringRef jobLabel);
+CFDictionaryRef GTMSMJobCopyDictionary(CFStringRef jobLabel) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
// This one is conspiciously absent from the ServiceManagement framework.
// Performs a check-in for the running process and returns its dictionary with
// the appropriate sockets and machports filled in.
// Caller takes ownership of the returned type.
-CFDictionaryRef GTMSMCopyJobCheckInDictionary(CFErrorRef *error);
+CFDictionaryRef GTMSMCopyJobCheckInDictionary(CFErrorRef *error) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
// The official ServiceManagement version returns an array of job dictionaries.
// This returns a dictionary of job dictionaries where the key is the label
// of the job, and the value is the dictionary for the job of that label.
// Caller takes ownership of the returned type.
-CFDictionaryRef GTMSMCopyAllJobDictionaries(void);
+CFDictionaryRef GTMSMCopyAllJobDictionaries(void) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
// Convert a CFType (and any of it's subitems) into a launch_data_t.
// Caller takes ownership of the returned type if it isn't added to a launch
// data container type.
launch_data_t GTMLaunchDataCreateFromCFType(CFTypeRef cf_type_ref,
- CFErrorRef *error);
+ CFErrorRef *error) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
// Convert a launch_data_t (and any of it's subitems) into a CFType.
// If |convert_non_standard_objects| is true, file descriptors and machports
@@ -66,7 +66,7 @@ launch_data_t GTMLaunchDataCreateFromCFType(CFTypeRef cf_type_ref,
// Caller is takes ownership of the returned type.
CFTypeRef GTMCFTypeCreateFromLaunchData(launch_data_t ldata,
bool convert_non_standard_objects,
- CFErrorRef *error);
+ CFErrorRef *error) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_6, __MAC_10_10, __IPHONE_3_0, __IPHONE_8_0, "Replace with XPC.");
GTM_EXTERN_C_END
diff --git a/Foundation/GTMServiceManagementTest.m b/Foundation/GTMServiceManagementTest.m
index 79881f3..80d3f3c 100644
--- a/Foundation/GTMServiceManagementTest.m
+++ b/Foundation/GTMServiceManagementTest.m
@@ -33,6 +33,10 @@ static NSString const *kGTMSocketKey
static NSString const *kGTMSocketName
= @"GTMServiceManagementTesting";
+#pragma clang diagnostic push
+// Ignore all of the deprecation warnings for GTMServiceManagement
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
@interface GTMServiceManagementTest : GTMTestCase
@end
@@ -215,4 +219,6 @@ static NSString const *kGTMSocketName
@end
+#pragma clang diagnostic pop
+
#endif // if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
diff --git a/Foundation/GTMServiceManagementTestingHarness.c b/Foundation/GTMServiceManagementTestingHarness.c
index bb86071..0f5cc3a 100644
--- a/Foundation/GTMServiceManagementTestingHarness.c
+++ b/Foundation/GTMServiceManagementTestingHarness.c
@@ -18,6 +18,10 @@
#include "GTMServiceManagement.h"
+#pragma clang diagnostic push
+// Ignore all of the deprecation warnings for GTMServiceManagement
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
int main(int argc, const char** argv) {
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
CFErrorRef error = NULL;
@@ -30,3 +34,5 @@ int main(int argc, const char** argv) {
#endif // if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
return 0;
}
+
+#pragma clang diagnostic pop