Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build under mac and ubuntu 18.04 #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified sqldata/build_all.sh
100644 → 100755
Empty file.
Empty file modified sqldata/build_all64.sh
100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions sqlines/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#ifdef WIN32
#include <io.h>
#include <direct.h>
#elif __APPLE__
#include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>

#define _read read
#define _write write
#define _close close
#else
#include <sys/stat.h>
#include <sys/io.h>
Expand Down
8 changes: 8 additions & 0 deletions sqlines/filelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#ifdef WIN32
#include <io.h>
#include <direct.h>
#elif __APPLE__
#include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>

#define _read read
#define _write write
#define _close close
#else
#include <sys/stat.h>
#include <sys/io.h>
Expand Down
1 change: 1 addition & 0 deletions sqlparser/build_all64.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
g++ -m64 --all-warnings -c dllmain.cpp cobol.cpp clauses.cpp datatypes.cpp db2.cpp functions.cpp greenplum.cpp guess.cpp informix.cpp language.cpp mysql.cpp oracle.cpp postgresql.cpp report.cpp select.cpp helpers.cpp patterns.cpp post.cpp procedures.cpp storage.cpp sqlparser.cpp sqlserver.cpp statements.cpp stats.cpp sybase.cpp teradata.cpp token.cpp
rm -rf sqlparser.a
ar rcs sqlparser.a dllmain.o cobol.o clauses.o datatypes.o db2.o functions.o greenplum.o guess.o informix.o language.o mysql.o oracle.o postgresql.o report.o select.o helpers.o patterns.o post.o procedures.o storage.o sqlparser.o sqlserver.o statements.o stats.o sybase.o teradata.o token.o
8 changes: 8 additions & 0 deletions sqlparser/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#ifdef WIN32
#include <io.h>
#include <direct.h>
#elif __APPLE__
#include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>

#define _read read
#define _write write
#define _close close
#else
#include <sys/stat.h>
#include <sys/io.h>
Expand Down
2 changes: 1 addition & 1 deletion sqlparser/oracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ bool SqlParser::ParseOracleRownumCondition(Token *first, Token *op, Token *secon

// rownum can be at any side of the expression
bool rownum1 = first->Compare("rownum", L"rownum", 6);
bool rownum2 = (first == false) ? second->Compare("rownum", L"rownum", 6) : false;
bool rownum2 = (first == NULL) ? second->Compare("rownum", L"rownum", 6) : false;

if(rownum1 == false && rownum2 == false)
return false;
Expand Down
4 changes: 2 additions & 2 deletions sqlparser/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ bool SqlParser::ParseSelectFromClause(Token *select, bool nested_from, Token **f
count++;

// Alias exists so comma must follow, otherwise FROM clause ended no matter what goes next
if(GetNextCharToken(',', L',') == false)
if(GetNextCharToken(',', L',') == NULL)
break;
}

Expand Down Expand Up @@ -1594,4 +1594,4 @@ void SqlParser::SelectConvertRowlimit(Token *select, Token *from, Token *from_en
Append(end, ")", L")", 1);
}
}
}
}
4 changes: 2 additions & 2 deletions sqlparser/statements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5953,7 +5953,7 @@ bool SqlParser::ParseIfStatement(Token *if_, int scope)
// Check if BEGIN follows
Token *next_begin = GetNext("BEGIN", L"BEGIN", 5);

if(next_begin == false)
if(next_begin == NULL)
{
Token::Change(then, "BEGIN", L"BEGIN", 5);
then_to_begin = true;
Expand Down Expand Up @@ -10065,4 +10065,4 @@ bool SqlParser::ParseFunctionBody(Token *create, Token *function, Token *name, T
AddGeneratedVariables();

return true;
}
}