Skip to content

Commit

Permalink
Fix vrogier#20 (compilation under Oracle 8i was broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrogier authored and alexeyvo committed Dec 2, 2015
1 parent fa1f27a commit aab35a6
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/column.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ boolean OCI_ColumnMap
{
case SQLT_INT:
case SQLT_UNDOCUMENTED_BIN_INTEGER:
#if OCI_VERSION_COMPILE >= OCI_12_1
case OCI_TYPECODE_PLS_INTEGER:
#endif
{
col->datatype = OCI_CDT_NUMERIC;
col->libcode = SQLT_INT;
Expand Down
6 changes: 4 additions & 2 deletions src/element.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ OCI_Timestamp * OCI_API OCI_ElemGetTimestamp
#else

OCI_LIB_CALL_ENTER( OCI_Timestamp *, NULL)
OCI_CHECK_PTR(OCI_IPC_ELEMENT, elem)
call_status = TRUE;
OCI_LIB_CALL_EXIT()

Expand Down Expand Up @@ -706,6 +707,7 @@ OCI_Interval * OCI_API OCI_ElemGetInterval
#else

OCI_LIB_CALL_ENTER( OCI_Interval *, NULL)
OCI_CHECK_PTR(OCI_IPC_ELEMENT, elem)
call_status = TRUE;
OCI_LIB_CALL_EXIT()

Expand Down Expand Up @@ -1058,8 +1060,8 @@ boolean OCI_API OCI_ElemSetTimestamp
#else

OCI_LIB_CALL_ENTER(boolean, FALSE)
OCI_CHECK_PTR(OCI_IPC_ELEMENT, elem)
call_status = TRUE;
call_retval = FALSE;
OCI_LIB_CALL_EXIT()

#endif
Expand Down Expand Up @@ -1090,8 +1092,8 @@ boolean OCI_API OCI_ElemSetInterval
#else

OCI_LIB_CALL_ENTER(boolean, FALSE)
OCI_CHECK_PTR(OCI_IPC_ELEMENT, elem)
call_status = TRUE;
call_retval = FALSE;
OCI_LIB_CALL_EXIT()

#endif
Expand Down
6 changes: 6 additions & 0 deletions src/interval.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ OCI_Interval * OCI_API OCI_IntervalCreate

OCI_CHECK_INITIALIZED()
OCI_CHECK_INTERVAL_ENABLED(con)

#if OCI_VERSION_COMPILE >= OCI_9_0
OCI_CHECK_ENUM_VALUE(con, NULL, type, IntervalTypeValues, OTEXT("Interval type"));
#endif

call_retval = OCI_IntervalInit(con, &call_retval, NULL, type);
call_status = (NULL != call_retval);
Expand Down Expand Up @@ -207,7 +210,10 @@ OCI_Interval ** OCI_API OCI_IntervalArrayCreate

OCI_CHECK_PTR(OCI_IPC_CONNECTION, con)
OCI_CHECK_INTERVAL_ENABLED(con)

#if OCI_VERSION_COMPILE >= OCI_9_0
OCI_CHECK_ENUM_VALUE(con, NULL, type, IntervalTypeValues, OTEXT("Interval type"))
#endif

#if OCI_VERSION_COMPILE >= OCI_9_0

Expand Down
6 changes: 3 additions & 3 deletions src/lob.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ boolean OCI_API OCI_LobRead2

if (OCILib.nls_utf8)
{
(*char_count) = OCI_StringUTF8Length((const char *) buffer);
(*char_count) = (ub4) OCI_StringLength((const char *)buffer, sizeof(char));
}

#endif
Expand Down Expand Up @@ -575,7 +575,7 @@ boolean OCI_API OCI_LobWrite2

#ifndef OCI_LOB2_API_ENABLED

(*char_count) = OCI_StringLength((const char *) buffer, sizeof(char));
(*char_count) = (ub4) OCI_StringLength((const char *)buffer, sizeof(char));

#endif

Expand Down Expand Up @@ -1062,7 +1062,7 @@ boolean OCI_API OCI_LobAppend2

#ifndef OCI_LOB2_API_ENABLED

(*char_count) = OCI_StringLength((const char *) buffer, sizeof(char));
(*char_count) = (ub4) OCI_StringLength((const char *)buffer, sizeof(char));

#endif

Expand Down
10 changes: 7 additions & 3 deletions src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ OCI_Timestamp * OCI_API OCI_ObjectGetTimestamp
#else

OCI_LIB_CALL_ENTER( OCI_Timestamp *, NULL)
OCI_CHECK_PTR(OCI_IPC_OBJECT, obj)
call_status = TRUE;
OCI_LIB_CALL_EXIT()

Expand Down Expand Up @@ -1247,7 +1248,8 @@ OCI_Interval * OCI_API OCI_ObjectGetInterval

#else

OCI_LIB_CALL_ENTER( OCI_Timestamp *, NULL)
OCI_LIB_CALL_ENTER(OCI_Interval *, NULL)
OCI_CHECK_PTR(OCI_IPC_OBJECT, obj)
call_status = TRUE;
OCI_LIB_CALL_EXIT()

Expand Down Expand Up @@ -1607,7 +1609,8 @@ boolean OCI_API OCI_ObjectSetTimestamp
#else

OCI_LIB_CALL_ENTER(boolean, FALSE)
call_retval = call_status = TRUE;
OCI_CHECK_PTR(OCI_IPC_OBJECT, obj)
call_status = TRUE;
OCI_LIB_CALL_EXIT()

#endif
Expand Down Expand Up @@ -1636,7 +1639,8 @@ boolean OCI_API OCI_ObjectSetInterval
#else

OCI_LIB_CALL_ENTER(boolean, FALSE)
call_retval = call_status = TRUE;
OCI_CHECK_PTR(OCI_IPC_OBJECT, obj)
call_status = TRUE;
OCI_LIB_CALL_EXIT()

#endif
Expand Down
2 changes: 1 addition & 1 deletion src/ocilib_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ boolean OCI_API OCI_ExecuteInternal

size_t OCI_StringLength
(
void *ptr,
void const *ptr,
size_t size_elem
);

Expand Down
9 changes: 6 additions & 3 deletions src/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,6 @@ boolean OCI_API OCI_BindArrayOfTimestamps

OCI_NOT_USED(name)
OCI_NOT_USED(type)
OCI_NOT_USED(code)
OCI_NOT_USED(nbelem)

#endif
Expand Down Expand Up @@ -3132,7 +3131,6 @@ boolean OCI_API OCI_BindInterval
#else

OCI_NOT_USED(name)
OCI_NOT_USED(code)

#endif

Expand Down Expand Up @@ -3171,7 +3169,6 @@ boolean OCI_API OCI_BindArrayOfIntervals

OCI_NOT_USED(name)
OCI_NOT_USED(type)
OCI_NOT_USED(code)
OCI_NOT_USED(nbelem)

#endif
Expand Down Expand Up @@ -3264,7 +3261,10 @@ boolean OCI_API OCI_BindArrayOfLobs
OCI_LIB_CALL_ENTER(boolean, FALSE)

OCI_CHECK_BIND_CALL(stmt, name, data, OCI_IPC_LOB, FALSE)

#if OCI_VERSION_COMPILE >= OCI_9_0
OCI_CHECK_ENUM_VALUE(stmt->con, stmt, type, LobTypeValues, OTEXT("Lob type"))
#endif

call_status = OCI_BindData(stmt, data, sizeof(OCILobLocator*), name, OCI_CDT_LOB,
OCI_ExternalSubTypeToSQLType(OCI_CDT_LOB, type),
Expand Down Expand Up @@ -3784,7 +3784,10 @@ boolean OCI_API OCI_RegisterLob
OCI_LIB_CALL_ENTER(boolean, FALSE)

OCI_CHECK_REGISTER_CALL(stmt, name)

#if OCI_VERSION_COMPILE >= OCI_9_0
OCI_CHECK_ENUM_VALUE(stmt->con, stmt, type, LobTypeValues, OTEXT("Lob type"))
#endif

call_status = OCI_BindData(stmt, NULL, sizeof(OCILobLocator*), name, OCI_CDT_LOB,
OCI_ExternalSubTypeToSQLType(OCI_CDT_LOB, type),
Expand Down
2 changes: 1 addition & 1 deletion src/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

size_t OCI_StringLength
(
void *ptr,
const void *ptr,
size_t size_elem
)
{
Expand Down

0 comments on commit aab35a6

Please sign in to comment.