summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-11 10:32:09 -0300
committerJames Almer <jamrial@gmail.com>2017-11-11 11:29:16 -0300
commit87865bf6c7001e6fd8c536a247f71a9a426c3bd0 (patch)
tree1a97298933e784025f282c21cbd15b3ce2a84711
parentf87ad3a058bfee786e942106c5c3450c02a66d48 (diff)
parentabf1c058d1bd0ed1b820ea5e501a4484756f00b0 (diff)
Merge commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0'
* commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0': msvc: Properly specify dllexport for data symbols shared across dll boundaries Merged-by: James Almer <jamrial@gmail.com>
-rw-r--r--ffbuild/library.mak2
-rw-r--r--libavcodec/ac3tab.h3
-rw-r--r--libavcodec/dca.h4
-rw-r--r--libavcodec/internal.h10
-rw-r--r--libavcodec/jpegtables.h16
-rw-r--r--libavcodec/mpeg4audio.h3
-rw-r--r--libavcodec/mpegaudiodata.h6
-rw-r--r--libavcodec/raw.h5
-rw-r--r--libavutil/internal.h8
-rw-r--r--libavutil/xga_font_data.h4
10 files changed, 40 insertions, 21 deletions
diff --git a/ffbuild/library.mak b/ffbuild/library.mak
index ed269fdab6..f85ee1ebbf 100644
--- a/ffbuild/library.mak
+++ b/ffbuild/library.mak
@@ -31,6 +31,8 @@ define RULES
$(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
+$(LIBOBJS): CPPFLAGS += -DBUILDING_$(NAME)
+
$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(EXTRALIBS-$$(*F)) $$(ELIBS)
diff --git a/libavcodec/ac3tab.h b/libavcodec/ac3tab.h
index f529fc8077..ade6fb15e7 100644
--- a/libavcodec/ac3tab.h
+++ b/libavcodec/ac3tab.h
@@ -26,10 +26,11 @@
#include "libavutil/internal.h"
#include "ac3.h"
+#include "internal.h"
extern const uint16_t ff_ac3_frame_size_tab[38][3];
extern const uint8_t ff_ac3_channels_tab[8];
-extern av_export const uint16_t avpriv_ac3_channel_layout_tab[8];
+extern av_export_avcodec const uint16_t avpriv_ac3_channel_layout_tab[8];
extern const uint8_t ff_ac3_enc_channel_map[8][2][6];
extern const uint8_t ff_ac3_dec_channel_map[8][2][6];
extern const uint16_t ff_ac3_sample_rate_tab[3];
diff --git a/libavcodec/dca.h b/libavcodec/dca.h
index dcc7c7b395..e96c589c02 100644
--- a/libavcodec/dca.h
+++ b/libavcodec/dca.h
@@ -29,10 +29,10 @@
#include <stdint.h>
#include "libavutil/common.h"
-#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "get_bits.h"
+#include "internal.h"
#define DCA_CORE_FRAME_HEADER_SIZE 18
@@ -195,7 +195,7 @@ enum DCADownMixType {
DCA_DMIX_TYPE_COUNT
};
-extern av_export const uint32_t avpriv_dca_sample_rates[16];
+extern av_export_avcodec const uint32_t avpriv_dca_sample_rates[16];
extern const uint32_t ff_dca_sampling_freqs[16];
extern const uint8_t ff_dca_freq_ranges[16];
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 948d5461c1..522032b108 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -414,4 +414,14 @@ int ff_alloc_a53_sei(const AVFrame *frame, size_t prefix_len,
*/
int64_t ff_guess_coded_bitrate(AVCodecContext *avctx);
+#if defined(_MSC_VER) && CONFIG_SHARED
+#ifdef BUILDING_avcodec
+# define av_export_avcodec __declspec(dllexport)
+#else
+# define av_export_avcodec __declspec(dllimport)
+#endif
+#else
+# define av_export_avcodec
+#endif
+
#endif /* AVCODEC_INTERNAL_H */
diff --git a/libavcodec/jpegtables.h b/libavcodec/jpegtables.h
index 6833b4b166..aa38df4033 100644
--- a/libavcodec/jpegtables.h
+++ b/libavcodec/jpegtables.h
@@ -23,18 +23,18 @@
#include <stdint.h>
-#include "libavutil/internal.h"
+#include "internal.h"
-extern av_export const uint8_t avpriv_mjpeg_bits_dc_luminance[];
-extern av_export const uint8_t avpriv_mjpeg_val_dc[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_bits_dc_luminance[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_val_dc[];
-extern av_export const uint8_t avpriv_mjpeg_bits_dc_chrominance[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_bits_dc_chrominance[];
-extern av_export const uint8_t avpriv_mjpeg_bits_ac_luminance[];
-extern av_export const uint8_t avpriv_mjpeg_val_ac_luminance[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_bits_ac_luminance[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_val_ac_luminance[];
-extern av_export const uint8_t avpriv_mjpeg_bits_ac_chrominance[];
-extern av_export const uint8_t avpriv_mjpeg_val_ac_chrominance[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_bits_ac_chrominance[];
+extern av_export_avcodec const uint8_t avpriv_mjpeg_val_ac_chrominance[];
void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
const uint8_t *bits_table,
diff --git a/libavcodec/mpeg4audio.h b/libavcodec/mpeg4audio.h
index 34471782ab..b9cea8af17 100644
--- a/libavcodec/mpeg4audio.h
+++ b/libavcodec/mpeg4audio.h
@@ -27,6 +27,7 @@
#include "libavutil/attributes.h"
#include "get_bits.h"
+#include "internal.h"
#include "put_bits.h"
typedef struct MPEG4AudioConfig {
@@ -44,7 +45,7 @@ typedef struct MPEG4AudioConfig {
int frame_length_short;
} MPEG4AudioConfig;
-extern av_export const int avpriv_mpeg4audio_sample_rates[16];
+extern av_export_avcodec const int avpriv_mpeg4audio_sample_rates[16];
extern const uint8_t ff_mpeg4audio_channels[8];
/**
diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h
index 29a26588b2..a188150cbf 100644
--- a/libavcodec/mpegaudiodata.h
+++ b/libavcodec/mpegaudiodata.h
@@ -29,13 +29,13 @@
#include <stdint.h>
-#include "libavutil/internal.h"
+#include "internal.h"
#define MODE_EXT_MS_STEREO 2
#define MODE_EXT_I_STEREO 1
-extern av_export const uint16_t avpriv_mpa_bitrate_tab[2][3][15];
-extern av_export const uint16_t avpriv_mpa_freq_tab[3];
+extern av_export_avcodec const uint16_t avpriv_mpa_bitrate_tab[2][3][15];
+extern av_export_avcodec const uint16_t avpriv_mpa_freq_tab[3];
extern const int ff_mpa_sblimit_table[5];
extern const int ff_mpa_quant_steps[17];
extern const int ff_mpa_quant_bits[17];
diff --git a/libavcodec/raw.h b/libavcodec/raw.h
index 24bf4cc55a..28a27b1f9e 100644
--- a/libavcodec/raw.h
+++ b/libavcodec/raw.h
@@ -28,6 +28,7 @@
#define AVCODEC_RAW_H
#include "avcodec.h"
+#include "internal.h"
#include "libavutil/internal.h"
typedef struct PixelFormatTag {
@@ -41,7 +42,7 @@ const struct PixelFormatTag *avpriv_get_raw_pix_fmt_tags(void);
enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc);
-extern av_export const PixelFormatTag avpriv_pix_fmt_bps_avi[];
-extern av_export const PixelFormatTag avpriv_pix_fmt_bps_mov[];
+extern av_export_avcodec const PixelFormatTag avpriv_pix_fmt_bps_avi[];
+extern av_export_avcodec const PixelFormatTag avpriv_pix_fmt_bps_mov[];
#endif /* AVCODEC_RAW_H */
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 6f92f71e8e..c4bf1466ef 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -64,9 +64,13 @@
#endif
#if defined(_MSC_VER) && CONFIG_SHARED
-# define av_export __declspec(dllimport)
+#ifdef BUILDING_avutil
+# define av_export_avutil __declspec(dllexport)
#else
-# define av_export
+# define av_export_avutil __declspec(dllimport)
+#endif
+#else
+# define av_export_avutil
#endif
#if HAVE_PRAGMA_DEPRECATED
diff --git a/libavutil/xga_font_data.h b/libavutil/xga_font_data.h
index 5e40f542e4..69dc337120 100644
--- a/libavutil/xga_font_data.h
+++ b/libavutil/xga_font_data.h
@@ -29,7 +29,7 @@
#include <stdint.h>
#include "internal.h"
-extern av_export const uint8_t avpriv_cga_font[2048];
-extern av_export const uint8_t avpriv_vga16_font[4096];
+extern av_export_avutil const uint8_t avpriv_cga_font[2048];
+extern av_export_avutil const uint8_t avpriv_vga16_font[4096];
#endif /* AVUTIL_XGA_FONT_DATA_H */