Changes required to compile Racket with C99+exts (#3497)

With these changes RacketCS and RacketBC can be compiled with:
     `-std=c99 -D_DEFAULT_SOURCE`

Also added some documentation on contribution guidelines.
This commit is contained in:
Paulo Matos 2020-11-13 19:34:12 +01:00 committed by GitHub
parent 83e256cce6
commit 355d384e3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 7 deletions

View File

@ -182,6 +182,13 @@ make that process faster by keeping a few guidelines in mind:
will only be detected by a full @exec{raco setup}.
@italic{Really:} run @exec{raco setup}.}
@item{For changes to the C code, ensure your code follows the C99 standard.
On *nix systems, extensions that are part of the @exec{_DEFAULT_SOURCE}
pre-processor flag are also allowed. See the
@hyperlink[https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-_005fDEFAULT_005fSOURCE]{glibc}
manual for more details.}
]
@; ------------------------------------------------------------

View File

@ -864,7 +864,7 @@ void scheme_future_block_until_gc()
# endif
int _eax, _ebx, _ecx, _edx, op = 0;
/* we can't always use EBX, so save and restore it: */
asm (MZ_PUSH_EBX "\n\t"
__asm__ (MZ_PUSH_EBX "\n\t"
"cpuid \n\t"
"movl %%ebx, %1 \n\t"
MZ_POP_EBX

View File

@ -265,14 +265,14 @@ READ_ONLY Scheme_Object *scheme_zerol, *scheme_nzerol, *scheme_long_pi,
XFORM_NONGCING static void to_double_prec(void)
{
int _dblprec = 0x27F;
asm ("fldcw %0" : : "m" (_dblprec));
__asm__ ("fldcw %0" : : "m" (_dblprec));
}
#endif
#if defined(ASM_DBLPREC_CONTROL_87) || defined(ASM_EXTPREC_CONTROL_87)
XFORM_NONGCING static void to_extended_prec(void)
{
int _extprec = 0x37F;
asm ("fldcw %0" : : "m" (_extprec));
__asm__ ("fldcw %0" : : "m" (_extprec));
}
#endif

View File

@ -12,6 +12,7 @@
# include <pwd.h>
# include <grp.h>
# include <dirent.h>
# include <sys/time.h>
#endif
#ifdef RKTIO_SYSTEM_WINDOWS
# include <shlobj.h>