Skip to content

Commit

Permalink
Reinvent htons() for mingw32 lacks it
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpovey committed May 1, 2012
1 parent a4dd984 commit 16b140d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions das.c
Expand Up @@ -3,7 +3,6 @@
* Copyright 2012 Jon Povey <jon@leetfighter.com>
* Released under the GPL v2
*/
#include <arpa/inet.h>
#include <assert.h>
#include <getopt.h>
#include <stdio.h>
Expand Down Expand Up @@ -133,7 +132,8 @@ void handle_args(int argc, char **argv)
void reverse_words(u16 *bin, int nwords)
{
while (nwords--) {
*bin = htons(*bin);
/* mingw32 doesn't seem to have htons() so do it myself */
*bin = *bin >> 8 | *bin << 8;
bin++;
}
}
Expand Down

0 comments on commit 16b140d

Please sign in to comment.