[Asterisk-code-review] chan oss: Compile in Solaris 11. (asterisk[15])

Joshua Colp asteriskteam at digium.com
Fri Jun 22 07:50:14 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/9252 )

Change subject: chan_oss: Compile in Solaris 11.
......................................................................

chan_oss: Compile in Solaris 11.

M_READ existed already and was conflicting in name.

Change-Id: I02108e07ae7d2dc314fe1e6c706c17731095a3e4
---
M channels/chan_oss.c
1 file changed, 12 insertions(+), 7 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 7866813..ed4391b 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -255,7 +255,12 @@
 	char *name;
 	int total_blocks;			/*!< total blocks in the output device */
 	int sounddev;
-	enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
+	enum {
+		CHAN_OSS_DUPLEX_UNSET,
+		CHAN_OSS_DUPLEX_FULL,
+		CHAN_OSS_DUPLEX_READ,
+		CHAN_OSS_DUPLEX_WRITE
+	} duplex;
 	int autoanswer;             /*!< Boolean: whether to answer the immediately upon calling */
 	int autohangup;             /*!< Boolean: whether to hangup the call when the remote end hangs up */
 	int hookstate;              /*!< Boolean: 1 if offhook; 0 if onhook */
@@ -318,7 +323,7 @@
 }
 static struct chan_oss_pvt oss_default = {
 	.sounddev = -1,
-	.duplex = M_UNSET,			/* XXX check this */
+	.duplex = CHAN_OSS_DUPLEX_UNSET, /* XXX check this */
 	.autoanswer = 1,
 	.autohangup = 1,
 	.queuesize = QUEUE_SIZE,
@@ -480,7 +485,7 @@
 	if (o->sounddev >= 0) {
 		ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
 		close(o->sounddev);
-		o->duplex = M_UNSET;
+		o->duplex = CHAN_OSS_DUPLEX_UNSET;
 		o->sounddev = -1;
 	}
 	if (mode == O_CLOSE)		/* we are done */
@@ -513,16 +518,16 @@
 		res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
 		if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
 			ast_verb(2, "Console is full duplex\n");
-			o->duplex = M_FULL;
+			o->duplex = CHAN_OSS_DUPLEX_FULL;
 		};
 		break;
 
 	case O_WRONLY:
-		o->duplex = M_WRITE;
+		o->duplex = CHAN_OSS_DUPLEX_WRITE;
 		break;
 
 	case O_RDONLY:
-		o->duplex = M_READ;
+		o->duplex = CHAN_OSS_DUPLEX_READ;
 		break;
 	}
 
@@ -1416,7 +1421,7 @@
 		ast_verb(1, "Turn off OSS support by adding " "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
 		goto error;
 	}
-	if (o->duplex != M_FULL)
+	if (o->duplex != CHAN_OSS_DUPLEX_FULL)
 		ast_log(LOG_WARNING, "XXX I don't work right with non " "full-duplex sound cards XXX\n");
 #endif /* TRYOPEN */
 

-- 
To view, visit https://gerrit.asterisk.org/9252
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I02108e07ae7d2dc314fe1e6c706c17731095a3e4
Gerrit-Change-Number: 9252
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180622/0f527401/attachment.html>


More information about the asterisk-code-review mailing list