Skip to content

Commit

Permalink
ChangeLog formatting and global variable attribute changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emilienlemaire committed Dec 12, 2024
1 parent 66934e3 commit 9afa7a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion libcob/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

2024-12-11 Emilien Lemaire <[email protected]>

* fileio.c: Always use `bdb_app_data` global variable to save the
pointer to the collating sequence function
pointer to the collating sequence function

2024-12-08 Simon Sobisch <[email protected]>

Expand Down
15 changes: 8 additions & 7 deletions libcob/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,14 @@ static unsigned int bdb_lock_id = 0;
key.data = fld->data; \
key.size = (cob_dbtsize_t) fld->size

/* #if (DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR > 0))
#define DBT_SET_APP_DATA(key,data) ((key)->app_data = (data))
#define DBT_GET_APP_DATA(key) ((key)->app_data)
#else
*/
/* Workaround for older BDB versions that do not have app_data in DBT */
static void *bdb_app_data = NULL;
/* #if DB_VERSION_MAJOR >= 6 *//* while the fields are part of DBT since 4.1, it wasn't
made part of the public API before 6.0 (DB_VERSION_FAMILY 12);
older versions overwrite that, see bug NNN */
/* #define DBT_SET_APP_DATA(key,data) ((key)->app_data = (data))
#define DBT_GET_APP_DATA(key) ((key)->app_data)
#else */
/* Used to save the collating sequence function, see bug 1032 */
COB_TLS void *bdb_app_data = NULL;
#define DBT_SET_APP_DATA(key,data) ((void)(key), bdb_app_data = (data))
#define DBT_GET_APP_DATA(key) ((void)(key), bdb_app_data)
/* #endif */
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite.src/run_file.at
Original file line number Diff line number Diff line change
Expand Up @@ -14654,6 +14654,7 @@ AT_CHECK([diff expected.txt prog2.txt])

AT_CLEANUP


AT_SETUP([DELETE WITH COLLATING SEQUENCE])
AT_KEYWORDS([runfile WRITE DELETE READ EBCDIC])

Expand Down

0 comments on commit 9afa7a7

Please sign in to comment.