зеркало из 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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XP_MAC
|
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||||
extern void mac_warning(const char* warning_message);
|
extern void mac_warning(const char* warning_message);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ msg_callback(int level, int num, int line, const char *file,
|
||||||
file = "<unknown file>";
|
file = "<unknown file>";
|
||||||
warning_message = g_strdup_printf("%s:%d: %s\n", file, line, message);
|
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);
|
mac_warning(warning_message);
|
||||||
#else
|
#else
|
||||||
fputs(warning_message, stderr);
|
fputs(warning_message, stderr);
|
||||||
|
@ -123,7 +123,7 @@ fopen_from_includes(const char *filename, const char *mode,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XP_MAC
|
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||||
extern FILE* mac_fopen(const char* filename, const char *mode);
|
extern FILE* mac_fopen(const char* filename, const char *mode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -139,17 +139,9 @@ new_input_data(const char *filename, IncludePathEntry *include_path)
|
||||||
size_t i;
|
size_t i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XP_MAC
|
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
||||||
// 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
|
|
||||||
// on Mac, fopen knows how to find files.
|
// on Mac, fopen knows how to find files.
|
||||||
inputfile = fopen(filename, "r");
|
inputfile = fopen(filename, "r");
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
inputfile = fopen_from_includes(filename, "r", include_path);
|
inputfile = fopen_from_includes(filename, "r", include_path);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -117,42 +117,10 @@ xpt_dump_usage(char *argv[]) {
|
||||||
" -v verbose mode\n", argv[0]);
|
" -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
|
#define main xptdump_main
|
||||||
int xptdump_main(int argc, char *argv[]);
|
int xptdump_main(int argc, char *argv[]);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(XP_MAC) && defined(XPIDL_PLUGIN)
|
|
||||||
|
|
||||||
#define get_file_length mac_get_file_length
|
#define get_file_length mac_get_file_length
|
||||||
extern size_t mac_get_file_length(const char* filename);
|
extern size_t mac_get_file_length(const char* filename);
|
||||||
|
@ -183,11 +151,6 @@ main(int argc, char **argv)
|
||||||
char *whole;
|
char *whole;
|
||||||
FILE *in;
|
FILE *in;
|
||||||
|
|
||||||
#ifdef XP_MAC
|
|
||||||
if (argc == 0 || argv == NULL)
|
|
||||||
argc = mac_get_args(&argv);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 2:
|
case 2:
|
||||||
if (argv[1][0] == '-') {
|
if (argv[1][0] == '-') {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче