Last change
on this file since 455 was 331, checked in by coas-nagasima, 6 years ago |
prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc
|
File size:
1.1 KB
|
Rev | Line | |
---|
[331] | 1 | #include <stdio.h>
|
---|
| 2 |
|
---|
| 3 | typedef int MyInt;
|
---|
| 4 |
|
---|
| 5 | struct FunStruct
|
---|
| 6 | {
|
---|
| 7 | int i;
|
---|
| 8 | int j;
|
---|
| 9 | };
|
---|
| 10 |
|
---|
| 11 | typedef struct FunStruct MyFunStruct;
|
---|
| 12 |
|
---|
| 13 | typedef MyFunStruct *MoreFunThanEver;
|
---|
| 14 |
|
---|
| 15 | int main()
|
---|
| 16 | {
|
---|
| 17 | MyInt a = 1;
|
---|
| 18 | printf("%d\n", a);
|
---|
| 19 |
|
---|
| 20 | MyFunStruct b;
|
---|
| 21 | b.i = 12;
|
---|
| 22 | b.j = 34;
|
---|
| 23 | printf("%d,%d\n", b.i, b.j);
|
---|
| 24 |
|
---|
| 25 | MoreFunThanEver c = &b;
|
---|
| 26 | printf("%d,%d\n", c->i, c->j);
|
---|
| 27 |
|
---|
| 28 | return 0;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | /* "If the specification of an array type includes any type qualifiers,
|
---|
| 32 | the element type is so-qualified, not the array type." */
|
---|
| 33 |
|
---|
| 34 | typedef int A[3];
|
---|
| 35 | extern A const ca;
|
---|
| 36 | extern const A ca;
|
---|
| 37 | extern const int ca[3];
|
---|
| 38 |
|
---|
| 39 | typedef A B[1][2];
|
---|
| 40 | extern B const cb;
|
---|
| 41 | extern const B cb;
|
---|
| 42 | extern const int cb[1][2][3];
|
---|
| 43 |
|
---|
| 44 | extern B b;
|
---|
| 45 | extern int b[1][2][3];
|
---|
| 46 |
|
---|
| 47 | /* Funny but valid function declaration. */
|
---|
| 48 | typedef int functype (int);
|
---|
| 49 | extern functype func;
|
---|
| 50 | int func(int i)
|
---|
| 51 | {
|
---|
| 52 | return i + 1;
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | /* Even funnier function decl and definition using typeof. */
|
---|
| 56 | int set_anon_super(void);
|
---|
| 57 | int set_anon_super(void)
|
---|
| 58 | {
|
---|
| 59 | return 42;
|
---|
| 60 | }
|
---|
| 61 | typedef int sas_type (void);
|
---|
| 62 | extern typeof(set_anon_super) set_anon_super;
|
---|
| 63 | extern sas_type set_anon_super;
|
---|
| 64 |
|
---|
| 65 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
|
---|
Note:
See
TracBrowser
for help on using the repository browser.