[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] [patch #7184] Support for PICKit2 programmer
From: |
Ivan Shmakov |
Subject: |
Re: [avrdude-dev] [patch #7184] Support for PICKit2 programmer |
Date: |
Mon, 03 Dec 2012 00:27:16 +0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
>>>>> Kirill Levchenko <address@hidden> writes:
> Does not compile without USB support because the necessary headers
> are not included for the dummy pickit2_initpgm and
> pickit2_nousb_open.
> Attached patch fixes it by moving #if after the includes.
FWIW, I can confirm this issue. A slightly more verbose patch
would be to move only the necessary #include's above the #if
(that'd be my personal preference), or, alternatively, to
duplicate these #include's below the respective #else, like:
--- pickit2.c.~1~ 2012-12-02 08:20:59.859669319 +0000
+++ pickit2.c
@@ -1338,7 +1338,14 @@
strncpy(pgm->type, "pickit2", sizeof(pgm->type));
}
#else
+#include <stdio.h> /* for fprintf () */
+#include <stdlib.h> /* for exit () */
+#include <string.h> /* for strncpy () */
+
+#include "avrdude.h" /* for progname */
+#include "pgm.h" /* for PROGRAMMER */
+
static int pickit2_nousb_open (struct programmer_t *pgm, char * name) {
fprintf(stderr,
#ifdef WIN32NATIVE
"%s: error: no usb or hid support. Please compile again with
libusb or HID support from Win32 DDK installed.\n",
[…]
--
FSF associate member #7257