yun93us / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

Compile errors on OSX #115

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build on OSX
2. Observe

What is the expected output? What do you see instead?
  Proper build, instead; errors

What version of the product are you using? On what operating system?
  latest (of Jan 3, 2012) on OSX 10.6.8

Please provide any additional information below.
  Fixed via the following:  (Compiles OK; Enumerates OK)

diff -r c0a850c1cb85 src/qextserialport.h
--- a/src/qextserialport.h Fri Nov 18 10:22:35 2011 +0800
+++ b/src/qextserialport.h Tue Jan 03 14:40:35 2012 -0500
@@ -34,6 +34,10 @@
#include <QtCore/QIODevice>
#include "qextserialport_global.h"

+#ifdef Q_OS_UNIX
+  #include <termios.h>
+#endif
+
/*line status constants*/
// ### QESP2.0 move to enum
#define LS_CTS  0x01
diff -r c0a850c1cb85 src/qextserialenumerator_osx.cpp
--- a/src/qextserialenumerator_osx.cpp Fri Nov 18 10:22:35 2011 +0800
+++ b/src/qextserialenumerator_osx.cpp Tue Jan 03 14:40:35 2012 -0500
@@ -174,12 +174,10 @@
}

// IOKit callbacks registered via setupNotifications()
-void deviceDiscoveredCallbackOSX( void *ctxt, io_iterator_t serialPortIterator 
);
-void deviceTerminatedCallbackOSX( void *ctxt, io_iterator_t serialPortIterator 
);

void deviceDiscoveredCallbackOSX( void *ctxt, io_iterator_t serialPortIterator )
{
-    QextSerialEnumerator* qese = (QextSerialEnumerator*)ctxt;
+    QextSerialEnumeratorPrivate* qese = (QextSerialEnumeratorPrivate*)ctxt;
    io_object_t serialService;
    while ((serialService = IOIteratorNext(serialPortIterator)))
        qese->onDeviceDiscoveredOSX(serialService);
@@ -187,7 +185,7 @@

void deviceTerminatedCallbackOSX( void *ctxt, io_iterator_t serialPortIterator )
{
-    QextSerialEnumerator* qese = (QextSerialEnumerator*)ctxt;
+    QextSerialEnumeratorPrivate* qese = (QextSerialEnumeratorPrivate*)ctxt;
    io_object_t serialService;
    while ((serialService = IOIteratorNext(serialPortIterator)))
        qese->onDeviceTerminatedOSX(serialService);

Original issue reported on code.google.com by kevin.m...@gmail.com on 3 Jan 2012 at 8:43

GoogleCodeExporter commented 8 years ago
The additional include of termios.h is specifically due to the need of having 
B76800 defined to correctly enum BaudRateType on OSX (and linux?)

Original comment by kevin.m...@gmail.com on 3 Jan 2012 at 8:46

GoogleCodeExporter commented 8 years ago
Apologies, this error was with the dbzhang800-qextserialport clone.  I'll 
re-post this issue in the correct location.

Original comment by kevin.m...@gmail.com on 4 Jan 2012 at 4:30

GoogleCodeExporter commented 8 years ago
Thanks

Original comment by dbzhang...@gmail.com on 16 Mar 2012 at 8:12