Skip to content

Commit

Permalink
Some fixes to allow building with gcc44.
Browse files Browse the repository at this point in the history
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
Sascha Wildner committed Mar 2, 2014
1 parent a832fc0 commit 381fa6d
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 8 deletions.
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/libc/sysvipc/sockets.c
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions share/mk/bsd.sys.mk
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions sys/dev/drm/include/drm/drmP.h
Expand Up @@ -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
*/
Expand Down
1 change: 0 additions & 1 deletion sys/dev/drm/include/linux/types.h
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions sys/dev/netif/ath/ath_hal/ar5416/ar5416_reset.c
Expand Up @@ -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 */
Expand Down
6 changes: 6 additions & 0 deletions sys/platform/pc32/include/pmap.h
Expand Up @@ -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 *);
Expand Down
6 changes: 6 additions & 0 deletions sys/platform/pc64/include/pmap.h
Expand Up @@ -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 *);
Expand Down
6 changes: 6 additions & 0 deletions sys/platform/vkernel/include/pmap.h
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion sys/platform/vkernel64/include/pmap.h
Expand Up @@ -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_
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions sys/sys/stdint.h
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions sys/sys/types.h
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions sys/vm/vm.h
Expand Up @@ -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)
Expand Down

0 comments on commit 381fa6d

Please sign in to comment.