OSDN Git Service

Linux build fix
authorJakub Pawlowski <jpawlowski@google.com>
Tue, 18 Oct 2016 16:56:29 +0000 (09:56 -0700)
committerJakub Pawlowski <jpawlowski@google.com>
Tue, 18 Oct 2016 17:42:18 +0000 (10:42 -0700)
Test: compile using ninja

btcore/src/hal_util.cc
stack/a2dp/a2dp_sbc_encoder.cc

index c2bf880..0480be5 100644 (file)
@@ -40,6 +40,8 @@ static const char kBluetoothLibraryName[] = "libbluetooth.default.so";
 
 static int load_bt_library(const struct hw_module_t **module) {
   const char *id = BT_STACK_MODULE_ID;
+  const char *sym = HAL_MODULE_INFO_SYM_AS_STR;
+  struct hw_module_t *hmi = nullptr;
 
   // Always try to load the default Bluetooth stack on GN builds.
   void *handle = dlopen(kBluetoothLibraryName, RTLD_NOW);
@@ -50,8 +52,7 @@ static int load_bt_library(const struct hw_module_t **module) {
   }
 
   // Get the address of the struct hal_module_info.
-  const char *sym = HAL_MODULE_INFO_SYM_AS_STR;
-  struct hw_module_t *hmi = (struct hw_module_t *)dlsym(handle, sym);
+  hmi = (struct hw_module_t *)dlsym(handle, sym);
   if (!hmi) {
     HULOGERR("%s", sym);
     goto error;
index f1c3708..cab0d60 100644 (file)
@@ -22,6 +22,7 @@
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "a2dp_api.h"
 #include "a2dp_sbc.h"