+
| | token.cpp/token.h
|
token.cpp/token.h --- token.cpp linux
+++ token.cpp windows
@@ -18,7 +18,9 @@
#include "strnote.h"
#include "ahtobj.h"
-#define s3size 0x8000
+#define s3size 0x8000
+
+#define Linux
//-------------------------------------------------------------
// Routines
@@ -1196,11 +1198,18 @@
// constマクロ展開
char *ptr_dval;
ptr_dval = lb->GetData2( id );
- if ( ptr_dval == NULL ) {
- _itoa( lb->GetOpt(id), cnvstr, 10 );
- } else {
- _gcvt( *(CALCVAR *)ptr_dval, 64, cnvstr );
- //sprintf( cnvstr, "%f", *(CALCVAR *)ptr_dval );
+ if ( ptr_dval == NULL ) {
+#ifdef Linux
+ sprintf( cnvstr, "%d", lb->GetOpt(id) );
+#else
+ _itoa( lb->GetOpt(id), cnvstr, 10 );
+#endif
+ } else {
+#ifdef Linux
+ sprintf( cnvstr, "%f", *(CALCVAR *)ptr_dval );
+#else
+ _gcvt( *(CALCVAR *)ptr_dval, 64, cnvstr );
+#endif
}
chk = ReplaceLineBuf( str, (char *)vs, cnvstr, 0, NULL );
break;
@@ -1957,8 +1966,12 @@
macdef->index[prms] = macptr; // 初期値ポインタの設定
type = GetToken();
switch(type) {
- case TK_NUM:
- _itoa( val, word, 10 );
+ case TK_NUM:
+#ifdef Linux
+ sprintf( word, "%d", val );
+#else
+ _itoa( val, word, 10 );
+#endif
break;
case TK_DNUM:
strcpy( word, (char *)s3 );
@@ -1979,8 +1992,12 @@
if ( type != TK_NUM ) {
SetError("bad default value");
return 6;
- }
- _itoa( val, word, 10 );
+ }
+#ifdef Linux
+ sprintf( word, "%d", val );
+#else
+ _itoa( val, word, 10 );
+#endif
sprintf( word,"-%d",val );
break;
default:
@@ -3006,8 +3023,12 @@
*errtmp = 0;
while(1) {
-
- _itoa( pline, ln_str, 10 );
+
+#ifdef Linux
+ sprintf( ln_str, "%d", pline );
+#else
+ _itoa( pline, ln_str, 10 );
+#endif
RegistExtMacro( "__line__", ln_str ); // 行番号マクロを更新
vp = p;
--- token.h linux
+++ token.h windows
@@ -4,12 +4,6 @@
//
#ifndef __token_h
#define __token_h
@@ -4,6 +4,12 @@
//
#ifndef __token_h
#define __token_h
+
+#define Linux
+#ifdef Linux
+#define _MAX_PATH 255
+#else
+#endif
// token type
#define TK_NONE 0
|