@@ -49,8 +49,8 @@ static pthread_attr_t hook_thread_attr;
4949extern Boolean AXIsProcessTrustedWithOptions (CFDictionaryRef options ) __attribute__((weak_import ));
5050extern CFStringRef kAXTrustedCheckOptionPrompt __attribute__((weak_import ));
5151#else
52- typedef Boolean (* AXIsProcessTrustedWithOptions_t )(CFDictionaryRef options );
53- typedef Boolean (* AXAPIEnabled_t )(void );
52+ Boolean (* AXIsProcessTrustedWithOptions_t )(CFDictionaryRef );
53+ Boolean (* AXAPIEnabled_t )(void );
5454#endif
5555
5656static void * hook_thread_proc (void * arg ) {
@@ -87,11 +87,11 @@ static void *hook_thread_proc(void *arg) {
8787 dlError = dlerror ();
8888 if (libApplicaitonServices != NULL && dlError == NULL ) {
8989 // Check for the new function AXIsProcessTrustedWithOptions().
90- AXIsProcessTrustedWithOptions_t fpAXIsProcessTrustedWithOptions = ( AXIsProcessTrustedWithOptions_t ) dlsym (libApplicaitonServices , "AXIsProcessTrustedWithOptions" );
90+ * ( void * * ) ( & AXIsProcessTrustedWithOptions_t ) = dlsym (libApplicaitonServices , "AXIsProcessTrustedWithOptions" );
9191 dlError = dlerror ();
92- if (fpAXIsProcessTrustedWithOptions != NULL && dlError == NULL ) {
92+ if (AXIsProcessTrustedWithOptions_t != NULL && dlError == NULL ) {
9393 // New accessibility API 10.9 and later.
94- const void * keys [] = { kAXTrustedCheckOptionPrompt };
94+ const void * keys [] = { dlsym ( libApplicaitonServices , " kAXTrustedCheckOptionPrompt" ) };
9595 const void * values [] = { kCFBooleanTrue };
9696
9797 CFDictionaryRef options = CFDictionaryCreate (
@@ -102,18 +102,18 @@ static void *hook_thread_proc(void *arg) {
102102 & kCFCopyStringDictionaryKeyCallBacks ,
103103 & kCFTypeDictionaryValueCallBacks );
104104
105- accessibilityEnabled = (* fpAXIsProcessTrustedWithOptions )(options );
105+ accessibilityEnabled = (* AXIsProcessTrustedWithOptions_t )(options );
106106 }
107107 else {
108108 logger (LOG_LEVEL_DEBUG , "%s [%u]: Failed to locate AXIsProcessTrustedWithOptions(). (%s)\n" ,
109109 __FUNCTION__ , __LINE__ , dlError );
110110
111111 // Check for the fallback function AXAPIEnabled().
112- AXAPIEnabled_t fpAXAPIEnabled = ( AXAPIEnabled_t ) dlsym (libApplicaitonServices , "AXAPIEnabled" );
112+ * ( void * * ) ( & AXAPIEnabled_t ) = dlsym (libApplicaitonServices , "AXAPIEnabled" );
113113 dlError = dlerror ();
114- if (fpAXAPIEnabled != NULL && dlError == NULL ) {
114+ if (AXAPIEnabled_t != NULL && dlError == NULL ) {
115115 // Old accessibility check 10.8 and older.
116- accessibilityEnabled = (* fpAXAPIEnabled )();
116+ accessibilityEnabled = (* AXAPIEnabled_t )();
117117 }
118118 else {
119119 // Could not load the AXAPIEnabled function!
0 commit comments