From 54b4246bb2025a5dcfdf1611c199998448d28424 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Thu, 19 Mar 2015 12:04:54 -0700 Subject: Fix link error of PROCESS_STATE_NONEXISTENT. * A reference to PROCESS_STATE_NONEXISTENT will cause link error with clang or standard C++ compiler because there is no out-of-class definition, although g++ is allowing it. Use +PROCESS_STATE_NONEXISTENT to get the value instead of reference. Change-Id: I62049584b94e6847b64b572f6ef6c3e9dcc573eb --- services/camera/libcameraservice/CameraService.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 574165b..55f7a40 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -884,7 +884,11 @@ status_t CameraService::handleEvictionsLocked(const String8& cameraId, int clien std::vector ownerPids(mActiveClientManager.getAllOwners()); ownerPids.push_back(clientPid); - std::vector priorities(ownerPids.size(), PROCESS_STATE_NONEXISTENT); + // Use the value +PROCESS_STATE_NONEXISTENT, to avoid taking + // address of PROCESS_STATE_NONEXISTENT as a reference argument + // for the vector constructor. PROCESS_STATE_NONEXISTENT does + // not have an out-of-class definition. + std::vector priorities(ownerPids.size(), +PROCESS_STATE_NONEXISTENT); // Get priorites of all active PIDs ProcessInfoService::getProcessStatesFromPids(ownerPids.size(), &ownerPids[0], -- cgit v1.1