2024-04-24 23:33 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002620LibParserUtils[All Projects] Generalpublic2020-02-21 10:09
ReporterJ. Peter Mugaas 
Assigned ToVincent Sanders 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusassignedResolutionopen 
Platformmingw-w64OSWindows 10OS Version10
Product Version0.2.1 
Target VersionFixed in Version 
Summary0002620: 0.2.4 - test suite cscodec-utf16.c in Windows
DescriptionI tried to compile cscodec-utf16.c in Windows with an automated build process that I was writing. I found that cscodec-utf16.c had these references:

 #include <arpa/inet.h>
 #include <netinet/in.h>

Those are NOT valid for Windows. To use the htonl and ntohl functions, you must include winsock2 and then you have to link to the Ws2_32 library. Please verify this statement at: https://docs.microsoft.com/en-us/windows/desktop/api/winsock/nf-winsock-ntohl .

I have done this in a cmake script I was writing to build libparserutils in Windows that includes running your test executables with a good deal of success I am providing a patch to fix the issue. Please feel free to use it.
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
Attached Files
  • patch file icon test-htonl-ntohl.patch (394 bytes) 2018-09-25 05:05 -
    --- libparserutils-0.2.4/test/cscodec-utf16.c.orig	2018-09-24 01:50:34.456328100 -0400
    +++ libparserutils-0.2.4/test/cscodec-utf16.c	2018-09-24 01:54:00.502994400 -0400
    @@ -3,8 +3,12 @@
     #include <string.h>
     
     /* These two are for htonl / ntohl */
    +#ifdef _WIN32
    +#include <winsock2.h>
    +#else
     #include <arpa/inet.h>
     #include <netinet/in.h>
    +#endif
     
     #include <parserutils/charset/codec.h>
     
    
    patch file icon test-htonl-ntohl.patch (394 bytes) 2018-09-25 05:05 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2018-09-25 05:05 J. Peter Mugaas New Issue
2018-09-25 05:05 J. Peter Mugaas File Added: test-htonl-ntohl.patch
2020-02-21 10:09 Vincent Sanders Assigned To => Vincent Sanders
2020-02-21 10:09 Vincent Sanders Status new => assigned
+Issue History