Skip to content

Commit e970d56

Browse files
authored
SocketTypes: use UnsupportedSocketType instead of -1.
`UnsupportedSocketType` was introduced in 569d5d1, but the values were not updated for cases where the socket type did not exist on the target system. This was discovered whilst attempting to build on Haiku, which does not have `SOCK_RDM`.
1 parent 9d29533 commit e970d56

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Network/Socket/Types.hsc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,35 +345,35 @@ pattern Stream :: SocketType
345345
#ifdef SOCK_STREAM
346346
pattern Stream = SocketType (#const SOCK_STREAM)
347347
#else
348-
pattern Stream = (-1)
348+
pattern Stream = UnsupportedSocketType
349349
#endif
350350

351351
pattern Datagram :: SocketType
352352
#ifdef SOCK_DGRAM
353353
pattern Datagram = SocketType (#const SOCK_DGRAM)
354354
#else
355-
pattern Datagram = (-1)
355+
pattern Datagram = UnsupportedSocketType
356356
#endif
357357

358358
pattern Raw :: SocketType
359359
#ifdef SOCK_RAW
360360
pattern Raw = SocketType (#const SOCK_RAW)
361361
#else
362-
pattern Raw = (-1)
362+
pattern Raw = UnsupportedSocketType
363363
#endif
364364

365365
pattern RDM :: SocketType
366366
#ifdef SOCK_RDM
367367
pattern RDM = SocketType (#const SOCK_RDM)
368368
#else
369-
pattern RDM = (-1)
369+
pattern RDM = UnsupportedSocketType
370370
#endif
371371

372372
pattern SeqPacket :: SocketType
373373
#ifdef SOCK_SEQPACKET
374374
pattern SeqPacket = SocketType (#const SOCK_SEQPACKET)
375375
#else
376-
pattern SeqPacket = (-1)
376+
pattern SeqPacket = UnsupportedSocketType
377377
#endif
378378

379379
------------------------------------------------------------------------

0 commit comments

Comments
 (0)