Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for arm #137

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion virtualization_12_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr

void *newVZMacOSInstaller(void *virtualMachine, void *vmQueue, const char *restoreImageFilePath);
void *newProgressObserverVZMacOSInstaller();
void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, void *completionHandler, void *fractionCompletedHandler);
void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, uintptr_t completionHandler, uintptr_t fractionCompletedHandler);
void cancelInstallVZMacOSInstaller(void *installerPtr);

#endif
6 changes: 3 additions & 3 deletions virtualization_12_arm64.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
{
if ([keyPath isEqualToString:@"fractionCompleted"] && [object isKindOfClass:[NSProgress class]]) {
NSProgress *progress = (NSProgress *)object;
macOSInstallFractionCompletedHandler(context, progress.fractionCompleted);
macOSInstallFractionCompletedHandler((uintptr_t)context, progress.fractionCompleted);
if (progress.finished) {
[progress removeObserver:self forKeyPath:@"fractionCompleted"];
}
Expand Down Expand Up @@ -423,7 +423,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr
return [[ProgressObserver alloc] init];
}

void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, void *completionHandler, void *fractionCompletedHandler)
void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, uintptr_t completionHandler, uintptr_t fractionCompletedHandler)
{
if (@available(macOS 12, *)) {
VZMacOSInstaller *installer = (VZMacOSInstaller *)installerPtr;
Expand All @@ -435,7 +435,7 @@ void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progress
addObserver:(ProgressObserver *)progressObserverPtr
forKeyPath:@"fractionCompleted"
options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew
context:fractionCompletedHandler];
context:(void*)fractionCompletedHandler];
});
return;
}
Expand Down