bugAVR Downloader/UploaDEr - Bugs: bug #48134, ft245r.c : dispatch/dispatch.h: No...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #48134: ft245r.c : dispatch/dispatch.h: No such file or directory

Submitter:  None
Submitted:  Sun 05 Jun 2016 08:17:51 AM UTC
Votes: 10
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Phillip Stevens
Originator Email:  -email is unavailable- Open/Closed:  Open
Release:  None Programmer hardware: 
Device type: 

Thu 09 Jun 2016 08:40:20 AM UTC, comment #2: 

Joerg,

I've prepared the diff as requested, and attached it to this bug.

Confirmed to work on OSX 10.4 Tiger.
avrdude 6.3
MacPorts 2.3.4
OSX10.4.11

I can't confirm it on later >10.6 OSX versions.

Pasted below, because it is short and helps traceability.

Cheers, Phillip

--- ft245r_original.c   2016-06-09 18:12:42.000000000 +1000
+++ ft245r.c    2016-06-09 18:27:39.000000000 +1000
@@ -123,14 +123,21 @@
 #include <pthread.h>
 
 #ifdef _APPLE_
-/* Mac OS X defines sem_init but actually does not implement them */
-#include <dispatch/dispatch.h>
+#include <AvailabilityMacros.h> /* since OS X 10.2 */
+#if(MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
 
+/* Mac OS X defines sem_init but actually does not implement them */
+#include <dispatch/dispatch.h> /* since OSX 10.6 */
 typedef dispatch_semaphore_t   sem_t;
 
 #define sem_init(psem,x,val)   *psem = dispatch_semaphore_create(val)
 #define sem_post(psem)         dispatch_semaphore_signal(*psem)
 #define sem_wait(psem)         dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)
+
+#else
+#include <sys/semaphore.h> /* since OSX 10.2 through OSX 10.5 */
+#endif
+
 #else
 #include <semaphore.h>
 #endif

(file #37438)

Phillip Stevens <feilipu>
Sun 05 Jun 2016 02:41:30 PM UTC, comment #1: 

I'd welcome if you provide the diff output as a so-called
"context diff" (diff -u).  That makes it a lot easier to
follow it.  Make sure to specify the original file first,
and the modified file second.

Can you provide a pointer to OSX documentation about these
functions?  I'm not familar with OSX.

Joerg Wunsch <joerg_wunsch>
Group administrator
Sun 05 Jun 2016 08:17:51 AM UTC, original submission:  

When compiling 6.3 on Mac OSX 10.4.11 with MacPorts the build fails because the dispatch.h file does not exist.

dispatch/dispatch.h was added with Grand Central in 10.6, I understand.

This bug was originally reported here
https://trac.macports.org/ticket/44717

And I reported the same thing here
https://trac.macports.org/ticket/51566

Tested that the fix suggested works on
avrdude 6.3
MacPorts 2.3.4
OSX10.4.11

Proposed resolution, in ft245r.c :

< #include <sys/semaphore.h>
---

> /* Mac OS X defines sem_init but actually does not implement them */
> #include <dispatch/dispatch.h>
>
> typedef dispatch_semaphore_t  sem_t;
>
> #define sem_init(psem,x,val)  *psem = dispatch_semaphore_create(val)
> #define sem_post(psem)                dispatch_semaphore_signal(*psem)
> #define sem_wait(psem)                dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #37438:  ft245r.c.diff added by feilipu (865B - application/octet-stream)
file #37395:  ancient_os_x.patch added by hramrach1 (553B - text/x-patch - patch presumably fixing the issue. untested.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by feilipu (Voted in favor of this item)
  • -email is unavailable- added by feilipu (Updated the item)
  • -email is unavailable- added by hramrach1 (Updated the item)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 10 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-21 feilipu Carbon-Copy- Added feilipu
    2016-06-09 feilipu Attached File- Added ft245r.c.diff, #37438
    2016-06-05 hramrach1 Attached File- Added ancient_os_x.patch, #37395

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code