зеркало из https://github.com/mozilla/pjs.git
changes to build as MPW tools. r=mccabe
This commit is contained in:
Родитель
6995692c09
Коммит
4aac9bae2d
|
@ -43,7 +43,7 @@ xpidl_process_node(TreeState *state)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||
extern void mac_warning(const char* warning_message);
|
||||
#endif
|
||||
|
||||
|
@ -57,7 +57,7 @@ msg_callback(int level, int num, int line, const char *file,
|
|||
file = "<unknown file>";
|
||||
warning_message = g_strdup_printf("%s:%d: %s\n", file, line, message);
|
||||
|
||||
#ifdef XP_MAC
|
||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||
mac_warning(warning_message);
|
||||
#else
|
||||
fputs(warning_message, stderr);
|
||||
|
@ -123,7 +123,7 @@ fopen_from_includes(const char *filename, const char *mode,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||
extern FILE* mac_fopen(const char* filename, const char *mode);
|
||||
#endif
|
||||
|
||||
|
@ -139,17 +139,9 @@ new_input_data(const char *filename, IncludePathEntry *include_path)
|
|||
size_t i;
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC
|
||||
// if file is a full path name, just use fopen, otherwise search access paths.
|
||||
#if 0
|
||||
if (strchr(filename, ':') == NULL)
|
||||
inputfile = mac_fopen(filename, "r");
|
||||
else
|
||||
inputfile = fopen(filename, "r");
|
||||
#else
|
||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||
// on Mac, fopen knows how to find files.
|
||||
inputfile = fopen(filename, "r");
|
||||
#endif
|
||||
#else
|
||||
inputfile = fopen_from_includes(filename, "r", include_path);
|
||||
#endif
|
||||
|
|
|
@ -117,42 +117,10 @@ xpt_dump_usage(char *argv[]) {
|
|||
" -v verbose mode\n", argv[0]);
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||
|
||||
static int mac_get_args(char*** argv)
|
||||
{
|
||||
static char* args[] = { "xpt_dump", NULL, NULL };
|
||||
static StandardFileReply reply;
|
||||
|
||||
*argv = args;
|
||||
|
||||
printf("choose an .xpt file to dump.\n");
|
||||
|
||||
StandardGetFile(NULL, 0, NULL, &reply);
|
||||
if (reply.sfGood && !reply.sfIsFolder) {
|
||||
short len = 0;
|
||||
Handle fullPath = NULL;
|
||||
if (FSpGetFullPath(&reply.sfFile, &len, &fullPath) == noErr && fullPath != NULL) {
|
||||
char* path = args[1] = XPT_MALLOC(1 + len);
|
||||
BlockMoveData(*fullPath, path, len);
|
||||
path[len] = '\0';
|
||||
DisposeHandle(fullPath);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef XPIDL_PLUGIN
|
||||
#define main xptdump_main
|
||||
int xptdump_main(int argc, char *argv[]);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||
|
||||
#define get_file_length mac_get_file_length
|
||||
extern size_t mac_get_file_length(const char* filename);
|
||||
|
@ -183,11 +151,6 @@ main(int argc, char **argv)
|
|||
char *whole;
|
||||
FILE *in;
|
||||
|
||||
#ifdef XP_MAC
|
||||
if (argc == 0 || argv == NULL)
|
||||
argc = mac_get_args(&argv);
|
||||
#endif
|
||||
|
||||
switch (argc) {
|
||||
case 2:
|
||||
if (argv[1][0] == '-') {
|
||||
|
|
Загрузка…
Ссылка в новой задаче