Prior to this commit, the output C files from compile_et would
emit #includes of <afsconfig.h> and <afs/param.h>. These files
are not installed, and are only available in an OpenAFS build tree.
The output C files also emit #includes of <afs/error_table.h>, which
is an installed file, and is therefore expected to be available on
a system with OpenAFS installed. Removing the first two headers will
allow OpenAFS's compile_et binary to be used to compile error tables
which are not part of OpenAFS, on systems where OpenAFS is installed.
The inclusion of afsconfig.h was added in commit
972a4072827fb2ec680354d5adebc2c5cca06939 to ensure that it was included
prior to afs/param.h; however, the inclusion of afs/param.h in
compile_et.c stems from the original IBM import and seems of minimal
value. The only changes needed to build without param.h are to use
int instead of afs_int32 in a couple places (int is 32 bits on
all platforms currently supported) and to include <sys/types.h>
for size_t.
Change-Id: I1ee969eec92b139d265a7494e13ddfc69c05f238
Reviewed-on: http://gerrit.openafs.org/11708
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
va_list args)
AFS_ATTRIBUTE_FORMAT(__printf__, 3, 0);
-extern const char *afs_error_table_name(afs_int32);
+extern const char *afs_error_table_name(int);
extern const char *afs_error_message(afs_int32);
extern const char *afs_error_message_localize(afs_int32 code, char *str, size_t len);
extern
};
static const char *const c_src_prolog[] = {
- "#include <afsconfig.h>\n",
- "#include <afs/param.h>\n",
"#include <afs/error_table.h>\n",
"static const char * const text[] = {\n",
0,
* For copyright info, see mit-sipb-cr.h.
*/
-#include <afs/param.h>
-
+#include <sys/types.h>
#include <errno.h>
#ifndef _AFS_ET_H
struct error_table {
char const *const *msgs;
- afs_int32 base;
+ int base;
int n_msgs;
};
struct et_list {
#define ERRCODE_RANGE 8 /* # of bits to shift table number */
#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
-extern char const *afs_error_table_name(afs_int32 num);
+extern char const *afs_error_table_name(int num);
extern void afs_add_to_error_table(struct et_list *new_table);
extern const char *afs_com_right(struct et_list *list, long code);
extern const char *afs_com_right_r(struct et_list *list, long code, char *str, size_t len);
static char buf[6];
const char *
-afs_error_table_name(afs_int32 num)
+afs_error_table_name(int num)
{
int ch;
int i;