Support compile mingw32

This commit is contained in:
lsv 2025-09-23 16:17:07 +05:00
parent cc47a8ef7b
commit e65781aa65
32 changed files with 225 additions and 128 deletions

View file

@ -1,24 +1,71 @@
cmake_minimum_required(VERSION 3.0.0) cmake_minimum_required(VERSION 3.23.0)
#set(CMAKE_CXX_SYSROOT_FLAG_CODE "list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc)") #set(CMAKE_CXX_SYSROOT_FLAG_CODE "list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc)")
project(pgAdmin3 VERSION 1.26.0) project(pgAdmin3 VERSION 1.26.0)
include_directories(. include include/libssh2 include_directories(. include)
) set(PRECOMP_FILE precomp.h)
if(UNIX) if(NOT CROSS_COMPILE)
include_directories(include/libssh2)
find_package(CURL)
if(NOT CURL_FOUND)
add_compile_definitions(NO_WXJSON_GIT) add_compile_definitions(NO_WXJSON_GIT)
else()
include_directories(${CURL_INCLUDE_DIR})
link_libraries(${CURL_LIBRARIES})
endif()
find_package(LibXslt REQUIRED)
if(NOT LIBXSLT_FOUND)
message(SEND_ERROR "Failed to find LibXslt")
return()
else()
include_directories(${LIBXSLT_INCLUDE_DIR})
link_libraries(${LIBXSLT_LIBRARIES})
message(STATUS "path libxslt = ${LIBXSLT_LIBRARIES}")
endif()
find_package(LibXml2 REQUIRED)
if(NOT LIBXML2_FOUND)
message(SEND_ERROR "Failed to find LibXml2")
return()
else()
include_directories(${LIBXML2_INCLUDE_DIR})
link_libraries(${LIBXML2_LIBRARIES})
message(STATUS "path libxml = ${LIBXML2_LIBRARIES}")
endif()
find_package(wxWidgets 3.2 REQUIRED stc aui base net core xrc html xml)
if(NOT wxWidgets_FOUND)
message(SEND_ERROR "Failed to find wxWidgets ")
return()
else()
include(${wxWidgets_USE_FILE})
include_directories(${wxWidgets_INCLUDE_DIRS})
link_libraries(${wxWidgets_LIBRARIES})
message(STATUS "path wxwidgets = ${wxWidgets_LIBRARIES} inclure = ${wxWidgets_INCLUDE_DIRS}")
endif()
find_package(PostgreSQL REQUIRED)
if(NOT PostgreSQL_FOUND)
message(SEND_ERROR "Failed to find PostgreSql")
return()
else()
include_directories(${PostgreSQL_INCLUDE_DIRS})
include_directories(${PostgreSQL_INCLUDE_DIRS}/server)
link_libraries(${PostgreSQL_LIBRARIES})
message(STATUS "path postgresql= ${PostgreSQL_LIBRARIES}")
endif()
add_compile_definitions(WX_PRECOMP)
else()
#windows
endif() endif()
add_compile_definitions(WX_PRECOMP)
add_compile_definitions(wxUSE_UNICODE) add_compile_definitions(wxUSE_UNICODE)
add_compile_definitions(EMBED_XRC) add_compile_definitions(EMBED_XRC)
add_compile_options(-Wno-narrowing add_compile_options(-Wno-narrowing)
)
#set(CMAKE_CXX_EXTENSIONS OFF)
list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c) list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
file(GLOB_RECURSE SOURCES file(GLOB_RECURSE SOURCES
agent/*.c* agent/*.c*
ctl/*.c* ctl/*.c*
@ -30,46 +77,38 @@ file(GLOB_RECURSE SOURCES
) )
########################################################## ##########################################################
find_package(LibXslt REQUIRED)
if(NOT LIBXSLT_FOUND) add_executable(${PROJECT_NAME} )
message(SEND_ERROR "Failed to find LibXslt") target_sources(${PROJECT_NAME} PUBLIC pgAdmin3.cpp ${SOURCES})
return() if(CROSS_COMPILE STREQUAL "Windows")
else() ENABLE_LANGUAGE(RC)
include_directories(${LIBXSLT_INCLUDE_DIR}) set(CMAKE_RC_COMPILER_INIT windres)
link_libraries(${LIBXSLT_LIBRARIES}) set(RC_FILE pgAdmin3.rc)
endif() SET(CMAKE_RC_COMPILE_OBJECT
find_package(LibXml2 REQUIRED) "<CMAKE_RC_COMPILER> <FLAGS> -v -O coff -I ${WXWIN}/include <DEFINES> -i <SOURCE> -o <OBJECT>")
if(NOT LIBXML2_FOUND) target_sources(${PROJECT_NAME} PRIVATE ${RC_FILE})
message(SEND_ERROR "Failed to find LibXml2") message(STATUS "Use RC file ${RC_FILE}")
return()
else()
include_directories(${LIBXML2_INCLUDE_DIR})
link_libraries(${LIBXML2_LIBRARIES})
endif()
find_package(wxWidgets 3.2 REQUIRED stc aui base net core xrc html xml)
if(NOT wxWidgets_FOUND)
message(SEND_ERROR "Failed to find wxWidgets ")
return()
else()
include(${wxWidgets_USE_FILE})
include_directories(${wxWidgets_INCLUDE_DIRS})
link_libraries(${wxWidgets_LIBRARIES})
endif() endif()
find_package(PostgreSQL REQUIRED) if (PRECOMP_FILE)
if(NOT PostgreSQL_FOUND) target_precompile_headers(${PROJECT_NAME} PUBLIC include/${PRECOMP_FILE})
message(SEND_ERROR "Failed to find PostgreSql") message(STATUS "Precompile header include/${PRECOMP_FILE}")
return() endif()
else() if(CROSS_COMPILE STREQUAL "Windows")
include_directories(${PostgreSQL_INCLUDE_DIRS}) #add_compile_definitions(_CRT_SECURE_NO_DEPRECATE=1 NDEBUG WIN32 _WINDOWS __WINDOWS__ __WIN95__ __WIN32__ WINVER=0x0500 STRICT __WXMSW__ WXUSINGDLL wxUSE_UNICODE=1 PG_SSL)
include_directories(${PostgreSQL_INCLUDE_DIRS}/server) add_compile_definitions(NDEBUG WIN32 WXPRECOMP WINVER=0x0600 STRICT wxUSE_UNICODE=1 PG_SSL)
link_libraries(${PostgreSQL_LIBRARIES}) set(WXWIN /home/sergey/k/wxMSW-3.2.2 )
set(PGDIR /home/sergey/k/pg10 )
set(PGBUILD /home/sergey/k )
#set(/home/sergey/k/openssl )
#set(PROJECTDIR /home/sergey/k/openssl )
include_directories(${WXWIN}/include ${PGDIR}/include ${PGDIR}/include/server )
include_directories(${PGBUILD}/libxml2/include ${PGBUILD}/libxslt/include ${PGBUILD}/iconv/include )
# include_directories(${PGBUILD}/openssl/include
# include_directories( ./include/libssh2 ./include/libssh2/Win32 )
endif() endif()
add_executable(pgAdmin3 pgAdmin3.cpp ${SOURCES})
target_precompile_headers(pgAdmin3 PUBLIC include/precomp.h)
set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})

View file

@ -29,6 +29,12 @@ It can be taken from the Postgresql 15 sources and put in include/parser/
There may be problems compiling the JSON parser. There may be problems compiling the JSON parser.
It can be eliminated (as well as the experimental part with Git) by defining NO_WXJSON_GIT as done above through CXXFLAGS. It can be eliminated (as well as the experimental part with Git) by defining NO_WXJSON_GIT as done above through CXXFLAGS.
Compile minGW
-------
rm -fR CMakeFiles CMakeCache.txt Makefile cmake_install.cmake
cmake -DCMAKE_TOOLCHAIN_FILE=../mingw-windows-x64.cmake ..
cmake --build . --config Release --target all -j 3 --
OS for assembly used "Alt Workstation" 10 OS for assembly used "Alt Workstation" 10
https://www.basealt.ru/alt-workstation/download#c1211 https://www.basealt.ru/alt-workstation/download#c1211

View file

@ -178,8 +178,8 @@ int dlgJob::Go(bool modal)
{ {
pgaStep *step = (pgaStep *)data; pgaStep *step = (pgaStep *)data;
int pos = lstSteps->AppendItem(stepFactory.GetIconId(), step->GetName(), step->GetComment()); int pos = lstSteps->AppendItem(stepFactory.GetIconId(), step->GetName(), step->GetComment());
lstSteps->SetItem(pos, 3, NumToStr((long)step)); lstSteps->SetItem(pos, 3, NumToStr((long long)step));
previousSteps.Add(NumToStr((long)step)); previousSteps.Add(NumToStr((long long)step));
} }
item = mainForm->GetBrowser()->GetNextChild(stepsItem, cookie); item = mainForm->GetBrowser()->GetNextChild(stepsItem, cookie);
} }
@ -201,8 +201,8 @@ int dlgJob::Go(bool modal)
{ {
pgaSchedule *schedule = (pgaSchedule *)data; pgaSchedule *schedule = (pgaSchedule *)data;
int pos = lstSchedules->AppendItem(scheduleFactory.GetIconId(), schedule->GetName(), schedule->GetComment()); int pos = lstSchedules->AppendItem(scheduleFactory.GetIconId(), schedule->GetName(), schedule->GetComment());
lstSchedules->SetItem(pos, 3, NumToStr((long)schedule)); lstSchedules->SetItem(pos, 3, NumToStr((long long)schedule));
previousSchedules.Add(NumToStr((long)schedule)); previousSchedules.Add(NumToStr((long long)schedule));
} }
item = mainForm->GetBrowser()->GetNextChild(schedulesItem, cookie); item = mainForm->GetBrowser()->GetNextChild(schedulesItem, cookie);
} }
@ -278,12 +278,12 @@ void dlgJob::OnChangeStep(wxCommandEvent &ev)
if (lstSteps->GetText(pos, 3).IsEmpty()) if (lstSteps->GetText(pos, 3).IsEmpty())
{ {
wxString *stepSql = new wxString(step.GetInsertSql()); wxString *stepSql = new wxString(step.GetInsertSql());
lstSteps->SetItemData(pos, (long)stepSql); lstSteps->SetItemData(pos, (long long)stepSql);
} }
else else
{ {
wxString *stepSql = new wxString(step.GetUpdateSql()); wxString *stepSql = new wxString(step.GetUpdateSql());
lstSteps->SetItemData(pos, (long)stepSql); lstSteps->SetItemData(pos, (long long)stepSql);
} }
CheckChange(); CheckChange();
@ -307,7 +307,7 @@ void dlgJob::OnAddStep(wxCommandEvent &ev)
{ {
int pos = lstSteps->AppendItem(stepFactory.GetIconId(), step.GetName(), step.GetComment()); int pos = lstSteps->AppendItem(stepFactory.GetIconId(), step.GetName(), step.GetComment());
wxString *stepSql = new wxString(step.GetInsertSql()); wxString *stepSql = new wxString(step.GetInsertSql());
lstSteps->SetItemData(pos, (long)stepSql); lstSteps->SetItemData(pos, (long long)stepSql);
CheckChange(); CheckChange();
} }
} }
@ -349,12 +349,12 @@ void dlgJob::OnChangeSchedule(wxCommandEvent &ev)
if (lstSchedules->GetText(pos, 3).IsEmpty()) if (lstSchedules->GetText(pos, 3).IsEmpty())
{ {
wxString *scheduleSql = new wxString(schedule.GetInsertSql()); wxString *scheduleSql = new wxString(schedule.GetInsertSql());
lstSchedules->SetItemData(pos, (long)scheduleSql); lstSchedules->SetItemData(pos, (long long)scheduleSql);
} }
else else
{ {
wxString *scheduleSql = new wxString(schedule.GetUpdateSql()); wxString *scheduleSql = new wxString(schedule.GetUpdateSql());
lstSchedules->SetItemData(pos, (long)scheduleSql); lstSchedules->SetItemData(pos, (long long)scheduleSql);
} }
CheckChange(); CheckChange();
@ -371,7 +371,7 @@ void dlgJob::OnAddSchedule(wxCommandEvent &ev)
{ {
int pos = lstSchedules->AppendItem(scheduleFactory.GetIconId(), schedule.GetName(), schedule.GetComment()); int pos = lstSchedules->AppendItem(scheduleFactory.GetIconId(), schedule.GetName(), schedule.GetComment());
wxString *scheduleSql = new wxString(schedule.GetInsertSql()); wxString *scheduleSql = new wxString(schedule.GetInsertSql());
lstSchedules->SetItemData(pos, (long)scheduleSql); lstSchedules->SetItemData(pos, (long long)scheduleSql);
CheckChange(); CheckChange();
} }
} }

View file

@ -98,14 +98,14 @@ long ctlComboBoxFix::GetLongKey(int sel)
{ {
if (sel < 0) if (sel < 0)
sel = GetSelection(); sel = GetSelection();
return (long)wxItemContainer::GetClientData(sel); return (long)wxPtrToUInt(wxItemContainer::GetClientData(sel));
} }
OID ctlComboBoxFix::GetOIDKey(int sel) OID ctlComboBoxFix::GetOIDKey(int sel)
{ {
if (sel < 0) if (sel < 0)
sel = GetSelection(); sel = GetSelection();
return (OID)wxItemContainer::GetClientData(sel); return (OID)wxPtrToUInt(wxItemContainer::GetClientData(sel));
} }
wxString ctlComboBoxFix::GetStringKey(int sel) wxString ctlComboBoxFix::GetStringKey(int sel)

View file

@ -1573,7 +1573,7 @@ void ctlSQLBox::SetCaretWidthForKeyboardLayout() {
int newwidth = currentwidth; int newwidth = currentwidth;
#ifdef __WXMSW__ #ifdef __WXMSW__
HKL la = GetKeyboardLayout(0); HKL la = GetKeyboardLayout(0);
if (((int)la & 0xFFFF) == 0x409) { if (((long long)la & 0xFFFF) == 0x409) {
//en //en
newwidth = 1; newwidth = 1;
} }

View file

@ -355,7 +355,7 @@ int dlgTable::Go(bool modal)
column->GetName(), column->GetDefinition()); column->GetName(), column->GetDefinition());
previousColumns.Add(column->GetQuotedIdentifier() previousColumns.Add(column->GetQuotedIdentifier()
+ wxT(" ") + column->GetDefinition()); + wxT(" ") + column->GetDefinition());
lstColumns->SetItem(pos, COL_PGCOLUMN, NumToStr((long)column)); lstColumns->SetItem(pos, COL_PGCOLUMN, NumToStr((long long)column));
if (inherited) if (inherited)
lstColumns->SetItem(pos, COL_INHERIT, column->GetInheritedTableName()); lstColumns->SetItem(pos, COL_INHERIT, column->GetInheritedTableName());
} }
@ -1859,8 +1859,8 @@ void dlgTable::OnChangeOfType(wxCommandEvent &ev)
void dlgTable::OnChangeCol(wxCommandEvent &ev) void dlgTable::OnChangeCol(wxCommandEvent &ev)
{ {
long pos = lstColumns->GetSelection(); long pos = lstColumns->GetSelection();
pgColumn *column = (pgColumn *) StrToLong(lstColumns->GetText(pos, COL_PGCOLUMN)); pgColumn *column = (pgColumn *) StrTolonglong(lstColumns->GetText(pos, COL_PGCOLUMN));
pgColumn *column2 = (pgColumn *) StrToLong(lstColumns->GetText(pos, COL_CHANGEDCOL)); pgColumn *column2 = (pgColumn *) StrTolonglong(lstColumns->GetText(pos, COL_CHANGEDCOL));
dlgColumn col(&columnFactory, mainForm, column, table); dlgColumn col(&columnFactory, mainForm, column, table);
col.CenterOnParent(); col.CenterOnParent();
@ -1877,7 +1877,7 @@ void dlgTable::OnChangeCol(wxCommandEvent &ev)
lstColumns->SetItem(pos, COL_SQLCHANGE, col.GetSql()); lstColumns->SetItem(pos, COL_SQLCHANGE, col.GetSql());
lstColumns->SetItem(pos, COL_STATISTICS, col.GetStatistics()); lstColumns->SetItem(pos, COL_STATISTICS, col.GetStatistics());
lstColumns->SetItem(pos, COL_COMMENTS, col.GetComment()); lstColumns->SetItem(pos, COL_COMMENTS, col.GetComment());
lstColumns->SetItem(pos, COL_CHANGEDCOL, NumToStr((long)column2)); lstColumns->SetItem(pos, COL_CHANGEDCOL, NumToStr((long long)column2));
} }
CheckChange(); CheckChange();
} }

View file

@ -232,7 +232,7 @@ public:
} }
if (k.size() > 0) { if (k.size() > 0) {
key3 kk = k.at(r); key3 kk = k.at(r);
if ((col == 0)) { if (col == 0) {
long ttmp = kk.pid; long ttmp = kk.pid;
if (kk.sum > 0) val = wxString::Format("*%ld", ttmp); // backend if (kk.sum > 0) val = wxString::Format("*%ld", ttmp); // backend
else else
@ -283,7 +283,13 @@ public:
{ {
return false; return false;
} }
unsigned GetRow(const wxDataViewItem& item) const wxOVERRIDE { return (unsigned long)item.GetID() - 1; } // 0 row = header unsigned int GetRow(const wxDataViewItem& item) const wxOVERRIDE {
unsigned int i;
// wxUIntToPtr()
i=wxPtrToUInt(item.GetID());
i=i-1;
return i;
} // 0 row = header
unsigned int GetColumnCount() const wxOVERRIDE { return 0; } unsigned int GetColumnCount() const wxOVERRIDE { return 0; }
wxString GetColumnType(unsigned int) const wxOVERRIDE { return ""; } wxString GetColumnType(unsigned int) const wxOVERRIDE { return ""; }
@ -449,7 +455,7 @@ public:
Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, [&](wxDataViewEvent& event) { Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, [&](wxDataViewEvent& event) {
int col = event.GetColumn(); int col = event.GetColumn();
wxDataViewItem item(event.GetItem()); wxDataViewItem item(event.GetItem());
long row = (long)item.GetID(); long row = wxPtrToUInt(item.GetID());
row--; row--;
if (col == 1) //qid if (col == 1) //qid
{ {
@ -544,7 +550,7 @@ public:
MyIndexListModel* m = static_cast<MyIndexListModel*>(GetModel()); MyIndexListModel* m = static_cast<MyIndexListModel*>(GetModel());
wxDataViewItem item(GetCurrentItem()); wxDataViewItem item(GetCurrentItem());
long row = (long)item.GetID(); long row = wxPtrToUInt(item.GetID());
if (!(row < m->GetCount())) row = 0; if (!(row < m->GetCount())) row = 0;
while (row != -1 && row < m->GetCount()) { while (row != -1 && row < m->GetCount()) {
@ -599,7 +605,7 @@ public:
HitTest(mc, item, column); HitTest(mc, item, column);
if (item != NULL && column != NULL) if (item != NULL && column != NULL)
{ {
int row = (long)item.GetID() - 1; int row = wxPtrToUInt(item.GetID()) - 1;
int ncol = column->GetModelColumn(); int ncol = column->GetModelColumn();
if (row >= 0) { if (row >= 0) {
if (column && column->GetModelColumn() == 2) { if (column && column->GetModelColumn() == 2) {

View file

@ -22,6 +22,7 @@
// wxAUI // wxAUI
#include <wx/aui/aui.h> #include <wx/aui/aui.h>
#include "schema/pgServer.h"
#include "dlg/dlgClasses.h" #include "dlg/dlgClasses.h"
#include "utils/factory.h" #include "utils/factory.h"
#include "ctl/ctlAuiNotebook.h" #include "ctl/ctlAuiNotebook.h"
@ -90,7 +91,7 @@ class MywxAuiDefaultTabArt : public wxAuiDefaultTabArt
{ {
public: public:
MywxAuiDefaultTabArt() :wxAuiDefaultTabArt(){}; MywxAuiDefaultTabArt() :wxAuiDefaultTabArt(){};
MywxAuiDefaultTabArt* Clone() { MywxAuiDefaultTabArt* Clone() wxOVERRIDE {
return new MywxAuiDefaultTabArt(*this); return new MywxAuiDefaultTabArt(*this);
} }
virtual void DrawTab(wxDC& dc, virtual void DrawTab(wxDC& dc,

View file

@ -27,7 +27,7 @@
#include "frm/frmLog.h" #include "frm/frmLog.h"
#include "ctl/ctlGitPanel.h" #include "ctl/ctlGitPanel.h"
#include "ctl/ctlShortCut.h" #include "ctl/ctlShortCut.h"
#include "utils/FunctionPGHelper.h"; #include "utils/FunctionPGHelper.h"
// //
// This number MUST be incremented if changing any of the default perspectives // This number MUST be incremented if changing any of the default perspectives
// //

View file

@ -11,8 +11,6 @@
#ifndef PGADMIN3_H #ifndef PGADMIN3_H
#define PGADMIN3_H #define PGADMIN3_H
#include "../utils/diff_match_patch.h"
#include "utils/FormatterSQL.h"
// wxWindows headers // wxWindows headers
#include <wx/wx.h> #include <wx/wx.h>
@ -20,6 +18,8 @@
#include <wx/colordlg.h> #include <wx/colordlg.h>
#include <wx/listctrl.h> #include <wx/listctrl.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include "../utils/diff_match_patch.h"
#include "utils/FormatterSQL.h"
#ifdef WIN32 #ifdef WIN32
#include <winsock2.h> #include <winsock2.h>
@ -167,8 +167,8 @@ WX_DECLARE_STRING_HASH_MAP(wxString, cacheMap);
class pgAdmin3 : public wxApp class pgAdmin3 : public wxApp
{ {
public: public:
virtual bool OnInit(); virtual bool OnInit() wxOVERRIDE;
virtual int OnExit(); virtual int OnExit() wxOVERRIDE;
virtual void OnFatalException() wxOVERRIDE; virtual void OnFatalException() wxOVERRIDE;
#ifdef __WXMAC__ #ifdef __WXMAC__
void MacOpenFile(const wxString &fileName); void MacOpenFile(const wxString &fileName);

View file

@ -11,7 +11,7 @@
#ifdef WX_PRECOMP #ifdef WX_PRECOMP
#ifdef __cplusplus #ifdef __cplusplus
#include <wx/wxprec.h>
#include "copyright.h" #include "copyright.h"
#include "pgAdmin3.h" #include "pgAdmin3.h"
#include "version.h" #include "version.h"

View file

@ -13,7 +13,7 @@
#define PGPROJOB_H #define PGPROJOB_H
#include "schema/pgServer.h" #include "schema/pgServer.h"
#include "schema/pgDatabase.h"
class pgproJobFactory : public pgDatabaseObjFactory class pgproJobFactory : public pgDatabaseObjFactory
{ {

View file

@ -107,6 +107,7 @@ bool StrToBool(const wxString &value); // english
long StrToLong(const wxString &value); long StrToLong(const wxString &value);
double StrToDouble(const wxString &value); double StrToDouble(const wxString &value);
wxLongLong StrToLongLong(const wxString &value); wxLongLong StrToLongLong(const wxString &value);
long long StrTolonglong(const wxString &value);
wxDateTime StrToDateTime(const wxString &value); wxDateTime StrToDateTime(const wxString &value);
OID StrToOid(const wxString &value); OID StrToOid(const wxString &value);
@ -115,6 +116,7 @@ wxString generate_spaces(int length);
// nls aware // nls aware
wxString BoolToYesNo(bool value); wxString BoolToYesNo(bool value);
wxString NumToStr(long value); wxString NumToStr(long value);
wxString NumToStr(long long value);
wxString NumToStr(double value); wxString NumToStr(double value);
wxString NumToStrHuman(wxLongLong value); wxString NumToStrHuman(wxLongLong value);
wxString NumToStr(OID value); wxString NumToStr(OID value);

26
mingw-windows-x64.cmake Normal file
View file

@ -0,0 +1,26 @@
# 1. Set the target system
set(CMAKE_SYSTEM_NAME Windows)
set(CROSS_COMPILE Windows)
#set(CMAKE_SYSTEM_PROCESSOR x86_64)
SET(CMAKE_FIND_ROOT_PATH /home/sergey/mingw/llvm-mingw-20231128-msvcrt-ubuntu-20.04-x86_64 )
# 2. Specify the cross-compilers
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
set(CMAKE_RANLIB x86_64-w64-mingw32-ranlib)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ignored-attributes ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ")
# 3. Configure search for external dependencies
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(WXWIN_LIB /home/sergey/wxWidgets-3.2.2.1/msw-build/lib )
set(WXWIN /home/sergey/k/wxMSW-3.2.2 )
set(PGDIR /home/sergey/k/pg10 )
set(PGBUILD /home/sergey/k )
set(wxWidgets_LIBRARIES "-L${WXWIN_LIB} -lwx_mswu_xrc-3.2-x86_64-w64-mingw32.dll -lwx_mswu_qa-3.2-x86_64-w64-mingw32.dll -lwx_baseu_net-3.2-x86_64-w64-mingw32.dll -lwx_mswu_html-3.2-x86_64-w64-mingw32.dll -lwx_mswu_core-3.2-x86_64-w64-mingw32.dll -lwx_baseu_xml-3.2-x86_64-w64-mingw32.dll -lwx_baseu-3.2-x86_64-w64-mingw32.dll -lwx_mswu_aui-3.2-x86_64-w64-mingw32.dll -lwx_baseu_xml-3.2-x86_64-w64-mingw32.dll -lwx_mswu_stc-3.2-x86_64-w64-mingw32.dll")
set(PGLIB "-L${PGDIR}/lib -lpq -lxml2")
set(XSLTLIB "-L${PGBUILD}/libxslt/lib -lxslt")
set(OTHERLIB " -lws2_32")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static-libgcc -static-libstdc++ -Wl,--subsystem,windows -mwindows ${wxWidgets_LIBRARIES} ${PGLIB} ${XSLTLIB} ${OTHERLIB}")

View file

@ -537,7 +537,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
else style = wxPENSTYLE_SOLID; else style = wxPENSTYLE_SOLID;
wxColour colour(GetRValue(colorref), GetGValue(colorref), GetBValue(colorref)); wxColour colour(GetRValue(colorref), GetGValue(colorref), GetBValue(colorref));
rec->param1 = (long)wxThePenList->FindOrCreatePen(colour, x, style); rec->param1 = (long long)wxThePenList->FindOrCreatePen(colour, x, style);
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
@ -618,11 +618,11 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
wxFont *theFont = wxFont *theFont =
wxTheFontList->FindOrCreateFont(pointSize, family, style, weight, (lfUnderline != 0)); wxTheFontList->FindOrCreateFont(pointSize, family, style, weight, (lfUnderline != 0));
rec->param1 = (long) theFont; rec->param1 = (long long) theFont;
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.GetCount() - 1); rec->param2 = (long long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEBRUSHINDIRECT: case META_CREATEBRUSHINDIRECT:
@ -675,7 +675,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
else style = wxPENSTYLE_SOLID; else style = wxPENSTYLE_SOLID;
wxColour colour(GetRValue(colorref), GetGValue(colorref), GetBValue(colorref)); wxColour colour(GetRValue(colorref), GetGValue(colorref), GetBValue(colorref));
rec->param1 = (long)wxTheBrushList->FindOrCreateBrush(colour, style); rec->param1 = (long long)wxTheBrushList->FindOrCreateBrush(colour, style);
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);

View file

@ -26,7 +26,7 @@
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include <wx/clipbrd.h> #include <wx/clipbrd.h>
#include <wx/sysopt.h> #include <wx/sysopt.h>
#include "wx/stackwalk.h" #include <wx/stackwalk.h>
// wxOGL // wxOGL
#include <ogl/ogl.h> #include <ogl/ogl.h>
@ -202,7 +202,7 @@ void frmDlgTest::OnSelect(wxCommandEvent &ev)
dlg->Show(); dlg->Show();
} }
} }
#if wxUSE_STACKWALKER
class MyStackWalker : public wxStackWalker class MyStackWalker : public wxStackWalker
{ {
public: public:
@ -262,15 +262,19 @@ void MyStackWalker::OnStackFrame(const wxStackFrame& frame)
Rez->Append(wxString::Format("----------------\n")); Rez->Append(wxString::Format("----------------\n"));
} }
#endif
// The Application! // The Application!
void pgAdmin3::OnFatalException() { void pgAdmin3::OnFatalException() {
#if wxUSE_STACKWALKER
wxString err = "fatal error"; wxString err = "fatal error";
MyStackWalker sw(err); MyStackWalker sw(err);
sw.WalkFromException(); sw.WalkFromException();
wxLogError(err); wxLogError(err);
wxMessageBox(err, wxMessageBox(err,
"wxExcept", wxOK | wxICON_ERROR); "wxExcept", wxOK | wxICON_ERROR);
#endif
} }
bool pgAdmin3::OnInit() bool pgAdmin3::OnInit()
{ {

View file

@ -831,9 +831,9 @@ static int yy_flex_strlen (yyconst char * );
*/ */
YY_DECL YY_DECL
{ {
register yy_state_type yy_current_state; yy_state_type yy_current_state;
register char *yy_cp, *yy_bp; char *yy_cp, *yy_bp;
register int yy_act; int yy_act;
#line 74 "pgscript/pgsScanner.ll" #line 74 "pgscript/pgsScanner.ll"
@ -888,7 +888,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -1989,9 +1989,9 @@ void yyFlexLexer::LexerOutput( const char* buf, int size )
*/ */
int yyFlexLexer::yy_get_next_buffer() int yyFlexLexer::yy_get_next_buffer()
{ {
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = (yytext_ptr); char *source = (yytext_ptr);
register int number_to_move, i; int number_to_move, i;
int ret_val; int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@ -2115,14 +2115,14 @@ int yyFlexLexer::yy_get_next_buffer()
yy_state_type yyFlexLexer::yy_get_previous_state() yy_state_type yyFlexLexer::yy_get_previous_state()
{ {
register yy_state_type yy_current_state; yy_state_type yy_current_state;
register char *yy_cp; char *yy_cp;
yy_current_state = (yy_start); yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{ {
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -2147,10 +2147,10 @@ int yyFlexLexer::yy_get_next_buffer()
*/ */
yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
{ {
register int yy_is_jam; int yy_is_jam;
register char *yy_cp = (yy_c_buf_p); char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1; YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -2168,9 +2168,9 @@ int yyFlexLexer::yy_get_next_buffer()
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
void yyFlexLexer::yyunput( int c, register char* yy_bp) void yyFlexLexer::yyunput( int c, char* yy_bp)
{ {
register char *yy_cp; char *yy_cp;
yy_cp = (yy_c_buf_p); yy_cp = (yy_c_buf_p);
@ -2180,10 +2180,10 @@ int yyFlexLexer::yy_get_next_buffer()
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */ { /* need to shift things up to make room */
/* +2 for EOB chars. */ /* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2; int number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source = char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
@ -2604,7 +2604,7 @@ void yyFlexLexer::LexerError( yyconst char msg[] )
#ifndef yytext_ptr #ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{ {
register int i; int i;
for ( i = 0; i < n; ++i ) for ( i = 0; i < n; ++i )
s1[i] = s2[i]; s1[i] = s2[i];
} }
@ -2613,7 +2613,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
#ifdef YY_NEED_STRLEN #ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s ) static int yy_flex_strlen (yyconst char * s )
{ {
register int n; int n;
for ( n = 0; s[n]; ++n ) for ( n = 0; s[n]; ++n )
; ;

View file

@ -289,7 +289,7 @@ char *M_lowercase(char *s)
*/ */
int M_strposition(char *s1, char *s2) int M_strposition(char *s1, char *s2)
{ {
register char ch1, ch2; char ch1, ch2;
char *p0, *p1, *p2; char *p0, *p1, *p2;
int ct; int ct;

View file

@ -891,7 +891,7 @@ void dlgRepCluster::OnOK(wxCommandEvent &ev)
done = remoteConn->ExecuteVoid( done = remoteConn->ExecuteVoid(
wxT("SELECT ") + schemaPrefix + wxT("storepath(") + wxT("SELECT ") + schemaPrefix + wxT("storepath(") +
txtNodeID->GetValue() + wxT(", ") + txtNodeID->GetValue() + wxT(", ") +
NumToStr((long)cbAdminNode->wxItemContainer::GetClientData(cbAdminNode->GetCurrentSelection())) + wxT(", ") + NumToStr((long long)cbAdminNode->wxItemContainer::GetClientData(cbAdminNode->GetCurrentSelection())) + wxT(", ") +
qtDbString(wxT("host=") + database->GetServer()->GetName() + qtDbString(wxT("host=") + database->GetServer()->GetName() +
wxT(" port=") + NumToStr((long)database->GetServer()->GetPort()) + wxT(" port=") + NumToStr((long)database->GetServer()->GetPort()) +
wxT(" dbname=") + database->GetName()) + wxT(", ") wxT(" dbname=") + database->GetName()) + wxT(", ")
@ -930,7 +930,7 @@ void dlgRepCluster::CheckChange()
if (cluster) if (cluster)
{ {
int sel = cbAdminNode->GetCurrentSelection(); int sel = cbAdminNode->GetCurrentSelection();
bool changed = (sel >= 0 && (long)cbAdminNode->wxEvtHandler::GetClientData() != cluster->GetAdminNodeID()); bool changed = (sel >= 0 && (long long)cbAdminNode->wxEvtHandler::GetClientData() != cluster->GetAdminNodeID());
EnableOK(changed || txtComment->GetValue() != cluster->GetComment()); EnableOK(changed || txtComment->GetValue() != cluster->GetComment());
} }
@ -1039,7 +1039,7 @@ wxString dlgRepCluster::GetSql()
int sel = cbAdminNode->GetCurrentSelection(); int sel = cbAdminNode->GetCurrentSelection();
if (sel >= 0) if (sel >= 0)
{ {
long id = (long)cbAdminNode->wxItemContainer::GetClientData(sel); long id = (long long)cbAdminNode->wxItemContainer::GetClientData(sel);
if (id != cluster->GetAdminNodeID()) if (id != cluster->GetAdminNodeID())
settings->WriteLong(wxT("Replication/") + cluster->GetName() + wxT("/AdminNode"), id); settings->WriteLong(wxT("Replication/") + cluster->GetName() + wxT("/AdminNode"), id);
} }

View file

@ -108,9 +108,9 @@ int dlgRepListen::Go(bool modal)
pgObject *dlgRepListen::CreateObject(pgCollection *collection) pgObject *dlgRepListen::CreateObject(pgCollection *collection)
{ {
pgObject *obj = listenFactory.CreateObjects(collection, 0, pgObject *obj = listenFactory.CreateObjects(collection, 0,
wxT(" WHERE li_origin = ") + NumToStr((OID)cbOrigin->wxItemContainer::GetClientData(cbOrigin->GetCurrentSelection())) + wxT(" WHERE li_origin = ") + NumToStr((long long)cbOrigin->wxItemContainer::GetClientData(cbOrigin->GetCurrentSelection())) +
wxT(" AND li_receiver = ") + NumToStr(node->GetSlId()) + wxT(" AND li_receiver = ") + NumToStr(node->GetSlId()) +
wxT(" AND li_provider = ") + NumToStr((OID)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection())) wxT(" AND li_provider = ") + NumToStr((long long)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection()))
); );
return obj; return obj;
@ -150,8 +150,8 @@ wxString dlgRepListen::GetSql()
// create mode // create mode
sql = wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("storelisten(") sql = wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("storelisten(")
+ NumToStr((OID)cbOrigin->wxItemContainer::GetClientData(cbOrigin->GetCurrentSelection())) + wxT(", ") + NumToStr((long long)cbOrigin->wxItemContainer::GetClientData(cbOrigin->GetCurrentSelection())) + wxT(", ")
+ NumToStr((OID)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection())) + wxT(", ") + NumToStr((long long)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection())) + wxT(", ")
+ NumToStr(node->GetSlId()) + wxT(");"); + NumToStr(node->GetSlId()) + wxT(");");
} }

View file

@ -103,7 +103,7 @@ int dlgRepPath::Go(bool modal)
pgObject *dlgRepPath::CreateObject(pgCollection *collection) pgObject *dlgRepPath::CreateObject(pgCollection *collection)
{ {
pgObject *obj = pathFactory.CreateObjects(collection, 0, pgObject *obj = pathFactory.CreateObjects(collection, 0,
wxT(" WHERE pa_server = ") + NumToStr((OID)cbServer->wxItemContainer::GetClientData(cbServer->GetCurrentSelection())) + wxT(" WHERE pa_server = ") + NumToStr((long long)cbServer->wxItemContainer::GetClientData(cbServer->GetCurrentSelection())) +
wxT(" AND pa_client = ") + NumToStr(node->GetSlId())); wxT(" AND pa_client = ") + NumToStr(node->GetSlId()));
return obj; return obj;
@ -145,7 +145,7 @@ wxString dlgRepPath::GetSql()
if (sel >= 0) if (sel >= 0)
{ {
sql = wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("storepath(") sql = wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("storepath(")
+ NumToStr((OID)cbServer->wxItemContainer::GetClientData(sel)) + wxT(", ") + NumToStr((long long)cbServer->wxItemContainer::GetClientData(sel)) + wxT(", ")
+ NumToStr(node->GetSlId()) + wxT(", ") + NumToStr(node->GetSlId()) + wxT(", ")
+ qtDbString(txtConnInfo->GetValue()) + wxT(", ") + qtDbString(txtConnInfo->GetValue()) + wxT(", ")
+ NumToStr(StrToLong(txtConnRetry->GetValue())) + wxT(");"); + NumToStr(StrToLong(txtConnRetry->GetValue())) + wxT(");");

View file

@ -107,7 +107,7 @@ int dlgRepSequence::Go(bool modal)
pgObject *dlgRepSequence::CreateObject(pgCollection *collection) pgObject *dlgRepSequence::CreateObject(pgCollection *collection)
{ {
pgObject *obj = slSequenceFactory.CreateObjects(collection, 0, pgObject *obj = slSequenceFactory.CreateObjects(collection, 0,
wxT(" WHERE seq_reloid = ") + NumToStr((OID)cbSequence->wxItemContainer::GetClientData(cbSequence->GetGuessedSelection()))); wxT(" WHERE seq_reloid = ") + NumToStr((long long)cbSequence->wxItemContainer::GetClientData(cbSequence->GetGuessedSelection())));
return obj; return obj;
} }

View file

@ -188,7 +188,7 @@ wxString dlgRepSetMerge::GetSql()
{ {
wxString sql; wxString sql;
wxString addId = NumToStr(set->GetSlId()); wxString addId = NumToStr(set->GetSlId());
wxString toId = NumToStr((long)cbTargetID->wxItemContainer::GetClientData(cbTargetID->GetCurrentSelection())); wxString toId = NumToStr((long long)cbTargetID->wxItemContainer::GetClientData(cbTargetID->GetCurrentSelection()));
wxString prefix = cluster->GetSchemaPrefix(); wxString prefix = cluster->GetSchemaPrefix();
if (set->GetSubscriptionCount() > 0) if (set->GetSubscriptionCount() > 0)
@ -323,7 +323,7 @@ void dlgRepSetMove::CheckChange()
wxString dlgRepSetMove::GetSql() wxString dlgRepSetMove::GetSql()
{ {
wxString toId = NumToStr((long)cbTargetNode->wxItemContainer::GetClientData(cbTargetNode->GetCurrentSelection())); wxString toId = NumToStr((long long)cbTargetNode->wxItemContainer::GetClientData(cbTargetNode->GetCurrentSelection()));
wxString sql = wxString sql =
wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("moveset(") + wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("moveset(") +

View file

@ -136,7 +136,7 @@ void dlgRepSubscription::CheckChange()
int sel = cbProvider->GetCurrentSelection(); int sel = cbProvider->GetCurrentSelection();
EnableOK(sel >= 0 && (chkForward->GetValue() != subscription->GetForward() EnableOK(sel >= 0 && (chkForward->GetValue() != subscription->GetForward()
|| (long)cbProvider->wxItemContainer::GetClientData(sel) != subscription->GetProviderId())); || (long long)cbProvider->wxItemContainer::GetClientData(sel) != subscription->GetProviderId()));
} }
else else
{ {
@ -159,11 +159,11 @@ wxString dlgRepSubscription::GetSql()
{ {
// Actually, provider and receiver are exchanged here. // Actually, provider and receiver are exchanged here.
sql += NumToStr(cluster->GetLocalNodeID()) + wxT(", ") sql += NumToStr(cluster->GetLocalNodeID()) + wxT(", ")
+ NumToStr((long)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection())); + NumToStr((long long)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection()));
} }
else else
{ {
sql += NumToStr((long)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection())) + wxT(", ") sql += NumToStr((long long)cbProvider->wxItemContainer::GetClientData(cbProvider->GetCurrentSelection())) + wxT(", ")
+ NumToStr(cluster->GetLocalNodeID()); + NumToStr(cluster->GetLocalNodeID());
} }
sql += wxT(", ") sql += wxT(", ")

View file

@ -124,7 +124,7 @@ int dlgRepTable::Go(bool modal)
pgObject *dlgRepTable::CreateObject(pgCollection *collection) pgObject *dlgRepTable::CreateObject(pgCollection *collection)
{ {
pgObject *obj = slTableFactory.CreateObjects(collection, 0, pgObject *obj = slTableFactory.CreateObjects(collection, 0,
wxT(" WHERE tab_reloid = ") + NumToStr((OID)cbTable->wxItemContainer::GetClientData(cbTable->GetGuessedSelection()))); wxT(" WHERE tab_reloid = ") + NumToStr((long long)cbTable->wxItemContainer::GetClientData(cbTable->GetGuessedSelection())));
return obj; return obj;
} }
@ -147,7 +147,7 @@ void dlgRepTable::OnChangeTable(wxCommandEvent &ev)
if (sel >= 0) if (sel >= 0)
{ {
OID relid = (OID)cbTable->wxItemContainer::GetClientData(sel); OID relid = (long long)cbTable->wxItemContainer::GetClientData(sel);
pgSet *idx = connection->ExecuteSet( pgSet *idx = connection->ExecuteSet(
wxT("SELECT relname\n") wxT("SELECT relname\n")

View file

@ -1150,7 +1150,7 @@ wxPoint FormatterSQL::align_level(int start_i, int level, int Xpos, int Ypos, in
if ((vi->txt.Lower() == "dblink")) { if ((vi->txt.Lower() == "dblink")) {
// neededNewLine.y = -1; // neededNewLine.y = -1;
} }
if ((s == 2511)) { if (s == 2511) {
p.x = p.x; p.x = p.x;
} }
if (fl & newLineComma) { if (fl & newLineComma) {

View file

@ -3,6 +3,7 @@
#include "wx/stdpaths.h" #include "wx/stdpaths.h"
#include "utils/utffile.h" #include "utils/utffile.h"
#include "utils/json/jsonval.h" #include "utils/json/jsonval.h"
#include "frm/frmStatus.h"
void WaitSample::Init() { void WaitSample::Init() {
wxString clr = "h1 { \ wxString clr = "h1 { \

View file

@ -13,7 +13,7 @@
#endif #endif
#include "pgAdmin3.h" #include "pgAdmin3.h"
#include "utils/json/jsonreader.h"
#include <wx/mstream.h> #include <wx/mstream.h>
#include <wx/sstream.h> #include <wx/sstream.h>
@ -1847,13 +1847,13 @@ wxJSONReader::ConvertCharByChar(wxString& s, const wxMemoryBuffer& utf8Buffer)
@param val the JSON value that will hold the memory buffer value @param val the JSON value that will hold the memory buffer value
@return the last char read or -1 in case of EOF @return the last char read or -1 in case of EOF
*/ */
/*
union byte union byte
{ {
unsigned char c[2]; unsigned char c[2];
short int b; short int b;
}; };
*/
int int
wxJSONReader::ReadMemoryBuff(wxInputStream& is, wxJSONValue& val) wxJSONReader::ReadMemoryBuff(wxInputStream& is, wxJSONValue& val)
{ {

View file

@ -13,6 +13,7 @@
#include "pgAdmin3.h" #include "pgAdmin3.h"
#include "utils/json/jsonwriter.h"
#include <wx/sstream.h> #include <wx/sstream.h>
#include <wx/mstream.h> #include <wx/mstream.h>

View file

@ -328,7 +328,7 @@ void MyDataViewCtrl::OnEVT_DATAVIEW_CONTEXT_MENU(wxCommandEvent& event) {
wxString label = mi->GetLabelText(id); wxString label = mi->GetLabelText(id);
StorageModel* m = dynamic_cast<StorageModel*>(GetModel()); StorageModel* m = dynamic_cast<StorageModel*>(GetModel());
#ifdef WIN32 #ifdef WIN32
int col = (int)mi->GetClientData(); int col = (long long)mi->GetClientData();
#else #else
long nc=(long)mi->GetClientData(); long nc=(long)mi->GetClientData();
int col= nc & 0xFFFF; int col= nc & 0xFFFF;

View file

@ -128,6 +128,12 @@ wxString NumToStr(long value)
result.Printf(wxT("%ld"), value); result.Printf(wxT("%ld"), value);
return result; return result;
} }
wxString NumToStr(long long value)
{
wxString result;
result.Printf(wxT("%lld"), value);
return result;
}
wxString NumToStr(OID value) wxString NumToStr(OID value)
@ -142,6 +148,10 @@ long StrToLong(const wxString &value)
{ {
return atol(value.ToAscii()); return atol(value.ToAscii());
} }
long long StrTolonglong(const wxString &value)
{
return atoll(value.ToAscii());
}
OID StrToOid(const wxString &value) OID StrToOid(const wxString &value)
@ -1206,11 +1216,13 @@ int ExecProcess(const wxString &command, wxArrayString &result)
#ifdef WIN32 #ifdef WIN32
#if (_MSC_VER < 1300) #if (_MSC_VER < 1300)
/* _ftol2 is more than VC7. */ /* _ftol2 is more than VC7. */
/*
extern "C" long _ftol( double ); extern "C" long _ftol( double );
extern "C" long _ftol2( double dblSource ) extern "C" long _ftol2( double dblSource )
{ {
return _ftol( dblSource ); return _ftol( dblSource );
} }
*/
#endif #endif
#endif #endif

View file

@ -12,16 +12,15 @@
// App headers // App headers
#include "pgAdmin3.h" #include "pgAdmin3.h"
#include <wx/dynlib.h> #include <wx/dynlib.h>
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
#pragma comment (lib, "Ws2_32.lib")
#undef ssize_t #undef ssize_t
#define ssize_t long #define ssize_t long
#include "libssh2.h" #include "libssh2.h"
#include "utils/sshTunnel.h" #include "utils/sshTunnel.h"
#include "frm/frmMain.h" #include "frm/frmMain.h"
#pragma comment (lib, "Ws2_32.lib")
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
typedef const char *(*inet_ntop_t) (int af, const void *src, char *dst, socklen_t size); typedef const char *(*inet_ntop_t) (int af, const void *src, char *dst, socklen_t size);
#ifdef WIN32 #ifdef WIN32