SASANO Takayoshi on Nostr: ...
コンパイル時ではなく実行時にエンディアンチェックがかかってしまうという問題はあるけど、
#include <stdio.h>
#include <netinet/in.h>
int main(int argc, char *argv[])
{
printf("%s endian\n", ntohs(0x1234) == 0x1234 ? "big" : "little");
return 0;
}
とか?
Published at
2024-09-02 22:25:57Event JSON
{
"id": "c07231a66452d34f937a081643149172e0eeaa463673c2da89414b7a18d016df",
"pubkey": "9479339eb118796a8d8e9b7c1ff6d34abf8cd0e4fe81b0d80372e2b1d2da7b12",
"created_at": 1725315957,
"kind": 1,
"tags": [
[
"e",
"3cb885011b55ec50cb5a6e242b2a9606725a3c9043f9ee32905012ab5811c71e",
"wss://relay.mostr.pub",
"reply"
],
[
"t",
"include"
],
[
"proxy",
"https://social.mikutter.hachune.net/users/uaa/statuses/113070306604512843",
"activitypub"
]
],
"content": "コンパイル時ではなく実行時にエンディアンチェックがかかってしまうという問題はあるけど、\n\n#include \u003cstdio.h\u003e\n#include \u003cnetinet/in.h\u003e\n\nint main(int argc, char *argv[])\n{\n\tprintf(\"%s endian\\n\", ntohs(0x1234) == 0x1234 ? \"big\" : \"little\");\n\treturn 0;\n}\n\nとか?",
"sig": "12654b22bf94167479b2f881e988ccb9e7d7f477a58b21335fffb19d389523a7b2178dfbe61094968d8157eee9a84091aa1dd94fa27a66663dc2b51b1cadf4bf"
}