summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-01-04 18:09:22 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-01-04 18:09:22 +0000
commitc8c4f6bf9f2a34c50cdc4b8ef2a9392a244b4b4c (patch)
tree08bec5e8c3ef2dba52b10b99696a786881f49b44 /legacy
parent84512c288ab8b779969c06abe2d27c1b52a26e5b (diff)
make eina compile again on Windows CE
SVN revision: 55853
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eina/src/lib/eina_file_win32.c34
-rw-r--r--legacy/eina/src/lib/eina_log.c15
-rw-r--r--legacy/eina/src/lib/eina_quadtree.c4
3 files changed, 45 insertions, 8 deletions
diff --git a/legacy/eina/src/lib/eina_file_win32.c b/legacy/eina/src/lib/eina_file_win32.c
index 7c2910ef7b..f21a8f6afb 100644
--- a/legacy/eina/src/lib/eina_file_win32.c
+++ b/legacy/eina/src/lib/eina_file_win32.c
@@ -183,7 +183,11 @@ _eina_file_win32_first_file(const char *dir, WIN32_FIND_DATA *fd)
183static Eina_Bool 183static Eina_Bool
184_eina_file_win32_ls_iterator_next(Eina_File_Iterator *it, void **data) 184_eina_file_win32_ls_iterator_next(Eina_File_Iterator *it, void **data)
185{ 185{
186#ifdef UNICODE
187 wchar_t *old_name;
188#else
186 char *old_name; 189 char *old_name;
190#endif
187 char *name; 191 char *name;
188 char *cname; 192 char *cname;
189 size_t length; 193 size_t length;
@@ -194,7 +198,11 @@ _eina_file_win32_ls_iterator_next(Eina_File_Iterator *it, void **data)
194 return EINA_FALSE; 198 return EINA_FALSE;
195 199
196 is_last = it->is_last; 200 is_last = it->is_last;
197 old_name = strdup(it->data.cFileName); 201#ifdef UNICODE
202 old_name = _wcsdup(it->data.cFileName);
203#else
204 old_name = _strdup(it->data.cFileName);
205#endif
198 if (!old_name) 206 if (!old_name)
199 return EINA_FALSE; 207 return EINA_FALSE;
200 208
@@ -208,7 +216,7 @@ _eina_file_win32_ls_iterator_next(Eina_File_Iterator *it, void **data)
208 } 216 }
209 } while ((it->data.cFileName[0] == '.') && 217 } while ((it->data.cFileName[0] == '.') &&
210 ((it->data.cFileName[1] == '\0') || 218 ((it->data.cFileName[1] == '\0') ||
211 ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); 219 ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); /* FIXME: what about UNICODE ? */
212 220
213#ifdef UNICODE 221#ifdef UNICODE
214 cname = evil_wchar_to_char(old_name); 222 cname = evil_wchar_to_char(old_name);
@@ -257,7 +265,11 @@ _eina_file_win32_ls_iterator_free(Eina_File_Iterator *it)
257static Eina_Bool 265static Eina_Bool
258_eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data) 266_eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data)
259{ 267{
268#ifdef UNICODE
269 wchar_t *old_name;
270#else
260 char *old_name; 271 char *old_name;
272#endif
261 char *cname; 273 char *cname;
262 size_t length; 274 size_t length;
263 DWORD attr; 275 DWORD attr;
@@ -269,7 +281,11 @@ _eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **d
269 281
270 attr = it->data.dwFileAttributes; 282 attr = it->data.dwFileAttributes;
271 is_last = it->is_last; 283 is_last = it->is_last;
272 old_name = strdup(it->data.cFileName); 284#ifdef UNICODE
285 old_name = _wcsdup(it->data.cFileName);
286#else
287 old_name = _strdup(it->data.cFileName);
288#endif
273 if (!old_name) 289 if (!old_name)
274 return EINA_FALSE; 290 return EINA_FALSE;
275 291
@@ -282,17 +298,25 @@ _eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **d
282 res = EINA_FALSE; 298 res = EINA_FALSE;
283 } 299 }
284 300
301#ifdef UNICODE
302 length = wcslen(old_name);
303#else
285 length = strlen(old_name); 304 length = strlen(old_name);
305#endif
286 if (it->info.name_start + length + 1 >= PATH_MAX) 306 if (it->info.name_start + length + 1 >= PATH_MAX)
287 { 307 {
288 free(old_name); 308 free(old_name);
289 old_name = strdup(it->data.cFileName); 309#ifdef UNICODE
310 old_name = _wcsdup(it->data.cFileName);
311#else
312 old_name = _strdup(it->data.cFileName);
313#endif
290 continue; 314 continue;
291 } 315 }
292 316
293 } while ((it->data.cFileName[0] == '.') && 317 } while ((it->data.cFileName[0] == '.') &&
294 ((it->data.cFileName[1] == '\0') || 318 ((it->data.cFileName[1] == '\0') ||
295 ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); 319 ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); /* FIXME: what about UNICODE ? */
296 320
297#ifdef UNICODE 321#ifdef UNICODE
298 cname = evil_wchar_to_char(old_name); 322 cname = evil_wchar_to_char(old_name);
diff --git a/legacy/eina/src/lib/eina_log.c b/legacy/eina/src/lib/eina_log.c
index 8c04f46216..33c021dd6f 100644
--- a/legacy/eina/src/lib/eina_log.c
+++ b/legacy/eina/src/lib/eina_log.c
@@ -693,7 +693,10 @@ eina_log_print_prefix_NOthreads_color_file_func(FILE *fp,
693 int line) 693 int line)
694{ 694{
695 DECLARE_LEVEL_NAME_COLOR(level); 695 DECLARE_LEVEL_NAME_COLOR(level);
696#ifdef _WIN32 696#ifdef _WIN32_WCE
697 fprintf(fp, "%s<%u>:%s %s:%d %s() ", name, eina_log_pid_get(),
698 d->domain_str, file, line, fnc);
699#elif _WIN32
697 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 700 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
698 color); 701 color);
699 fprintf(fp, "%s", name); 702 fprintf(fp, "%s", name);
@@ -731,7 +734,10 @@ eina_log_print_prefix_NOthreads_color_NOfile_func(FILE *fp,
731 int line __UNUSED__) 734 int line __UNUSED__)
732{ 735{
733 DECLARE_LEVEL_NAME_COLOR(level); 736 DECLARE_LEVEL_NAME_COLOR(level);
734#ifdef _WIN32 737#ifdef _WIN32_WCE
738 fprintf(fp, "%s<%u>:%s %s() ", name, eina_log_pid_get(), d->domain_str,
739 fnc);
740#elif _WIN32
735 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 741 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
736 color); 742 color);
737 fprintf(fp, "%s", name); 743 fprintf(fp, "%s", name);
@@ -766,7 +772,10 @@ eina_log_print_prefix_NOthreads_color_file_NOfunc(FILE *fp,
766 int line) 772 int line)
767{ 773{
768 DECLARE_LEVEL_NAME_COLOR(level); 774 DECLARE_LEVEL_NAME_COLOR(level);
769#ifdef _WIN32 775#ifdef _WIN32_WCE
776 fprintf(fp, "%s<%u>:%s %s:%d ", name, eina_log_pid_get(), d->domain_str,
777 file, line);
778#elif _WIN32
770 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 779 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
771 color); 780 color);
772 fprintf(fp, "%s", name); 781 fprintf(fp, "%s", name);
diff --git a/legacy/eina/src/lib/eina_quadtree.c b/legacy/eina/src/lib/eina_quadtree.c
index 0aa47e26ca..daf03d080a 100644
--- a/legacy/eina/src/lib/eina_quadtree.c
+++ b/legacy/eina/src/lib/eina_quadtree.c
@@ -30,6 +30,10 @@
30#include <stdlib.h> 30#include <stdlib.h>
31#include <stdio.h> 31#include <stdio.h>
32 32
33#ifdef HAVE_EVIL
34# include <Evil.h>
35#endif
36
33#include "eina_quadtree.h" 37#include "eina_quadtree.h"
34#include "eina_magic.h" 38#include "eina_magic.h"
35#include "eina_mempool.h" 39#include "eina_mempool.h"