Skip to content

Implementation of ODBC's setup API #13

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

Merged
merged 9 commits into from
Aug 13, 2018
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.swp
driver/*.swp
builds/*
cscope.out
.vs
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ add_custom_target(curlclean
WORKING_DIRECTORY "${LIBCURL_PATH_SRC}/winbuild"
)


message("Driver source files: ${DRV_SRC} .")
message("Driver include paths: " ${ODBC_INC} ${DRV_SRC_DIR}
${LIBCURL_INC_PATH} ${UJSON4C_INC} ${CTIMESTAMP_PATH_SRC})
Expand All @@ -223,7 +222,7 @@ target_compile_definitions(${DRV_NAME} PRIVATE "DRIVER_BUILD")
include_directories(${ODBC_INC} ${DRV_SRC_DIR} ${LIBCURL_INC_PATH}
${UJSON4C_INC} ${CTIMESTAMP_PATH_SRC})

target_link_libraries(${DRV_NAME} libcurl)
target_link_libraries(${DRV_NAME} odbccp32 legacy_stdio_definitions libcurl)

# add testing project/target
enable_testing()
Expand Down
6 changes: 4 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ REM USAGE function: output a usage message
echo setup : invoke MSVC's build environment setup script before
echo building (requires 2017 version or later^).
echo clean : remove all the files in the build dir.
echo proper : clean both the libs and builds dirs and exit.
echo proper : clean libs, builds and project dirs and exit.
echo nobuild : skip project building (the default is to build^).
echo type=T : selects the build type; T can be one of Debug/Release/
echo RelWithDebInfo/MinSizeRel^); defaults to Debug.
Expand Down Expand Up @@ -276,6 +276,8 @@ REM PROPER function: clean up the build and libs dir.
MSBuild %BUILD_DIR%\curlclean.vcxproj
)
call:CLEAN
REM delete VisualStudio files
rmdir /S /Q .vs

goto:eof

Expand Down Expand Up @@ -385,7 +387,7 @@ REM BUILD function: build various targets
REM file name expansion, cmd style...
for /f %%i in ("%DRIVER_BASE_NAME%*.vcxproj") do MSBuild %%~nxi %MSBUILD_ARGS%

if not ERRORLEVEL 1 if /i not [%ARG:symbols=%] == [%ARG%] (
if not ERRORLEVEL 1 if /i not [%ARG:exports=%] == [%ARG%] (
dumpbin /exports %CFG_INTDIR%\%DRIVER_BASE_NAME%*.dll
)
)
Expand Down
2 changes: 0 additions & 2 deletions builds/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion devtools/astyle-c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
# Ensure astyle is available and is of the right version to have all below
# parameters supported.
#
if ! which -s astyle ; then
if ! which astyle &>/dev/null ; then
echo "ERROR: The astyle code formatter is not available. Exiting."
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion driver/build_def.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ REM Helper script to generate the definition file of symbols to export in DLL
@echo off

REM TODO: find out a smart way for this filtering
set FILTER="Select-String -Pattern 'SQLRETURN\s+SQL_API\s+\w+' *.c | %%{ [regex]::split($_, '\s+')[2]; } | %%{ [regex]::split($_, '\(')[0]; }"
set FILTER="Select-String -Pattern '^\w+\s+SQL_API\s+\w+(\(|$)' *.c | %%{ [regex]::split($_, '\s+')[2]; } | %%{ [regex]::split($_, '\(')[0]; }"

set DRV_NAME=%1
set OUTFILE=%2
Expand Down
3 changes: 3 additions & 0 deletions driver/catalogue.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ size_t quote_tokens(SQLWCHAR *src, size_t len, SQLWCHAR *dest)
}
*pos ++ = src[i];
}
if (copying) {
*pos ++ = L'\''; /* end last token */
}
/* should not overrun */
assert(i < 2/*see typ_buf below*/ * ESODBC_MAX_IDENTIFIER_LEN);
return pos - dest;
Expand Down
Loading