[#1219] ruby animal — OZAWA Sakuro <crouton@...>

小澤さく@塩尻Internetです.

18 messages 1996/12/09

[#1256] ruby 0.99.4-961212 available — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです.

21 messages 1996/12/12
[#1257] Re: ruby 0.99.4-961212 available — Yasuo OHBA <jammy@...> 1996/12/12

大庭@SHLJapanです.

[#1258] Re: ruby 0.99.4-961212 available — matz@... (Yukihiro Matsumoto) 1996/12/12

まつもと ゆきひろです.

[#1259] Re: ruby 0.99.4-961212 available — WATANABE Hirofumi <watanabe@...> 1996/12/12

わたなべです.

[#1261] Re: ruby 0.99.4-961212 available — matz@... (Yukihiro Matsumoto) 1996/12/12

まつもと ゆきひろです.

[#1290] ruby 0.99.4-961217 will be available — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです.

32 messages 1996/12/17
[#1300] Re: ruby 0.99.4-961217 will be available — sinara@... 1996/12/17

原です。

[#1305] Re: ruby 0.99.4-961217 will be available — matz@... (Yukihiro Matsumoto) 1996/12/17

まつもと ゆきひろです.

[#1308] Re: ruby 0.99.4-961217 will be available — gougi@... (Shigeru Gougi) 1996/12/17

ごうぎ@TCIです。

[#1341] Re: ruby 0.99.4-961217 will be available — matz@... (Yukihiro Matsumoto) 1996/12/18

まつもと ゆきひろです.

[#1342] Re: ruby 0.99.4-961217 will be available — sinara@... 1996/12/18

原です。

[#1345] [BUG?] access string out of range — sinara@... 1996/12/18

原です。

[#1330] Re: Rational and Complex — Shin-ichiro Hara <sinara@...>

原です。

30 messages 1996/12/17
[#1335] Re: Rational and Complex — sinara@... 1996/12/18

原です。

[#1359] Re: Rational and Complex 1996/12/18

けいじゅ@SHLジャパンです.

[#1423] 配列への grep — (Dezawa Shin-ichiro) <dezawa@...>

出沢です

14 messages 1996/12/23

[#1469] wish ... — Noritugu Nakamura <nnakamur@...>

25 messages 1996/12/24
[#1470] Re: wish ... — matz@... (Yukihiro Matsumoto) 1996/12/24

まつもと ゆきひろです.

[ruby-list:1518] dynamic endian check for nextstep

From: matz@... (Yukihiro Matsumoto)
Date: 1996-12-26 03:44:14 UTC
List: ruby-list #1518
まつもと ゆきひろです

NEXTSTEPのFat Binary用のendian check patchです.
これで実行時にendianをチェックします.でもテストしてません.^^;;

--- defines.h~	Wed Dec 25 10:22:07 1996
+++ defines.h	Thu Dec 26 02:51:49 1996
@@ -17,6 +17,7 @@
 #undef SJIS
 
 #ifdef NeXT
+#define DYNAMIC_ENDIAN		/* determine endian at runtime */
 #define S_IXUSR _S_IXUSR        /* execute/search permission, owner */
 #define S_IXGRP 0000010         /* execute/search permission, group */
 #define S_IXOTH 0000001         /* execute/search permission, other */
--- pack.c~	Tue Dec 24 15:39:08 1996
+++ pack.c	Thu Dec 26 02:50:19 1996
@@ -19,6 +19,36 @@
 			+(((x)>>24)&0xFF)	\
 			+(((x)&0x0000FF00)<<8)	\
 			+(((x)&0x00FF0000)>>8)	)
+
+#ifdef DYNAMIC_ENDIAN
+#ifdef ntohs
+#undef ntohs
+#undef ntohl
+#undef htons
+#undef htonl
+#endif
+static int
+endian()
+{
+    static int init = 0;
+    static int endian_value;
+    char *p;
+
+    if (init) return endian_value;
+    init = 1;
+    p = (char*)&init;
+    return endian_value = p[0]?0:1;
+}
+
+#define ntohs(x) (endian()?(x):swaps(x))
+#define ntohl(x) (endian()?(x):swapl(x))
+#define htons(x) (endian()?(x):swaps(x))
+#define htonl(x) (endian()?(x):swapl(x))
+#define htovs(x) (endian()?swaps(x):(x))
+#define htovl(x) (endian()?swapl(x):(x))
+#define vtohs(x) (endian()?swaps(x):(x))
+#define vtohl(x) (endian()?swapl(x):(x))
+#else
 #ifdef WORDS_BIGENDIAN
 #ifndef ntohs
 #define ntohs(x) (x)
@@ -41,6 +71,7 @@
 #define htovl(x) (x)
 #define vtohs(x) (x)
 #define vtohl(x) (x)
+#endif
 #endif
 
 extern VALUE cString, cArray;

In This Thread

Prev Next