More fixes for Solaris, including fixes for the Sunpro compiler:

* avr.h: Remove stray semicolon.
* configure.ac: Add check for predefined types uint_t and ulong_t.
* confwin.c: Include "avrdude.h" on top to avoid empty translation
unit warning.
* ppwin.c: (Ditto.)
* ser_win32.c: (Ditto.)
* serbb_win32.c: (Ditto.)
* jtagmkII.c (jtagmkII_recv): remove unreachable "return".
* stk500.c (stk500_initialize): (Ditto.)
* par.c: Test for both, __sun__ and __sun to see whether we are
being compiled on Solaris.
* ppi.c: (Ditto.)
* stk500v2.c: Implement the DEBUG and DEBUGRECV macros in a way
that is compatible with the ISO C99 standard.
* usbtiny.c: Only typedef uint_t and ulong_t if they have not
been found already by the autoconf checks.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@804 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2009-02-23 22:04:57 +00:00
parent 8c2fa9933c
commit 8b35dc3620
13 changed files with 44 additions and 12 deletions

View File

@ -1,3 +1,23 @@
2009-02-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
More fixes for Solaris, including fixes for the Sunpro compiler:
* avr.h: Remove stray semicolon.
* configure.ac: Add check for predefined types uint_t and ulong_t.
* confwin.c: Include "avrdude.h" on top to avoid empty translation
unit warning.
* ppwin.c: (Ditto.)
* ser_win32.c: (Ditto.)
* serbb_win32.c: (Ditto.)
* jtagmkII.c (jtagmkII_recv): remove unreachable "return".
* stk500.c (stk500_initialize): (Ditto.)
* par.c: Test for both, __sun__ and __sun to see whether we are
being compiled on Solaris.
* ppi.c: (Ditto.)
* stk500v2.c: Implement the DEBUG and DEBUGRECV macros in a way
that is compatible with the ISO C99 standard.
* usbtiny.c: Only typedef uint_t and ulong_t if they have not
been found already by the autoconf checks.
2009-02-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2009-02-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #22204: Solaris10/11 Undefiniertes Symbol gethostbyname socket bug #22204: Solaris10/11 Undefiniertes Symbol gethostbyname socket

2
avr.h
View File

@ -61,7 +61,7 @@ int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size);
int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles); int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles);
int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles);; int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles);
int avr_mem_hiaddr(AVRMEM * mem); int avr_mem_hiaddr(AVRMEM * mem);

View File

@ -118,6 +118,13 @@ fi
LIBS="${SAVED_LIBS}" LIBS="${SAVED_LIBS}"
AC_SUBST(LIBHID, $LIBHID) AC_SUBST(LIBHID, $LIBHID)
# Check for types
# Solaris has uint_t and ulong_t typedefs in <sys/types.h>, avoid
# the redeclaration in usbtiny.c.
AC_CHECK_TYPES([uint_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([ulong_t], [], [], [#include <sys/types.h>])
# Checks for misc stuff. # Checks for misc stuff.
AC_ARG_ENABLE( AC_ARG_ENABLE(

View File

@ -18,6 +18,7 @@
*/ */
#include "avrdude.h"
#if defined(WIN32NATIVE) #if defined(WIN32NATIVE)

View File

@ -595,7 +595,6 @@ int jtagmkII_recv(PROGRAMMER * pgm, unsigned char **msg) {
} }
free(*msg); free(*msg);
} }
return 0;
} }

2
par.c
View File

@ -32,7 +32,7 @@
# include "freebsd_ppi.h" # include "freebsd_ppi.h"
#elif defined(__linux__) #elif defined(__linux__)
# include "linux_ppdev.h" # include "linux_ppdev.h"
#elif defined(__sun__) && defined(__svr4__) /* Solaris */ #elif defined(__sun__) || defined(__sun) /* Solaris */
# include "solaris_ecpp.h" # include "solaris_ecpp.h"
#endif #endif

2
ppi.c
View File

@ -37,7 +37,7 @@
# include "freebsd_ppi.h" # include "freebsd_ppi.h"
#elif defined(__linux__) #elif defined(__linux__)
# include "linux_ppdev.h" # include "linux_ppdev.h"
#elif defined(__sun__) && defined(__svr4__) /* Solaris */ #elif defined(__sun__) || defined(__sun) /* Solaris */
# include "solaris_ecpp.h" # include "solaris_ecpp.h"
#endif #endif

View File

@ -32,6 +32,7 @@ reg = register as defined in an enum in ppi.h. This must be converted
#include "ac_cfg.h" #include "ac_cfg.h"
#include "avrdude.h"
#if defined (WIN32NATIVE) #if defined (WIN32NATIVE)
@ -45,7 +46,6 @@ reg = register as defined in an enum in ppi.h. This must be converted
#include <sys/time.h> #include <sys/time.h>
#include <windows.h> #include <windows.h>
#include "avrdude.h"
#include "serial.h" #include "serial.h"
#include "ppi.h" #include "ppi.h"

View File

@ -24,13 +24,14 @@
* Native Win32 serial interface for avrdude. * Native Win32 serial interface for avrdude.
*/ */
#include "avrdude.h"
#if defined(WIN32NATIVE) #if defined(WIN32NATIVE)
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> /* for isprint */ #include <ctype.h> /* for isprint */
#include "avrdude.h"
#include "serial.h" #include "serial.h"
long serial_recv_timeout = 5000; /* ms */ long serial_recv_timeout = 5000; /* ms */

View File

@ -24,6 +24,8 @@
* Win32 serial bitbanging interface for avrdude. * Win32 serial bitbanging interface for avrdude.
*/ */
#include "avrdude.h"
#if defined(WIN32NATIVE) #if defined(WIN32NATIVE)
@ -32,7 +34,6 @@
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
#include "avrdude.h"
#include "avr.h" #include "avr.h"
#include "pindefs.h" #include "pindefs.h"
#include "pgm.h" #include "pgm.h"

View File

@ -539,7 +539,6 @@ static int stk500_initialize(PROGRAMMER * pgm, AVRPART * p)
if (stk500_getsync(pgm) < 0) if (stk500_getsync(pgm) < 0)
return -1; return -1;
goto retry; goto retry;
return -1;
} }
else if (buf[0] != Resp_STK_INSYNC) { else if (buf[0] != Resp_STK_INSYNC) {
fprintf(stderr, fprintf(stderr,

View File

@ -70,15 +70,15 @@
#define STK500V2_XTAL 7372800U #define STK500V2_XTAL 7372800U
#if 0 #if 0
#define DEBUG(format,args...) fprintf(stderr, format, ## args) #define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#else #else
#define DEBUG(format,args...) #define DEBUG(...)
#endif #endif
#if 0 #if 0
#define DEBUGRECV(format,args...) fprintf(stderr, format, ## args) #define DEBUGRECV(...) fprintf(stderr, __VA_ARGS__)
#else #else
#define DEBUGRECV(format,args...) #define DEBUGRECV(...)
#endif #endif
enum hvmode enum hvmode

View File

@ -41,8 +41,12 @@
#if defined(HAVE_LIBUSB) // we use LIBUSB to talk to the board #if defined(HAVE_LIBUSB) // we use LIBUSB to talk to the board
#include <usb.h> #include <usb.h>
#ifndef HAVE_UINT_T
typedef unsigned int uint_t; typedef unsigned int uint_t;
#endif
#ifndef HAVE_ULONG_T
typedef unsigned long ulong_t; typedef unsigned long ulong_t;
#endif
extern int avr_write_byte_default ( PROGRAMMER* pgm, AVRPART* p, extern int avr_write_byte_default ( PROGRAMMER* pgm, AVRPART* p,
AVRMEM* mem, ulong_t addr, AVRMEM* mem, ulong_t addr,