Random cleanup of platform.h.
This commit is contained in:
parent
0960ca7383
commit
18958e9309
@ -149,10 +149,8 @@ __extension__ typedef unsigned long long __u64;
|
|||||||
#endif /* ifndef __GNUC__ */
|
#endif /* ifndef __GNUC__ */
|
||||||
|
|
||||||
#if (defined __digital__ && defined __unix__)
|
#if (defined __digital__ && defined __unix__)
|
||||||
# undef HAVE_STDBOOL_H
|
|
||||||
# undef HAVE_MNTENT_H
|
# undef HAVE_MNTENT_H
|
||||||
#else
|
#else
|
||||||
# define HAVE_STDBOOL_H 1
|
|
||||||
# define HAVE_MNTENT_H 1
|
# define HAVE_MNTENT_H 1
|
||||||
#endif /* ___digital__ && __unix__ */
|
#endif /* ___digital__ && __unix__ */
|
||||||
|
|
||||||
@ -168,6 +166,8 @@ __extension__ typedef unsigned long long __u64;
|
|||||||
# error "Sorry, this libc version is not supported :("
|
# error "Sorry, this libc version is not supported :("
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead.
|
||||||
|
|
||||||
#if defined __GLIBC__ || defined __UCLIBC__ \
|
#if defined __GLIBC__ || defined __UCLIBC__ \
|
||||||
|| defined __dietlibc__ || defined _NEWLIB_VERSION
|
|| defined __dietlibc__ || defined _NEWLIB_VERSION
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
@ -187,12 +187,10 @@ typedef unsigned long long int uintmax_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined __digital__ && defined __unix__)
|
// Is this for non-linux systems, or what?
|
||||||
#include <standards.h>
|
|
||||||
#define HAVE_STANDARDS_H
|
#if !((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1))
|
||||||
#include <inttypes.h>
|
#define lchown chown
|
||||||
#define HAVE_INTTYPES_H
|
|
||||||
#define PRIu32 "u"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* uclibc does not implement daemon for no-mmu systems.
|
/* uclibc does not implement daemon for no-mmu systems.
|
||||||
@ -206,8 +204,9 @@ typedef unsigned long long int uintmax_t;
|
|||||||
#define BB_NOMMU
|
#define BB_NOMMU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Need to implement fdprintf for platforms that haven't got dprintf. */
|
/* Platforms that haven't got dprintf need to implement fdprintf() in
|
||||||
/* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */
|
* libbb. This would require a platform.c. It's not going to be cleaned
|
||||||
|
* out of the tree, so stop saying it should be. */
|
||||||
#define fdprintf dprintf
|
#define fdprintf dprintf
|
||||||
|
|
||||||
/* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */
|
/* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */
|
||||||
@ -216,15 +215,16 @@ typedef unsigned long long int uintmax_t;
|
|||||||
#define FNM_LEADING_DIR 0
|
#define FNM_LEADING_DIR 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* move to platform.c */
|
|
||||||
#if (defined __digital__ && defined __unix__)
|
#if (defined __digital__ && defined __unix__)
|
||||||
/* use legacy setpgrp(pidt_,pid_t) for now.. */
|
#include <standards.h>
|
||||||
#define bb_setpgrp do{pid_t __me = getpid();setpgrp(__me,__me);}while(0)
|
#define HAVE_STANDARDS_H
|
||||||
#else
|
#include <inttypes.h>
|
||||||
#define bb_setpgrp setpgrp()
|
#define HAVE_INTTYPES_H
|
||||||
#endif
|
#define PRIu32 "u"
|
||||||
|
|
||||||
|
/* use legacy setpgrp(pidt_,pid_t) for now. move to platform.c */
|
||||||
|
#define bb_setpgrp do{pid_t __me = getpid();setpgrp(__me,__me);}while(0)
|
||||||
|
|
||||||
/* This is needed on some non linux unices like Tru64 */
|
|
||||||
#if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET
|
#if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET
|
||||||
#define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)
|
#define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)
|
||||||
#endif
|
#endif
|
||||||
@ -238,4 +238,12 @@ typedef unsigned long long int uintmax_t;
|
|||||||
#define ADJ_TICK MOD_CLKB
|
#define ADJ_TICK MOD_CLKB
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define bb_setpgrp setpgrp()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(BLKGETSIZE64)
|
||||||
|
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* platform.h */
|
#endif /* platform.h */
|
||||||
|
@ -20,13 +20,6 @@
|
|||||||
|
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
/* Compiler version-specific crap that should be in a header file somewhere. */
|
|
||||||
|
|
||||||
#if !((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1))
|
|
||||||
#define lchown chown
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int copy_file(const char *source, const char *dest, int flags)
|
int copy_file(const char *source, const char *dest, int flags)
|
||||||
{
|
{
|
||||||
struct stat source_stat;
|
struct stat source_stat;
|
||||||
|
@ -48,12 +48,6 @@
|
|||||||
#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
|
#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
|
||||||
#define BLKSSZGET _IO(0x12,104) /* get block device sector size */
|
#define BLKSSZGET _IO(0x12,104) /* get block device sector size */
|
||||||
|
|
||||||
/* Avoid conflicts with the 2.6 kernel headers, which define
|
|
||||||
* _IOR rather differently */
|
|
||||||
#undef _IOR
|
|
||||||
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
|
|
||||||
#define BLKGETSIZE64 _IOR(0x12,114,uint64_t)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
fdisk.h
|
fdisk.h
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user