#103 Patch for Win32 16 bit PIC

closed-fixed
None
5
2008-05-18
2008-05-16
No

The get_line function in file pic16/device.c is not working right in windows. Without any changes it is having an endless loop in SDCC. This patch changes the open to Binary Read instead of Text Read. It needs tested under Linux and Mac, but the code looks like it should have been binary read for all platforms.

Tim Stahlhut

Index: sdcc/src/pic16/device.c

--- sdcc/src/pic16/device.c (revision 5157)
+++ sdcc/src/pic16/device.c (working copy)
@@ -550,7 +550,7 @@
SNPRINTF(&buffer[0], PATH_MAX, "%s%s%s",
path, DIR_SEPARATOR_STRING, DEVICE_FILE_NAME);
//printf("%s: checking %s\n", __func__, &buffer[0]);
- f = fopen(&buffer[0], "r");
+ f = fopen(&buffer[0], "rb");
} // for
} // while
} // if

Discussion

  • Borut Ražem

    Borut Ražem - 2008-05-17
    • assigned_to: nobody --> borutr
     
  • Borut Ražem

    Borut Ražem - 2008-05-18

    Logged In: YES
    user_id=568035
    Originator: NO

    Fixed in a different way in svn revision #5158.

    Borut

     
  • Tim Stahlhut

    Tim Stahlhut - 2008-05-18

    Logged In: YES
    user_id=662788
    Originator: YES

    Your patch fixed the problem, I just downloaded the Windows Snapshot and it worked.
    Thanks, Tim S

     
  • Borut Ražem

    Borut Ražem - 2008-05-18
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks