Permalink
Browse files

Some fixes to allow building with gcc44.

Most of them for type redefinitions which gcc47 has stopped warning about
(if they are compatible).

The libstdc++ fix is modeled after gcc47's libstdc++. We don't have
__libc_C_ctype_[] anymore.
  • Loading branch information...
1 parent a832fc0 commit 381fa6da48f61b44a92fbaf73b2f65e40c705e14 Sascha Wildner committed Mar 2, 2014
@@ -34,15 +34,17 @@
// Information as gleaned from /usr/include/ctype.h
-#ifdef _CTYPE_S
- extern "C" const unsigned long __libc_C_ctype_[];
-#else
+#ifndef _CTYPE_S
extern "C" const __uint16_t __libc_C_ctype_[];
#endif
const ctype_base::mask*
ctype<char>::classic_table() throw()
+#ifdef _CTYPE_S
+ { return 0; }
+#else
{ return __libc_C_ctype_ + 1; }
+#endif
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
@@ -281,7 +281,7 @@ send_msg_with_cred(int sock, char *buffer, size_t size) {
int
receive_msg_with_cred(int sock, char *buffer, size_t size,
struct cmsgcred *cred) {
- struct msghdr msg = {0};
+ struct msghdr msg = { .msg_name = NULL };
struct iovec vec;
ssize_t n;
int result;
View
@@ -47,7 +47,11 @@ CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs\
. if ${WARNS} >= 2 && ${WARNS} <= 4
# XXX Delete -Wmaybe-uninitialized by default for now -- the compiler doesn't
# XXX always get it right.
+. if ${CCVER} == "gcc47"
CWARNFLAGS += -Wno-maybe-uninitialized
+. else
+CWARNFLAGS += -Wno-uninitialized
+. endif
. endif
# Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and
# -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4
@@ -668,8 +668,6 @@ struct drm_ati_pcigart_info {
struct drm_dma_handle *dmah; /* handle for ATI PCIGART table */
};
-typedef vm_paddr_t resource_size_t;
-
/**
* GEM specific mm private for tracking GEM objects
*/
@@ -50,7 +50,6 @@ typedef _Bool bool;
typedef u64 phys_addr_t;
typedef unsigned long kernel_ulong_t;
-typedef unsigned int uint;
typedef unsigned gfp_t;
typedef uint64_t loff_t;
typedef vm_paddr_t resource_size_t;
@@ -2439,6 +2439,7 @@ ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah,
int16_t minDelta = 0;
CHAN_CENTERS centers;
+ minPwrT4[0] = 0; /* XXX make gcc44 happy */
ar5416GetChannelCenters(ah, chan, &centers);
/* Trim numPiers for the number of populated channel Piers */
@@ -303,8 +303,14 @@ extern vm_offset_t clean_eva;
extern vm_offset_t clean_sva;
extern char *ptvmmap; /* poor name! */
+#ifndef __VM_PAGE_T_DEFINED__
+#define __VM_PAGE_T_DEFINED__
typedef struct vm_page *vm_page_t;
+#endif
+#ifndef __VM_MEMATTR_T_DEFINED__
+#define __VM_MEMATTR_T_DEFINED__
typedef char vm_memattr_t;
+#endif
void pmap_release(struct pmap *pmap);
void pmap_interlock_wait (struct vmspace *);
@@ -351,8 +351,14 @@ extern vm_offset_t clean_eva;
extern vm_offset_t clean_sva;
extern char *ptvmmap; /* poor name! */
+#ifndef __VM_PAGE_T_DEFINED__
+#define __VM_PAGE_T_DEFINED__
typedef struct vm_page *vm_page_t;
+#endif
+#ifndef __VM_MEMATTR_T_DEFINED__
+#define __VM_MEMATTR_T_DEFINED__
typedef char vm_memattr_t;
+#endif
void pmap_release(struct pmap *pmap);
void pmap_interlock_wait (struct vmspace *);
@@ -176,8 +176,14 @@ extern char *ptvmmap; /* poor name! */
extern vm_offset_t clean_sva;
extern vm_offset_t clean_eva;
+#ifndef __VM_PAGE_T_DEFINED__
+#define __VM_PAGE_T_DEFINED__
typedef struct vm_page *vm_page_t;
+#endif
+#ifndef __VM_MEMATTR_T_DEFINED__
+#define __VM_MEMATTR_T_DEFINED__
typedef char vm_memattr_t;
+#endif
void pmap_bootstrap (void);
void *pmap_mapdev (vm_paddr_t, vm_size_t);
@@ -43,7 +43,6 @@
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
* $FreeBSD: src/sys/i386/include/pmap.h,v 1.65.2.3 2001/10/03 07:15:37 peter Exp $
- * $DragonFly: src/sys/platform/vkernel/include/pmap.h,v 1.4 2007/07/01 02:51:44 dillon Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -203,8 +202,14 @@ extern char *ptvmmap; /* poor name! */
extern vm_offset_t clean_sva;
extern vm_offset_t clean_eva;
+#ifndef __VM_PAGE_T_DEFINED__
+#define __VM_PAGE_T_DEFINED__
typedef struct vm_page *vm_page_t;
+#endif
+#ifndef __VM_MEMATTR_T_DEFINED__
+#define __VM_MEMATTR_T_DEFINED__
typedef char vm_memattr_t;
+#endif
void pmap_bootstrap(vm_paddr_t *, int64_t);
void *pmap_mapdev (vm_paddr_t, vm_size_t);
View
@@ -29,8 +29,14 @@
#ifndef __cplusplus
typedef int __wchar_t;
#endif
+#ifndef ___WINT_T_DECLARED
typedef int __wint_t;
+#define ___WINT_T_DECLARED
+#endif
+#ifndef ___RUNE_T_DECLARED
typedef int __rune_t;
+#define ___RUNE_T_DECLARED
+#endif
typedef void *__wctrans_t;
typedef void *__wctype_t;
View
@@ -256,8 +256,14 @@ __END_DECLS
* must be at least 16 bits.
*/
typedef int __ct_rune_t; /* arg type for ctype funcs */
+#ifndef ___RUNE_T_DECLARED
typedef __ct_rune_t __rune_t; /* rune_t (see above) */
+#define ___RUNE_T_DECLARED
+#endif
+#ifndef ___WINT_T_DECLARED
typedef __ct_rune_t __wint_t; /* wint_t (see above) */
+#define ___WINT_T_DECLARED
+#endif
/*
* Also required for locale support
View
@@ -121,7 +121,10 @@ typedef struct vm_page *vm_page_t;
/* Memory attributes. */
+#ifndef __VM_MEMATTR_T_DEFINED__
+#define __VM_MEMATTR_T_DEFINED__
typedef char vm_memattr_t;
+#endif
#define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHEABLE)
#define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)PAT_WRITE_COMBINING)

0 comments on commit 381fa6d

Please sign in to comment.