summaryrefslogtreecommitdiff
path: root/legacy/edje
diff options
context:
space:
mode:
authortsauerbeck <tsauerbeck>2004-10-20 16:48:58 +0000
committertsauerbeck <tsauerbeck@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2004-10-20 16:48:58 +0000
commit7fac19890720255c577cf7ef7f362c59a0beead4 (patch)
treeb5944b35027db082dbceb48df171684d9c0e5847 /legacy/edje
parenta84ea1ccee9fb5753bf96a0f35f54d33874712b6 (diff)
mingw portability, step 1
SVN revision: 11925
Diffstat (limited to 'legacy/edje')
-rw-r--r--legacy/edje/configure.in2
-rw-r--r--legacy/edje/src/bin/edje_cc.c8
-rw-r--r--legacy/edje/src/bin/edje_cc.h1
-rw-r--r--legacy/edje/src/bin/edje_cc_parse.c10
-rw-r--r--legacy/edje/src/bin/edje_main.c8
5 files changed, 22 insertions, 7 deletions
diff --git a/legacy/edje/configure.in b/legacy/edje/configure.in
index 6ae7edb0c2..7bf52b3004 100644
--- a/legacy/edje/configure.in
+++ b/legacy/edje/configure.in
@@ -19,6 +19,8 @@ AM_ENABLE_SHARED
19AM_PROG_LIBTOOL 19AM_PROG_LIBTOOL
20AC_FUNC_ALLOCA 20AC_FUNC_ALLOCA
21 21
22AC_CHECK_FUNCS(realpath)
23
22AC_CHECK_HEADERS(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file])) 24AC_CHECK_HEADERS(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
23 25
24AC_CHECK_FUNCS(fnmatch, res=yes, res=no) 26AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
diff --git a/legacy/edje/src/bin/edje_cc.c b/legacy/edje/src/bin/edje_cc.c
index 65cb1857d9..8a0a5f8b85 100644
--- a/legacy/edje/src/bin/edje_cc.c
+++ b/legacy/edje/src/bin/edje_cc.c
@@ -136,7 +136,11 @@ main(int argc, char **argv)
136 } 136 }
137 137
138 /* check whether file_in exists */ 138 /* check whether file_in exists */
139#ifdef HAVE_REALPATH
139 if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode)) 140 if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode))
141#else
142 if (stat(file_in, &st) || !S_ISREG(st.st_mode))
143#endif
140 { 144 {
141 fprintf(stderr, "%s: Error: file not found: %s.\n", progname, file_in); 145 fprintf(stderr, "%s: Error: file not found: %s.\n", progname, file_in);
142 main_help(); 146 main_help();
@@ -164,7 +168,11 @@ main(int argc, char **argv)
164 exit(-1); 168 exit(-1);
165 } 169 }
166 170
171#ifdef HAVE_REALPATH
167 if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2)) 172 if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2))
173#else
174 if (!strcmp (file_in, file_out))
175#endif
168 { 176 {
169 fprintf(stderr, "%s: Error: input file equals output file.\n", progname); 177 fprintf(stderr, "%s: Error: input file equals output file.\n", progname);
170 main_help(); 178 main_help();
diff --git a/legacy/edje/src/bin/edje_cc.h b/legacy/edje/src/bin/edje_cc.h
index de2cf41b17..7d1377fb19 100644
--- a/legacy/edje/src/bin/edje_cc.h
+++ b/legacy/edje/src/bin/edje_cc.h
@@ -12,7 +12,6 @@
12#include <unistd.h> 12#include <unistd.h>
13#include <fcntl.h> 13#include <fcntl.h>
14#include <errno.h> 14#include <errno.h>
15#include <sys/mman.h>
16#include <sys/types.h> 15#include <sys/types.h>
17#include <sys/stat.h> 16#include <sys/stat.h>
18#include <stdarg.h> 17#include <stdarg.h>
diff --git a/legacy/edje/src/bin/edje_cc_parse.c b/legacy/edje/src/bin/edje_cc_parse.c
index 08d8b59812..70a6f4e0f7 100644
--- a/legacy/edje/src/bin/edje_cc_parse.c
+++ b/legacy/edje/src/bin/edje_cc_parse.c
@@ -571,18 +571,16 @@ compile(void)
571 571
572 size = lseek(fd, 0, SEEK_END); 572 size = lseek(fd, 0, SEEK_END);
573 lseek(fd, 0, SEEK_SET); 573 lseek(fd, 0, SEEK_SET);
574 data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); 574 data = malloc(size);
575 if (data) 575 if (data && read(fd, data, size) == size)
576 {
577 parse(data, size); 576 parse(data, size);
578 munmap(data, size);
579 }
580 else 577 else
581 { 578 {
582 fprintf(stderr, "%s: Error. cannot mmap file \"%s\" for input. %s\n", 579 fprintf(stderr, "%s: Error. cannot read file \"%s\". %s\n",
583 progname, file_in, strerror(errno)); 580 progname, file_in, strerror(errno));
584 exit(-1); 581 exit(-1);
585 } 582 }
583 free(data);
586 close(fd); 584 close(fd);
587} 585}
588 586
diff --git a/legacy/edje/src/bin/edje_main.c b/legacy/edje/src/bin/edje_main.c
index 9c15d0a51a..4e0fa5ca62 100644
--- a/legacy/edje/src/bin/edje_main.c
+++ b/legacy/edje/src/bin/edje_main.c
@@ -1,5 +1,6 @@
1#include "edje_main.h" 1#include "edje_main.h"
2 2
3#ifndef WIN32
3typedef struct _Demo_Edje Demo_Edje; 4typedef struct _Demo_Edje Demo_Edje;
4 5
5struct _Demo_Edje 6struct _Demo_Edje
@@ -863,4 +864,11 @@ main(int argc, char **argv)
863 864
864 return 0; 865 return 0;
865} 866}
867#else
868int main ()
869{
870 fprintf(stderr, "no workie on win32 yet\n");
866 871
872 return 0;
873}
874#endif