Linux build fix

This commit is contained in:
skidau 2015-04-14 11:29:23 +00:00
parent c1acdb8aec
commit 232c499247
3 changed files with 14 additions and 5 deletions

View File

@ -103,6 +103,10 @@ sw, sword, s32, int --> signed word
#include "BreakpointStructures.h"
#include "remote.h"
#if (defined __WIN32__ || defined _WIN32)
#define strdup _strdup
#endif
extern bool dexp_eval(char *, u32*);
//struct intToString{
@ -624,7 +628,7 @@ void parseAndCreateConditionalBreaks(u32 address, u8 flags, char** exp, int n){
}else{
now->exp_type_flags |= 6; //assume signed word
}
now->address = _strdup(exp[i]);
now->address = strdup(exp[i]);
i++;
if(i >= n) goto fail;
char* operandName = exp[i];
@ -639,7 +643,7 @@ void parseAndCreateConditionalBreaks(u32 address, u8 flags, char** exp, int n){
}else{
now->exp_type_flags |= 0x60; //assume signed word
}
now->value = _strdup(exp[i]);
now->value = strdup(exp[i]);
i++;
u32 val;
if(!dexp_eval(now->value, &val) || !dexp_eval(now->address, &val)){
@ -677,7 +681,7 @@ void parseAndCreateConditionalBreaks(u32 address, u8 flags, char** exp, int n){
u8 parseExpressionType(char* given_type){
u8 flags = 0;
//for such a small string, pays off to convert first
char* type = _strdup(given_type);
char* type = strdup(given_type);
for(int i = 0; type[i] != '\0'; i++){
type[i] = toupper(type[i]);
}

View File

@ -41,6 +41,10 @@
#include <errno.h>
#include <stdlib.h>
#if (defined __WIN32__ || defined _WIN32)
#define fileno _fileno
#endif
/* end standard C headers. */
/* flex integer type definitions */
@ -1538,7 +1542,7 @@ extern int isatty (int );
b->yy_bs_column = 0;
}
b->yy_is_interactive = file ? (isatty( _fileno(file) ) > 0) : 0;
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}

View File

@ -27,6 +27,7 @@
# define close closesocket
# define read _read
# define write _write
#define strdup _strdup
#endif // _WIN32
#include "remote.h"
@ -2077,7 +2078,7 @@ void executeBreakCommands(int n, char** cmd){
command = breakSymbolCombo(command, &len);
changed = (len == 5);
}if (!changed){
command = _strdup(replaceAlias(cmd[0], breakAliasTable));
command = strdup(replaceAlias(cmd[0], breakAliasTable));
changed = (strcmp(cmd[0], command));
}
if (!changed){