From a1f38054c7eb48b03a55d1559190637238d88fe1 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 11 Sep 2014 08:28:51 -0500 Subject: MTP: Build flag for setting custom MTP device/path Change-Id: Ic19ec61dc6cb08df00eb1326d96262b46bb93bfb --- mtp/mtp_MtpServer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mtp/mtp_MtpServer.cpp') diff --git a/mtp/mtp_MtpServer.cpp b/mtp/mtp_MtpServer.cpp index af80f6826..9df564ffc 100755 --- a/mtp/mtp_MtpServer.cpp +++ b/mtp/mtp_MtpServer.cpp @@ -47,11 +47,13 @@ void twmtp_MtpServer::set_storages(storages* mtpstorages) { int twmtp_MtpServer::setup() { - #define USB_MTP_DEVICE "/dev/mtp_usb" usePtp = false; MyMtpDatabase* mtpdb = new MyMtpDatabase(); #ifdef USB_MTP_DEVICE - int fd = open(USB_MTP_DEVICE, O_RDWR); +#define STRINGIFY(x) #x +#define EXPAND(x) STRINGIFY(x) + MTPI("Using '%s' for MTP device.\n", EXPAND(USB_MTP_DEVICE)); + int fd = open(EXPAND(USB_MTP_DEVICE), O_RDWR); #else int fd = open("/dev/mtp_usb", O_RDWR); #endif -- cgit v1.2.3