Skip to content

Commit

Permalink
Wrap up some variadic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
emlynmac committed Aug 23, 2021
1 parent db32719 commit d1be9a6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.build
.DS_Store
DerivedData
.swiftpm
14 changes: 13 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ let package = Package(
name: "Copus",
targets: ["Copus"]
),
.library(
name: "Copus-wrapper",
targets: ["Copus-wrapper"]
),
.library(
name: "Opus",
targets: ["Opus", "Copus"]
Expand All @@ -28,6 +32,8 @@ let package = Package(
"AUTHORS",
"autogen.sh",
"celt/arm",
"celt_headers.mk",
"celt_sources.mk",
"celt/dump_modes",
"celt/meson.build",
"celt/opus_custom_demo.c",
Expand All @@ -50,6 +56,8 @@ let package = Package(
"meson.build",
"meson",
"NEWS",
"opus_headers.mk",
"opus_sources.mk",
"opus-uninstalled.pc.in",
"opus.m4",
"opus.pc.in",
Expand Down Expand Up @@ -102,9 +110,13 @@ let package = Package(
.define("HAVE_UNISTD_H", to: "1"),
]
),
.target(
name: "Copus-wrapper",
dependencies: ["Copus"]
),
.target(
name: "Opus",
dependencies: ["Copus"]
dependencies: ["Copus", "Copus-wrapper"]
),
.testTarget(
name: "OpusTests",
Expand Down
4 changes: 2 additions & 2 deletions Sources/Copus-wrapper/variadic-wrapper.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "variadic-wrapper.h"

int opus_custom_encoder_ctl_wrapper(CELTEncoder *OPUS_RESTRICT st, int request, opus_int32 val)
int opus_custom_encoder_ctl_wrapper(OpusCustomEncoder *OPUS_RESTRICT st, int request, opus_int32 val)
{
opus_custom_encoder_ctl(st, request, val);
}

int opus_custom_decoder_ctl_wrapper(CELTEncoder *OPUS_RESTRICT st, int request, opus_int32 val)
int opus_custom_decoder_ctl_wrapper(OpusCustomDecoder *OPUS_RESTRICT st, int request, opus_int32 val)
{
opus_custom_decoder_ctl(st, request, val);
}
6 changes: 3 additions & 3 deletions Sources/Copus-wrapper/variadic-wrapper.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef __OPUS_VARIADIC_WRAPPER_H__
#define __OPUS_VARIADIC_WRAPPER_H__

#include <celt.h>
//#include ""
#include <opus_defines.h>
#include <opus_custom.h>

int opus_custom_encoder_ctl_wrapper(CELTEncoder *OPUS_RESTRICT st, int request, opus_int32 val);
int opus_custom_decoder_ctl_wrapper(CELTEncoder *OPUS_RESTRICT st, int request, opus_int32 val);
int opus_custom_encoder_ctl_wrapper(OpusCustomEncoder *OPUS_RESTRICT st, int request, opus_int32 val);
int opus_custom_decoder_ctl_wrapper(OpusCustomDecoder *OPUS_RESTRICT st, int request, opus_int32 val);

#endif

0 comments on commit d1be9a6

Please sign in to comment.