diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-05-19 05:35:19 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-05-19 05:35:19 +0000 |
commit | 8d4f3abad4f931a843696cb73a50929b7ed636c0 (patch) | |
tree | aa360774a903d3ebb0b2b5f3031c2e359f9c3afb /messages.c | |
parent | 3568776688d5969d409882839378da3659af5d1a (diff) | |
download | busybox-w32-8d4f3abad4f931a843696cb73a50929b7ed636c0.tar.gz busybox-w32-8d4f3abad4f931a843696cb73a50929b7ed636c0.tar.bz2 busybox-w32-8d4f3abad4f931a843696cb73a50929b7ed636c0.zip |
More libc portability updates, add in the website (which has not been
archived previously). Wrote 'which' during the meeting today.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@558 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'messages.c')
-rw-r--r-- | messages.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/messages.c b/messages.c index 73d64276d..2f8aab515 100644 --- a/messages.c +++ b/messages.c | |||
@@ -27,26 +27,28 @@ | |||
27 | * may make the binary slightly smaller. | 27 | * may make the binary slightly smaller. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | // TO use, do something like this | 30 | // To use this header file, include something like this: |
31 | // | 31 | // |
32 | //#define BB_DECLARE_EXTERN | 32 | //#define BB_DECLARE_EXTERN |
33 | //#define bb_need_memory_exhausted | 33 | //#define bb_need_memory_exhausted |
34 | //#include "messages.c" | 34 | //#include "messages.c" |
35 | // | 35 | // |
36 | //Then just use the string memory_exhausted when it is needed. | ||
37 | // | ||
38 | |||
39 | #include "internal.h" | ||
36 | #ifndef _BB_MESSAGES_C | 40 | #ifndef _BB_MESSAGES_C |
37 | #define _BB_MESSAGES_C | 41 | #define _BB_MESSAGES_C |
38 | 42 | ||
39 | #define _BB_DEF_MESSAGE_PROTO(symbol) extern const char *symbol; | ||
40 | #define _BB_DEF_MESSAGE_INITIALIZE(symbol, string_const) const char *symbol = string_const; | ||
41 | |||
42 | #ifdef BB_DECLARE_EXTERN | 43 | #ifdef BB_DECLARE_EXTERN |
43 | # define BB_DEF_MESSAGE(symbol, string_const) _BB_DEF_MESSAGE_PROTO(symbol) | 44 | # define BB_DEF_MESSAGE(symbol, string_const) extern const char *symbol; |
44 | #else | 45 | #else |
45 | # define BB_DEF_MESSAGE(symbol, string_const) _BB_DEF_MESSAGE_INITIALIZE(symbol, string_const) | 46 | # define BB_DEF_MESSAGE(symbol, string_const) const char *symbol = string_const; |
46 | #endif | 47 | #endif |
47 | 48 | ||
49 | |||
48 | #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN | 50 | #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN |
49 | BB_DEF_MESSAGE(name_too_long, "%s: file name too long\n") | 51 | BB_DEF_MESSAGE(name_too_long, "%s: file name too long\n") |
50 | #endif | 52 | #endif |
51 | #if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN | 53 | #if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN |
52 | BB_DEF_MESSAGE(omitting_directory, "%s: %s: omitting directory\n") | 54 | BB_DEF_MESSAGE(omitting_directory, "%s: %s: omitting directory\n") |
@@ -69,6 +71,13 @@ BB_DEF_MESSAGE(name_too_long, "%s: file name too long\n") | |||
69 | #if defined bb_need_help || ! defined BB_DECLARE_EXTERN | 71 | #if defined bb_need_help || ! defined BB_DECLARE_EXTERN |
70 | BB_DEF_MESSAGE(dash_dash_help, "--help") | 72 | BB_DEF_MESSAGE(dash_dash_help, "--help") |
71 | #endif | 73 | #endif |
74 | #if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN | ||
75 | BB_DEF_MESSAGE(write_error, "Write Error\n") | ||
76 | #endif | ||
77 | |||
78 | |||
79 | |||
80 | |||
72 | 81 | ||
73 | #endif /* _BB_MESSAGES_C */ | 82 | #endif /* _BB_MESSAGES_C */ |
74 | 83 | ||