Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2014-07-31 03:02:14 +0400
committerAdam Langley <agl@google.com>2014-08-01 02:03:11 +0400
commiteb7d2ed1fe8a33b3e3871502ba7e12efaf94360c (patch)
treef6bcb80a83aef47e8a23210618792c08c54cba92 /include/openssl/mem.h
parent60d4c0e81042e4c014f38575a72c4befded62eef (diff)
Add visibility rules.
This change marks public symbols as dynamically exported. This means that it becomes viable to build a shared library of libcrypto and libssl with -fvisibility=hidden. On Windows, one not only needs to mark functions for export in a component, but also for import when using them from a different component. Because of this we have to build with |BORINGSSL_IMPLEMENTATION| defined when building the code. Other components, when including our headers, won't have that defined and then the |OPENSSL_EXPORT| tag becomes an import tag instead. See the #defines in base.h In the asm code, symbols are now hidden by default and those that need to be exported are wrapped by a C function. In order to support Chromium, a couple of libssl functions were moved to ssl.h from ssl_locl.h: ssl_get_new_session and ssl_update_cache. Change-Id: Ib4b76e2f1983ee066e7806c24721e8626d08a261 Reviewed-on: https://boringssl-review.googlesource.com/1350 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'include/openssl/mem.h')
-rw-r--r--include/openssl/mem.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/openssl/mem.h b/include/openssl/mem.h
index 0d04c95b..293e04bf 100644
--- a/include/openssl/mem.h
+++ b/include/openssl/mem.h
@@ -82,29 +82,29 @@ void *OPENSSL_realloc_clean(void *ptr, size_t old_size, size_t new_size);
/* OPENSSL_cleanse zeros out |len| bytes of memory at |ptr|. This is similar to
* |memset_s| from C11. */
-void OPENSSL_cleanse(void *ptr, size_t len);
+OPENSSL_EXPORT void OPENSSL_cleanse(void *ptr, size_t len);
/* CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. It
* takes an amount of time dependent on |len|, but independent of the contents
* of |a| and |b|. Unlike memcmp, it cannot be used to put elements into a
* defined order as the return value when a != b is undefined, other than to be
* non-zero. */
-int CRYPTO_memcmp(const void *a, const void *b, size_t len);
+OPENSSL_EXPORT int CRYPTO_memcmp(const void *a, const void *b, size_t len);
/* OPENSSL_hash32 implements the 32 bit, FNV-1a hash. */
-uint32_t OPENSSL_hash32(const void *ptr, size_t len);
+OPENSSL_EXPORT uint32_t OPENSSL_hash32(const void *ptr, size_t len);
/* OPENSSL_strdup has the same behaviour as strdup(3). */
-char *OPENSSL_strdup(const char *s);
+OPENSSL_EXPORT char *OPENSSL_strdup(const char *s);
/* OPENSSL_strnlen has the same behaviour as strnlen(3). */
-size_t OPENSSL_strnlen(const char *s, size_t len);
+OPENSSL_EXPORT size_t OPENSSL_strnlen(const char *s, size_t len);
/* OPENSSL_strcasecmp has the same behaviour as strcasecmp(3). */
-int OPENSSL_strcasecmp(const char *a, const char *b);
+OPENSSL_EXPORT int OPENSSL_strcasecmp(const char *a, const char *b);
/* OPENSSL_strncasecmp has the same behaviour as strncasecmp(3). */
-int OPENSSL_strncasecmp(const char *a, const char *b, size_t n);
+OPENSSL_EXPORT int OPENSSL_strncasecmp(const char *a, const char *b, size_t n);
/* DECIMAL_SIZE returns an upper bound for the length of the decimal
* representation of the given type. */
@@ -120,10 +120,11 @@ int OPENSSL_strncasecmp(const char *a, const char *b, size_t n);
#else
#define __bio_h__attr__(x)
#endif
-int BIO_snprintf(char *buf, size_t n, const char *format, ...)
+OPENSSL_EXPORT int BIO_snprintf(char *buf, size_t n, const char *format, ...)
__bio_h__attr__((__format__(__printf__, 3, 4)));
-int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
+OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format,
+ va_list args)
__bio_h__attr__((__format__(__printf__, 3, 0)));
#undef __bio_h__attr__