Make default symbol visibility to hidden with explicit public visibility specified.
Add missing static scope to a few more places.
This commit is contained in:
parent
c859cf35d5
commit
7743792018
7 changed files with 26 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@ files.lst
|
|||
*.o
|
||||
*.so
|
||||
pcompress
|
||||
libpcompress*
|
||||
Makefile
|
||||
test.log
|
||||
test/datafiles
|
||||
|
|
|
@ -215,8 +215,8 @@ DEBUG_CPPFLAGS = $(COMMON_CPPFLAGS)
|
|||
DEBUG_FPTR_FLAG =
|
||||
|
||||
RELEASE_LINK = g++ -pthread @LIBBSCGEN_OPT@ @EXTRA_OPT_FLAGS@ -fopenmp -fPIC
|
||||
RELEASE_COMPILE = gcc -c @EXTRA_OPT_FLAGS@ -fPIC
|
||||
RELEASE_COMPILE_cpp = g++ -c @EXTRA_OPT_FLAGS@ -fPIC
|
||||
RELEASE_COMPILE = gcc -c @EXTRA_OPT_FLAGS@ -fPIC -fvisibility=hidden
|
||||
RELEASE_COMPILE_cpp = g++ -c @EXTRA_OPT_FLAGS@ -fPIC -fvisibility=hidden
|
||||
RELEASE_VEC_FLAGS = $(COMMON_VEC_FLAGS)
|
||||
RELEASE_LOOP_OPTFLAGS = $(COMMON_LOOP_OPTFLAGS)
|
||||
RELEASE_CPPFLAGS = $(COMMON_CPPFLAGS) -DNDEBUG
|
||||
|
|
18
pcompress.c
18
pcompress.c
|
@ -78,7 +78,7 @@ static void * writer_thread(void *dat);
|
|||
static int init_algo(pc_ctx_t *pctx, const char *algo, int bail);
|
||||
extern uint32_t lzma_crc32(const uint8_t *buf, uint64_t size, uint32_t crc);
|
||||
|
||||
void
|
||||
void DLL_EXPORT
|
||||
usage(pc_ctx_t *pctx)
|
||||
{
|
||||
fprintf(stderr,
|
||||
|
@ -686,7 +686,7 @@ cont:
|
|||
*/
|
||||
#define UNCOMP_BAIL err = 1; goto uncomp_done
|
||||
|
||||
int
|
||||
int DLL_EXPORT
|
||||
start_decompress(pc_ctx_t *pctx, const char *filename, const char *to_filename)
|
||||
{
|
||||
char algorithm[ALGO_SZ];
|
||||
|
@ -1689,7 +1689,7 @@ do_cancel:
|
|||
*/
|
||||
#define COMP_BAIL err = 1; goto comp_done
|
||||
|
||||
int
|
||||
int DLL_EXPORT
|
||||
start_compress(pc_ctx_t *pctx, const char *filename, uint64_t chunksize, int level)
|
||||
{
|
||||
struct wdata w;
|
||||
|
@ -2516,7 +2516,7 @@ init_algo(pc_ctx_t *pctx, const char *algo, int bail)
|
|||
/*
|
||||
* Pcompress context handling functions.
|
||||
*/
|
||||
pc_ctx_t *
|
||||
pc_ctx_t DLL_EXPORT *
|
||||
create_pc_context(void)
|
||||
{
|
||||
pc_ctx_t *ctx = (pc_ctx_t *)malloc(sizeof (pc_ctx_t));
|
||||
|
@ -2537,7 +2537,7 @@ create_pc_context(void)
|
|||
return (ctx);
|
||||
}
|
||||
|
||||
void
|
||||
void DLL_EXPORT
|
||||
destroy_pc_context(pc_ctx_t *pctx)
|
||||
{
|
||||
if (pctx->do_compress)
|
||||
|
@ -2549,7 +2549,7 @@ destroy_pc_context(pc_ctx_t *pctx)
|
|||
slab_cleanup(pctx->hide_mem_stats);
|
||||
}
|
||||
|
||||
int
|
||||
int DLL_EXPORT
|
||||
init_pc_context_argstr(pc_ctx_t *pctx, char *args)
|
||||
{
|
||||
int ac;
|
||||
|
@ -2568,7 +2568,7 @@ init_pc_context_argstr(pc_ctx_t *pctx, char *args)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
int DLL_EXPORT
|
||||
init_pc_context(pc_ctx_t *pctx, int argc, char *argv[])
|
||||
{
|
||||
int opt, num_rem, err, my_optind;
|
||||
|
@ -2859,7 +2859,7 @@ init_pc_context(pc_ctx_t *pctx, int argc, char *argv[])
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
int DLL_EXPORT
|
||||
start_pcompress(pc_ctx_t *pctx)
|
||||
{
|
||||
int err;
|
||||
|
@ -2877,7 +2877,7 @@ start_pcompress(pc_ctx_t *pctx)
|
|||
/*
|
||||
* Setter functions for various parameters in the context.
|
||||
*/
|
||||
void
|
||||
void DLL_EXPORT
|
||||
pc_set_userpw(pc_ctx_t *pctx, unsigned char *pwdata, int pwlen)
|
||||
{
|
||||
pctx->user_pw = pwdata;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/*
|
||||
* PPMd model order to working set memory size mappings.
|
||||
*/
|
||||
unsigned int ppmd8_mem_sz[] = {
|
||||
static unsigned int ppmd8_mem_sz[] = {
|
||||
(16 << 20),
|
||||
(16 << 20),
|
||||
(32 << 20),
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#define XOP_FLAG 0x800
|
||||
#define AES_FLAG 0x2000000
|
||||
|
||||
void
|
||||
static void
|
||||
exec_cpuid(uint32_t *regs)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* moinakg@belenix.org, http://moinakg.wordpress.com/
|
||||
*/
|
||||
|
@ -93,7 +93,6 @@ struct cpu_raw_data_t {
|
|||
char vendor_str[VENDOR_STR_MAX];
|
||||
};
|
||||
|
||||
void exec_cpuid(uint32_t *regs);
|
||||
void cpuid_get_raw_data(struct cpu_raw_data_t* data);
|
||||
void cpuid_basic_identify(processor_info_t *pc);
|
||||
|
||||
|
|
|
@ -134,6 +134,14 @@ typedef int32_t bsize_t;
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define DLL_EXPORT __attribute__ ((visibility ("default")))
|
||||
#define DLL_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#else
|
||||
#define DLL_EXPORT
|
||||
#define DLL_LOCAL
|
||||
#endif
|
||||
|
||||
#define ISP2(x) ((x != 0) && ((x & (~x + 1)) == x))
|
||||
|
||||
#ifdef DEBUG_STATS
|
||||
|
|
Loading…
Reference in a new issue