Skip to content

Commit f0c3784

Browse files
authored
Merge pull request #153 from pali/master
Do not export driver private C functions
2 parents 1b4c220 + b537a6f commit f0c3784

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

dbdimp.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515

1616
#include "dbdimp.h"
1717

18+
#ifdef HAVE_GET_CHARSET_NUMBER
19+
/* Available only in some clients and declared in header file my_sys.h which cannot be included */
20+
unsigned int get_charset_number(const char *cs_name, unsigned int cs_flags);
21+
#endif
22+
23+
#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4))
24+
/* Do not export non-static functions from driver library */
25+
#pragma GCC visibility push(hidden)
26+
#endif
27+
1828
#define ASYNC_CHECK_RETURN(h, value)\
1929
if(imp_dbh->async_query_in_flight) {\
2030
mariadb_dr_do_error(h, CR_UNKNOWN_ERROR, "Calling a synchronous function on an asynchronous handle", "HY000");\
@@ -513,7 +523,7 @@ PERL_STATIC_INLINE bool mysql_charsetnr_is_utf8(unsigned int id)
513523
/*
514524
count embedded options
515525
*/
516-
int count_embedded_options(char *st)
526+
static int count_embedded_options(char *st)
517527
{
518528
int rc;
519529
char c;
@@ -538,7 +548,7 @@ int count_embedded_options(char *st)
538548
/*
539549
Free embedded options
540550
*/
541-
int free_embedded_options(char ** options_list, int options_count)
551+
static int free_embedded_options(char ** options_list, int options_count)
542552
{
543553
int i;
544554

@@ -556,7 +566,7 @@ int free_embedded_options(char ** options_list, int options_count)
556566
Print out embedded option settings
557567
558568
*/
559-
int print_embedded_options(PerlIO *stream, char ** options_list, int options_count)
569+
static int print_embedded_options(PerlIO *stream, char ** options_list, int options_count)
560570
{
561571
int i;
562572

@@ -573,7 +583,7 @@ int print_embedded_options(PerlIO *stream, char ** options_list, int options_cou
573583
/*
574584
575585
*/
576-
char **fill_out_embedded_options(char *options,
586+
static char **fill_out_embedded_options(char *options,
577587
int options_type,
578588
STRLEN slen, int cnt)
579589
{
@@ -1364,11 +1374,6 @@ static void error_no_connection(SV *h, const char *msg)
13641374
mariadb_dr_do_error(h, CR_CONNECTION_ERROR, msg, "HY000");
13651375
}
13661376

1367-
#ifdef HAVE_GET_CHARSET_NUMBER
1368-
/* Available only in some clients and declared in header file my_sys.h which cannot be included */
1369-
unsigned int get_charset_number(const char *cs_name, unsigned int cs_flags);
1370-
#endif
1371-
13721377
/***************************************************************************
13731378
*
13741379
* Name: mariadb_dr_connect

socket.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
#include <unistd.h>
1717
#endif
1818

19+
#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4))
20+
/* Do not export non-static functions from driver library */
21+
#pragma GCC visibility push(hidden)
22+
#endif
23+
1924
/*
2025
* Warning: Native socket code must be outside of dbdimp.c and dbdimp.h because
2126
* perl header files redefine socket function. This file must not

0 commit comments

Comments
 (0)