Просмотр исходного кода

LibC: Make nameinfo (NI_*) constants bitfield-friendly

These are supposed to be used as flags in a bitfield, so let's make
them powers of two.
Andreas Kling 3 лет назад
Родитель
Сommit
ab878576bb
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      Userland/Libraries/LibC/netdb.h

+ 5 - 5
Userland/Libraries/LibC/netdb.h

@@ -90,11 +90,11 @@ struct addrinfo {
 #define NI_MAXHOST 1025
 #define NI_MAXHOST 1025
 #define NI_MAXSERV 32
 #define NI_MAXSERV 32
 
 
-#define NI_NUMERICHOST 1
-#define NI_NUMERICSERV 2
-#define NI_NAMEREQD 3
-#define NI_NOFQDN 4
-#define NI_DGRAM 5
+#define NI_NUMERICHOST (1 << 0)
+#define NI_NUMERICSERV (1 << 1)
+#define NI_NAMEREQD (1 << 2)
+#define NI_NOFQDN (1 << 3)
+#define NI_DGRAM (1 << 4)
 
 
 int getaddrinfo(char const* __restrict node, char const* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res);
 int getaddrinfo(char const* __restrict node, char const* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res);
 void freeaddrinfo(struct addrinfo* res);
 void freeaddrinfo(struct addrinfo* res);