diff options
| author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-13 18:28:33 +0000 |
|---|---|---|
| committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-13 18:28:33 +0000 |
| commit | d0343f5ade874477acbdf56191f4dd4f39be40ae (patch) | |
| tree | b09a3d310801261efed160a5151b2518195086f5 | |
| parent | a6c77fd456710954e1d47fb7796b925d334cbb7a (diff) | |
| download | busybox-w32-d0343f5ade874477acbdf56191f4dd4f39be40ae.tar.gz busybox-w32-d0343f5ade874477acbdf56191f4dd4f39be40ae.tar.bz2 busybox-w32-d0343f5ade874477acbdf56191f4dd4f39be40ae.zip | |
Random cleanup of platform.h.
git-svn-id: svn://busybox.net/trunk/busybox@15375 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | include/platform.h | 40 | ||||
| -rw-r--r-- | libbb/copy_file.c | 7 | ||||
| -rw-r--r-- | util-linux/fdisk.c | 6 |
3 files changed, 24 insertions, 29 deletions
diff --git a/include/platform.h b/include/platform.h index 1effc61c0..3e1229e9d 100644 --- a/include/platform.h +++ b/include/platform.h | |||
| @@ -149,10 +149,8 @@ __extension__ typedef unsigned long long __u64; | |||
| 149 | #endif /* ifndef __GNUC__ */ | 149 | #endif /* ifndef __GNUC__ */ |
| 150 | 150 | ||
| 151 | #if (defined __digital__ && defined __unix__) | 151 | #if (defined __digital__ && defined __unix__) |
| 152 | # undef HAVE_STDBOOL_H | ||
| 153 | # undef HAVE_MNTENT_H | 152 | # undef HAVE_MNTENT_H |
| 154 | #else | 153 | #else |
| 155 | # define HAVE_STDBOOL_H 1 | ||
| 156 | # define HAVE_MNTENT_H 1 | 154 | # define HAVE_MNTENT_H 1 |
| 157 | #endif /* ___digital__ && __unix__ */ | 155 | #endif /* ___digital__ && __unix__ */ |
| 158 | 156 | ||
| @@ -168,6 +166,8 @@ __extension__ typedef unsigned long long __u64; | |||
| 168 | # error "Sorry, this libc version is not supported :(" | 166 | # error "Sorry, this libc version is not supported :(" |
| 169 | #endif | 167 | #endif |
| 170 | 168 | ||
| 169 | // Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead. | ||
| 170 | |||
| 171 | #if defined __GLIBC__ || defined __UCLIBC__ \ | 171 | #if defined __GLIBC__ || defined __UCLIBC__ \ |
| 172 | || defined __dietlibc__ || defined _NEWLIB_VERSION | 172 | || defined __dietlibc__ || defined _NEWLIB_VERSION |
| 173 | #include <features.h> | 173 | #include <features.h> |
| @@ -187,12 +187,10 @@ typedef unsigned long long int uintmax_t; | |||
| 187 | #endif | 187 | #endif |
| 188 | #endif | 188 | #endif |
| 189 | 189 | ||
| 190 | #if (defined __digital__ && defined __unix__) | 190 | // Is this for non-linux systems, or what? |
| 191 | #include <standards.h> | 191 | |
| 192 | #define HAVE_STANDARDS_H | 192 | #if !((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)) |
| 193 | #include <inttypes.h> | 193 | #define lchown chown |
| 194 | #define HAVE_INTTYPES_H | ||
| 195 | #define PRIu32 "u" | ||
| 196 | #endif | 194 | #endif |
| 197 | 195 | ||
| 198 | /* uclibc does not implement daemon for no-mmu systems. | 196 | /* uclibc does not implement daemon for no-mmu systems. |
| @@ -206,8 +204,9 @@ typedef unsigned long long int uintmax_t; | |||
| 206 | #define BB_NOMMU | 204 | #define BB_NOMMU |
| 207 | #endif | 205 | #endif |
| 208 | 206 | ||
| 209 | /* Need to implement fdprintf for platforms that haven't got dprintf. */ | 207 | /* Platforms that haven't got dprintf need to implement fdprintf() in |
| 210 | /* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */ | 208 | * libbb. This would require a platform.c. It's not going to be cleaned |
| 209 | * out of the tree, so stop saying it should be. */ | ||
| 211 | #define fdprintf dprintf | 210 | #define fdprintf dprintf |
| 212 | 211 | ||
| 213 | /* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */ | 212 | /* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */ |
| @@ -216,15 +215,16 @@ typedef unsigned long long int uintmax_t; | |||
| 216 | #define FNM_LEADING_DIR 0 | 215 | #define FNM_LEADING_DIR 0 |
| 217 | #endif | 216 | #endif |
| 218 | 217 | ||
| 219 | /* move to platform.c */ | ||
| 220 | #if (defined __digital__ && defined __unix__) | 218 | #if (defined __digital__ && defined __unix__) |
| 221 | /* use legacy setpgrp(pidt_,pid_t) for now.. */ | 219 | #include <standards.h> |
| 220 | #define HAVE_STANDARDS_H | ||
| 221 | #include <inttypes.h> | ||
| 222 | #define HAVE_INTTYPES_H | ||
| 223 | #define PRIu32 "u" | ||
| 224 | |||
| 225 | /* use legacy setpgrp(pidt_,pid_t) for now. move to platform.c */ | ||
| 222 | #define bb_setpgrp do{pid_t __me = getpid();setpgrp(__me,__me);}while(0) | 226 | #define bb_setpgrp do{pid_t __me = getpid();setpgrp(__me,__me);}while(0) |
| 223 | #else | ||
| 224 | #define bb_setpgrp setpgrp() | ||
| 225 | #endif | ||
| 226 | 227 | ||
| 227 | /* This is needed on some non linux unices like Tru64 */ | ||
| 228 | #if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET | 228 | #if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET |
| 229 | #define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET) | 229 | #define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET) |
| 230 | #endif | 230 | #endif |
| @@ -238,4 +238,12 @@ typedef unsigned long long int uintmax_t; | |||
| 238 | #define ADJ_TICK MOD_CLKB | 238 | #define ADJ_TICK MOD_CLKB |
| 239 | #endif | 239 | #endif |
| 240 | 240 | ||
| 241 | #else | ||
| 242 | #define bb_setpgrp setpgrp() | ||
| 243 | #endif | ||
| 244 | |||
| 245 | #if defined(__linux__) && !defined(BLKGETSIZE64) | ||
| 246 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) | ||
| 247 | #endif | ||
| 248 | |||
| 241 | #endif /* platform.h */ | 249 | #endif /* platform.h */ |
diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 2f7514628..a4da92218 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c | |||
| @@ -20,13 +20,6 @@ | |||
| 20 | 20 | ||
| 21 | #include "libbb.h" | 21 | #include "libbb.h" |
| 22 | 22 | ||
| 23 | /* Compiler version-specific crap that should be in a header file somewhere. */ | ||
| 24 | |||
| 25 | #if !((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)) | ||
| 26 | #define lchown chown | ||
| 27 | #endif | ||
| 28 | |||
| 29 | |||
| 30 | int copy_file(const char *source, const char *dest, int flags) | 23 | int copy_file(const char *source, const char *dest, int flags) |
| 31 | { | 24 | { |
| 32 | struct stat source_stat; | 25 | struct stat source_stat; |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 26ec2e363..5ef5acb1b 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
| @@ -48,12 +48,6 @@ | |||
| 48 | #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ | 48 | #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ |
| 49 | #define BLKSSZGET _IO(0x12,104) /* get block device sector size */ | 49 | #define BLKSSZGET _IO(0x12,104) /* get block device sector size */ |
| 50 | 50 | ||
| 51 | /* Avoid conflicts with the 2.6 kernel headers, which define | ||
| 52 | * _IOR rather differently */ | ||
| 53 | #undef _IOR | ||
| 54 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
| 55 | #define BLKGETSIZE64 _IOR(0x12,114,uint64_t) | ||
| 56 | |||
| 57 | /* | 51 | /* |
| 58 | fdisk.h | 52 | fdisk.h |
| 59 | */ | 53 | */ |
