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

Renamed cfree wrapper to avoid conflict with standard library. #140

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion func.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (ctx Context) ResultText(v string) {
if len(v) != 0 {
cv = C.CString(v)
}
C.sqlite3_result_text(ctx.ptr, cv, C.int(len(v)), (*[0]byte)(C.cfree))
C.sqlite3_result_text(ctx.ptr, cv, C.int(len(v)), (*[0]byte)(C.sqlitego_free))
}
func (ctx Context) ResultError(err error) {
if err, isError := err.(Error); isError {
Expand Down
2 changes: 1 addition & 1 deletion sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ func (stmt *Stmt) BindText(param int, value string) {
v = emptyCstr
} else {
v = C.CString(value)
free = (*[0]byte)(C.cfree)
free = (*[0]byte)(C.sqlitego_free)
}
res := C.sqlite3_bind_text(stmt.stmt, C.int(param), v, C.int(len(value)), free)
stmt.handleBindErr("BindText", res)
Expand Down
2 changes: 1 addition & 1 deletion wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <stdlib.h>
#include <sqlite3.h>

void cfree(void *p) {
void sqlitego_free(void *p) {
free(p);
};

Expand Down
4 changes: 2 additions & 2 deletions wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#ifndef WRAPPERS_H
#define WRAPPERS_H

/* cfree wraps free to fix https://github.com/crawshaw/sqlite/issues/60 */
void cfree(void *p);
/* wraps free to fix https://github.com/crawshaw/sqlite/issues/60 */
void sqlitego_free(void *p);

int c_strm_w_tramp(void*, const void*, int);
int c_strm_r_tramp(void*, const void*, int*);
Expand Down