fix return checks. broke compile!

SVN revision: 44523
This commit is contained in:
Carsten Haitzler 2009-12-17 11:58:15 +00:00
parent c7c66a652a
commit 5b9e0b0ead
1 changed files with 26 additions and 20 deletions

View File

@ -34,6 +34,8 @@ void *alloca (size_t);
#include <math.h> #include <math.h>
#include "edje_cc.h" #include "edje_cc.h"
#include <Ecore.h>
#include <Ecore_File.h>
static void new_object(void); static void new_object(void);
static void new_statement(void); static void new_statement(void);
@ -696,24 +698,28 @@ compile(void)
* Also, that preprocessor is not managing C++ comments, so pass the * Also, that preprocessor is not managing C++ comments, so pass the
* sun cc preprocessor just after. * sun cc preprocessor just after.
*/ */
snprintf(buf, sizeof(buf), "/usr/ccs/lib/cpp -I%s %s %s %s", ret = -1;
inc, def, file_in, tmpn); if (ecore_file_exists("/usr/ccs/lib/cpp"))
ret = system(buf); {
if (ret == 0) snprintf(buf, sizeof(buf), "/usr/ccs/lib/cpp -I%s %s %s %s",
{ inc, def, file_in, tmpn);
static char tmpn2[4096]; ret = system(buf);
if (ret == 0)
snprintf (tmpn2, PATH_MAX, "%s/edje_cc.edc-tmp-XXXXXX", tmp_dir); {
fd = mkstemp(tmpn2); static char tmpn2[4096];
if (fd >= 0)
{ snprintf (tmpn2, PATH_MAX, "%s/edje_cc.edc-tmp-XXXXXX", tmp_dir);
close(fd); fd = mkstemp(tmpn2);
snprintf (buf, 4096, "cc -E -I%s %s -o %s %s", if (fd >= 0)
inc, def, tmpn2, tmpn); {
ret = system(buf); close(fd);
snprintf(tmpn, 4096, "%s", tmpn2); snprintf (buf, 4096, "cc -E -I%s %s -o %s %s",
} inc, def, tmpn2, tmpn);
} ret = system(buf);
snprintf(tmpn, 4096, "%s", tmpn2);
}
}
}
/* /*
* On some BSD based systems (MacOS, OpenBSD), the default cpp * On some BSD based systems (MacOS, OpenBSD), the default cpp
* in the path is a wrapper script that chokes on the -o option. * in the path is a wrapper script that chokes on the -o option.
@ -728,13 +734,13 @@ compile(void)
* OpenSolaris: using gcc -E to remove them after using cpp. * OpenSolaris: using gcc -E to remove them after using cpp.
* *
*/ */
if (ret < 0) if (ret != 0)
{ {
snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s", snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
file_in, inc, def, tmpn); file_in, inc, def, tmpn);
ret = system(buf); ret = system(buf);
} }
if (ret < 0) if (ret != 0)
{ {
snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s", snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s",
inc, def, tmpn, file_in); inc, def, tmpn, file_in);