Closed GoogleCodeExporter closed 8 years ago
Apologies - I meant for this to be an enhancement, not a defect report. Can't
seem to change it now.
Original comment by davesmar...@gmail.com
on 4 Aug 2011 at 11:52
Hi Dave!
Thanks for sharing the Windows code (I was just in the process of making a
Visual Studio C++ Express port myself)!
I have built and run your code with success!
I have looked into the 3 problems that you found (which I can replicate):
2) 42_function_pointer
This is not an issue as picoc does not support function pointer at this time
(see Issue list). When looking at the test Makefile one can see that this test
has been skipped.
3) 46_grep
Probably not an issue specifically for the Windows port. When looking at the
test Makefile one can see that this test has been skipped.
1) 32_led
This usse is caused by the exclusion of the '%' operator in platform_win32.h.
By including the operator (line 6-10), by commenting out NO_MODULUS:
//# define HEAP_SIZE C_HEAPSIZE
//# define NO_FP
//# define NO_CTYPE
//# define NO_HASH_INCLUDE
//# define NO_MODULUS
the test case works fine! I have commented out NO_CTYPE also as VC++ has ctypes.
I have detected one other minor issue:
cstdlib\time.c(46): warning C4047: '=' : 'void *' differs in levels of
indirection from 'errno_t'
This is caused by the return type of gmtime_s in VC++ beeing errno_t instead of
a pointer as on Unix. Probably not a big deal.
Jørgen
Original comment by jjohans...@gmail.com
on 4 Oct 2011 at 11:44
Hi Dave and Jørgen, thanks very much for your work on this.
I've just checked in revision #572 which adds a Visual Studio 2011 project. I
haven't tested it much yet but it does seem to run. I'll finish it soon.
Original comment by zik.sale...@gmail.com
on 5 Oct 2011 at 11:01
Excellent! I have just checket out the latest from SVN and it builds and runs
OK. A couple of comments:
- In platform.h I think there are two instances of 'extern jmp_buf ExitBuf;'
that can be removed (line 58 and 77).
- platform_msvc.c seems to be missing the new debugger stuff.
- The included Visual Studio 2011 project can not be opened in Visual Studio
C++ 2010 Express unfortunately (but is easy to recreate).
Jørgen
Original comment by jjohans...@gmail.com
on 6 Oct 2011 at 9:11
I believe this now works.
Original comment by zik.sale...@gmail.com
on 24 Feb 2013 at 12:36
[deleted comment]
[deleted comment]
[deleted comment]
Hi folks,
The following:
"cstdlib\time.c(46): warning C4047: '=' : 'void *' differs in levels of
indirection from 'errno_t'
This is caused by the return type of gmtime_s in VC++ beeing errno_t instead of
a pointer as on Unix. Probably not a big deal."
Could be fixed by creating the gmtime_r() under windows.
These is how the funtion are defined:
Unix: gmtime_r(const time_t*, struct tm*)
Win: gmtime_s(struct tm*, const time_t*)
We could fix the problem by replacing in platform_win32.h:
#define gmtime_r gmtime_s
For:
struct tm *gmtime_r(const time_t *time, struct tm *result);
And add this function to platform_win32.c:
#include <time.h>
/* simulates gmtime_r under windows */
struct tm *gmtime_r(const time_t *time, struct tm *result)
{
errno_t gmtime_error = gmtime_s(result, time);
if (gmtime_error==0)
return *result;
else
return NULL;
}
Thanks a lot for the good work, I'm using this version compiled with GCC
4.8.2, Cygwin64/Win8.1 and with VS2012/Win7 in another machine
Under Cygwin I did build picoc using the makefile from release 2.1 and I had to
include debug.c in the make file, otherwise the program would not link.
Makefile:
TARGET = picoc
SRCS = picoc.c table.c lex.c debug.c parse.c expression.c heap.c \
type.c variable.c clibrary.c platform.c include.c \
platform/platform_unix.c platform/library_unix.c \
cstdlib/stdio.c cstdlib/math.c cstdlib/string.c cstdlib/stdlib.c \
cstdlib/time.c cstdlib/errno.c cstdlib/ctype.c cstdlib/stdbool.c \
cstdlib/unistd.c
OBJS := $(SRCS:%.c=%.o)
Regards,
Otto
Original comment by ofba...@gmail.com
on 5 Apr 2014 at 5:42
Attachments:
Original issue reported on code.google.com by
davesmar...@gmail.com
on 4 Aug 2011 at 11:51Attachments: