1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Add the usual "#ifdef __cplusplus" magic to header file ext/misc/carray.h. Also update carray.h/carray.c to use SQLITE_API in the usual way.

FossilOrigin-Name: 0f97c2a459bfadc2fe19e710e8845039b4434010656d311074b9594b02d0826a
This commit is contained in:
dan
2021-07-09 11:52:53 +00:00
parent a13c0c73c5
commit f33e7795b3
4 changed files with 54 additions and 23 deletions

View File

@ -56,14 +56,24 @@
SQLITE_EXTENSION_INIT1
#include <assert.h>
#include <string.h>
/* Allowed values for the mFlags parameter to sqlite3_carray_bind().
** Must exactly match the definitions in carray.h.
*/
#define CARRAY_INT32 0 /* Data is 32-bit signed integers */
#define CARRAY_INT64 1 /* Data is 64-bit signed integers */
#define CARRAY_DOUBLE 2 /* Data is doubles */
#define CARRAY_TEXT 3 /* Data is char* */
#ifndef CARRAY_INT32
# define CARRAY_INT32 0 /* Data is 32-bit signed integers */
# define CARRAY_INT64 1 /* Data is 64-bit signed integers */
# define CARRAY_DOUBLE 2 /* Data is doubles */
# define CARRAY_TEXT 3 /* Data is char* */
#endif
#ifndef SQLITE_API
# ifdef _WIN32
# define SQLITE_API __declspec(dllexport)
# else
# define SQLITE_API
# endif
#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
@ -400,10 +410,7 @@ static void carrayBindDel(void *pPtr){
** Invoke this interface in order to bind to the single-argument
** version of CARRAY().
*/
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_carray_bind(
SQLITE_API int sqlite3_carray_bind(
sqlite3_stmt *pStmt,
int idx,
void *aData,
@ -498,10 +505,7 @@ static void inttoptrFunc(
#endif /* SQLITE_OMIT_VIRTUALTABLE */
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_carray_init(
SQLITE_API int sqlite3_carray_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi

View File

@ -1,12 +1,32 @@
/*
** 2020-11-17
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
**
** Interface definitions for the CARRAY table-valued function
** extension.
*/
#ifndef _CARRAY_H
#define _CARRAY_H
#include "sqlite3.h" /* Required for error code definitions */
#ifdef __cplusplus
extern "C" {
#endif
/* Use this interface to bind an array to the single-argument version
** of CARRAY().
*/
int sqlite3_carray_bind(
SQLITE_API int sqlite3_carray_bind(
sqlite3_stmt *pStmt, /* Statement to be bound */
int i, /* Parameter index */
void *aData, /* Pointer to array data */
@ -21,3 +41,10 @@ int sqlite3_carray_bind(
#define CARRAY_INT64 1 /* Data is 64-bit signed integers */
#define CARRAY_DOUBLE 2 /* Data is doubles */
#define CARRAY_TEXT 3 /* Data is char* */
#ifdef __cplusplus
} /* end of the 'extern "C"' block */
#endif
#endif /* ifndef _CARRAY_H */