git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35145 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
 #define wxKERNCHECK(arg, msg) wxFORCECHECK_MSG(arg != KERN_SUCCESS, msg)
 #define wxSCHECK(arg, msg) wxFORCECHECK_MSG(arg != S_OK, msg)
 
 #define wxKERNCHECK(arg, msg) wxFORCECHECK_MSG(arg != KERN_SUCCESS, msg)
 #define wxSCHECK(arg, msg) wxFORCECHECK_MSG(arg != S_OK, msg)
 
-#ifdef __WXDEBUG___
-#    define wxVERIFY(arg)    wxASSERT(arg)
-#else
-#    define wxVERIFY(arg)    arg
-#endif
-
 /*
 void CFShowTypeIDDescription(CFTypeRef pData)
 {
 /*
 void CFShowTypeIDDescription(CFTypeRef pData)
 {
     //Dictionary that will hold first
     //the matching dictionary for determining which kind of devices we want,
     //then later some registry properties from an iterator (see below)
     //Dictionary that will hold first
     //the matching dictionary for determining which kind of devices we want,
     //then later some registry properties from an iterator (see below)
-    CFMutableDictionaryRef pDictionary;
-
-    //Create a dictionary
     //The call to IOServiceMatching filters down the
     //the services we want to hid services (and also eats the
     //dictionary up for us (consumes one reference))
     //The call to IOServiceMatching filters down the
     //the services we want to hid services (and also eats the
     //dictionary up for us (consumes one reference))
-    wxVERIFY((pDictionary = IOServiceMatching(kIOHIDDeviceKey)) != NULL );
+    CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey);
+    wxCHECK_MSG( pDictionary, false,
+                    _T("IOServiceMatching(kIOHIDDeviceKey) failed") );
+
+    wxASSERT( pDictionary );
 
     //Here we'll filter down the services to what we want
     if (nType != -1)
 
     //Here we'll filter down the services to what we want
     if (nType != -1)
         if(--nDev != 0)
             continue;
 
         if(--nDev != 0)
             continue;
 
-        wxVERIFY(IORegistryEntryCreateCFProperties(pObject, &pDictionary,
-                                            kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS);
+        if ( IORegistryEntryCreateCFProperties
+             (
+                pObject,
+                &pDictionary,
+                kCFAllocatorDefault,
+                kNilOptions
+             ) != KERN_SUCCESS )
+        {
+            wxLogDebug(_T("IORegistryEntryCreateCFProperties failed"));
+        }
 
         //Just for sanity :)
         wxASSERT(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID());
 
         //Just for sanity :)
         wxASSERT(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID());
         (*ppPlugin)->Release(ppPlugin);
 
         //open the HID interface...
         (*ppPlugin)->Release(ppPlugin);
 
         //open the HID interface...
-        wxVERIFY((*m_ppDevice)->open(m_ppDevice, 0) == S_OK);
+        if ( (*m_ppDevice)->open(m_ppDevice, 0) != S_OK )
+            wxLogDebug(_T("HID device: open failed"));
 
         //
         //Now the hard part - in order to scan things we need "cookies" -
 
         //
         //Now the hard part - in order to scan things we need "cookies" -
     //Dictionary that will hold first
     //the matching dictionary for determining which kind of devices we want,
     //then later some registry properties from an iterator (see below)
     //Dictionary that will hold first
     //the matching dictionary for determining which kind of devices we want,
     //then later some registry properties from an iterator (see below)
-    CFMutableDictionaryRef pDictionary;
-
-    //Create a dictionary
-    //The call to IOServiceMatching filters down the
-    //the services we want to hid services (and also eats the
-    //dictionary up for us (consumes one reference))
-    wxVERIFY((pDictionary = IOServiceMatching(kIOHIDDeviceKey)) != NULL );
+    CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey);
+    wxCHECK_MSG( pDictionary, 0,
+                    _T("IOServiceMatching(kIOHIDDeviceKey) failed") );
 
     //Here we'll filter down the services to what we want
     if (nType != -1)
 
     //Here we'll filter down the services to what we want
     if (nType != -1)
     io_iterator_t pIterator;
     wxIOCHECK(IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator), "No Matching HID Services");
 
     io_iterator_t pIterator;
     wxIOCHECK(IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator), "No Matching HID Services");
 
         return 0;
 
     //Now we iterate through them
         return 0;
 
     //Now we iterate through them
 
 void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, int i)
 {
 
 void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, int i)
 {
+    //3rd Param flags (none yet)
-    wxVERIFY((*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) == S_OK);//3rd Param flags (none yet)
+    if ( (*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) != S_OK )
+        wxLogDebug(_T("HID device: adding element failed"));
 }
 
 void wxHIDDevice::InitCookies(size_t dwSize, bool bQueue)
 }
 
 void wxHIDDevice::InitCookies(size_t dwSize, bool bQueue)
     if (bQueue)
     {
         wxASSERT( m_ppQueue == NULL);
     if (bQueue)
     {
         wxASSERT( m_ppQueue == NULL);
-        wxVERIFY(  (m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice)) != NULL);
-        wxVERIFY(  (*m_ppQueue)->create(m_ppQueue, 0, 512) == S_OK); //Param 2, flags, none yet
+        m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice);
+        if ( !m_ppQueue )
+        {
+            wxLogDebug(_T("HID device: allocQueue failed"));
+            return;
+        }
+
+        //Param 2, flags, none yet
+        if ( (*m_ppQueue)->create(m_ppQueue, 0, 512) != S_OK )
+        {
+            wxLogDebug(_T("HID device: create failed"));
+        }