link-mso19: Use more portable g_htons().
Not all systems provide <arpa/inet.h> and/or htons(). Use portable and always available g_htons() from glib instead.
This commit is contained in:
parent
753d722f34
commit
a24e9d0484
|
@ -20,7 +20,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include <arpa/inet.h>
|
|
||||||
|
|
||||||
/* serial protocol */
|
/* serial protocol */
|
||||||
#define mso_trans(a, v) \
|
#define mso_trans(a, v) \
|
||||||
|
@ -55,7 +54,7 @@ SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial,
|
||||||
p += sizeof(mso_head);
|
p += sizeof(mso_head);
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
*(uint16_t *) p = htons(payload[i]);
|
*(uint16_t *) p = g_htons(payload[i]);
|
||||||
p += 2;
|
p += 2;
|
||||||
}
|
}
|
||||||
memcpy(p, mso_foot, sizeof(mso_foot));
|
memcpy(p, mso_foot, sizeof(mso_foot));
|
||||||
|
|
Loading…
Reference in New Issue