mirror of
https://github.com/louisrubet/rpn
synced 2025-01-04 11:01:35 +01:00
Suppr. WIN32 target
This commit is contained in:
parent
388d748add
commit
50d396fbf3
3 changed files with 10 additions and 15 deletions
|
@ -133,7 +133,6 @@ int inprog(branch& myobj)
|
||||||
{
|
{
|
||||||
// run it
|
// run it
|
||||||
prog.run(*_stack, *_global_heap, &local_heap);
|
prog.run(*_stack, *_global_heap, &local_heap);
|
||||||
//TODO here: _local_heap free
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// point on next command
|
// point on next command
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define M_PI 3.141592653589793238462643383279502797479068098137295573004504331874296718662975536062731407582759857177734375
|
|
||||||
#define M_E 2.71828182845904523536028747135266231435842186719354886266923086032766716801933881697550532408058643341064453125
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
void pi(void)
|
void pi(void)
|
||||||
{
|
{
|
||||||
|
|
19
src/rpn.cpp
19
src/rpn.cpp
|
@ -21,12 +21,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef WIN32
|
|
||||||
#include <tchar.h>
|
|
||||||
#else
|
|
||||||
#define _TCHAR char
|
|
||||||
#define _tmain main
|
|
||||||
#endif
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -368,13 +362,20 @@ public:
|
||||||
ret_value ret = ret_ok;
|
ret_value ret = ret_ok;
|
||||||
cmd_type_t type;
|
cmd_type_t type;
|
||||||
|
|
||||||
_stack = &stk;
|
// stack comes from outside
|
||||||
|
_stack = &stk;
|
||||||
|
|
||||||
|
// global heap comes from outside
|
||||||
_global_heap = &hp;
|
_global_heap = &hp;
|
||||||
|
|
||||||
|
// local heap can come from outside
|
||||||
|
// if not, set a new local heap
|
||||||
if (local_hp != NULL)
|
if (local_hp != NULL)
|
||||||
_local_heap = local_hp;
|
_local_heap = local_hp;
|
||||||
else
|
else
|
||||||
_local_heap = &local_heap;
|
_local_heap = &local_heap;
|
||||||
_err = ret_ok;
|
|
||||||
|
_err = ret_ok;
|
||||||
_err_context = "";
|
_err_context = "";
|
||||||
|
|
||||||
// branches for 'if'
|
// branches for 'if'
|
||||||
|
@ -774,7 +775,7 @@ static void apply_default(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
int _tmain(int argc, _TCHAR* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
heap global_heap;
|
heap global_heap;
|
||||||
stack global_stack;
|
stack global_stack;
|
||||||
|
|
Loading…
Reference in a new issue