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

Submitted by:  None
Submitted on:  Sun 05 Jun 2016 08:17:51 AM UTC  
Votes:  10  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: Phillip Stevens
Originator Email: -unavailable-Open/Closed: Open
Release: NoneProgrammer 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>
Project 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

 

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
  • -unavailable- added by feilipu (Voted in favor of this item)
  • -unavailable- added by feilipu (Updated the item)
  • -unavailable- added by hramrach1 (Updated the item)
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 10 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Jun 2016 12:52:53 PM UTCfeilipuCarbon-Copy-=>Added feilipu
    Thu 09 Jun 2016 08:40:20 AM UTCfeilipuAttached File-=>Added ft245r.c.diff, #37438
    Sun 05 Jun 2016 05:11:13 PM UTChramrach1Attached File-=>Added ancient_os_x.patch, #37395

    Back to the top


    Powered by Savane 3.1-cleanup1