├── 05 ├── musl-0.6.0 │ ├── crt │ │ ├── crt1.c │ │ ├── crti.c │ │ ├── crtn.c │ │ └── i386 │ │ │ └── crt1.s │ ├── include │ │ ├── byteswap.h │ │ ├── malloc.h │ │ ├── bits │ │ ├── sys │ │ │ ├── poll.h │ │ │ ├── vt.h │ │ │ ├── stropts.h │ │ │ ├── ucontext.h │ │ │ ├── vfs.h │ │ │ ├── soundcard.h │ │ │ ├── sysmacros.h │ │ │ ├── kd.h │ │ │ ├── reg.h │ │ │ ├── statfs.h │ │ │ ├── sysctl.h │ │ │ ├── klog.h │ │ │ ├── un.h │ │ │ ├── ioctl.h │ │ │ ├── user.h │ │ │ ├── swap.h │ │ │ └── uio.h │ │ ├── features.h │ │ ├── search.h │ │ ├── netinet │ │ │ └── tcp.h │ │ ├── linux │ │ │ └── version.h │ │ ├── alloca.h │ │ ├── stdbool.h │ │ ├── libgen.h │ │ ├── stropts.h │ │ ├── ulimit.h │ │ └── errno.h │ ├── src │ │ ├── setjmp │ │ │ ├── setjmp.c │ │ │ └── longjmp.c │ │ ├── thread │ │ │ ├── clone.c │ │ │ ├── __unmapself.c │ │ │ ├── __set_thread_area.c │ │ │ ├── pthread_equal.c │ │ │ ├── pthread_attr_destroy.c │ │ │ ├── pthread_cond_destroy.c │ │ │ ├── pthread_mutex_destroy.c │ │ │ ├── pthread_spin_destroy.c │ │ │ ├── pthread_testcancel.c │ │ │ ├── pthread_barrier_destroy.c │ │ │ ├── pthread_rwlock_destroy.c │ │ │ ├── pthread_spin_unlock.c │ │ │ ├── pthread_attr_getscope.c │ │ │ ├── pthread_attr_setscope.c │ │ │ ├── pthread_mutexattr_destroy.c │ │ │ ├── pthread_spin_init.c │ │ │ ├── pthread_attr_init.c │ │ │ ├── pthread_spin_lock.c │ │ │ ├── pthread_spin_trylock.c │ │ │ ├── pthread_key_delete.c │ │ │ ├── pthread_mutexattr_init.c │ │ │ ├── pthread_cond_wait.c │ │ │ ├── pthread_attr_getdetachstate.c │ │ │ ├── pthread_attr_setdetachstate.c │ │ │ ├── pthread_cond_init.c │ │ │ ├── pthread_cond_signal.c │ │ │ ├── pthread_mutexattr_gettype.c │ │ │ ├── pthread_cond_broadcast.c │ │ │ ├── pthread_kill.c │ │ │ ├── pthread_cancel.c │ │ │ ├── __futex.c │ │ │ ├── pthread_attr_getguardsize.c │ │ │ ├── pthread_attr_getstacksize.c │ │ │ ├── pthread_getspecific.c │ │ │ ├── pthread_mutex_init.c │ │ │ ├── pthread_rwlock_init.c │ │ │ ├── pthread_mutexattr_settype.c │ │ │ ├── pthread_rwlock_rdlock.c │ │ │ ├── pthread_attr_setguardsize.c │ │ │ ├── pthread_mutex_lock.c │ │ │ ├── pthread_attr_setstacksize.c │ │ │ ├── pthread_barrier_init.c │ │ │ ├── __wake.c │ │ │ ├── pthread_detach.c │ │ │ ├── pthread_setcanceltype.c │ │ │ └── pthread_setcancelstate.c │ │ ├── math │ │ │ ├── i386 │ │ │ │ ├── s_ceil.s │ │ │ │ ├── s_ceilf.s │ │ │ │ ├── s_floor.s │ │ │ │ ├── s_floorf.s │ │ │ │ ├── s_ldexp.s │ │ │ │ ├── s_ldexpf.s │ │ │ │ ├── s_truncf.s │ │ │ │ ├── e_expf.s │ │ │ │ ├── e_remainderf.s │ │ │ │ ├── e_sqrt.s │ │ │ │ ├── e_sqrtf.s │ │ │ │ ├── s_fabs.s │ │ │ │ ├── s_fabsf.s │ │ │ │ ├── s_rint.s │ │ │ │ ├── s_rintf.s │ │ │ │ ├── e_log.s │ │ │ │ ├── e_logf.s │ │ │ │ ├── e_log10.s │ │ │ │ ├── e_log10f.s │ │ │ │ ├── s_scalbln.s │ │ │ │ ├── s_scalblnf.s │ │ │ │ └── e_remainder.s │ │ │ ├── __x86_64 │ │ │ │ ├── e_sqrt.s │ │ │ │ └── e_sqrtf.s │ │ │ ├── s_ldexp.c │ │ │ ├── s_ldexpf.c │ │ │ ├── s_lrint.c │ │ │ ├── s_lrintf.c │ │ │ └── s_llrint.c │ │ ├── signal │ │ │ ├── restore.c │ │ │ ├── sigrtmax.c │ │ │ ├── sigrtmin.c │ │ │ ├── kill.c │ │ │ ├── raise.c │ │ │ ├── sigemptyset.c │ │ │ ├── sigfillset.c │ │ │ ├── sigwaitinfo.c │ │ │ ├── sigpending.c │ │ │ ├── sigsuspend.c │ │ │ ├── killpg.c │ │ │ ├── sigaltstack.c │ │ │ ├── sighold.c │ │ │ ├── sigpause.c │ │ │ ├── sigwait.c │ │ │ ├── sigrelse.c │ │ │ ├── i386 │ │ │ │ └── sigsetjmp.s │ │ │ ├── sigignore.c │ │ │ ├── x86_64 │ │ │ │ └── restore.s │ │ │ └── siginterrupt.c │ │ ├── network │ │ │ ├── h_errno.c │ │ │ ├── res_init.c │ │ │ ├── in6addr_any.c │ │ │ ├── in6addr_loopback.c │ │ │ ├── freeaddrinfo.c │ │ │ ├── listen.c │ │ │ ├── shutdown.c │ │ │ ├── htons.c │ │ │ ├── inet_aton.c │ │ │ ├── bind.c │ │ │ ├── ntohs.c │ │ │ ├── socket.c │ │ │ ├── htonl.c │ │ │ ├── recv.c │ │ │ ├── getpeername.c │ │ │ ├── getsockname.c │ │ │ ├── send.c │ │ │ ├── sockatmark.c │ │ │ ├── socketpair.c │ │ │ ├── ntohl.c │ │ │ ├── getsockopt.c │ │ │ ├── setsockopt.c │ │ │ ├── serv.c │ │ │ ├── inet_ntoa.c │ │ │ ├── inet_addr.c │ │ │ ├── accept.c │ │ │ ├── recvmsg.c │ │ │ ├── sendmsg.c │ │ │ └── connect.c │ │ ├── internal │ │ │ ├── libc.c │ │ │ ├── locale_impl.h │ │ │ └── syscall.c │ │ ├── linux │ │ │ ├── gethostid.c │ │ │ ├── brk.c │ │ │ ├── getpagesize.c │ │ │ ├── reboot.c │ │ │ ├── chroot.c │ │ │ ├── klogctl.c │ │ │ ├── swapoff.c │ │ │ ├── epoll_create.c │ │ │ ├── sysinfo.c │ │ │ ├── epoll_create1.c │ │ │ ├── sbrk.c │ │ │ ├── umount.c │ │ │ ├── stime.c │ │ │ ├── swapon.c │ │ │ ├── setgroups.c │ │ │ ├── umount2.c │ │ │ ├── sethostname.c │ │ │ ├── settimeofday.c │ │ │ ├── signalfd.c │ │ │ ├── epoll_ctl.c │ │ │ ├── epoll_wait.c │ │ │ ├── getdtablesize.c │ │ │ ├── epoll_pwait.c │ │ │ ├── sendfile.c │ │ │ ├── mount.c │ │ │ └── wait3.c │ │ ├── stdio │ │ │ ├── __ofl.c │ │ │ ├── getc.c │ │ │ ├── getchar.c │ │ │ ├── getwc.c │ │ │ ├── putchar.c │ │ │ ├── rewind.c │ │ │ ├── __fclose_ca.c │ │ │ ├── putwc.c │ │ │ ├── __stdio_close.c │ │ │ ├── getw.c │ │ │ ├── putw.c │ │ │ ├── __fpending.c │ │ │ ├── vprintf.c │ │ │ ├── getline.c │ │ │ ├── puts.c │ │ │ ├── putc.c │ │ │ ├── remove.c │ │ │ ├── setbuf.c │ │ │ ├── __uflow.c │ │ │ ├── vscanf.c │ │ │ ├── getwchar.c │ │ │ ├── __stdio_read.c │ │ │ ├── getchar_unlocked.c │ │ │ ├── putwchar.c │ │ │ ├── vsprintf.c │ │ │ ├── fileno.c │ │ │ ├── fsetpos.c │ │ │ ├── rename.c │ │ │ ├── vwscanf.c │ │ │ ├── putchar_unlocked.c │ │ │ ├── gets.c │ │ │ ├── getc_unlocked.c │ │ │ ├── feof.c │ │ │ ├── putc_unlocked.c │ │ │ ├── fgetpos.c │ │ │ ├── ferror.c │ │ │ ├── pclose.c │ │ │ ├── scanf.c │ │ │ ├── printf.c │ │ │ ├── fscanf.c │ │ │ ├── fwide.c │ │ │ ├── dprintf.c │ │ │ ├── fprintf.c │ │ │ ├── sprintf.c │ │ │ ├── sscanf.c │ │ │ ├── wscanf.c │ │ │ ├── snprintf.c │ │ │ ├── fwscanf.c │ │ │ ├── clearerr.c │ │ │ ├── swscanf.c │ │ │ ├── __scanf.h │ │ │ ├── __stdio_write.c │ │ │ └── asprintf.c │ │ ├── stdlib │ │ │ ├── abs.c │ │ │ ├── labs.c │ │ │ ├── llabs.c │ │ │ ├── atof.c │ │ │ ├── imaxabs.c │ │ │ ├── strtof.c │ │ │ ├── div.c │ │ │ ├── strtod.c │ │ │ ├── ldiv.c │ │ │ ├── lldiv.c │ │ │ ├── imaxdiv.c │ │ │ └── atoi.c │ │ ├── ctype │ │ │ ├── isgraph.c │ │ │ ├── isprint.c │ │ │ ├── isascii.c │ │ │ ├── isblank.c │ │ │ ├── iswalpha.c │ │ │ ├── isalnum.c │ │ │ ├── ispunct.c │ │ │ ├── iswlower.c │ │ │ ├── iswupper.c │ │ │ ├── __ctype_get_mb_cur_max.c │ │ │ ├── iscntrl.c │ │ │ ├── isspace.c │ │ │ ├── tolower.c │ │ │ ├── isdigit.c │ │ │ ├── islower.c │ │ │ ├── isupper.c │ │ │ ├── isxdigit.c │ │ │ ├── toupper.c │ │ │ ├── isalpha.c │ │ │ ├── toascii.c │ │ │ ├── iswblank.c │ │ │ ├── iswgraph.c │ │ │ ├── iswdigit.c │ │ │ ├── iswxdigit.c │ │ │ ├── iswalnum.c │ │ │ ├── wcswidth.c │ │ │ ├── iswcntrl.c │ │ │ └── iswprint.c │ │ ├── prng │ │ │ ├── __seed48.c │ │ │ ├── random.c │ │ │ ├── srandom.c │ │ │ ├── srand48.c │ │ │ ├── rand_r.c │ │ │ ├── lcong48.c │ │ │ ├── rand.c │ │ │ └── seed48.c │ │ ├── locale │ │ │ ├── catclose.c │ │ │ ├── isalnum_l.c │ │ │ ├── isalpha_l.c │ │ │ ├── isblank_l.c │ │ │ ├── iscntrl_l.c │ │ │ ├── isdigit_l.c │ │ │ ├── isgraph_l.c │ │ │ ├── islower_l.c │ │ │ ├── isprint_l.c │ │ │ ├── ispunct_l.c │ │ │ ├── isspace_l.c │ │ │ ├── isupper_l.c │ │ │ ├── tolower_l.c │ │ │ ├── toupper_l.c │ │ │ ├── isxdigit_l.c │ │ │ ├── strcoll.c │ │ │ ├── catopen.c │ │ │ ├── freelocale.c │ │ │ ├── catgets.c │ │ │ ├── wcscoll.c │ │ │ ├── nl_langinfo.c │ │ │ ├── strxfrm.c │ │ │ ├── duplocale.c │ │ │ ├── setlocale.c │ │ │ └── wcsxfrm.c │ │ ├── unistd │ │ │ ├── setpgrp.c │ │ │ ├── setegid.c │ │ │ ├── seteuid.c │ │ │ ├── fdatasync.c │ │ │ ├── sync.c │ │ │ ├── _exit.c │ │ │ ├── dup.c │ │ │ ├── getgid.c │ │ │ ├── getlogin.c │ │ │ ├── getpid.c │ │ │ ├── getuid.c │ │ │ ├── setsid.c │ │ │ ├── fchdir.c │ │ │ ├── getegid.c │ │ │ ├── geteuid.c │ │ │ ├── getpgrp.c │ │ │ ├── getppid.c │ │ │ ├── dup2.c │ │ │ ├── getsid.c │ │ │ ├── pipe.c │ │ │ ├── unlink.c │ │ │ ├── getpgid.c │ │ │ ├── alarm.c │ │ │ ├── chdir.c │ │ │ ├── fsync.c │ │ │ ├── rmdir.c │ │ │ ├── isatty.c │ │ │ ├── setpgid.c │ │ │ ├── fchown.c │ │ │ ├── getgroups.c │ │ │ ├── ualarm.c │ │ │ ├── access.c │ │ │ ├── chown.c │ │ │ ├── lchown.c │ │ │ ├── link.c │ │ │ ├── unlinkat.c │ │ │ ├── symlink.c │ │ │ ├── getcwd.c │ │ │ ├── readlink.c │ │ │ ├── symlinkat.c │ │ │ ├── faccessat.c │ │ │ ├── close.c │ │ │ ├── fchownat.c │ │ │ ├── renameat.c │ │ │ ├── tcsetpgrp.c │ │ │ ├── pause.c │ │ │ ├── readlinkat.c │ │ │ ├── linkat.c │ │ │ ├── tcgetpgrp.c │ │ │ ├── ftruncate.c │ │ │ ├── setgid.c │ │ │ ├── setuid.c │ │ │ ├── sleep.c │ │ │ ├── truncate.c │ │ │ ├── usleep.c │ │ │ ├── read.c │ │ │ ├── write.c │ │ │ ├── setregid.c │ │ │ ├── setreuid.c │ │ │ ├── nice.c │ │ │ ├── readv.c │ │ │ ├── writev.c │ │ │ └── ttyname.c │ │ ├── time │ │ │ ├── difftime.c │ │ │ ├── ctime.c │ │ │ ├── times.c │ │ │ ├── ctime_r.c │ │ │ ├── asctime_r.c │ │ │ ├── asctime.c │ │ │ ├── gmtime.c │ │ │ ├── gmtime_r.c │ │ │ ├── clock.c │ │ │ ├── gettimeofday.c │ │ │ ├── localtime.c │ │ │ ├── localtime_r.c │ │ │ ├── __time.h │ │ │ └── time.c │ │ ├── dirent │ │ │ ├── dirfd.c │ │ │ ├── telldir.c │ │ │ ├── __dirent.h │ │ │ ├── closedir.c │ │ │ ├── alphasort.c │ │ │ ├── __getdents.c │ │ │ ├── rewinddir.c │ │ │ └── seekdir.c │ │ ├── misc │ │ │ ├── realpath.c │ │ │ ├── bswap_32.c │ │ │ ├── ffs.c │ │ │ ├── uname.c │ │ │ ├── setpriority.c │ │ │ ├── getdomainname.c │ │ │ ├── bswap_64.c │ │ │ ├── sched_yield.c │ │ │ ├── getpriority.c │ │ │ ├── ftw.c │ │ │ ├── getgrouplist.c │ │ │ ├── basename.c │ │ │ ├── ioctl.c │ │ │ └── setrlimit.c │ │ ├── process │ │ │ ├── wait.c │ │ │ ├── execv.c │ │ │ ├── vfork.c │ │ │ ├── fork.c │ │ │ ├── waitpid.c │ │ │ ├── waitid.c │ │ │ └── execve.c │ │ ├── conf │ │ │ └── pathconf.c │ │ ├── exit │ │ │ ├── abort.c │ │ │ ├── _Exit.c │ │ │ └── assert.c │ │ ├── multibyte │ │ │ ├── btowc.c │ │ │ └── wctob.c │ │ ├── mman │ │ │ ├── posix_madvise.c │ │ │ ├── munlockall.c │ │ │ ├── mlockall.c │ │ │ ├── mlock.c │ │ │ ├── munlock.c │ │ │ ├── mprotect.c │ │ │ └── msync.c │ │ ├── string │ │ │ ├── bzero.c │ │ │ ├── index.c │ │ │ ├── rindex.c │ │ │ ├── strcasestr.c │ │ │ ├── bcopy.c │ │ │ ├── strcat.c │ │ │ ├── wcslen.c │ │ │ ├── bcmp.c │ │ │ ├── mempcpy.c │ │ │ ├── strnlen.c │ │ │ ├── strpbrk.c │ │ │ ├── wcswcs.c │ │ │ ├── wcscat.c │ │ │ ├── wcscmp.c │ │ │ ├── wcscpy.c │ │ │ ├── strchrnul.c │ │ │ ├── wcspbrk.c │ │ │ ├── wcsncmp.c │ │ │ ├── wcsspn.c │ │ │ ├── strcmp.c │ │ │ ├── wmemchr.c │ │ │ ├── wmemcmp.c │ │ │ ├── strncpy.c │ │ │ ├── wcsrchr.c │ │ │ ├── wmemset.c │ │ │ ├── wcschr.c │ │ │ ├── wmemcpy.c │ │ │ ├── memcmp.c │ │ │ ├── strrchr.c │ │ │ ├── wcsncpy.c │ │ │ ├── strncat.c │ │ │ ├── wcsncat.c │ │ │ ├── strlcat.c │ │ │ ├── strncmp.c │ │ │ ├── wmemmove.c │ │ │ ├── strerror_r.c │ │ │ ├── strndup.c │ │ │ ├── strsep.c │ │ │ ├── swab.c │ │ │ ├── strcasecmp.c │ │ │ ├── wcscspn.c │ │ │ ├── strtok.c │ │ │ └── strtok_r.c │ │ ├── termios │ │ │ ├── tcdrain.c │ │ │ ├── tcflow.c │ │ │ ├── tcflush.c │ │ │ ├── tcgetsid.c │ │ │ ├── tcsendbreak.c │ │ │ ├── tcgetattr.c │ │ │ ├── cfgetospeed.c │ │ │ └── tcsetattr.c │ │ ├── stat │ │ │ ├── mkfifo.c │ │ │ ├── umask.c │ │ │ ├── fchmod.c │ │ │ ├── mkfifoat.c │ │ │ ├── chmod.c │ │ │ ├── mkdir.c │ │ │ ├── mkdirat.c │ │ │ ├── fchmodat.c │ │ │ ├── mknodat.c │ │ │ ├── fstat.c │ │ │ ├── stat.c │ │ │ ├── lstat.c │ │ │ ├── fstatat.c │ │ │ ├── fstatvfs.c │ │ │ └── statvfs.c │ │ ├── passwd │ │ │ ├── lckpwdf.c │ │ │ └── getspent.c │ │ ├── env │ │ │ ├── clearenv.c │ │ │ └── __environ.c │ │ ├── malloc │ │ │ ├── __brk.c │ │ │ └── memalign.c │ │ ├── fcntl │ │ │ └── creat.c │ │ ├── errno │ │ │ └── __errno_location.c │ │ ├── ipc │ │ │ ├── ftok.c │ │ │ ├── shmdt.c │ │ │ ├── semget.c │ │ │ ├── semop.c │ │ │ └── shmget.c │ │ └── select │ │ │ └── poll.c │ ├── .gitignore │ └── arch │ │ ├── i386 │ │ ├── bits │ │ │ ├── tcp.h │ │ │ ├── endian.h │ │ │ ├── setjmp.h │ │ │ ├── posix.h │ │ │ ├── pthread.h │ │ │ ├── sysmacros.h │ │ │ └── wait.h │ │ └── pthread_arch.h │ │ └── x86_64 │ │ ├── bits │ │ ├── tcp.h │ │ ├── setjmp.h │ │ ├── endian.h │ │ ├── posix.h │ │ ├── pthread.h │ │ └── sysmacros.h │ │ └── pthread_arch.h ├── tcc-0.9.27 │ ├── VERSION │ ├── tests │ │ ├── pp │ │ │ ├── 04.expect │ │ │ ├── 06.expect │ │ │ ├── 07.expect │ │ │ ├── 09.expect │ │ │ ├── 08.expect │ │ │ ├── 01.expect │ │ │ ├── 13.expect │ │ │ ├── 18.expect │ │ │ ├── 16.expect │ │ │ ├── 07.c │ │ │ ├── 06.c │ │ │ ├── 10.expect │ │ │ ├── 16.c │ │ │ ├── 04.c │ │ │ ├── 09.c │ │ │ ├── 12.expect │ │ │ ├── 05.expect │ │ │ ├── 14.expect │ │ │ ├── 15.expect │ │ │ ├── 21.expect │ │ │ ├── 17.expect │ │ │ ├── 08.c │ │ │ ├── 20.expect │ │ │ ├── 13.S │ │ │ ├── 03.expect │ │ │ ├── 19.expect │ │ │ ├── 01.c │ │ │ ├── 10.c │ │ │ ├── 11.expect │ │ │ ├── 14.c │ │ │ ├── 05.c │ │ │ ├── 12.S │ │ │ └── 02.expect │ │ ├── tests2 │ │ │ ├── 81_types.expect │ │ │ ├── 80_flexarray.expect │ │ │ ├── 82_attribs_position.expect │ │ │ ├── 92_enum_bitfield.expect │ │ │ ├── 43_void_param.expect │ │ │ ├── 48_nested_break.expect │ │ │ ├── 64_macro_nesting.expect │ │ │ ├── 86_memory-model.expect │ │ │ ├── 99_fastcall.expect │ │ │ ├── 29_array_address.expect │ │ │ ├── 35_sizeof.expect │ │ │ ├── 71_macro_empty_arg.expect │ │ │ ├── 84_hex-float.expect │ │ │ ├── 88_codeopt.expect │ │ │ ├── 14_if.expect │ │ │ ├── 18_include.h │ │ │ ├── 27_sizeof.expect │ │ │ ├── 85_asm-outside-function.expect │ │ │ ├── 00_assignment.expect │ │ │ ├── 12_hashdefine.expect │ │ │ ├── 39_typedef.expect │ │ │ ├── 42_function_pointer.expect │ │ │ ├── 55_lshift_type.expect │ │ │ ├── 44_scoped_declarations.expect │ │ │ ├── 47_switch_return.expect │ │ │ ├── 07_function.expect │ │ │ ├── 18_include.expect │ │ │ ├── 49_bracket_evaluation.expect │ │ │ ├── 67_macro_concat.expect │ │ │ ├── 91_ptr_longlong_arith32.expect │ │ │ ├── 03_struct.expect │ │ │ ├── 34_array_assignment.expect │ │ │ ├── 72_long_long_constant.expect │ │ │ ├── 79_vla_continue.expect │ │ │ ├── 83_utf8_in_identifiers.expect │ │ │ ├── 06_case.expect │ │ │ ├── 20_pointer_comparison.expect │ │ │ ├── 41_hashif.expect │ │ │ ├── 78_vla_label.expect │ │ │ ├── 01_comment.expect │ │ │ ├── 17_enum.expect │ │ │ ├── 19_pointer_arithmetic.expect │ │ │ ├── 95_bitfields_ms.c │ │ │ ├── 13_integer_literals.expect │ │ │ ├── 04_for.expect │ │ │ ├── 26_character_constants.expect │ │ │ ├── 45_empty_for.expect │ │ │ ├── 46_grep.expect │ │ │ ├── 51_static.expect │ │ │ ├── 05_array.expect │ │ │ ├── 08_while.expect │ │ │ ├── 09_do_while.expect │ │ │ ├── 33_ternary_op.expect │ │ │ ├── 38_multiple_array_index.expect │ │ │ ├── 52_unnamed_enum.expect │ │ │ ├── 77_push_pop_macro.expect │ │ │ ├── 54_goto.expect │ │ │ ├── 94_generic.expect │ │ │ ├── 15_recursion.expect │ │ │ ├── 21_char_array.expect │ │ │ ├── 31_args.expect │ │ │ ├── 32_led.expect │ │ │ ├── 25_quicksort.expect │ │ │ ├── 97_utf8_string_literal.expect │ │ │ ├── 11_precedence.expect │ │ │ ├── 10_pointer.expect │ │ │ ├── 28_strings.expect │ │ │ ├── 50_logical_second_arg.expect │ │ │ ├── 71_macro_empty_arg.c │ │ │ ├── 16_nesting.expect │ │ │ ├── 23_type_coercion.expect │ │ │ ├── 98_al_ax_extend.expect │ │ │ ├── 85_asm-outside-function.c │ │ │ ├── 89_nocode_wanted.expect │ │ │ ├── 76_dollars_in_identifiers.expect │ │ │ ├── 87_dead_code.expect │ │ │ ├── 43_void_param.c │ │ │ ├── 83_utf8_in_identifiers.c │ │ │ ├── 18_include.c │ │ │ ├── 37_sprintf.expect │ │ │ ├── 36_array_initialisers.expect │ │ │ ├── 64_macro_nesting.c │ │ │ ├── 29_array_address.c │ │ │ ├── 04_for.c │ │ │ ├── 22_floating_point.expect │ │ │ ├── 24_math_library.expect │ │ │ ├── 35_sizeof.c │ │ │ ├── 02_printf.expect │ │ │ ├── 44_scoped_declarations.c │ │ │ ├── 12_hashdefine.c │ │ │ └── 33_ternary_op.c │ │ └── tcctest.h │ ├── win32 │ │ ├── lib │ │ │ ├── crt1w.c │ │ │ ├── wincrt1w.c │ │ │ └── dllmain.c │ │ └── include │ │ │ └── values.h │ ├── examples │ │ ├── ex5.c │ │ └── ex1.c │ ├── errno.h │ ├── assert.h │ ├── limits.h │ ├── stddef.h │ ├── config.h │ ├── include │ │ └── stdbool.h │ └── stdarg.h ├── .gitignore ├── main.c ├── errno.h ├── assert.h ├── limits.h ├── stddef.h ├── test.c └── stdarg.h ├── 04a ├── test_inc ├── in04a └── Makefile ├── 00 ├── in00 ├── hexcompile └── Makefile ├── .gitignore ├── 01 └── Makefile ├── 02 └── Makefile ├── 03 └── Makefile └── 04 └── Makefile /05/musl-0.6.0/crt/crt1.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/crt/crti.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/crt/crtn.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04a/test_inc: -------------------------------------------------------------------------------- 1 | #define W world 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/byteswap.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/malloc.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/setjmp/setjmp.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/clone.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/VERSION: -------------------------------------------------------------------------------- 1 | 0.9.27 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_ceil.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_ceilf.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_floor.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_floorf.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_ldexp.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_ldexpf.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_truncf.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/setjmp/longjmp.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/restore.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/__unmapself.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_expf.s: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_remainderf.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/04.expect: -------------------------------------------------------------------------------- 1 | (1) 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/06.expect: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/81_types.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/bits: -------------------------------------------------------------------------------- 1 | ../arch/x86_64/bits -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/__set_thread_area.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/07.expect: -------------------------------------------------------------------------------- 1 | a 2 | YES 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/09.expect: -------------------------------------------------------------------------------- 1 | aaaaoooo 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/80_flexarray.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /00/in00: -------------------------------------------------------------------------------- 1 | 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | musl-gcc 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/h_errno.c: -------------------------------------------------------------------------------- 1 | int h_errno; 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/08.expect: -------------------------------------------------------------------------------- 1 | (hej.s_s.s_pos) 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/82_attribs_position.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/92_enum_bitfield.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/poll.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/vt.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/01.expect: -------------------------------------------------------------------------------- 1 | char p[] = "x ## y"; 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/13.expect: -------------------------------------------------------------------------------- 1 | .text 2 | endtext: 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/43_void_param.expect: -------------------------------------------------------------------------------- 1 | yo 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/48_nested_break.expect: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/64_macro_nesting.expect: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/86_memory-model.expect: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/99_fastcall.expect: -------------------------------------------------------------------------------- 1 | TEST OK 2 | -------------------------------------------------------------------------------- /04a/in04a: -------------------------------------------------------------------------------- 1 | #define H Hello, 2 | #include test_inc 3 | H W! 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/tcp.h: -------------------------------------------------------------------------------- 1 | #define TCP_NODELAY 1 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/bits/tcp.h: -------------------------------------------------------------------------------- 1 | #define TCP_NODELAY 1 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/stropts.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/ucontext.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/vfs.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/29_array_address.expect: -------------------------------------------------------------------------------- 1 | bcdef 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/35_sizeof.expect: -------------------------------------------------------------------------------- 1 | 1 1 2 | 2 2 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/71_macro_empty_arg.expect: -------------------------------------------------------------------------------- 1 | 17 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/84_hex-float.expect: -------------------------------------------------------------------------------- 1 | n+1 = 15 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/88_codeopt.expect: -------------------------------------------------------------------------------- 1 | okay 2 | okay 3 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/features.h: -------------------------------------------------------------------------------- 1 | #warning "features.h is bogus" 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/18.expect: -------------------------------------------------------------------------------- 1 | X181 1 2 | X182 0 3 | X183 yeah 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/14_if.expect: -------------------------------------------------------------------------------- 1 | a is true 2 | b is false 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/18_include.h: -------------------------------------------------------------------------------- 1 | printf("included\n"); 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/27_sizeof.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 4 3 | 8 4 | 4 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/85_asm-outside-function.expect: -------------------------------------------------------------------------------- 1 | okay 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/soundcard.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/16.expect: -------------------------------------------------------------------------------- 1 | 2 | 16.c:3: warning: A redefined 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/00_assignment.expect: -------------------------------------------------------------------------------- 1 | 42 2 | 64 3 | 12, 34 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/12_hashdefine.expect: -------------------------------------------------------------------------------- 1 | 12 2 | 12, 24, 36 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/39_typedef.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 12,34 3 | 12,34 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/42_function_pointer.expect: -------------------------------------------------------------------------------- 1 | yo 24 2 | 42 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/55_lshift_type.expect: -------------------------------------------------------------------------------- 1 | 0 test(s) failed 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long jmp_buf [7]; 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long jmp_buf [9]; 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/44_scoped_declarations.expect: -------------------------------------------------------------------------------- 1 | it's all good 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/47_switch_return.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | out 4 | 3 5 | -------------------------------------------------------------------------------- /00/hexcompile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pommicket/bootstrap/HEAD/00/hexcompile -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/internal/libc.c: -------------------------------------------------------------------------------- 1 | #include "libc.h" 2 | 3 | struct libc libc; 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/gethostid.c: -------------------------------------------------------------------------------- 1 | long gethostid() 2 | { 3 | return 0; 4 | } 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/res_init.c: -------------------------------------------------------------------------------- 1 | int res_init() 2 | { 3 | return 0; 4 | } 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/07.c: -------------------------------------------------------------------------------- 1 | #define a() YES 2 | #define b() a 3 | b() 4 | b()() 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/07_function.expect: -------------------------------------------------------------------------------- 1 | 9 2 | 16 3 | a=1234 4 | qfunc() 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/18_include.expect: -------------------------------------------------------------------------------- 1 | including 2 | included 3 | done 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/49_bracket_evaluation.expect: -------------------------------------------------------------------------------- 1 | 12.340000, 56.780000 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/67_macro_concat.expect: -------------------------------------------------------------------------------- 1 | jim: 21, bob: 42 2 | jim: 63 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/91_ptr_longlong_arith32.expect: -------------------------------------------------------------------------------- 1 | data = "0123-5678" 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | README.html 2 | out?? 3 | out??? 4 | *.out 5 | tags 6 | TAGS 7 | markdown 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__ofl.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | struct ofl __ofl; 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/abs.c: -------------------------------------------------------------------------------- 1 | int abs(int a) 2 | { 3 | return a>0 ? a : -a; 4 | } 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/03_struct.expect: -------------------------------------------------------------------------------- 1 | 12 2 | 34 3 | 12 4 | 34 5 | 56 6 | 78 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/34_array_assignment.expect: -------------------------------------------------------------------------------- 1 | 12 23 34 45 2 | 12 23 34 45 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/72_long_long_constant.expect: -------------------------------------------------------------------------------- 1 | long long constant test ok. 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/79_vla_continue.expect: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | OK 4 | OK 5 | OK 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/83_utf8_in_identifiers.expect: -------------------------------------------------------------------------------- 1 | привет=0.1 2 | Lefèvre=2 3 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/labs.c: -------------------------------------------------------------------------------- 1 | long labs(long a) 2 | { 3 | return a>0 ? a : -a; 4 | } 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/06.c: -------------------------------------------------------------------------------- 1 | #define X(a,b, \ 2 | c,d) \ 3 | foo 4 | 5 | X(1,2,3,4) 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/06_case.expect: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 1 4 | 1 5 | 2 6 | 2 7 | 3 8 | 0 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/20_pointer_comparison.expect: -------------------------------------------------------------------------------- 1 | 12 2 | 34 3 | 0 4 | 1 5 | 1 6 | 0 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/41_hashif.expect: -------------------------------------------------------------------------------- 1 | #include test 2 | b 3 | g 4 | i 5 | p 6 | r 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/78_vla_label.expect: -------------------------------------------------------------------------------- 1 | boom! 2 | boom! 3 | 11 4 | 12 5 | 0 6 | 1 7 | -------------------------------------------------------------------------------- /05/.gitignore: -------------------------------------------------------------------------------- 1 | in04 2 | address_map.txt 3 | *.o 4 | *.d 5 | tcc-bootstrap 6 | musl-bootstrap 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/__x86_64/e_sqrt.s: -------------------------------------------------------------------------------- 1 | .global sqrt 2 | sqrt: sqrtsd %xmm0, %xmm0 3 | ret 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_sqrt.s: -------------------------------------------------------------------------------- 1 | .global sqrt 2 | sqrt: fldl 4(%esp) 3 | fsqrt 4 | ret 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigrtmax.c: -------------------------------------------------------------------------------- 1 | int __libc_current_sigrtmax() 2 | { 3 | return 64; 4 | } 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigrtmin.c: -------------------------------------------------------------------------------- 1 | int __libc_current_sigrtmin() 2 | { 3 | return 34; 4 | } 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/01_comment.expect: -------------------------------------------------------------------------------- 1 | Hello 2 | Hello 3 | Hello 4 | Hello 5 | Hello 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/17_enum.expect: -------------------------------------------------------------------------------- 1 | 0 1 2 3 54 73 74 75 2 | 12 3 | 54 4 | enum to int: 1 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/19_pointer_arithmetic.expect: -------------------------------------------------------------------------------- 1 | 42 2 | b is not NULL 3 | c is NULL 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/win32/lib/crt1w.c: -------------------------------------------------------------------------------- 1 | #define _UNICODE 1 2 | #define UNICODE 1 3 | #include "crt1.c" 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/__x86_64/e_sqrtf.s: -------------------------------------------------------------------------------- 1 | .global sqrtf 2 | sqrtf: sqrtss %xmm0, %xmm0 3 | ret 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_sqrtf.s: -------------------------------------------------------------------------------- 1 | .global sqrtf 2 | sqrtf: flds 4(%esp) 3 | fsqrt 4 | ret 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_fabs.s: -------------------------------------------------------------------------------- 1 | .global fabs 2 | fabs: 3 | fldl 4(%esp) 4 | fabs 5 | ret 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_fabsf.s: -------------------------------------------------------------------------------- 1 | .global fabsf 2 | fabsf: 3 | flds 4(%esp) 4 | fabs 5 | ret 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_rint.s: -------------------------------------------------------------------------------- 1 | .global rint 2 | rint: 3 | fldl 4(%esp) 4 | frndint 5 | ret 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/llabs.c: -------------------------------------------------------------------------------- 1 | long long llabs(long long a) 2 | { 3 | return a>0 ? a : -a; 4 | } 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/10.expect: -------------------------------------------------------------------------------- 1 | x 2 | x x 3 | x x x x 4 | x x x x x x x x 5 | x x x x x x x x)))) 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/16.c: -------------------------------------------------------------------------------- 1 | /* The following should warn */ 2 | #define A ... 3 | #define A <<= 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/95_bitfields_ms.c: -------------------------------------------------------------------------------- 1 | #define MS_BITFIELDS 1 2 | #include "95_bitfields.c" 3 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isgraph.c: -------------------------------------------------------------------------------- 1 | int isgraph(int c) 2 | { 3 | return (unsigned)c-0x21 < 0x5e; 4 | } 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isprint.c: -------------------------------------------------------------------------------- 1 | int isprint(int c) 2 | { 3 | return (unsigned)c-0x20 < 0x5f; 4 | } 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_rintf.s: -------------------------------------------------------------------------------- 1 | .global rintf 2 | rintf: 3 | flds 4(%esp) 4 | frndint 5 | ret 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/__seed48.c: -------------------------------------------------------------------------------- 1 | unsigned short __seed48[7] = { 0, 0, 0, 0xe66d, 0xdeec, 0x5, 0xb }; 2 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/13_integer_literals.expect: -------------------------------------------------------------------------------- 1 | 24680 2 | 342391 3 | 2386092 4 | 2386092 5 | 1365 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/win32/lib/wincrt1w.c: -------------------------------------------------------------------------------- 1 | #define _UNICODE 1 2 | #define UNICODE 1 3 | #include "wincrt1.c" 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_LP64_OFF64 1 2 | #define _POSIX_V6_LP64_OFF64 1 3 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/search.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEARCH_H 2 | #define _SEARCH_H 3 | 4 | // FIXME!!! 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_log.s: -------------------------------------------------------------------------------- 1 | .global log 2 | log: 3 | fldln2 4 | fldl 4(%esp) 5 | fyl2x 6 | ret 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_logf.s: -------------------------------------------------------------------------------- 1 | .global logf 2 | logf: 3 | fldln2 4 | flds 4(%esp) 5 | fyl2x 6 | ret 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/04.c: -------------------------------------------------------------------------------- 1 | #define foobar 1 2 | #define C(x,y) x##y 3 | #define D(x) (C(x,bar)) 4 | D(foo) 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/04_for.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/26_character_constants.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 8 3 | 64 4 | 1 5 | 14 6 | 16 7 | 64 8 | test @ 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/internal/locale_impl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct __locale { 4 | int dummy; 5 | }; 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_log10.s: -------------------------------------------------------------------------------- 1 | .global log10 2 | log10: 3 | fldlg2 4 | fldl 4(%esp) 5 | fyl2x 6 | ret 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/45_empty_for.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/46_grep.expect: -------------------------------------------------------------------------------- 1 | File 46_grep.c: 2 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 3 | 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/51_static.expect: -------------------------------------------------------------------------------- 1 | 1234 2 | 4567 3 | 4568 4 | 4569 5 | 4570 6 | 1234 7 | 8901 8 | 2345 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isascii(int c) 4 | { 5 | return !(c&~0x7f); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_log10f.s: -------------------------------------------------------------------------------- 1 | .global log10f 2 | log10f: 3 | fldlg2 4 | flds 4(%esp) 5 | fyl2x 6 | ret 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int getc(FILE *f) 4 | { 5 | return fgetc(f); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getchar.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int getchar(void) 4 | { 5 | return fgetc(stdin); 6 | } 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/09.c: -------------------------------------------------------------------------------- 1 | #define C(a,b,c) a##b##c 2 | #define N(x,y) C(x,_,y) 3 | #define A_O aaaaoooo 4 | N(A,O) 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/05_array.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 4 3 | 9 4 | 16 5 | 25 6 | 36 7 | 49 8 | 64 9 | 81 10 | 100 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/catclose.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int catclose (nl_catd catd) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getwc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | wint_t getwc(FILE *f) 4 | { 5 | return fgetwc(f); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putchar.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int putchar(int c) 4 | { 5 | return fputc(c, stdout); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/rewind.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void rewind(FILE *f) 4 | { 5 | fseek(f, 0, SEEK_SET); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | pid_t setpgrp(void) 4 | { 5 | return setpgid(0, 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/12.expect: -------------------------------------------------------------------------------- 1 | 9999: 1: movw (%esi), %bx; .section __ex_table, "a"; .long 9999b, 6001f ; 2 | 6001: 3 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/08_while.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | 3 5 | 5 6 | 8 7 | 13 8 | 21 9 | 34 10 | 55 11 | 89 12 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/09_do_while.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | 3 5 | 5 6 | 8 7 | 13 8 | 21 9 | 34 10 | 55 11 | 89 12 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/33_ternary_op.expect: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 4 4 | 9 5 | 16 6 | 15 7 | 18 8 | 21 9 | 24 10 | 27 11 | -------------------------------------------------------------------------------- /05/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) { 4 | printf("Hello, world!\n"); 5 | return 0; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isblank.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isblank(int c) 4 | { 5 | return (c == ' ' || c == '\t'); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswalpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswalpha(wint_t wc) 4 | { 5 | return (32U|wc)-'a'<26; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/s_ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/s_ldexpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ldexpf(float x, int n) 4 | { 5 | return scalbnf(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/in6addr_any.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/random.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* FIXME */ 4 | 5 | long random() 6 | { 7 | return rand(); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/atof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double atof(const char *s) 4 | { 5 | return strtod(s, 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/difftime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double difftime(time_t t1, time_t t0) 4 | { 5 | return t1-t0; 6 | } 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/05.expect: -------------------------------------------------------------------------------- 1 | int j[] = { 123, 45, 67, 89, 2 | 10, 11, 12, }; 3 | int j[] = { 123, 45, 67, 89, 10, 11, 12, }; 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/14.expect: -------------------------------------------------------------------------------- 1 | return Z(Z(1,2),2); 2 | return Q(1,2); 3 | return ((A + A) * (A + A)) + ((B * B) + (B * B)); 4 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/38_multiple_array_index.expect: -------------------------------------------------------------------------------- 1 | x=0: 1 2 3 4 2 | x=1: 5 6 7 8 3 | x=2: 9 10 11 12 4 | x=3: 13 14 15 16 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/52_unnamed_enum.expect: -------------------------------------------------------------------------------- 1 | a=0 2 | b=1 3 | c=2 4 | e=0 5 | f=1 6 | g=2 7 | i=0 8 | j=1 9 | k=2 10 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/77_push_pop_macro.expect: -------------------------------------------------------------------------------- 1 | abort = 111 2 | abort = 222 3 | abort = 333 4 | abort = 222 5 | abort = 111 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_TCP_H 2 | #define _NETINET_TCP_H 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isalnum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isalnum(int c) 4 | { 5 | return isalpha(c) || isdigit(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/ispunct.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ispunct(int c) 4 | { 5 | return isgraph(c) && !isalnum(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswlower.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswlower(wint_t wc) 4 | { 5 | return towupper(wc) != wc; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswupper(wint_t wc) 4 | { 5 | return towlower(wc) != wc; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isalnum_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isalnum_l(int c, locale_t l) 4 | { 5 | return isalnum(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isalpha_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isalpha_l(int c, locale_t l) 4 | { 5 | return isalpha(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isblank_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isblank_l(int c, locale_t l) 4 | { 5 | return isblank(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/iscntrl_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iscntrl_l(int c, locale_t l) 4 | { 5 | return iscntrl(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isdigit_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isdigit_l(int c, locale_t l) 4 | { 5 | return isdigit(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isgraph_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isgraph_l(int c, locale_t l) 4 | { 5 | return isgraph(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/islower_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int islower_l(int c, locale_t l) 4 | { 5 | return islower(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isprint_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isprint_l(int c, locale_t l) 4 | { 5 | return isprint(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/ispunct_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ispunct_l(int c, locale_t l) 4 | { 5 | return ispunct(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isspace_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isspace_l(int c, locale_t l) 4 | { 5 | return isspace(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isupper_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isupper_l(int c, locale_t l) 4 | { 5 | return isupper(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/tolower_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int tolower_l(int c, locale_t l) 4 | { 5 | return tolower(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/toupper_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int toupper_l(int c, locale_t l) 4 | { 5 | return toupper(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__fclose_ca.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int __fclose_ca(FILE *f) 4 | { 5 | return f->close(f); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/imaxabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | intmax_t imaxabs(intmax_t a) 4 | { 5 | return a>0 ? a : -a; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/ctime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *ctime(const time_t *t) 4 | { 5 | return asctime(localtime(t)); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setegid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int setegid(gid_t egid) 4 | { 5 | return setregid(-1, egid); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/seteuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int seteuid(uid_t euid) 4 | { 5 | return setreuid(-1, euid); 6 | } 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/15.expect: -------------------------------------------------------------------------------- 1 | return (long double)d; 2 | return A+++B; 3 | return A+ ++B; 4 | return A+++ +B; 5 | return 0x1E -1; 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/21.expect: -------------------------------------------------------------------------------- 1 | ----- 1 ------ 2 | OK 3 | ----- 2 ------ 4 | OK 5 | ----- 3 ------ 6 | OK 7 | ----- 4 ------ 8 | OK 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/54_goto.expect: -------------------------------------------------------------------------------- 1 | In fred() 2 | At end 3 | In joe() 4 | c = 1234 5 | done 6 | In henry() 7 | b = 1234 8 | done 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/94_generic.expect: -------------------------------------------------------------------------------- 1 | 20 2 | 10 3 | 20 4 | 123 5 | 2 6 | 0 7 | 5 8 | 1 9 | 2 10 | 3 11 | 4 12 | long 13 | 1 -------------------------------------------------------------------------------- /05/musl-0.6.0/include/linux/version.h: -------------------------------------------------------------------------------- 1 | #define LINUX_VERSION_CODE 132638 2 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 3 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/sysmacros.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYSMACROS_H 2 | #define _SYSMACROS_H 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/__ctype_get_mb_cur_max.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t __ctype_get_mb_cur_max() 4 | { 5 | return 4; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iscntrl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iscntrl(int c) 4 | { 5 | return (unsigned)c < 0x20 || c == 0x7f; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isspace.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isspace(int c) 4 | { 5 | return c == ' ' || (unsigned)c-'\t' < 5; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/dirfd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__dirent.h" 3 | 4 | int dirfd(DIR *d) 5 | { 6 | return d->fd; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/isxdigit_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isxdigit_l(int c, locale_t l) 4 | { 5 | return isxdigit(c); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putwc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | wint_t putwc(wchar_t c, FILE *f) 4 | { 5 | return fputwc(c, f); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/strtof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float strtof(const char *s, char **p) 4 | { 5 | return strtold(s, p); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/fdatasync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fdatasync(int fd) 5 | { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/sync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | void sync(void) 5 | { 6 | syscall0(__NR_sync); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/15_recursion.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 6 4 | 24 5 | 120 6 | 720 7 | 5040 8 | 40320 9 | 362880 10 | 3628800 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/21_char_array.expect: -------------------------------------------------------------------------------- 1 | hello 2 | h: 104 3 | e: 101 4 | l: 108 5 | l: 108 6 | o: 111 7 | copied string is hello 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/31_args.expect: -------------------------------------------------------------------------------- 1 | hello world 6 2 | arg 1: arg1 3 | arg 2: arg2 4 | arg 3: arg3 5 | arg 4: arg4 6 | arg 5: arg5 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/tolower.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int tolower(int c) 4 | { 5 | if (isupper(c)) return c | 32; 6 | return c; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/brk.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | int brk(void *end) 4 | { 5 | return -(syscall1(__NR_brk, (long)end) == -1); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/strcoll.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strcoll(const char *l, const char *r) 4 | { 5 | return strcmp(l, r); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/realpath.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *realpath(const char *filename, char *resolved) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/in6addr_loopback.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; 4 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/wait.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | pid_t wait(int *status) 4 | { 5 | return waitpid((pid_t)-1, status, 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/div.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | div_t div(int num, int den) 4 | { 5 | return (div_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/strtod.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double strtod(const char *s, char **p) 4 | { 5 | return strtold(s, p); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_equal.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pthread_equal(pthread_t a, pthread_t b) 4 | { 5 | return a==b; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/_exit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void _exit(int status) 5 | { 6 | _Exit(status); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/17.expect: -------------------------------------------------------------------------------- 1 | X162 "onetok" 2 | X161 "onetok" 3 | X163 "one##tok" 4 | X170 x ## y 5 | X171 x ## y 6 | X180 return Z(Z(1)); 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/32_led.expect: -------------------------------------------------------------------------------- 1 | _ _ _ _ 2 | | _| _| |_| |_ |_ | 3 | | |_ _| | _| |_| | 4 | 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/pthread.h: -------------------------------------------------------------------------------- 1 | struct __ptcb { 2 | long __jb[7]; 3 | int __dummy; 4 | struct __ptcb *__next; 5 | void *__ptrs[3]; 6 | }; 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/conf/pathconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long pathconf(const char *path, int name) 4 | { 5 | return fpathconf(-1, name); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isdigit 3 | 4 | int isdigit(int c) 5 | { 6 | return (unsigned)c-'0' < 10; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/islower.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef islower 3 | 4 | int islower(int c) 5 | { 6 | return (unsigned)c-'a' < 26; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isupper 3 | 4 | int isupper(int c) 5 | { 6 | return (unsigned)c-'A' < 26; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isxdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isxdigit(int c) 4 | { 5 | return isdigit(c) || ((unsigned)c|32)-'a' < 6; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/toupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int toupper(int c) 4 | { 5 | if (islower(c)) return c & 0x5f; 6 | return c; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/telldir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__dirent.h" 3 | 4 | long telldir(DIR *dir) 5 | { 6 | return dir->tell; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/exit/abort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void abort(void) 5 | { 6 | raise(SIGABRT); 7 | for (;;); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/getpagesize.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int getpagesize(void) 5 | { 6 | return PAGE_SIZE; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/catopen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | nl_catd catopen (const char *name, int oflag) 4 | { 5 | return (nl_catd)-1; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/freelocale.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "locale_impl.h" 3 | 4 | void freelocale(locale_t l) 5 | { 6 | free(l); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/multibyte/btowc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wint_t btowc(int c) 5 | { 6 | return c<128U ? c : EOF; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/srandom.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* FIXME */ 4 | 5 | void srandom(unsigned seed) 6 | { 7 | return srand(seed); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__stdio_close.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int __stdio_close(FILE *f) 4 | { 5 | return __syscall_close(f->fd); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getw.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int getw(FILE *f) 4 | { 5 | int x; 6 | return fread(&x, sizeof x, 1, f) ? x : EOF; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putw.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int putw(int x, FILE *f) 4 | { 5 | return fwrite(&x, sizeof x, 1, f) ? x : EOF; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/ldiv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ldiv_t ldiv(long num, long den) 4 | { 5 | return (ldiv_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/dup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int dup(int fd) 5 | { 6 | return syscall1(__NR_dup, fd); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/08.c: -------------------------------------------------------------------------------- 1 | // test macro expansion in arguments 2 | #define s_pos s_s.s_pos 3 | #define foo(x) (x) 4 | foo(hej.s_pos) 5 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/25_quicksort.expect: -------------------------------------------------------------------------------- 1 | 62 83 4 89 36 21 74 37 65 33 96 38 53 16 74 55 2 | 4 16 21 33 36 37 38 53 55 62 65 74 74 83 89 96 3 | -------------------------------------------------------------------------------- /05/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | #include // we define all the relevant things here 5 | 6 | #endif // _ERRNO_H 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/bits/pthread.h: -------------------------------------------------------------------------------- 1 | struct __ptcb { 2 | long __jb[7]; 3 | int __dummy; 4 | struct __ptcb *__next; 5 | void *__ptrs[3]; 6 | }; 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/isalpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isalpha 3 | 4 | int isalpha(int c) 5 | { 6 | return ((unsigned)c|32)-'a' < 26; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/posix_madvise.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_madvise(void *addr, size_t len, int advice) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__fpending.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | size_t __fpending(FILE *f) 4 | { 5 | return f->wend ? f->wpos - f->wbase : 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/vprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int vprintf(const char *fmt, va_list ap) 4 | { 5 | return vfprintf(stdout, fmt, ap); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/bzero.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void bzero(void *s, size_t n) 5 | { 6 | memset(s, 0, n); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_destroy(pthread_attr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_cond_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_cond_destroy(pthread_cond_t *c) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | gid_t getgid(void) 5 | { 6 | return syscall0(__NR_getgid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getlogin.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *getlogin(void) 5 | { 6 | return getenv("LOGNAME"); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getpid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getpid(void) 5 | { 6 | return syscall0(__NR_getpid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | uid_t getuid(void) 5 | { 6 | return syscall0(__NR_getuid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t setsid(void) 5 | { 6 | return syscall0(__NR_setsid); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/examples/ex5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World\n"); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /00/Makefile: -------------------------------------------------------------------------------- 1 | all: README.html out00 2 | out00: in00 3 | ./hexcompile 4 | %.html: %.md ../markdown 5 | ../markdown $< 6 | clean: 7 | rm -f out00 README.html 8 | -------------------------------------------------------------------------------- /05/assert.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASSERT_H 2 | #define _ASSERT_H 3 | 4 | // assert is defined in stdc_common.h 5 | #include 6 | 7 | #endif // _ASSERT_H 8 | -------------------------------------------------------------------------------- /05/limits.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIMITS_H 2 | #define _LIMITS_H 3 | 4 | #include // we define all the relevant constants here 5 | 6 | #endif // _LIMITS_H 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/reboot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int reboot(int type) 5 | { 6 | errno = ENOSYS; 7 | return -1; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/freeaddrinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void freeaddrinfo(struct addrinfo *p) 5 | { 6 | free(p); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/srand48.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void srand48(long seed) 4 | { 5 | seed48((unsigned short [3]){ 0x330e, seed, seed>>16 }); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getline.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ssize_t getline(char **s, size_t *n, FILE *f) 4 | { 5 | return getdelim(s, n, '\n', f); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/puts.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int puts(const char *s) 4 | { 5 | return -(fputs(s, stdout) < 0 || putchar('\n') < 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/index.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *index(const char *s, int c) 5 | { 6 | return strchr(s, c); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcdrain.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcdrain(int fd) 5 | { 6 | return ioctl(fd, TCSBRK, 1); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutex_destroy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pthread_mutex_destroy(pthread_mutex_t *mutex) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_spin_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_destroy(pthread_spinlock_t *s) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_testcancel.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | void pthread_testcancel() 4 | { 5 | CANCELPT_BEGIN; 6 | CANCELPT_END; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/fchdir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fchdir(int fd) 5 | { 6 | return syscall1(__NR_fchdir, fd); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getegid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | gid_t getegid(void) 5 | { 6 | return syscall0(__NR_getegid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/geteuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | uid_t geteuid(void) 5 | { 6 | return syscall0(__NR_geteuid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getpgrp(void) 5 | { 6 | return syscall0(__NR_getpgrp); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getppid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getppid(void) 5 | { 6 | return syscall0(__NR_getppid); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/97_utf8_string_literal.expect: -------------------------------------------------------------------------------- 1 | 0068 0065 006C 006C 006F 0024 0024 4F60 597D 00A2 00A2 4E16 754C 20AC 20AC 0077 006F 0072 006C 0064 2 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/s_lrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // FIXME: incorrect exception behavior 4 | 5 | long lrint(double x) 6 | { 7 | return rint(x); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/s_lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // FIXME: incorrect exception behavior 4 | 5 | long lrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/munlockall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int munlockall(void) 5 | { 6 | return syscall0(__NR_munlockall); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/multibyte/wctob.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wctob(wint_t c) 5 | { 6 | if (c < 128U) return c; 7 | return EOF; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/rand_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int rand_r(unsigned *seed) 4 | { 5 | return (*seed = *seed * 1103515245 + 12345) & 0x7fffffff; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/mkfifo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mkfifo(const char *path, mode_t mode) 4 | { 5 | return mknod(path, mode | S_IFIFO, 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/umask.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | mode_t umask(mode_t mode) 5 | { 6 | return syscall1(__NR_umask, mode); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int putc(int c, FILE *f) 4 | { 5 | return fputc(c, f); 6 | } 7 | 8 | weak_alias(putc, _IO_putc); 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/remove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int remove(const char *path) 5 | { 6 | return __syscall_unlink(path); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/setbuf.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | void setbuf(FILE *f, char *buf) 4 | { 5 | setvbuf(f, buf, buf ? _IOFBF : _IONBF, BUFSIZ); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/lldiv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | lldiv_t lldiv(long long num, long long den) 4 | { 5 | return (lldiv_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/rindex.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *rindex(const char *s, int c) 5 | { 6 | return strrchr(s, c); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_barrier_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_barrier_destroy(pthread_barrier_t *b) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_rwlock_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_destroy(pthread_rwlock_t *rw) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_spin_unlock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_unlock(pthread_spinlock_t *s) 4 | { 5 | return *s = 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/dup2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int dup2(int old, int new) 5 | { 6 | return __syscall_dup2(old, new); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getsid(pid_t pid) 5 | { 6 | return syscall1(__NR_getsid, pid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/pipe.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int pipe(int fd[2]) 5 | { 6 | return syscall1(__NR_pipe, (long)fd); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/unlink.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int unlink(const char *path) 5 | { 6 | return __syscall_unlink(path); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | #include // we define all the relevant things here 5 | 6 | #endif // _ERRNO_H 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/examples/ex1.c: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/tcc -run 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World\n"); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/toascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* nonsense function that should NEVER be used! */ 4 | int toascii(int c) 5 | { 6 | return c & 0x7f; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/catgets.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *catgets (nl_catd catd, int set_id, int msg_id, const char *s) 4 | { 5 | return (char *)s; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/s_llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // FIXME: incorrect exception behavior 4 | 5 | long long llrint(double x) 6 | { 7 | return rint(x); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/mlockall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mlockall(int flags) 5 | { 6 | return syscall1(__NR_mlockall, flags); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/passwd/lckpwdf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int lckpwdf() 4 | { 5 | return 0; 6 | } 7 | 8 | int ulckpwdf() 9 | { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/kill.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int kill(pid_t pid, int sig) 5 | { 6 | return syscall2(__NR_kill, pid, sig); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__uflow.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int __uflow(FILE *f) 4 | { 5 | if (__underflow(f) < 0) return EOF; 6 | else return *f->rpos++; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/imaxdiv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | imaxdiv_t imaxdiv(intmax_t num, intmax_t den) 4 | { 5 | return (imaxdiv_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strcasestr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strcasestr(const char *h, const char *n) 4 | { 5 | //FIXME! 6 | return strstr(h, n); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_getscope.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_getscope(pthread_attr_t *a, int *scope) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_setscope.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setscope(pthread_attr_t *a, int scope) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutexattr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_destroy(pthread_mutexattr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_spin_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_init(pthread_spinlock_t *s, int shared) 4 | { 5 | return *s = 0; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getpgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getpgid(pid_t pid) 5 | { 6 | return syscall1(__NR_getpgid, pid); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/assert.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASSERT_H 2 | #define _ASSERT_H 3 | 4 | // assert is defined in stdc_common.h 5 | #include 6 | 7 | #endif // _ASSERT_H 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/20.expect: -------------------------------------------------------------------------------- 1 | X1 printk(KERN_WARNING "pipapo",bla); 2 | X2 printk(KERN_WARNING "bla",foo); 3 | X2 twoopq 4 | X3 otwopq 5 | X4 optwoq 6 | X5 opqtwo 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/11_precedence.expect: -------------------------------------------------------------------------------- 1 | 134 2 | 134 3 | 0 4 | 1 5 | 1 6 | 1 7 | 1 8 | 46 9 | 1, 0 10 | 0, 1 11 | 1 12 | 1916 13 | 1916 14 | 64 15 | 4 16 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/kd.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_KD_H 2 | #define _SYS_KD_H 3 | 4 | #define _LINUX_TYPES_H 5 | #include 6 | #undef _LINUX_TYPES_H 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswblank.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int iswblank(wint_t wc) 6 | { 7 | return isblank(wc); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/env/clearenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern char **__environ; 4 | 5 | int clearenv() 6 | { 7 | __environ[0] = 0; 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/chroot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int chroot(const char *path) 5 | { 6 | return syscall1(__NR_chroot, (long)path); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/wcscoll.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* FIXME: stub */ 4 | int wcscoll(const wchar_t *l, const wchar_t *r) 5 | { 6 | return wcscmp(l, r); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/malloc/__brk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | uintptr_t __brk(uintptr_t newbrk) 5 | { 6 | return syscall1(__NR_brk, newbrk); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/raise.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int raise(int sig) 5 | { 6 | return __syscall_kill(__syscall_getpid(), sig); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/vscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int vscanf(const char *fmt, va_list ap) 5 | { 6 | return vfscanf(stdin, fmt, ap); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/bcopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void bcopy(const void *s1, void *s2, size_t n) 5 | { 6 | memmove(s2, s1, n); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strcat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strcat(char *dest, const char *src) 4 | { 5 | strcpy(dest + strlen(dest), src); 6 | return dest; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcslen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcslen(const wchar_t *s) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s; s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcflow.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcflow(int fd, int action) 5 | { 6 | return ioctl(fd, TCXONC, action); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcflush.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcflush(int fd, int queue) 5 | { 6 | return ioctl(fd, TCFLSH, queue); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/alarm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | unsigned alarm(unsigned seconds) 5 | { 6 | return syscall1(__NR_alarm, seconds); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/chdir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int chdir(const char *path) 5 | { 6 | return syscall1(__NR_chdir, (long)path); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/fsync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fsync(int fd) 5 | { 6 | //return syscall1(__NR_fsync, fd); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/rmdir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int rmdir(const char *path) 5 | { 6 | return syscall1(__NR_rmdir, (long)path); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/limits.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIMITS_H 2 | #define _LIMITS_H 3 | 4 | #include // we define all the relevant constants here 5 | 6 | #endif // _LIMITS_H 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/win32/include/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparable to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/__dirent.h: -------------------------------------------------------------------------------- 1 | struct __DIR_s 2 | { 3 | int lock; 4 | int fd; 5 | off_t tell; 6 | int buf_pos; 7 | int buf_end; 8 | char buf[2048]; 9 | }; 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/klogctl.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | int klogctl (int type, char *buf, int len) 4 | { 5 | return syscall3(__NR_syslog, type, (long)buf, len); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/swapoff.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int swapoff(const char *path) 5 | { 6 | return syscall1(__NR_swapoff, (long)path); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/fchmod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fchmod(int fd, mode_t mode) 5 | { 6 | return syscall2(__NR_fchmod, fd, mode); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/mkfifoat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mkfifoat(int fd, const char *path, mode_t mode) 4 | { 5 | return mknodat(fd, path, mode | S_IFIFO, 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getwchar.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | wint_t getwchar(void) 4 | { 5 | return fgetwc(stdin); 6 | } 7 | 8 | weak_alias(getwchar, getwchar_unlocked); 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/bcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int bcmp(const void *s1, const void *s2, size_t n) 5 | { 6 | return memcmp(s1, s2, n); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/mempcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void *mempcpy(void *dest, void *src, size_t n) 4 | { 5 | memcpy(dest, src, n); 6 | return (char *)dest + n; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t strnlen(const char *s, size_t n) 4 | { 5 | const char *p = memchr(s, 0, n); 6 | return p ? p-s : n; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strpbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strpbrk(const char *s, const char *b) 4 | { 5 | s += strcspn(s, b); 6 | return *s ? (char *)s : 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcswcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcswcs(const wchar_t *haystack, const wchar_t *needle) 4 | { 5 | return wcsstr(haystack, needle); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_init(pthread_attr_t *a) 4 | { 5 | memset(a, 0, sizeof *a); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_spin_lock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_lock(pthread_spinlock_t *s) 4 | { 5 | while (a_xchg(s, 1)); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_spin_trylock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_trylock(pthread_spinlock_t *s) 4 | { 5 | return -a_xchg(s, 1) & EBUSY; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/times.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | clock_t times(struct tms *tms) 5 | { 6 | return syscall1(__NR_times, (long)&tms); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/isatty.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int isatty(int fd) 5 | { 6 | struct termios t; 7 | return tcgetattr(fd, &t) == 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/epoll_create.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int epoll_create(int size) 5 | { 6 | return syscall1(__NR_epoll_create, size); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/sysinfo.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | struct sysinfo; 4 | 5 | int sysinfo(struct sysinfo *info) 6 | { 7 | return syscall1(__NR_sysinfo, (long)info); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigemptyset.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigemptyset(sigset_t *set) 5 | { 6 | memset(set, 0, sizeof *set); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigfillset.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigfillset(sigset_t *set) 5 | { 6 | memset(set, -1, sizeof *set); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcscat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscat(wchar_t *dest, const wchar_t *src) 4 | { 5 | wcscpy(dest + wcslen(dest), src); 6 | return dest; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcscmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscmp(const wchar_t *l, const wchar_t *r) 4 | { 5 | for (; *l==*r && *l && *r; l++, r++); 6 | return *l - *r; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcscpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscpy(wchar_t *d, const wchar_t *s) 4 | { 5 | wchar_t *a = d; 6 | while ((*d++ = *s++)); 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setpgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t setpgid(pid_t pid, pid_t pgid) 5 | { 6 | return syscall2(__NR_setpgid, pid, pgid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/alloca.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALLOCA_H 2 | #define _ALLOCA_H 3 | 4 | #define __NEED_size_t 5 | #include 6 | 7 | void *alloca(size_t); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/reg.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_USER_H 2 | #define _SYS_USER_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswgraph.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswgraph(wint_t wc) 4 | { 5 | /* ISO C defines this function as: */ 6 | return !iswspace(wc) && iswprint(wc); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/epoll_create1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int epoll_create1(int flags) 5 | { 6 | return syscall1(__NR_epoll_create1, flags); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/sbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | void *sbrk(ptrdiff_t inc) 5 | { 6 | return (void *)syscall1(__NR_brk, syscall1(__NR_brk, 0)+inc); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/umount.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int umount(const char *special) 5 | { 6 | return syscall2(__NR_umount2, (long)special, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/bswap_32.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uint32_t bswap_32(uint32_t x) 5 | { 6 | return x>>24 | x>>16&0xff00 | x<<16&0xff0000 | x<<24; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/mlock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mlock(const void *addr, size_t len) 5 | { 6 | return syscall2(__NR_mlock, (long)addr, len); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__stdio_read.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | size_t __stdio_read(FILE *f, unsigned char *buf, size_t len) 4 | { 5 | return __syscall_read(f->fd, buf, len); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getchar_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int getchar_unlocked(void) 4 | { 5 | return stdin->rpos < stdin->rstop ? *stdin->rpos++ : __uflow(stdin); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putwchar.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | wint_t putwchar(wchar_t c) 4 | { 5 | return fputwc(c, stdout); 6 | } 7 | 8 | weak_alias(putwchar, putwchar_unlocked); 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strchrnul.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strchrnul(const char *s, int c) 4 | { 5 | char *p = strchr(s, c); 6 | return p ? p : (char *)s + strlen(s); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/fchown.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fchown(int fd, uid_t uid, gid_t gid) 5 | { 6 | return syscall3(__NR_fchown, fd, uid, gid); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/13.S: -------------------------------------------------------------------------------- 1 | # `modelist' label. Each video mode record looks like: 2 | #ifdef AAA 3 | # modelist' label. Each video mode record looks like: 4 | #endif 5 | .text 6 | endtext: 7 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/10_pointer.expect: -------------------------------------------------------------------------------- 1 | a = 42 2 | bolshevic.a = 12 3 | bolshevic.b = 34 4 | bolshevic.c = 56 5 | tsar->a = 12 6 | tsar->b = 34 7 | tsar->c = 56 8 | bolshevic.b = 34 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/pthread_arch.h: -------------------------------------------------------------------------------- 1 | static inline struct pthread *__pthread_self() 2 | { 3 | struct pthread *self; 4 | __asm__ ("movl %%gs:0,%0" : "=r" (self) ); 5 | return self; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/pthread_arch.h: -------------------------------------------------------------------------------- 1 | static inline struct pthread *__pthread_self() 2 | { 3 | struct pthread *self; 4 | __asm__ ("movq %%fs:0,%0" : "=r" (self) ); 5 | return self; 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #undef iswdigit 5 | 6 | int iswdigit(wint_t wc) 7 | { 8 | return (unsigned)wc-'0' < 10; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswxdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int iswxdigit(wint_t wc) 5 | { 6 | return (unsigned)(wc-'0') < 10 || (unsigned)((wc|32)-'a') < 6; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/stime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int stime(time_t *t) 4 | { 5 | struct timeval tv = { .tv_sec = *t, .tv_usec = 0 }; 6 | return settimeofday(&tv, (void *)0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/swapon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int swapon(const char *path, int flags) 5 | { 6 | return syscall2(__NR_swapon, (long)path, flags); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/listen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int listen(int fd, int backlog) 5 | { 6 | return socketcall(listen, fd, backlog, 0, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/shutdown.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int shutdown(int fd, int how) 5 | { 6 | return socketcall(shutdown, fd, how, 0, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/chmod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int chmod(const char *path, mode_t mode) 5 | { 6 | return syscall2(__NR_chmod, (long)path, mode); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/mkdir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mkdir(const char *path, mode_t mode) 5 | { 6 | return syscall2(__NR_mkdir, (long)path, mode); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/vsprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int vsprintf(char *s, const char *fmt, va_list ap) 5 | { 6 | return vsnprintf(s, INT_MAX, fmt, ap); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcspbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcspbrk(const wchar_t *s, const wchar_t *b) 4 | { 5 | s += wcscspn(s, b); 6 | return *s ? (wchar_t *)s : NULL; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_key_delete.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_key_delete(pthread_key_t k) 4 | { 5 | if (libc.tsd_keys) libc.tsd_keys[k] = 0; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutexattr_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_init(pthread_mutexattr_t *a) 4 | { 5 | memset(a, 0, sizeof *a); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/ctime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *ctime_r(const time_t *t, char *buf) 4 | { 5 | struct tm tm; 6 | localtime_r(t, &tm); 7 | return asctime_r(&tm, buf); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/ffs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ffs(int i) 4 | { 5 | unsigned int j = i; 6 | for (i=1; j && !(j&1); j>>=1, i++); 7 | if (j) return i; 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/munlock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int munlock(const void *addr, size_t len) 5 | { 6 | return syscall2(__NR_munlock, (long)addr, len); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/execv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern char **__environ; 4 | 5 | int execv(const char *path, char *const argv[]) 6 | { 7 | return execve(path, argv, __environ); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigwaitinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigwaitinfo(const sigset_t *mask, siginfo_t *si) 5 | { 6 | return sigtimedwait(mask, si, NULL); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fileno.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fileno(FILE *f) 4 | { 5 | return f->fd; 6 | } 7 | 8 | int fileno_unlocked(FILE *f) 9 | { 10 | return f->fd; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fsetpos.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fsetpos(FILE *f, const fpos_t *pos) 4 | { 5 | return __fseeko(f, *(const off_t *)pos, SEEK_SET); 6 | } 7 | 8 | LFS64(fsetpos); 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/rename.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int rename(const char *old, const char *new) 5 | { 6 | return syscall2(__NR_rename, (long)old, (long)new); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_cond_wait.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_cond_wait(pthread_cond_t *c, pthread_mutex_t *m) 4 | { 5 | return pthread_cond_timedwait(c, m, 0); 6 | } 7 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getgroups.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getgroups(int count, gid_t list[]) 5 | { 6 | return syscall2(__NR_getgroups, count, (long)list); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/ualarm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | /* FIXME: ?? */ 5 | useconds_t ualarm(useconds_t useconds, useconds_t interval) 6 | { 7 | return -1; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/setgroups.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int setgroups(int count, const gid_t list[]) 5 | { 6 | return syscall2(__NR_setgroups, count, (long)list); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/umount2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int umount2(const char *special, int flags) 5 | { 6 | return syscall2(__NR_umount2, (long)special, flags); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/uname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int uname(struct utsname *uts) 6 | { 7 | return syscall1(__NR_uname, (long)uts); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/passwd/getspent.c: -------------------------------------------------------------------------------- 1 | #include "pwf.h" 2 | 3 | void setspent() 4 | { 5 | } 6 | 7 | void endspent() 8 | { 9 | } 10 | 11 | struct spwd *getspent() 12 | { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/vfork.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t vfork(void) 5 | { 6 | /* vfork syscall cannot be made from C code */ 7 | return syscall0(__NR_fork); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/vwscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int vwscanf(const wchar_t *fmt, va_list ap) 6 | { 7 | return vfwscanf(stdin, fmt, ap); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/access.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int access(const char *filename, int amode) 5 | { 6 | return syscall2(__NR_access, (long)filename, amode); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/chown.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int chown(const char *path, uid_t uid, gid_t gid) 5 | { 6 | return syscall3(__NR_chown, (long)path, uid, gid); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/03.expect: -------------------------------------------------------------------------------- 1 | printf("x" "1" "= %d, x" "2" "= %s", x1, x2); 2 | fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s); 3 | \#include "vers2.h" 4 | "hello"; 5 | "hello" ", world" 6 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/28_strings.expect: -------------------------------------------------------------------------------- 1 | hello 2 | gollo 3 | 1 4 | 1 5 | 1 6 | 5 7 | gollo! 8 | 1 9 | 1 10 | 1 11 | 1 12 | ollo! 13 | lo! 14 | 1 15 | grrrr! 16 | grgrr! 17 | 1 18 | 1 19 | 1 20 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswalnum.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #undef iswalnum 5 | 6 | int iswalnum(wint_t wc) 7 | { 8 | return (unsigned)wc-'0' < 10 || iswalpha(wc); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/sethostname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sethostname(const char *name, size_t len) 5 | { 6 | return syscall2(__NR_sethostname, (long)name, len); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/mprotect.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mprotect(void *addr, size_t len, int prot) 5 | { 6 | return syscall3(__NR_mprotect, (long)addr, len, prot); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigpending.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sigpending(sigset_t *set) 5 | { 6 | return syscall2(__NR_rt_sigpending, (long)set, SYSCALL_SIGSET_SIZE); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/mkdirat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mkdirat(int fd, const char *path, mode_t mode) 5 | { 6 | return syscall3(__NR_mkdirat, fd, (long)path, mode); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcsncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r && *l && *r; l++, r++); 6 | return n ? *l - *r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcsspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s && wcschr(c, *s); s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_getdetachstate.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_getdetachstate(pthread_attr_t *a, int *state) 4 | { 5 | *state = a->_a_detach; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_setdetachstate.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setdetachstate(pthread_attr_t *a, int state) 4 | { 5 | a->_a_detach = state; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_cond_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_cond_init(pthread_cond_t *c, const pthread_condattr_t *a) 4 | { 5 | memset(c, 0, sizeof *c); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_cond_signal.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_cond_signal(pthread_cond_t *c) 4 | { 5 | c->_c_block = 0; 6 | __wake(&c->_c_block, 1, 0); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutexattr_gettype.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_gettype(const pthread_mutexattr_t *a, int *type) 4 | { 5 | *type = *a & 3; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/asctime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__asctime(const struct tm *, char *); 4 | 5 | char *asctime_r(const struct tm *tm, char *buf) 6 | { 7 | return __asctime(tm, buf); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/lchown.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int lchown(const char *path, uid_t uid, gid_t gid) 5 | { 6 | return syscall3(__NR_lchown, (long)path, uid, gid); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/link.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int link(const char *existing, const char *new) 5 | { 6 | return syscall2(__NR_link, (long)existing, (long)new); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/unlinkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int unlinkat(int fd, const char *path, int flag) 5 | { 6 | return syscall3(__NR_unlinkat, fd, (long)path, flag); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/19.expect: -------------------------------------------------------------------------------- 1 | X92 M_IFI_1 2 | X93 KO 3 | X94 KO 4 | X95 a 5 | X96 M_IFI_1 6 | X97 ok 7 | X98 (1)(ok, nok) 8 | X99 ok 9 | X1 ok 10 | X2 1 11 | X3 ok 12 | X4 1 13 | X5 nok 14 | X6 ok 15 | -------------------------------------------------------------------------------- /01/Makefile: -------------------------------------------------------------------------------- 1 | all: out01 README.html 2 | out01: in01 out00 3 | ./out00 4 | out00: in00 5 | ../00/hexcompile 6 | %.html: %.md ../markdown 7 | ../markdown $< 8 | clean: 9 | rm -f out00 out01 README.html 10 | -------------------------------------------------------------------------------- /02/Makefile: -------------------------------------------------------------------------------- 1 | all: out01 out02 README.html 2 | out01: in01 3 | ../01/out00 4 | out02: out01 in02 5 | ./out01 6 | %.html: %.md ../markdown 7 | ../markdown $< 8 | clean: 9 | rm -f out01 out02 README.html 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/env/__environ.c: -------------------------------------------------------------------------------- 1 | #include "libc.h" 2 | 3 | #undef environ 4 | char **___environ; 5 | weak_alias(___environ, __environ); 6 | weak_alias(___environ, _environ); 7 | weak_alias(___environ, environ); 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/settimeofday.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int settimeofday(const struct timeval *tv, void *tz) 5 | { 6 | return syscall2(__NR_settimeofday, (long)tv, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/setpriority.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int setpriority(int which, id_t who, int prio) 5 | { 6 | return syscall3(__NR_getpriority, which, who, prio); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/htons.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | uint16_t htons(uint16_t n) 4 | { 5 | union { 6 | uint8_t b[2]; 7 | uint16_t s; 8 | } u = { { n>>8, n } }; 9 | return u.s; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/inet_aton.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int inet_aton(const char *cp, struct in_addr *inp) 5 | { 6 | return inet_pton(AF_INET, cp, (void *)inp) > 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/fork.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | /* FIXME: add support for atfork stupidity */ 5 | 6 | pid_t fork(void) 7 | { 8 | return syscall0(__NR_fork); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigsuspend.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sigsuspend(const sigset_t *mask) 5 | { 6 | return syscall2(__NR_rt_sigsuspend, (long)mask, sizeof(sigset_t)); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putchar_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int putchar_unlocked(int c) 4 | { 5 | return stdout->wpos < stdout->wstop ? 6 | (*stdout->wpos++ = c) : __overflow(stdout, c); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strcmp(const char *l, const char *r) 4 | { 5 | for (; *l==*r && *l && *r; l++, r++); 6 | return *(unsigned char *)l - *(unsigned char *)r; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_cond_broadcast.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_cond_broadcast(pthread_cond_t *c) 4 | { 5 | c->_c_block = 0; 6 | __wake(&c->_c_block, -1, 0); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_kill.c: -------------------------------------------------------------------------------- 1 | #define SYSCALL_RETURN_ERRNO 2 | #include "pthread_impl.h" 3 | 4 | int pthread_kill(pthread_t t, int sig) 5 | { 6 | return syscall3(__NR_tgkill, t->pid, t->tid, sig); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/symlink.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int symlink(const char *existing, const char *new) 5 | { 6 | return syscall2(__NR_symlink, (long)existing, (long)new); 7 | } 8 | -------------------------------------------------------------------------------- /03/Makefile: -------------------------------------------------------------------------------- 1 | all: out02 out03 README.html 2 | out02: in02 ../02/out01 3 | ../02/out01 4 | out03: out02 in03 5 | ./out02 6 | %.html: %.md ../markdown 7 | ../markdown $< 8 | clean: 9 | rm -f out* README.html 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/signalfd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int signalfd(int fd, const sigset_t *sigs, int flags) 5 | { 6 | return syscall3(__NR_signalfd, fd, (long)sigs, 8); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_scalbln.s: -------------------------------------------------------------------------------- 1 | .global ldexp 2 | .global scalbn 3 | .global scalbln 4 | ldexp: 5 | scalbn: 6 | scalbln: 7 | fildl 12(%esp) 8 | fldl 4(%esp) 9 | fscale 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/getdomainname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int getdomainname(char *name, size_t len) 6 | { 7 | *name = 0; 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/bind.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int bind(int fd, const struct sockaddr *addr, socklen_t len) 5 | { 6 | return socketcall(bind, fd, addr, len, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/ntohs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | uint16_t ntohs(uint16_t n) 4 | { 5 | union { 6 | uint16_t s; 7 | uint8_t b[2]; 8 | } u = { n }; 9 | return (u.b[0]<<8) | u.b[1]; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/socket.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int socket(int domain, int type, int protocol) 5 | { 6 | return socketcall(socket, domain, type, protocol, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/waitpid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t waitpid(pid_t pid, int *status, int options) 5 | { 6 | return syscall4(__NR_wait4, pid, (long)status, options, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/gets.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | char *gets(char *s) 4 | { 5 | char *ret = fgets(s, INT_MAX, stdin); 6 | if (ret && s[strlen(s)-1] == '\n') s[strlen(s)-1] = 0; 7 | return ret; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_cancel.c: -------------------------------------------------------------------------------- 1 | #define SYSCALL_RETURN_ERRNO 2 | #include "pthread_impl.h" 3 | 4 | int pthread_cancel(pthread_t t) 5 | { 6 | return syscall3(__NR_tgkill, t->pid, t->tid, SIGCANCEL); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/01.c: -------------------------------------------------------------------------------- 1 | #define hash_hash # ## # 2 | #define mkstr(a) # a 3 | #define in_between(a) mkstr(a) 4 | #define join(c, d) in_between(c hash_hash d) 5 | char p[] = join(x, y); 6 | // char p[] = "x ## y"; 7 | -------------------------------------------------------------------------------- /04a/Makefile: -------------------------------------------------------------------------------- 1 | all: out04 out04a README.html 2 | out04: in04 ../04/out03 3 | ../04/out03 4 | out04a: in04a out04 5 | ./out04 6 | %.html: %.md ../markdown 7 | ../markdown $< 8 | clean: 9 | rm -f out* README.html 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | #ifndef __cplusplus 5 | 6 | #define true 1 7 | #define false 0 8 | 9 | typedef _Bool bool; 10 | 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/exit/_Exit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define SYSCALL_NORETURN 3 | #include "syscall.h" 4 | 5 | void _Exit(int ec) 6 | { 7 | syscall1(__NR_exit_group, ec); 8 | syscall1(__NR_exit, ec); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/s_scalblnf.s: -------------------------------------------------------------------------------- 1 | .global ldexpf 2 | .global scalbnf 3 | .global scalblnf 4 | ldexpf: 5 | scalbnf: 6 | scalblnf: 7 | fildl 8(%esp) 8 | flds 4(%esp) 9 | fscale 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/getc_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int getc_unlocked(FILE *f) 4 | { 5 | return f->rpos < f->rstop ? *f->rpos++ : __uflow(f); 6 | } 7 | 8 | weak_alias (getc_unlocked, fgetc_unlocked); 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wmemchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n) 5 | { 6 | for (; n && *s != c; s++); 7 | return n ? (wchar_t *)s : 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wmemcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wmemcmp(const wchar_t *l, const wchar_t *r, size_t n) 5 | { 6 | for (; n && *l==*r; n--, l++, r++); 7 | return n ? *l-*r : 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/10.c: -------------------------------------------------------------------------------- 1 | #define f(x) x 2 | #define g(x) f(x) f(x 3 | #define i(x) g(x)) g(x 4 | #define h(x) i(x))) i(x 5 | #define k(x) i(x))) i(x)))) 6 | f(x) 7 | g(x)) 8 | i(x))) 9 | h(x)))) 10 | k(x)))) 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/50_logical_second_arg.expect: -------------------------------------------------------------------------------- 1 | fred 2 | 0 3 | fred 4 | joe 5 | 1 6 | joe 7 | fred 8 | 0 9 | joe 10 | 1 11 | fred 12 | 0 13 | fred 14 | joe 15 | 1 16 | joe 17 | fred 18 | 0 19 | joe 20 | 1 21 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/71_macro_empty_arg.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define T(a,b,c) a b c 4 | 5 | int main(void) 6 | { 7 | printf("%d", T(1,+,2) T(+,,) T(,2,*) T(,7,) T(,,)); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/epoll_ctl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) 5 | { 6 | return syscall4(__NR_epoll_ctl, fd, op, fd2, (long)ev); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/bswap_64.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uint32_t bswap_32(uint32_t); 5 | 6 | uint64_t bswap_64(uint64_t x) 7 | { 8 | return bswap_32(x)+0LL<<32 | bswap_32(x>>32); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/mman/msync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int msync(void *start, size_t len, int flags) 6 | { 7 | return syscall3(__NR_msync, (long)start, len, flags); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/htonl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | uint32_t htonl(uint32_t n) 4 | { 5 | union { 6 | uint8_t b[4]; 7 | uint32_t i; 8 | } u = { { n>>24, n>>16, n>>8, n } }; 9 | return u.i; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/recv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t recv(int fd, void *buf, size_t len, int flags) 6 | { 7 | return recvfrom(fd, buf, len, flags, 0, 0); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/lcong48.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern unsigned short __seed48[7]; 5 | 6 | void lcong48(unsigned short p[7]) 7 | { 8 | memcpy(__seed48, p, sizeof __seed48); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/fchmodat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fchmodat(int fd, const char *path, mode_t mode, int flag) 5 | { 6 | return syscall4(__NR_fchmodat, fd, (long)path, mode, flag); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__stpncpy(char *, const char *, size_t); 4 | 5 | char *strncpy(char *d, const char *s, size_t n) 6 | { 7 | __stpncpy(d, s, n); 8 | return d; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcsrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsrchr(const wchar_t *s, wint_t c) 4 | { 5 | const wchar_t *p; 6 | for (p=s+wcslen(s); p>=s && *p!=c; p--); 7 | return p>=s ? (wchar_t *)p : 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wmemset.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wmemset(wchar_t *d, wchar_t c, size_t n) 5 | { 6 | wchar_t *ret = d; 7 | while (n--) *d++ = c; 8 | return ret; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcgetsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | pid_t tcgetsid(int fd) 5 | { 6 | int sid; 7 | if (ioctl(fd, TIOCGSID, &sid) < 0) 8 | return -1; 9 | return sid; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/__futex.c: -------------------------------------------------------------------------------- 1 | #include "futex.h" 2 | #include "syscall.h" 3 | 4 | int __futex(volatile int *addr, int op, int val, void *ts) 5 | { 6 | return syscall4(__NR_futex, (long)addr, op, val, (long)ts); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_getguardsize.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_getguardsize(pthread_attr_t *a, size_t *size) 4 | { 5 | *size = a->_a_guardsize + DEFAULT_GUARD_SIZE; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_getstacksize.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_getstacksize(pthread_attr_t *a, size_t *size) 4 | { 5 | *size = a->_a_stacksize + DEFAULT_STACK_SIZE; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/asctime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__asctime(const struct tm *, char *); 4 | 5 | char *asctime(const struct tm *tm) 6 | { 7 | static char buf[26]; 8 | return __asctime(tm, buf); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/getcwd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | char *getcwd(char *buf, size_t size) 6 | { 7 | return syscall2(__NR_getcwd, (long)buf, size) < 0 ? NULL : buf; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/readlink.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int readlink(const char *path, char *buf, size_t bufsize) 5 | { 6 | return syscall3(__NR_readlink, (long)path, (long)buf, bufsize); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/11.expect: -------------------------------------------------------------------------------- 1 | a 2 | a b 3 | a b c 4 | a b c d 5 | x a b c d y 6 | x a b c y 7 | x a b y 8 | x a y 9 | x y 10 | x A,B,C y 11 | x A,B y 12 | x A y 13 | x y 14 | __attribute__((__noreturn__)) 15 | 1 2 16 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/wcswidth.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcswidth(const wchar_t *wcs, size_t n) 4 | { 5 | int l=0, k=0; 6 | for (; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l+=k, wcs++); 7 | return (k < 0) ? k : l; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/fcntl/creat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int creat(const char *filename, mode_t mode) 5 | { 6 | return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode); 7 | } 8 | 9 | LFS64(creat); 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/epoll_wait.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int epoll_wait(int fd, struct epoll_event *ev, int cnt, int to) 5 | { 6 | return syscall4(__NR_epoll_wait, fd, (long)ev, cnt, to); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/sched_yield.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int __yield() 6 | { 7 | return syscall0(__NR_sched_yield); 8 | } 9 | 10 | weak_alias(__yield, sched_yield); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/getpeername.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getpeername(int fd, struct sockaddr *addr, socklen_t *len) 5 | { 6 | return socketcall(getpeername, fd, addr, len, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/getsockname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getsockname(int fd, struct sockaddr *addr, socklen_t *len) 5 | { 6 | return socketcall(getsockname, fd, addr, len, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/send.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t send(int fd, const void *buf, size_t len, int flags) 6 | { 7 | return sendto(fd, buf, len, flags, 0, 0); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/sockatmark.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sockatmark(int s) 5 | { 6 | int ret; 7 | if (ioctl(s, SIOCATMARK, &ret) < 0) 8 | return -1; 9 | return ret; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/mknodat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mknodat(int fd, const char *path, mode_t mode, dev_t dev) 5 | { 6 | return syscall4(__NR_mknodat, fd, (long)path, mode, dev & 0xffff); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcschr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcschr(const wchar_t *s, wchar_t c) 4 | { 5 | if (!c) return (wchar_t *)s + wcslen(s); 6 | for (; *s && *s != c; s++); 7 | return *s ? (wchar_t *)s : 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wmemcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wmemcpy(wchar_t *d, const wchar_t *s, size_t n) 5 | { 6 | wchar_t *a = d; 7 | while (n--) *d++ = *s++; 8 | return a; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/symlinkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int symlinkat(const char *existing, int fd, const char *new) 5 | { 6 | return syscall3(__NR_symlinkat, (long)existing, fd, (long)new); 7 | } 8 | -------------------------------------------------------------------------------- /05/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | #include 5 | #define offsetof(struct, member) ((size_t)(&((struct *)NULL)->member)) 6 | // @NONSTANDARD: we don't have wchar_t 7 | 8 | #endif // _STDDEF_H 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tcctest.h: -------------------------------------------------------------------------------- 1 | static inline const char *get_basefile_from_header(void) 2 | { 3 | return __BASE_FILE__; 4 | } 5 | 6 | static inline const char *get_file_from_header(void) 7 | { 8 | return __FILE__; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/statfs.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_STATFS_H 2 | #define _SYS_STATFS_H 3 | 4 | #include 5 | 6 | #define statfs statvfs 7 | #define fstatfs fstatvfs 8 | #define f_namelen f_namemax 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/sysctl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSCTL_H 2 | #define _SYS_SYSCTL_H 3 | 4 | #define __NEED_size_t 5 | #include 6 | 7 | int sysctl (int *, int, void *, size_t *, void *, size_t); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/waitid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int waitid(idtype_t type, id_t id, siginfo_t *info, int options) 5 | { 6 | return syscall5(__NR_waitid, type, id, (long)info, options, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/killpg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int killpg(pid_t pgid, int sig) 5 | { 6 | if (pgid < 0) { 7 | errno = EINVAL; 8 | return -1; 9 | } 10 | return kill(-pgid, sig); 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/fstat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int fstat(int fd, struct stat *buf) 6 | { 7 | return syscall2(__NR_fstat, fd, (long)buf); 8 | } 9 | 10 | LFS64(fstat); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/memcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int memcmp(const void *vl, const void *vr, size_t n) 4 | { 5 | const unsigned char *l=vl, *r=vr; 6 | for (; n && *l == *r; n--, l++, r++); 7 | return n ? *l-*r : 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strrchr(const char *s, int c) 4 | { 5 | const char *p; 6 | c = (char)c; 7 | for (p=s+strlen(s); p>=s && *p!=c; p--); 8 | return p>=s ? (char *)p : 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcsncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncpy(wchar_t *d, const wchar_t *s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n && (*d++ = *s++)) n--; 7 | wmemset(d, 0, n); 8 | return a; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_getspecific.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | void *pthread_getspecific(pthread_key_t k) 4 | { 5 | struct pthread *self = pthread_self(); 6 | if (!self->tsd) return 0; 7 | return self->tsd[k]; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/gmtime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "__time.h" 4 | 5 | struct tm *gmtime(const time_t *t) 6 | { 7 | static struct tm tm; 8 | __time_to_tm(*t, &tm); 9 | tm.tm_isdst = 0; 10 | return &tm; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/faccessat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int faccessat(int fd, const char *filename, int amode, int flag) 5 | { 6 | return syscall4(__NR_faccessat, fd, (long)filename, amode, flag); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/16_nesting.expect: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 0 0 1 3 | 0 0 2 4 | 0 1 0 5 | 0 1 1 6 | 0 1 2 7 | 0 2 0 8 | 0 2 1 9 | 0 2 2 10 | 1 0 0 11 | 1 0 1 12 | 1 0 2 13 | 1 1 0 14 | 1 1 1 15 | 1 1 2 16 | 1 2 0 17 | 1 2 1 18 | 1 2 2 19 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/23_type_coercion.expect: -------------------------------------------------------------------------------- 1 | char: a 2 | char: b 3 | char: c 4 | int: 97 5 | int: 98 6 | int: 99 7 | float: 97.000000 8 | float: 98.000000 9 | float: 99.000000 10 | 97 97 11 | 97 97 12 | 97.000000 97.000000 13 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/98_al_ax_extend.expect: -------------------------------------------------------------------------------- 1 | 0000ABCE 0000ABCE 2 | FFFFABCE FFFFABCE 3 | 000000CE 000000CE 4 | FFFFFFCE FFFFFFCE 5 | 6 | 0000ABCE 0000ABCE 7 | FFFFABCE FFFFABCE 8 | 000000CE 000000CE 9 | FFFFFFCE FFFFFFCE 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/socketpair.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int socketpair(int domain, int type, int protocol, int fd[2]) 5 | { 6 | return socketcall(socketpair, domain, type, protocol, fd, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/feof.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | #undef feof 4 | 5 | int feof(FILE *f) 6 | { 7 | return !!(f->flags & F_EOF); 8 | } 9 | 10 | int feof_unlocked(FILE *f) 11 | { 12 | return !!(f->flags & F_EOF); 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/putc_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int putc_unlocked(int c, FILE *f) 4 | { 5 | return f->wpos < f->wstop ? (*f->wpos++ = c) : __overflow(f, c); 6 | } 7 | 8 | weak_alias(putc_unlocked, fputc_unlocked); 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strncat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strncat(char *d, const char *s, size_t n) 4 | { 5 | char *a = d; 6 | d += strlen(d); 7 | while (n && (*d++ = *s++)) n--; 8 | *d++ = 0; 9 | return a; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcsendbreak.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcsendbreak(int fd, int dur) 5 | { 6 | /* nonzero duration is implementation-defined, so ignore it */ 7 | return ioctl(fd, TCSBRK, 0); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutex_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutex_init(pthread_mutex_t *m, const pthread_mutexattr_t *a) 4 | { 5 | memset(m, 0, sizeof *m); 6 | if (a) { 7 | } 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/close.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int close(int fd) 6 | { 7 | int ret = __syscall_close(fd); 8 | CANCELPT_BEGIN; 9 | CANCELPT_END; 10 | return ret; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/fchownat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag) 5 | { 6 | return syscall5(__NR_fchownat, fd, (long)path, uid, gid, flag); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/renameat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int renameat(int oldfd, const char *old, int newfd, const char *new) 5 | { 6 | return syscall4(__NR_renameat, oldfd, (long)old, newfd, (long)new); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/tcsetpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int tcsetpgrp(int fd, pid_t pgrp) 6 | { 7 | int pgrp_int = pgrp; 8 | return ioctl(fd, TIOCSPGRP, &pgrp_int); 9 | } 10 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | #include 5 | #define offsetof(struct, member) ((size_t)(&((struct *)NULL)->member)) 6 | // @NONSTANDARD: we don't have wchar_t 7 | 8 | #endif // _STDDEF_H 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/85_asm-outside-function.c: -------------------------------------------------------------------------------- 1 | extern int printf (const char *, ...); 2 | extern void vide(void); 3 | __asm__("vide: ret"); 4 | 5 | int main() { 6 | vide(); 7 | printf ("okay\n"); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/klog.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_KLOG_H 2 | #define _SYS_KLOG_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int klogctl (int, char *, int); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/closedir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "__dirent.h" 4 | #include "libc.h" 5 | 6 | int closedir(DIR *dir) 7 | { 8 | int ret = close(dir->fd); 9 | free(dir); 10 | return ret; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/ntohl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | uint32_t ntohl(uint32_t n) 4 | { 5 | union { 6 | uint32_t i; 7 | uint8_t b[4]; 8 | } u = { n }; 9 | return (u.b[0]<<24) | (u.b[1]<<16) | (u.b[2]<<8) | u.b[3]; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fgetpos.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fgetpos(FILE *f, fpos_t *pos) 4 | { 5 | off_t off = __ftello(f); 6 | if (off < 0) return -1; 7 | *(off_t *)pos = off; 8 | return 0; 9 | } 10 | 11 | LFS64(fgetpos); 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcgetattr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int tcgetattr(int fd, struct termios *tio) 6 | { 7 | if (ioctl(fd, TCGETS, tio)) 8 | return -1; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_rwlock_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_init(pthread_rwlock_t *rw, const pthread_rwlockattr_t *a) 4 | { 5 | memset(rw, 0, sizeof *rw); 6 | if (a) { 7 | } 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/gmtime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "__time.h" 4 | 5 | struct tm *gmtime_r(const time_t *t, struct tm *result) 6 | { 7 | __time_to_tm(*t, result); 8 | result->tm_isdst = 0; 9 | return result; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/pause.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int pause(void) 6 | { 7 | int r; 8 | CANCELPT_BEGIN; 9 | r = syscall0(__NR_pause); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/readlinkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int readlinkat(int fd, const char *path, char *buf, size_t bufsize) 5 | { 6 | return syscall4(__NR_readlinkat, fd, (long)path, (long)buf, bufsize); 7 | } 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/89_nocode_wanted.expect: -------------------------------------------------------------------------------- 1 | begin 2 | timeout=2 3 | timeout=1 4 | timeout=2 5 | timeout=1 6 | timeout=2 7 | timeout=1 8 | timeout=2 9 | timeout=1 10 | timeout=2 11 | timeout=1 12 | timeout=2 13 | timeout=1 14 | end 15 | -------------------------------------------------------------------------------- /05/test.c: -------------------------------------------------------------------------------- 1 | extern unsigned long __syscall(int, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 2 | int main(void) { 3 | __syscall(1, 1, (unsigned long)"Hello, world!\n", 14, 0, 0, 0); 4 | return 42; 5 | } 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/stat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int stat(const char *path, struct stat *buf) 6 | { 7 | return syscall2(__NR_stat, (long)path, (long)buf); 8 | } 9 | 10 | LFS64(stat); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/ferror.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | #undef ferror 4 | 5 | int ferror(FILE *f) 6 | { 7 | return !!(f->flags & F_ERR); 8 | } 9 | 10 | int ferror_unlocked(FILE *f) 11 | { 12 | return !!(f->flags & F_ERR); 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/pclose.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int pclose(FILE *f) 4 | { 5 | int status; 6 | fclose(f); 7 | while (waitpid(f->pipe_pid, &status, 0) == -1) 8 | if (errno != EINTR) return -1; 9 | return status; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcsncat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncat(wchar_t *d, const wchar_t *s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | d += wcslen(d); 7 | while (n && (*d++ = *s++)) n--; 8 | *d++ = 0; 9 | return a; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutexattr_settype.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_settype(pthread_mutexattr_t *a, int type) 4 | { 5 | if ((unsigned)type > 2) return EINVAL; 6 | *a = (*a & ~3) | type; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/clock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* this function assumes 100 hz linux and corrects for it */ 5 | clock_t clock() 6 | { 7 | struct tms tms; 8 | return (unsigned long)times(&tms)*10000; 9 | } 10 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/config.h: -------------------------------------------------------------------------------- 1 | #define TCC_VERSION "0.9.27" 2 | #define CONFIG_TCC_STATIC 1 3 | #define TCC_TARGET_X86_64 1 4 | #define ONE_SOURCE 1 5 | #define CONFIG_TCCDIR "../tcc-bootstrap" 6 | #define CONFIG_LDDIR "lib/x86_64-linux-gnu" 7 | #define inline 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/internal/syscall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | long __syscall_ret(unsigned long r) 5 | { 6 | if (r >= (unsigned long)-1 - 4096) { 7 | errno = -(long)r; 8 | return -1; 9 | } 10 | return (long)r; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/nl_langinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // FIXME: other items 4 | 5 | char *nl_langinfo(nl_item item) 6 | { 7 | switch (item) { 8 | case CODESET: 9 | return "UTF-8"; 10 | default: 11 | return ""; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/strxfrm.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* collate only by code points */ 4 | size_t strxfrm(char *dest, const char *src, size_t n) 5 | { 6 | size_t l = strlen(src); 7 | if (n > l) strcpy(dest, src); 8 | return l; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigaltstack.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sigaltstack(const stack_t *ss, stack_t *old) 5 | { 6 | /* depends on kernel struct matching */ 7 | return syscall2(__NR_sigaltstack, (long)ss, (long)old); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/lstat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int lstat(const char *path, struct stat *buf) 6 | { 7 | return syscall2(__NR_lstat, (long)path, (long)buf); 8 | } 9 | 10 | LFS64(lstat); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/scanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int scanf(const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vscanf(fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_rwlock_rdlock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_rdlock(pthread_rwlock_t *rw) 4 | { 5 | while (pthread_rwlock_tryrdlock(rw)) 6 | __wait(&rw->_rw_wrlock, &rw->_rw_waiters, 1, 0); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/gettimeofday.c: -------------------------------------------------------------------------------- 1 | #define SYSCALL_RETURN_ERRNO 2 | #include 3 | #include "syscall.h" 4 | 5 | int gettimeofday(struct timeval *tv, void *tz) 6 | { 7 | syscall2(__NR_gettimeofday, (long)tv, 0); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/linkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int linkat(int fd1, const char *existing, int fd2, const char *new, int flag) 5 | { 6 | return syscall5(__NR_linkat, fd1, (long)existing, fd2, (long)new, flag); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/tcgetpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | pid_t tcgetpgrp(int fd) 6 | { 7 | int pgrp; 8 | if (ioctl(fd, TIOCGPGRP, &pgrp) < 0) 9 | return -1; 10 | return pgrp; 11 | } 12 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/76_dollars_in_identifiers.expect: -------------------------------------------------------------------------------- 1 | fred=10 2 | joe=20 3 | henry=30 4 | fred2=10 5 | joe2=20 6 | henry2=30 7 | fred10=100 8 | joe_10=2 9 | local=10 10 | a100$=100 11 | a$$=1000 12 | a$c$b=2121 13 | $100=10000 14 | $$$=money 15 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/87_dead_code.expect: -------------------------------------------------------------------------------- 1 | timeout=2 2 | timeout=1 3 | boo 4 | yeah 5 | twice 6 | once 7 | twice 8 | SEtwice 9 | SEonce 10 | SEtwice 11 | twice2 12 | once2 13 | twice2 14 | twice3 15 | once3 16 | twice3 17 | caseok 18 | caseok2 19 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/libgen.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBGEN_H 2 | #define _LIBGEN_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | char *dirname(char *); 9 | char *basename(char *); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/stropts.h: -------------------------------------------------------------------------------- 1 | #ifndef _STROPTS_H 2 | #define _STROPTS_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | // FIXME 9 | 10 | int ioctl (int, int, ...); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/un.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UN_H 2 | #define _SYS_UN_H 3 | 4 | #define __NEED_sa_family_t 5 | #include 6 | 7 | struct sockaddr_un 8 | { 9 | sa_family_t sun_family; 10 | char sun_path[108]; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/errno/__errno_location.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | #undef errno 5 | int errno; 6 | 7 | int *__errno_location(void) 8 | { 9 | if (libc.errno_location) return libc.errno_location(); 10 | return &errno; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/getdtablesize.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int getdtablesize(void) 5 | { 6 | struct rlimit rl; 7 | getrlimit(RLIMIT_NOFILE, &rl); 8 | return rl.rlim_max < INT_MAX ? rl.rlim_max : INT_MAX; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/getpriority.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getpriority(int which, id_t who) 5 | { 6 | int ret = syscall2(__NR_getpriority, which, who); 7 | if (ret < 0) return ret; 8 | return 20-ret; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/getsockopt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getsockopt(int fd, int level, int optname, void *optval, socklen_t *optlen) 5 | { 6 | return socketcall(getsockopt, fd, level, optname, optval, optlen, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/rand.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static unsigned seed; 4 | 5 | void srand(unsigned s) 6 | { 7 | seed = s-1; 8 | } 9 | 10 | int rand(void) 11 | { 12 | return (seed = (seed+1) * 1103515245 + 12345 - 1)+1 & 0x7fffffff; 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/printf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int printf(const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vprintf(fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/ftruncate.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int ftruncate(int fd, off_t length) 6 | { 7 | return syscall3(__NR_ftruncate, fd, SYSCALL_LL(length)); 8 | } 9 | 10 | LFS64(ftruncate); 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/14.c: -------------------------------------------------------------------------------- 1 | #define W Z 2 | #define Z(X) W(X,2) 3 | #define Y(X) Z(X) 4 | #define X Y 5 | return X(X(1)); 6 | 7 | #define P Q 8 | #define Q(n) P(n,2) 9 | return P(1); 10 | 11 | #define A (B * B) 12 | #define B (A + A) 13 | return A + B; 14 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/43_void_param.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void fred(void) 4 | { 5 | printf("yo\n"); 6 | } 7 | 8 | int main() 9 | { 10 | fred(); 11 | 12 | return 0; 13 | } 14 | 15 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 16 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/83_utf8_in_identifiers.c: -------------------------------------------------------------------------------- 1 | #include 2 | double привет=0.1; 3 | int Lefèvre=2; 4 | int main(){ 5 | printf("привет=%g\n",привет); 6 | printf("Lefèvre=%d\n",Lefèvre); 7 | return 0; 8 | } 9 | // pcc & tcc only 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/sysmacros.h: -------------------------------------------------------------------------------- 1 | #define major(x) (((x) >> 8) & 0xff) 2 | #define minor(x) ((x) & 0xff) 3 | #define makedev(x,y) (((x)<<8)|((y)&0xff)) 4 | 5 | //#define makedev(x,y) \ 6 | // ((x)*0x100000001ULL)&(0xfffffffffff0) 7 | // ((y)*0x1001 & 0xffff0ff) 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/ftw.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int fd_limit) 5 | { 6 | return nftw(path, (void *)fn, fd_limit, FTW_PHYS); 7 | } 8 | 9 | LFS64(ftw); 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/getgrouplist.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* FIXME */ 4 | 5 | int getgrouplist(const char *user, gid_t gid, gid_t *groups, int *ngroups) 6 | { 7 | if (*ngroups<1) return -1; 8 | *groups = gid; 9 | *ngroups = 1; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/setsockopt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int setsockopt(int fd, int level, int optname, const void *optval, socklen_t optlen) 5 | { 6 | return socketcall(setsockopt, fd, level, optname, optval, optlen, 0); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strlcat.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | 4 | size_t strlcat(char *d, const char *s, size_t n) 5 | { 6 | size_t l = strnlen(d, n); 7 | if (l == n) return l + strlen(s); 8 | return l + strlcpy(d+l, s, n-l); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_setguardsize.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setguardsize(pthread_attr_t *a, size_t size) 4 | { 5 | if (size > SIZE_MAX/8) return EINVAL; 6 | a->_a_guardsize = size - DEFAULT_GUARD_SIZE; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/18_include.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("including\n"); 6 | #include "18_include.h" 7 | printf("done\n"); 8 | 9 | return 0; 10 | } 11 | 12 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 13 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/win32/lib/dllmain.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | 3 | #include 4 | 5 | BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 6 | { 7 | return TRUE; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/x86_64/bits/sysmacros.h: -------------------------------------------------------------------------------- 1 | #define major(x) (((x) >> 8) & 0xff) 2 | #define minor(x) ((x) & 0xff) 3 | #define makedev(x,y) (((x)<<8)|((y)&0xff)) 4 | 5 | //#define makedev(x,y) \ 6 | // ((x)*0x100000001ULL)&(0xfffffffffff0) 7 | // ((y)*0x1001 & 0xffff0ff) 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_IOCTL_H 2 | #define _SYS_IOCTL_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | int ioctl (int, int, ...); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/alphasort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "libc.h" 4 | 5 | int alphasort(const struct dirent **a, const struct dirent **b) 6 | { 7 | return strcoll((*a)->d_name, (*b)->d_name); 8 | } 9 | 10 | LFS64(alphasort); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/epoll_pwait.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs) 5 | { 6 | return syscall6(__NR_epoll_pwait, fd, (long)ev, cnt, to, (long)sigs, 8); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int fscanf(FILE *f, const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vfscanf(f, fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fwide.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | #define SH (8*sizeof(int)-1) 4 | #define NORMALIZE(x) ((x)>>SH | -((-(x))>>SH)) 5 | 6 | int fwide(FILE *f, int mode) 7 | { 8 | if (!f->mode) f->mode = NORMALIZE(mode); 9 | return f->mode; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_mutex_lock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutex_lock(pthread_mutex_t *m) 4 | { 5 | int r; 6 | while ((r=pthread_mutex_trylock(m)) == EBUSY) 7 | __wait(&m->_m_lock, &m->_m_waiters, 1, 0); 8 | return r; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setgid(gid_t gid) 6 | { 7 | if (libc.rsyscall) return libc.rsyscall(__NR_setgid, gid, 0, 0, 0, 0, 0); 8 | return syscall1(__NR_setgid, gid); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setuid(uid_t uid) 6 | { 7 | if (libc.rsyscall) return libc.rsyscall(__NR_setuid, uid, 0, 0, 0, 0, 0); 8 | return syscall1(__NR_setuid, uid); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/sleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | unsigned sleep(unsigned seconds) 5 | { 6 | struct timespec tv = { .tv_sec = seconds, .tv_nsec = 0 }; 7 | if (nanosleep(&tv, &tv)) 8 | return tv.tv_sec; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/truncate.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int truncate(const char *path, off_t length) 6 | { 7 | return syscall3(__NR_truncate, (long)path, SYSCALL_LL(length)); 8 | } 9 | 10 | LFS64(truncate); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswcntrl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int iswcntrl(wint_t wc) 5 | { 6 | return (unsigned)wc < 32 7 | || (unsigned)(wc-0x7f) < 33 8 | || (unsigned)(wc-0x2028) < 2 9 | || (unsigned)(wc-0xfff9) < 3; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/serv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void endservent(void) 6 | { 7 | } 8 | 9 | void setservent(int stayopen) 10 | { 11 | } 12 | 13 | struct servent *getservent(void) 14 | { 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sighold.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sighold(int sig) 5 | { 6 | sigset_t mask; 7 | 8 | sigemptyset(&mask); 9 | if (sigaddset(&mask, sig) < 0) return -1; 10 | return sigprocmask(SIG_BLOCK, &mask, NULL); 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigpause.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigpause(int sig) 5 | { 6 | sigset_t mask; 7 | 8 | if (sigprocmask(0, NULL, &mask) < 0 || sigdelset(&mask, sig) < 0) 9 | return -1; 10 | return sigsuspend(&mask); 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigwait.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigwait(const sigset_t *mask, int *sig) 5 | { 6 | siginfo_t si; 7 | if (sigtimedwait(mask, &si, NULL) < 0) 8 | return -1; 9 | *sig = si.si_signo; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/dprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int dprintf(int fd, const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vdprintf(fd, fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int fprintf(FILE *f, const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vfprintf(f, fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/sprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sprintf(char *s, const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vsprintf(s, fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/sscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sscanf(const char *s, const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vsscanf(s, fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_attr_setstacksize.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setstacksize(pthread_attr_t *a, size_t size) 4 | { 5 | if (size-PAGE_SIZE > SIZE_MAX/4) return EINVAL; 6 | a->_a_stacksize = size - DEFAULT_STACK_SIZE; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /04/Makefile: -------------------------------------------------------------------------------- 1 | all: out03 guessing_game.out out04 README.html 2 | out03: in03 ../03/out02 3 | ../03/out02 4 | %.html: %.md ../markdown 5 | ../markdown $< 6 | out04: in04 out03 7 | ./out03 8 | %.out: % out03 9 | ./out03 $< $@ 10 | clean: 11 | rm -f out* README.html *.out 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/user.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_USER_H 2 | #define _SYS_USER_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigrelse.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigrelse(int sig) 5 | { 6 | sigset_t mask; 7 | 8 | sigemptyset(&mask); 9 | if (sigaddset(&mask, sig) < 0) return -1; 10 | return sigprocmask(SIG_UNBLOCK, &mask, NULL); 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strncmp(const char *_l, const char *_r, size_t n) 4 | { 5 | const unsigned char *l=_l, *r=_r; 6 | if (!n--) return 0; 7 | for (; *l && *r && n && *l == *r ; l++, r++, n--); 8 | return *l - *r; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wmemmove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) 5 | { 6 | if ((size_t)(d-s) < n) { 7 | while (n--) d[n] = s[n]; 8 | return d; 9 | } 10 | return wmemcpy(d, s, n); 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/usleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int usleep(useconds_t useconds) 5 | { 6 | struct timespec tv = { 7 | .tv_sec = useconds/1000000, 8 | .tv_nsec = (useconds%1000000)*1000 9 | }; 10 | return nanosleep(&tv, &tv); 11 | } 12 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/05.c: -------------------------------------------------------------------------------- 1 | #define t(x,y,z) x ## y ## z 2 | #define xxx(s) int s[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), \ 3 | t(10,,), t(,11,), t(,,12), t(,,) }; 4 | 5 | int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), 6 | t(10,,), t(,11,), t(,,12), t(,,) }; 7 | xxx(j) 8 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/12.S: -------------------------------------------------------------------------------- 1 | #define SRC(y...) \ 2 | 9999: y; \ 3 | .section __ex_table, "a"; \ 4 | .long 9999b, 6001f ; \ 5 | // .previous 6 | 7 | SRC(1: movw (%esi), %bx) 8 | 6001: 9 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/37_sprintf.expect: -------------------------------------------------------------------------------- 1 | ->01<- 2 | ->02<- 3 | ->03<- 4 | ->04<- 5 | ->05<- 6 | ->06<- 7 | ->07<- 8 | ->08<- 9 | ->09<- 10 | ->10<- 11 | ->11<- 12 | ->12<- 13 | ->13<- 14 | ->14<- 15 | ->15<- 16 | ->16<- 17 | ->17<- 18 | ->18<- 19 | ->19<- 20 | ->20<- 21 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/i386/sigsetjmp.s: -------------------------------------------------------------------------------- 1 | .global sigsetjmp 2 | sigsetjmp: 3 | mov 4(%esp),%eax 4 | mov 8(%esp),%ecx 5 | mov %ecx,24(%eax) 6 | jecxz 1f 7 | add $28,%eax 8 | push %eax 9 | push $0 10 | push $2 11 | call sigprocmask 12 | add $12,%esp 13 | 1: jmp setjmp 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/wscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int wscanf(const wchar_t *fmt, ...) 6 | { 7 | int ret; 8 | va_list ap; 9 | va_start(ap, fmt); 10 | ret = vwscanf(fmt, ap); 11 | va_end(ap); 12 | return ret; 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strerror_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int strerror_r(int err, char *buf, size_t buflen) 5 | { 6 | char *msg = strerror(err); 7 | if (strlen(msg) >= buflen) 8 | return ERANGE; 9 | strcpy(buf, msg); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strndup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *strndup(const char *s, size_t n) 5 | { 6 | size_t l = strnlen(s, n); 7 | char *d = malloc(l+1); 8 | if (!d) return NULL; 9 | memcpy(d, s, l); 10 | d[l] = 0; 11 | return d; 12 | } 13 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/36_array_initialisers.expect: -------------------------------------------------------------------------------- 1 | 0: 12 2 | 1: 34 3 | 2: 56 4 | 3: 78 5 | 4: 90 6 | 5: 123 7 | 6: 456 8 | 7: 789 9 | 8: 8642 10 | 9: 9753 11 | 0: 12 12 | 1: 34 13 | 2: 56 14 | 3: 78 15 | 4: 90 16 | 5: 123 17 | 6: 456 18 | 7: 789 19 | 8: 8642 20 | 9: 9753 21 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/64_macro_nesting.c: -------------------------------------------------------------------------------- 1 | #include // printf() 2 | 3 | #define CAT2(a,b) a##b 4 | #define CAT(a,b) CAT2(a,b) 5 | #define AB(x) CAT(x,y) 6 | 7 | int main(void) 8 | { 9 | int xy = 42; 10 | printf("%d\n", CAT(A,B)(x)); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/duplocale.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "locale_impl.h" 4 | 5 | locale_t duplocale(locale_t old) 6 | { 7 | locale_t new; 8 | new = calloc(1, sizeof *new); 9 | if (new) memcpy(new, old, sizeof *new); 10 | return new; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/process/execve.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int execve(const char *path, char *const argv[], char *const envp[]) 5 | { 6 | /* do we need to use environ if envp is null? */ 7 | return syscall3(__NR_execve, (long)path, (long)argv, (long)envp); 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/sigignore.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sigignore(int sig) 5 | { 6 | struct sigaction sa; 7 | 8 | sigemptyset(&sa.sa_mask); 9 | sa.sa_handler = SIG_IGN; 10 | sa.sa_flags = 0; 11 | return sigaction(sig, &sa, NULL); 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/fstatat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int fstatat(int fd, const char *path, struct stat *buf, int flag) 6 | { 7 | return syscall4(__NR_fstatat, fd, (long)path, (long)buf, flag); 8 | } 9 | 10 | LFS64(fstatat); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strsep.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strsep(char **str, const char *sep) 4 | { 5 | char *s = *str, *end; 6 | if (!s) return NULL; 7 | end = s + strcspn(s, sep); 8 | if (*end) *end++ = 0; 9 | else end = 0; 10 | *str = end; 11 | return s; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_barrier_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_barrier_init(pthread_barrier_t *b, const pthread_barrierattr_t *a, unsigned count) 4 | { 5 | if (!count) return EINVAL; 6 | *b = (pthread_barrier_t){ ._b_limit = count-1 }; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/localtime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "__time.h" 4 | 5 | struct tm *localtime(const time_t *t) 6 | { 7 | static struct tm tm; 8 | __tzset(); 9 | __time_to_tm(*t - __timezone, &tm); 10 | tm.tm_isdst = -1; 11 | return __dst_adjust(&tm); 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/read.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t read(int fd, void *buf, size_t count) 6 | { 7 | ssize_t r; 8 | CANCELPT_BEGIN; 9 | r = __syscall_read(fd, buf, count); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/29_array_address.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char a[10]; 7 | strcpy(a, "abcdef"); 8 | printf("%s\n", &a[1]); 9 | 10 | return 0; 11 | } 12 | 13 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/ulimit.h: -------------------------------------------------------------------------------- 1 | #ifndef _ULIMIT_H 2 | #define _ULIMIT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define UL_GETFSIZE 1 9 | #define UL_SETFSIZE 2 10 | 11 | long ulimit (int, ...); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ipc/ftok.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | key_t ftok(const char *path, int id) 5 | { 6 | struct stat st; 7 | if (stat(path, &st) < 0) return -1; 8 | 9 | return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xff) << 24)); 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/sendfile.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t sendfile(int out_fd, int in_fd, off_t *ofs, size_t count) 6 | { 7 | return syscall4(__NR_sendfile, out_fd, in_fd, (long)ofs, count); 8 | } 9 | 10 | LFS64(sendfile); 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/malloc/memalign.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void *memalign(size_t align, size_t len) 5 | { 6 | void *mem; 7 | int ret; 8 | if ((ret = posix_memalign(&mem, align, len))) { 9 | errno = ret; 10 | return 0; 11 | } 12 | return mem; 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/math/i386/e_remainder.s: -------------------------------------------------------------------------------- 1 | .global remainderf 2 | remainderf: 3 | flds 8(%esp) 4 | flds 4(%esp) 5 | jmp 1f 6 | 7 | .global remainder 8 | remainder: 9 | fldl 12(%esp) 10 | fldl 4(%esp) 11 | 1: fprem1 12 | fstsw %ax 13 | sahf 14 | jp 1b 15 | fstp %st(1) 16 | ret 17 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/basename.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *basename(char *s) 5 | { 6 | size_t i; 7 | if (!s || !*s) return "."; 8 | i = strlen(s)-1; 9 | for (; i&&s[i]=='/'; i--) s[i] = 0; 10 | for (; i&&s[i-1]!='/'; i--); 11 | return s+i; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/snprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int snprintf(char *s, size_t n, const char *fmt, ...) 5 | { 6 | int ret; 7 | va_list ap; 8 | va_start(ap, fmt); 9 | ret = vsnprintf(s, n, fmt, ap); 10 | va_end(ap); 11 | return ret; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/localtime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "__time.h" 4 | 5 | struct tm *localtime_r(const time_t *t, struct tm *result) 6 | { 7 | __tzset(); 8 | __time_to_tm(*t - __timezone, result); 9 | result->tm_isdst = -1; 10 | return __dst_adjust(result); 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/write.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t write(int fd, const void *buf, size_t count) 6 | { 7 | int r; 8 | CANCELPT_BEGIN; 9 | r = __syscall_write(fd, buf, count); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/04_for.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Count; 6 | 7 | for (Count = 1; Count <= 10; Count++) 8 | { 9 | printf("%d\n", Count); 10 | } 11 | 12 | return 0; 13 | } 14 | 15 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 16 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/22_floating_point.expect: -------------------------------------------------------------------------------- 1 | 69.120003 2 | 69.120000 3 | -44.440000 4 | 700.665200 5 | 0.217330 6 | 1 1 0 0 0 1 7 | 0 1 1 1 0 0 8 | 0 0 0 1 1 1 9 | 69.120003 10 | -44.439999 11 | 700.665222 12 | 0.217330 13 | 12.340000 14 | -12.340000 15 | 2.000000 16 | 0.909297 17 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ipc/shmdt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "ipc.h" 4 | 5 | int shmdt(const void *addr) 6 | { 7 | #ifdef __NR_shmdt 8 | return syscall1(__NR_shmdt, (long)addr); 9 | #else 10 | return syscall2(__NR_ipc, IPCOP_shmdt, (long)addr); 11 | #endif 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/mount.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data) 5 | { 6 | return syscall5(__NR_mount, (long)special, (long)dir, (long)fstype, flags, (long)data); 7 | } 8 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/inet_ntoa.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *inet_ntoa(struct in_addr in) 5 | { 6 | static char buf[16]; 7 | unsigned char *a = (void *)∈ 8 | snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); 9 | return buf; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/select/poll.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int poll(struct pollfd *fds, nfds_t n, int timeout) 6 | { 7 | int r; 8 | CANCELPT_BEGIN; 9 | r = syscall3(__NR_poll, (long)fds, n, timeout); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/x86_64/restore.s: -------------------------------------------------------------------------------- 1 | .global __restore_rt 2 | .global __restore 3 | .type __restore_rt,%function 4 | .type __restore,%function 5 | __restore_rt: 6 | __restore: 7 | movl $15, %eax 8 | syscall 9 | .size __restore_rt,.-__restore_rt 10 | .size __restore,.-__restore 11 | 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/fwscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int fwscanf(FILE *f, const wchar_t *fmt, ...) 6 | { 7 | int ret; 8 | va_list ap; 9 | va_start(ap, fmt); 10 | ret = vfwscanf(f, fmt, ap); 11 | va_end(ap); 12 | return ret; 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/cfgetospeed.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | speed_t cfgetospeed(const struct termios *tio) 5 | { 6 | return tio->c_cflag & CBAUD; 7 | } 8 | 9 | speed_t cfgetispeed(const struct termios *tio) 10 | { 11 | return cfgetospeed(tio); 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/__wake.c: -------------------------------------------------------------------------------- 1 | #define SYSCALL_RETURN_ERRNO 2 | #include "pthread_impl.h" 3 | 4 | void __wake(volatile int *addr, int cnt, int priv) 5 | { 6 | if (priv) priv = 128; priv=0; 7 | if (cnt<0) cnt = INT_MAX; 8 | syscall3(__NR_futex, (long)addr, FUTEX_WAKE | priv, cnt); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setregid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setregid(gid_t rgid, gid_t egid) 6 | { 7 | if (libc.rsyscall) return libc.rsyscall(__NR_setregid, rgid, egid, 0, 0, 0, 0); 8 | return syscall2(__NR_setregid, rgid, egid); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/setreuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setreuid(uid_t ruid, uid_t euid) 6 | { 7 | if (libc.rsyscall) return libc.rsyscall(__NR_setreuid, ruid, euid, 0, 0, 0, 0); 8 | return syscall2(__NR_setreuid, ruid, euid); 9 | } 10 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/24_math_library.expect: -------------------------------------------------------------------------------- 1 | 0.119712 2 | 0.992809 3 | 0.120579 4 | 0.120290 5 | 1.450506 6 | 0.119429 7 | 0.120288 8 | 1.007209 9 | 0.119427 10 | 1.127497 11 | 0.120000 12 | -2.120264 13 | -0.920819 14 | 0.775357 15 | 0.346410 16 | 12.000000 17 | 13.000000 18 | 12.000000 19 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/swap.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SWAP_H 2 | #define _SYS_SWAP_H 3 | 4 | #define SWAP_FLAG_PREFER 0x8000 5 | #define SWAP_FLAG_PRIO_MASK 0x7fff 6 | #define SWAP_FLAG_PRIO_SHIFT 0 7 | 8 | int swapon (const char *, int); 9 | int swapoff (const char *); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ctype/iswprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswprint(wint_t wc) 4 | { 5 | unsigned c = wc; 6 | /* assume any non-control, non-illegal codepoint is printable */ 7 | if (c>0x10ffff || c-0xd800<0x800 || (c&0xfffe)==0xfffe || iswcntrl(c)) 8 | return 0; 9 | return 1; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/exit/assert.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void __assert_fail(const char *expr, const char *file, int line, const char *func) 5 | { 6 | fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line); 7 | fflush(NULL); 8 | abort(); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/linux/wait3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | pid_t wait4(pid_t, int *, int, struct rusage *); 6 | 7 | pid_t wait3(int *status, int options, struct rusage *usage) 8 | { 9 | return wait4(-1, status, options, usage); 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/clearerr.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | void clearerr(FILE *f) 4 | { 5 | FLOCK(f); 6 | f->flags &= ~(F_EOF|F_ERR); 7 | FUNLOCK(f); 8 | } 9 | 10 | void clearerr_unlocked(FILE *f) 11 | { 12 | FLOCK(f); 13 | f->flags &= ~(F_EOF|F_ERR); 14 | FUNLOCK(f); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/swab.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void swab(const void *_src, void *_dest, ssize_t n) 4 | { 5 | const char *src = _src; 6 | char *dest = _dest; 7 | for (; n>0; n-=2) { 8 | dest[0] = src[1]; 9 | dest[1] = src[0]; 10 | dest += 2; 11 | src += 2; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/swscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int swscanf(const wchar_t *s, const wchar_t *fmt, ...) 6 | { 7 | int ret; 8 | va_list ap; 9 | va_start(ap, fmt); 10 | ret = vswscanf(s, fmt, ap); 11 | va_end(ap); 12 | return ret; 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strcasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int strcasecmp(const char *_l, const char *_r) 5 | { 6 | const unsigned char *l=_l, *r=_r; 7 | for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++); 8 | return tolower(*l) - tolower(*r); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/__time.h: -------------------------------------------------------------------------------- 1 | time_t __tm_to_time(struct tm *); 2 | struct tm *__time_to_tm(time_t, struct tm *); 3 | void __tzset(void); 4 | struct tm *__dst_adjust(struct tm *tm); 5 | 6 | extern long __timezone; 7 | extern int __daylight; 8 | extern int __dst_offset; 9 | extern char *__tzname[2]; 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/time/time.c: -------------------------------------------------------------------------------- 1 | #define SYSCALL_RETURN_ERRNO 2 | #include 3 | #include 4 | #include "syscall.h" 5 | 6 | time_t time(time_t *t) 7 | { 8 | struct timeval tv; 9 | syscall2(__NR_gettimeofday, (long)&tv, 0); 10 | if (t) *t = tv.tv_sec; 11 | return tv.tv_sec; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/nice.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int nice(int inc) 6 | { 7 | #ifdef __NR_nice 8 | return syscall1(__NR_nice, inc); 9 | #else 10 | return setpriority(PRIO_PROCESS, 0, getpriority(PRIO_PROCESS, 0)+inc); 11 | #endif 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/__getdents.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int __getdents(int fd, struct dirent *buf, size_t len) 6 | { 7 | return syscall3(__NR_getdents, fd, (long)buf, len); 8 | } 9 | 10 | weak_alias(__getdents, getdents); 11 | 12 | LFS64(getdents); 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ipc/semget.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "ipc.h" 4 | 5 | int semget(key_t key, int n, int fl) 6 | { 7 | #ifdef __NR_semget 8 | return syscall3(__NR_semget, key, n, fl); 9 | #else 10 | return syscall4(__NR_ipc, IPCOP_semget, key, n, fl); 11 | #endif 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/inet_addr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "__dns.h" 5 | 6 | in_addr_t inet_addr(const char *p) 7 | { 8 | struct sockaddr_in sin; 9 | if (__ipparse(&sin, AF_INET, p)) return -1; 10 | return sin.sin_addr.s_addr; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/prng/seed48.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern unsigned short __seed48[7]; 5 | 6 | unsigned short *seed48(unsigned short *s) 7 | { 8 | static unsigned short p[3]; 9 | memcpy(p, __seed48, sizeof p); 10 | memcpy(__seed48, s, sizeof p); 11 | return p; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/fstatvfs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int fstatvfs(int fd, struct statvfs *buf) 6 | { 7 | return syscall2(__NR_fstatfs, fd, (long)buf); 8 | } 9 | 10 | weak_alias(fstatvfs, fstatfs); 11 | 12 | LFS64(fstatvfs); 13 | LFS64(fstatfs); 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/wcscspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcscspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | if (!c[0]) return wcslen(s); 7 | if (!c[1]) return (s=wcschr(a=s, *c)) ? s-a : wcslen(a); 8 | for (a=s; *s && !wcschr(c, *s); s++); 9 | return s-a; 10 | } 11 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_detach.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_detach(pthread_t t) 4 | { 5 | /* Cannot detach a thread that's already exiting */ 6 | if (a_xchg(&t->exitlock, 1)) 7 | return pthread_join(t, 0); 8 | t->detached = 1; 9 | t->exitlock = 0; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/readv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t readv(int fd, const struct iovec *iov, int count) 6 | { 7 | ssize_t r; 8 | CANCELPT_BEGIN; 9 | r = syscall3(__NR_readv, fd, (long)iov, count); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/writev.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t writev(int fd, const struct iovec *iov, int count) 6 | { 7 | ssize_t r; 8 | CANCELPT_BEGIN; 9 | r = syscall3(__NR_writev, fd, (long)iov, count); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/pp/02.expect: -------------------------------------------------------------------------------- 1 | f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 2 | f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); 3 | char c[2][6] = { "hello", "" }; 4 | f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 5 | f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); 6 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/accept.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int accept(int fd, struct sockaddr *addr, socklen_t *len) 6 | { 7 | int ret; 8 | CANCELPT_BEGIN; 9 | ret = socketcall(accept, fd, addr, len, 0, 0, 0); 10 | CANCELPT_END; 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/recvmsg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t recvmsg(int fd, struct msghdr *msg, int flags) 6 | { 7 | ssize_t r; 8 | CANCELPT_BEGIN; 9 | r = socketcall(recvmsg, fd, msg, flags, 0, 0, 0); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_setcanceltype.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_setcanceltype(int new, int *old) 4 | { 5 | struct pthread *self = pthread_self(); 6 | if (old) *old = self->cancelasync; 7 | if ((unsigned)new > 1) return EINVAL; 8 | self->cancelasync = new; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /05/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef unsigned long va_list; 5 | 6 | #define va_start(list, arg) ((list) = (unsigned long)&arg) 7 | #define va_arg(list, type) (*((type *)(list += ((sizeof(type) + 7) & 0xfffffffffffffff8)))) 8 | #define va_end(list) 9 | 10 | #endif // _STDARG_H 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/35_sizeof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char a; 6 | short b; 7 | 8 | printf("%d %d\n", sizeof(char), sizeof(a)); 9 | printf("%d %d\n", sizeof(short), sizeof(b)); 10 | 11 | return 0; 12 | } 13 | 14 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 15 | -------------------------------------------------------------------------------- /05/musl-0.6.0/crt/i386/crt1.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global _start 3 | _start: 4 | xorl %ebp,%ebp 5 | popl %ecx 6 | movl %esp,%eax 7 | andl $-16,%esp 8 | pushl %esp 9 | pushl %esp 10 | pushl %edx 11 | pushl $0 12 | pushl $0 13 | pushl %eax 14 | pushl %ecx 15 | pushl $main 16 | call __libc_start_main 17 | .L0: jmp .L0 18 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | extern int *__errno_location(void); 11 | #define errno (*__errno_location()) 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/rewinddir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "__dirent.h" 4 | #include "libc.h" 5 | 6 | void rewinddir(DIR *dir) 7 | { 8 | LOCK(&dir->lock); 9 | lseek(dir->fd, 0, SEEK_SET); 10 | dir->buf_pos = dir->buf_end = 0; 11 | dir->tell = 0; 12 | UNLOCK(&dir->lock); 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/dirent/seekdir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "__dirent.h" 4 | #include "libc.h" 5 | 6 | void seekdir(DIR *dir, long off) 7 | { 8 | LOCK(&dir->lock); 9 | dir->tell = lseek(dir->fd, off, SEEK_SET); 10 | dir->buf_pos = dir->buf_end = 0; 11 | UNLOCK(&dir->lock); 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/ioctl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int ioctl(int fd, int req, ...) 6 | { 7 | void *arg; 8 | va_list ap; 9 | va_start(ap, req); 10 | arg = va_arg(ap, void *); 11 | va_end(ap); 12 | return syscall3(__NR_ioctl, fd, req, (long)arg); 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/sendmsg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t sendmsg(int fd, const struct msghdr *msg, int flags) 6 | { 7 | ssize_t r; 8 | CANCELPT_BEGIN; 9 | r = socketcall(sendmsg, fd, msg, flags, 0, 0, 0); 10 | CANCELPT_END; 11 | return r; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__scanf.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct rctx 4 | { 5 | void (*read)(struct rctx *); 6 | void *opaque; 7 | int wide; 8 | int (*is_space)(); 9 | int l; 10 | int e; 11 | int c; 12 | int u; 13 | int w; 14 | } rctx_t; 15 | 16 | int __scanf(rctx_t *, const wchar_t *, va_list); 17 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strtok.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strtok(char *s, const char *sep) 4 | { 5 | static char *p; 6 | if (!s && !(s = p)) return NULL; 7 | s += strspn(s, sep); 8 | if (!*s) return p = 0; 9 | p = s + strcspn(s, sep); 10 | if (*p) *p++ = 0; 11 | else p = 0; 12 | return s; 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/string/strtok_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strtok_r(char *s, const char *sep, char **p) 4 | { 5 | if (!s && !(s = *p)) return NULL; 6 | s += strspn(s, sep); 7 | if (!*s) return *p = 0; 8 | *p = s + strcspn(s, sep); 9 | if (**p) *(*p)++ = 0; 10 | else *p = 0; 11 | return s; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/thread/pthread_setcancelstate.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_setcancelstate(int new, int *old) 4 | { 5 | struct pthread *self = pthread_self(); 6 | if (old) *old = self->canceldisable; 7 | if ((unsigned)new > 1) return EINVAL; 8 | self->canceldisable = new; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/02_printf.expect: -------------------------------------------------------------------------------- 1 | Hello world 2 | Count = -5 3 | Count = -4 4 | Count = -3 5 | Count = -2 6 | Count = -1 7 | Count = 0 8 | Count = 1 9 | Count = 2 10 | Count = 3 11 | Count = 4 12 | Count = 5 13 | String 'hello', 'there' is 'hello', 'there' 14 | Character 'A' is 'A' 15 | Character 'a' is 'a' 16 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/44_scoped_declarations.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | 7 | for (a = 0; a < 2; a++) 8 | { 9 | int b = a; 10 | } 11 | 12 | printf("it's all good\n"); 13 | 14 | return 0; 15 | } 16 | 17 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 18 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/setlocale.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *setlocale(int category, const char *locale) 4 | { 5 | /* Note: plain "C" would be better, but puts some broken 6 | * software into legacy 8-bit-codepage mode, ignoring 7 | * the standard library's multibyte encoding */ 8 | return "C.UTF-8"; 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/locale/wcsxfrm.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* collate only by code points */ 4 | size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t n) 5 | { 6 | size_t l = wcslen(src); 7 | if (l >= n) { 8 | wmemcpy(dest, src, n-1); 9 | dest[n-1] = 0; 10 | } else wcscpy(dest, src); 11 | return l; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/network/connect.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int connect(int fd, const struct sockaddr *addr, socklen_t len) 6 | { 7 | int ret; 8 | CANCELPT_BEGIN; 9 | ret = socketcall(connect, fd, addr, len, 0, 0, 0); 10 | CANCELPT_END; 11 | return ret; 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stat/statvfs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int statvfs(const char *path, struct statvfs *buf) 6 | { 7 | return syscall2(__NR_statfs, (long)path, (long)buf); 8 | } 9 | 10 | weak_alias(statvfs, statfs); 11 | 12 | LFS64(statvfs); 13 | LFS64(statfs); 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/__stdio_write.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | size_t __stdio_write(FILE *f, const unsigned char *buf, size_t len) 4 | { 5 | const unsigned char *stop = buf+len; 6 | ssize_t cnt = 1; 7 | for (; buffd, buf, len))>0; buf+=cnt); 8 | return len-(stop-buf); 9 | } 10 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdlib/atoi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int atoi(const char *s) 5 | { 6 | int n=0, neg=0; 7 | while (isspace(*s)) s++; 8 | switch (*s) { 9 | case '-': neg=1; 10 | case '+': s++; 11 | } 12 | while (isdigit(*s)) 13 | n = 10*n + *s++ - '0'; 14 | return neg ? -n : n; 15 | } 16 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/unistd/ttyname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | char *ttyname(int fd) 6 | { 7 | static char buf[TTY_NAME_MAX]; 8 | int result; 9 | if ((result = ttyname_r(fd, buf, sizeof buf))) { 10 | errno = result; 11 | return NULL; 12 | } 13 | return buf; 14 | } 15 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef unsigned long va_list; 5 | 6 | #define va_start(list, arg) ((list) = (unsigned long)&arg) 7 | #define va_arg(list, type) (*((type *)(list += ((sizeof(type) + 7) & 0xfffffffffffffff8)))) 8 | #define va_end(list) 9 | 10 | #endif // _STDARG_H 11 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/12_hashdefine.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define FRED 12 4 | #define BLOGGS(x) (12*(x)) 5 | 6 | int main() 7 | { 8 | printf("%d\n", FRED); 9 | printf("%d, %d, %d\n", BLOGGS(1), BLOGGS(2), BLOGGS(3)); 10 | 11 | return 0; 12 | } 13 | 14 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 15 | -------------------------------------------------------------------------------- /05/musl-0.6.0/include/sys/uio.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UIO_H 2 | #define _SYS_UIO_H 3 | 4 | #define __NEED_size_t 5 | #define __NEED_ssize_t 6 | #define __NEED_struct_iovec 7 | 8 | #include 9 | 10 | ssize_t readv (int, const struct iovec *, int); 11 | ssize_t writev (int, const struct iovec *, int); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ipc/semop.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "ipc.h" 4 | 5 | int semop(int id, struct sembuf *buf, size_t n) 6 | { 7 | #ifdef __NR_semop 8 | return syscall3(__NR_semop, id, (long)buf, n); 9 | #else 10 | return syscall5(__NR_ipc, IPCOP_semop, id, n, 0, (long)buf); 11 | #endif 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/ipc/shmget.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "ipc.h" 4 | 5 | int shmget(key_t key, size_t size, int flag) 6 | { 7 | #ifdef __NR_shmget 8 | return syscall3(__NR_shmget, key, size, flag); 9 | #else 10 | return syscall4(__NR_ipc, IPCOP_shmget, key, size, flag); 11 | #endif 12 | } 13 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/stdio/asprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int vasprintf(char **, const char *, va_list); 5 | 6 | int asprintf(char **s, const char *fmt, ...) 7 | { 8 | int ret; 9 | va_list ap; 10 | va_start(ap, fmt); 11 | ret = vasprintf(s, fmt, ap); 12 | va_end(ap); 13 | return ret; 14 | } 15 | -------------------------------------------------------------------------------- /05/musl-0.6.0/arch/i386/bits/wait.h: -------------------------------------------------------------------------------- 1 | #define WNOHANG 1 2 | #define WUNTRACED 2 3 | 4 | #define WSTOPPED 2 5 | #define WEXITED 4 6 | #define WCONTINUED 8 7 | #define WNOWAIT 0x1000000 8 | 9 | #if defined(__XOPEN_SOURCE) || defined(__GNU_SOURCE) 10 | #define P_ALL 0 11 | #define P_PID 1 12 | #define P_PGID 2 13 | #endif 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/misc/setrlimit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setrlimit(int resource, const struct rlimit *rlim) 6 | { 7 | long k_rlim[2] = { rlim->rlim_cur, rlim->rlim_max }; 8 | return syscall2(__NR_setrlimit, resource, (long)k_rlim); 9 | } 10 | 11 | LFS64(setrlimit); 12 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/signal/siginterrupt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int siginterrupt(int sig, int flag) 5 | { 6 | struct sigaction sa; 7 | 8 | sigaction(sig, NULL, &sa); 9 | if (flag) sa.sa_flags &= ~SA_RESTART; 10 | else sa.sa_flags |= SA_RESTART; 11 | 12 | return sigaction(sig, &sa, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /05/musl-0.6.0/src/termios/tcsetattr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int tcsetattr(int fd, int act, const struct termios *tio) 7 | { 8 | if (act < 0 || act > 2) { 9 | errno = EINVAL; 10 | return -1; 11 | } 12 | return ioctl(fd, TCSETS+act, tio); 13 | } 14 | -------------------------------------------------------------------------------- /05/tcc-0.9.27/tests/tests2/33_ternary_op.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Count; 6 | 7 | for (Count = 0; Count < 10; Count++) 8 | { 9 | printf("%d\n", (Count < 5) ? (Count*Count) : (Count * 3)); 10 | } 11 | 12 | return 0; 13 | } 14 | 15 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 16 | --------------------------------------------------------------------------------