Unified · Split
| @@ -300,11 +300,11 @@ endif · 299 unmodified lines | ||
| 300 | 300 | |
| 301 | 301 | # documentation and man page |
| 302 | 302 | tcc-doc.html: tcc-doc.texi |
| 303 | − -texi2html -monolithic -number $< | |
| 303 | + -texi2html -monolithic -number-sections $< | |
| 304 | 304 | |
| 305 | 305 | tcc.1: tcc-doc.texi |
| 306 | 306 | -$(top_srcdir)/texi2pod.pl $< tcc.pod |
| 307 | − -pod2man --section=1 --center=" " --release=" " tcc.pod > $@ | |
| 307 | + -pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/VERSION` tcc.pod > $@ | |
| 308 | 308 | |
| 309 | 309 | tcc-doc.info: tcc-doc.texi |
| 310 | 310 | -makeinfo $< |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | #ifdef TARGET_DEFS_ONLY |
| 25 | 25 | |
| 26 | 26 | #ifdef TCC_ARM_EABI |
| 27 | −#ifndef TCC_ARM_VFP // Avoid useless warning | |
| 27 | +#ifndef TCC_ARM_VFP /* Avoid useless warning */ | |
| 28 | 28 | #define TCC_ARM_VFP |
| 29 | 29 | #endif |
| 30 | 30 | #endif |
| @@ -104,7 +104,7 @@ enum { · 73 unmodified lines | ||
| 104 | 104 | |
| 105 | 105 | /* defined if structures are passed as pointers. Otherwise structures |
| 106 | 106 | are directly pushed on stack. */ |
| 107 | −//#define FUNC_STRUCT_PARAM_AS_PTR | |
| 107 | +/* #define FUNC_STRUCT_PARAM_AS_PTR */ | |
| 108 | 108 | |
| 109 | 109 | /* pointer size, in bytes */ |
| 110 | 110 | #define PTR_SIZE 4 |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #ifdef TARGET_DEFS_ONLY |
| 22 | 22 | |
| 23 | −//#define ASSEMBLY_LISTING_C67 | |
| 23 | +/* #define ASSEMBLY_LISTING_C67 */ | |
| 24 | 24 | |
| 25 | 25 | /* number of available registers */ |
| 26 | 26 | #define NB_REGS 24 |
| @@ -93,11 +93,11 @@ enum { · 66 unmodified lines | ||
| 93 | 93 | #define REG_FRET TREG_C67_A4 /* float return register */ |
| 94 | 94 | |
| 95 | 95 | /* defined if function parameters must be evaluated in reverse order */ |
| 96 | −//#define INVERT_FUNC_PARAMS | |
| 96 | +/* #define INVERT_FUNC_PARAMS */ | |
| 97 | 97 | |
| 98 | 98 | /* defined if structures are passed as pointers. Otherwise structures |
| 99 | 99 | are directly pushed on stack. */ |
| 100 | −//#define FUNC_STRUCT_PARAM_AS_PTR | |
| 100 | +/* #define FUNC_STRUCT_PARAM_AS_PTR */ | |
| 101 | 101 | |
| 102 | 102 | /* pointer size, in bytes */ |
| 103 | 103 | #define PTR_SIZE 4 |
| @@ -253,7 +253,7 @@ void gsym(int t) · 149 unmodified lines | ||
| 253 | 253 | #define C67_B3 107 |
| 254 | 254 | #define C67_FP 108 |
| 255 | 255 | #define C67_B2 109 |
| 256 | −#define C67_CREG_ZERO -1 // Special code for no condition reg test | |
| 256 | +#define C67_CREG_ZERO -1 /* Special code for no condition reg test */ | |
| 257 | 257 | |
| 258 | 258 | |
| 259 | 259 | int ConvertRegToRegClass(int r) |
| @@ -37,8 +37,8 @@ struct filehdr { · 36 unmodified lines | ||
| 37 | 37 | #define F_BYTE_ORDER (F_LITTLE | F_BIG) |
| 38 | 38 | #define FILHDR struct filehdr |
| 39 | 39 | |
| 40 | −//#define FILHSZ sizeof(FILHDR) | |
| 41 | −#define FILHSZ 22 // above rounds to align on 4 bytes which causes problems | |
| 40 | +/* #define FILHSZ sizeof(FILHDR) */ | |
| 41 | +#define FILHSZ 22 /* above rounds to align on 4 bytes which causes problems */ | |
| 42 | 42 | |
| 43 | 43 | #define COFF_C67_MAGIC 0x00c2 |
| 44 | 44 | |
| @@ -150,7 +150,7 @@ struct scnhdr { · 105 unmodified lines | ||
| 150 | 150 | /*------------------------------------------------------------------------*/ |
| 151 | 151 | /* Define constants for names of "special" sections */ |
| 152 | 152 | /*------------------------------------------------------------------------*/ |
| 153 | −//#define _TEXT ".text" | |
| 153 | +/* #define _TEXT ".text" */ | |
| 154 | 154 | #define _DATA ".data" |
| 155 | 155 | #define _BSS ".bss" |
| 156 | 156 | #define _CINIT ".cinit" |
| @@ -1725,7 +1725,7 @@ typedef Elf32_Addr Elf32_Conflict; · 1724 unmodified lines | ||
| 1725 | 1725 | #define R_C60_GOTOFF 9 /* 32 bit offset to GOT */ |
| 1726 | 1726 | #define R_C60_GOTPC 10 /* 32 bit PC relative offset to GOT */ |
| 1727 | 1727 | |
| 1728 | −#define R_C60HI16 0x55 // high 16 bit MVKH embedded | |
| 1729 | −#define R_C60LO16 0x54 // low 16 bit MVKL embedded | |
| 1728 | +#define R_C60HI16 0x55 /* high 16 bit MVKH embedded */ | |
| 1729 | +#define R_C60LO16 0x54 /* low 16 bit MVKL embedded */ | |
| 1730 | 1730 | |
| 1731 | 1731 | #endif /* elf.h */ |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | #include "tcc.h" |
| 23 | 23 | |
| 24 | −// #define NB_ASM_REGS 8 | |
| 24 | +/* #define NB_ASM_REGS 8 */ | |
| 25 | 25 | #define MAX_OPERANDS 3 |
| 26 | 26 | #define NB_SAVED_REGS 3 |
| 27 | 27 | |
| @@ -55,7 +55,7 @@ enum { · 54 unmodified lines | ||
| 55 | 55 | |
| 56 | 56 | /* defined if structures are passed as pointers. Otherwise structures |
| 57 | 57 | are directly pushed on stack. */ |
| 58 | −//#define FUNC_STRUCT_PARAM_AS_PTR | |
| 58 | +/* #define FUNC_STRUCT_PARAM_AS_PTR */ | |
| 59 | 59 | |
| 60 | 60 | /* pointer size, in bytes */ |
| 61 | 61 | #define PTR_SIZE 4 |
| @@ -53,11 +53,11 @@ const int reg_classes[NB_REGS] = { · 52 unmodified lines | ||
| 53 | 53 | #define REG_FRET REG_ST0 /* float return register */ |
| 54 | 54 | |
| 55 | 55 | /* defined if function parameters must be evaluated in reverse order */ |
| 56 | −//#define INVERT_FUNC_PARAMS | |
| 56 | +/* #define INVERT_FUNC_PARAMS */ | |
| 57 | 57 | |
| 58 | 58 | /* defined if structures are passed as pointers. Otherwise structures |
| 59 | 59 | are directly pushed on stack. */ |
| 60 | −//#define FUNC_STRUCT_PARAM_AS_PTR | |
| 60 | +/* #define FUNC_STRUCT_PARAM_AS_PTR */ | |
| 61 | 61 | |
| 62 | 62 | /* pointer size, in bytes */ |
| 63 | 63 | #define PTR_SIZE 4 |
| @@ -29,11 +29,11 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <unistd.h> |
| 30 | 30 | #endif |
| 31 | 31 | |
| 32 | −//#define BOUND_DEBUG | |
| 32 | +/* #define BOUND_DEBUG */ | |
| 33 | 33 | |
| 34 | 34 | /* define so that bound array is static (faster, but use memory if |
| 35 | 35 | bound checking not used) */ |
| 36 | −//#define BOUND_STATIC | |
| 36 | +/* #define BOUND_STATIC */ | |
| 37 | 37 | |
| 38 | 38 | /* use malloc hooks. Currently the code cannot be reliable if no hooks */ |
| 39 | 39 | #define CONFIG_TCC_MALLOC_HOOKS |
| @@ -1018,7 +1018,7 @@ LIBTCCAPI TCCState *tcc_new(void) · 1017 unmodified lines | ||
| 1018 | 1018 | s->char_is_unsigned = 1; |
| 1019 | 1019 | #endif |
| 1020 | 1020 | /* enable this if you want symbols with leading underscore on windows: */ |
| 1021 | −#if 0 //def TCC_TARGET_PE | |
| 1021 | +#if 0 /* def TCC_TARGET_PE */ | |
| 1022 | 1022 | s->leading_underscore = 1; |
| 1023 | 1023 | #endif |
| 1024 | 1024 | #ifdef TCC_TARGET_I386 |
| @@ -388,13 +388,14 @@ and floating point numbers (@code{long double}, @code{double}, and · 387 unmodified lines | ||
| 388 | 388 | @section ISOC99 extensions |
| 389 | 389 | |
| 390 | 390 | TCC implements many features of the new C standard: ISO C99. Currently |
| 391 | −missing items are: complex and imaginary numbers and variable length | |
| 392 | −arrays. | |
| 391 | +missing items are: complex and imaginary numbers. | |
| 393 | 392 | |
| 394 | 393 | Currently implemented ISOC99 features: |
| 395 | 394 | |
| 396 | 395 | @itemize |
| 397 | 396 | |
| 397 | +@item variable length arrays. | |
| 398 | + | |
| 398 | 399 | @item 64 bit @code{long long} types are fully supported. |
| 399 | 400 | |
| 400 | 401 | @item The boolean type @code{_Bool} is supported. |
| @@ -98,21 +98,21 @@ · 97 unmodified lines | ||
| 98 | 98 | #include "libtcc.h" |
| 99 | 99 | |
| 100 | 100 | /* parser debug */ |
| 101 | −//#define PARSE_DEBUG | |
| 101 | +/* #define PARSE_DEBUG */ | |
| 102 | 102 | /* preprocessor debug */ |
| 103 | −//#define PP_DEBUG | |
| 103 | +/* #define PP_DEBUG */ | |
| 104 | 104 | /* include file debug */ |
| 105 | −//#define INC_DEBUG | |
| 105 | +/* #define INC_DEBUG */ | |
| 106 | 106 | /* memory leak debug */ |
| 107 | −//#define MEM_DEBUG | |
| 107 | +/* #define MEM_DEBUG */ | |
| 108 | 108 | /* assembler debug */ |
| 109 | −//#define ASM_DEBUG | |
| 109 | +/* #define ASM_DEBUG */ | |
| 110 | 110 | |
| 111 | 111 | /* target selection */ |
| 112 | −//#define TCC_TARGET_I386 /* i386 code generator */ | |
| 113 | −//#define TCC_TARGET_ARM /* ARMv4 code generator */ | |
| 114 | −//#define TCC_TARGET_C67 /* TMS320C67xx code generator */ | |
| 115 | −//#define TCC_TARGET_X86_64 /* x86-64 code generator */ | |
| 112 | +/* #define TCC_TARGET_I386 *//* i386 code generator */ | |
| 113 | +/* #define TCC_TARGET_ARM *//* ARMv4 code generator */ | |
| 114 | +/* #define TCC_TARGET_C67 *//* TMS320C67xx code generator */ | |
| 115 | +/* #define TCC_TARGET_X86_64 *//* x86-64 code generator */ | |
| 116 | 116 | |
| 117 | 117 | /* default target is I386 */ |
| 118 | 118 | #if !defined(TCC_TARGET_I386) && !defined(TCC_TARGET_ARM) && \ |
| @@ -894,7 +894,7 @@ struct TCCState { · 775 unmodified lines | ||
| 894 | 894 | DEF_ASM(x ## nle) \ |
| 895 | 895 | DEF_ASM(x ## g) |
| 896 | 896 | |
| 897 | −#endif // defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 | |
| 897 | +#endif /* defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 */ | |
| 898 | 898 | |
| 899 | 899 | enum tcc_token { |
| 900 | 900 | TOK_LAST = TOK_IDENT - 1, |
| @@ -909,10 +909,10 @@ enum tcc_token { · 8 unmodified lines | ||
| 909 | 909 | #define snprintf _snprintf |
| 910 | 910 | #define vsnprintf _vsnprintf |
| 911 | 911 | #ifndef __GNUC__ |
| 912 | − #define strtold (long double)strtod | |
| 913 | − #define strtof (float)strtod | |
| 914 | − #define strtoll _strtoi64 | |
| 915 | − #define strtoull _strtoui64 | |
| 912 | +# define strtold (long double)strtod | |
| 913 | +# define strtof (float)strtod | |
| 914 | +# define strtoll _strtoi64 | |
| 915 | +# define strtoull _strtoui64 | |
| 916 | 916 | #endif |
| 917 | 917 | #else |
| 918 | 918 | /* XXX: need to define this to use them in non ISOC99 context */ |
| @@ -1835,7 +1835,7 @@ static int elf_output_file(TCCState *s1, const char *filename) · 1834 unmodified lines | ||
| 1835 | 1835 | for(i = 1; i < s1->nb_sections; i++) { |
| 1836 | 1836 | s = s1->sections[i]; |
| 1837 | 1837 | s->sh_name = put_elf_str(strsec, s->name); |
| 1838 | −#if 0 //gr | |
| 1838 | +#if 0 /* gr */ | |
| 1839 | 1839 | printf("section: f=%08x t=%08x i=%08x %s %s\n", |
| 1840 | 1840 | s->sh_flags, |
| 1841 | 1841 | s->sh_type, |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #endif |
| 31 | 31 | |
| 32 | 32 | #define PE_MERGE_DATA |
| 33 | −// #define PE_PRINT_SECTIONS | |
| 33 | +/* #define PE_PRINT_SECTIONS */ | |
| 34 | 34 | |
| 35 | 35 | #ifdef TCC_TARGET_X86_64 |
| 36 | 36 | # define ADDR3264 ULONGLONG |
| @@ -239,7 +239,7 @@ typedef struct { · 238 unmodified lines | ||
| 239 | 239 | #define SCNiPTR "i" |
| 240 | 240 | #define SCNoPTR "o" |
| 241 | 241 | #define SCNxPTR "x" |
| 242 | − #define SCNuPTR "u" | |
| 242 | +#define SCNuPTR "u" | |
| 243 | 243 | #endif |
| 244 | 244 | |
| 245 | 245 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
| @@ -241,8 +241,8 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ · 240 unmodified lines | ||
| 241 | 241 | /* Make sure macros are not defined. */ |
| 242 | 242 | #pragma push_macro("vsnprintf") |
| 243 | 243 | #pragma push_macro("snprintf") |
| 244 | − #undef vsnprintf | |
| 245 | − #undef snprintf | |
| 244 | +# undef vsnprintf | |
| 245 | +# undef snprintf | |
| 246 | 246 | extern |
| 247 | 247 | __attribute__((format(gnu_printf, 3, 0))) __attribute__((nonnull (3))) |
| 248 | 248 | int __mingw_vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList); |
| @@ -267,14 +267,14 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ · 18 unmodified lines | ||
| 267 | 267 | #pragma pop_macro("snprintf") |
| 268 | 268 | #pragma pop_macro("vsnprintf") |
| 269 | 269 | /* Check if vsnprintf and snprintf are defaulting to gnu-style. */ |
| 270 | − #if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF | |
| 271 | − #ifndef vsnprint | |
| 272 | − #define vsnprintf __mingw_vsnprintf | |
| 273 | − #endif | |
| 274 | − #ifndef snprintf | |
| 275 | − #define snprintf __mingw_snprintf | |
| 276 | − #endif | |
| 277 | − #endif | |
| 270 | +# if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF | |
| 271 | +# ifndef vsnprint | |
| 272 | +# define vsnprintf __mingw_vsnprintf | |
| 273 | +# endif | |
| 274 | +# ifndef snprintf | |
| 275 | +# define snprintf __mingw_snprintf | |
| 276 | +# endif | |
| 277 | +# endif | |
| 278 | 278 | _CRTIMP int __cdecl _vscprintf(const char *_Format,va_list _ArgList); |
| 279 | 279 | _CRTIMP int __cdecl _set_printf_count_output(int _Value); |
| 280 | 280 | _CRTIMP int __cdecl _get_printf_count_output(void); |
| @@ -25,7 +25,7 @@ extern "C" { · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | #include <sys/types.h> |
| 27 | 27 | |
| 28 | −#ifndef __TINYC__ //gr | |
| 28 | +#ifndef __TINYC__ /* gr */ | |
| 29 | 29 | #ifdef _USE_32BIT_TIME_T |
| 30 | 30 | #ifdef _WIN64 |
| 31 | 31 | #undef _USE_32BIT_TIME_T |
| @@ -22,7 +22,7 @@ extern "C" { · 21 unmodified lines | ||
| 22 | 22 | #define _CRTIMP __declspec(dllimport) |
| 23 | 23 | #endif |
| 24 | 24 | |
| 25 | −#ifndef __TINYC__ //gr | |
| 25 | +#ifndef __TINYC__ /* gr */ | |
| 26 | 26 | #ifdef _USE_32BIT_TIME_T |
| 27 | 27 | #ifdef _WIN64 |
| 28 | 28 | #undef _USE_32BIT_TIME_T |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include <_mingw.h> |
| 14 | 14 | |
| 15 | −#ifndef __TINYC__ //gr | |
| 15 | +#ifndef __TINYC__ /* gr */ | |
| 16 | 16 | #ifdef _USE_32BIT_TIME_T |
| 17 | 17 | #ifdef _WIN64 |
| 18 | 18 | #undef _USE_32BIT_TIME_T |
| @@ -27,7 +27,7 @@ extern "C" { · 26 unmodified lines | ||
| 27 | 27 | #define _WCHAR_T_DEFINED |
| 28 | 28 | #endif |
| 29 | 29 | |
| 30 | −#ifndef __TINYC__ //gr | |
| 30 | +#ifndef __TINYC__ /* gr */ | |
| 31 | 31 | #ifdef _USE_32BIT_TIME_T |
| 32 | 32 | #ifdef _WIN64 |
| 33 | 33 | #undef _USE_32BIT_TIME_T |
| @@ -110,7 +110,7 @@ extern "C" { · 109 unmodified lines | ||
| 110 | 110 | typedef DWORD *PDWORD; |
| 111 | 111 | typedef DWORD *LPDWORD; |
| 112 | 112 | typedef void *LPVOID; |
| 113 | − #ifndef _LPCVOID_DEFINED | |
| 113 | +# ifndef _LPCVOID_DEFINED | |
| 114 | 114 | #define _LPCVOID_DEFINED |
| 115 | 115 | typedef CONST void *LPCVOID; |
| 116 | 116 | #endif |
| @@ -1763,7 +1763,7 @@ · 1762 unmodified lines | ||
| 1763 | 1763 | #ifndef WSA_QOS_RESERVED_PETYPE |
| 1764 | 1764 | #define WSA_QOS_RESERVED_PETYPE 11031L |
| 1765 | 1765 | #endif |
| 1766 | −#endif // WSABASEERR | |
| 1766 | +#endif /* WSABASEERR */ | |
| 1767 | 1767 | |
| 1768 | 1768 | #define ERROR_SXS_SECTION_NOT_FOUND 14000L |
| 1769 | 1769 | #define ERROR_SXS_CANT_GEN_ACTCTX 14001L |
| @@ -3163,4 +3163,4 @@ __CRT_INLINE HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : ( · 1393 unmodified lines | ||
| 3163 | 3163 | #define COMADMIN_E_SAFERINVALID _HRESULT_TYPEDEF_(0x80110822L) |
| 3164 | 3164 | #define COMADMIN_E_REGISTRY_ACCESSDENIED _HRESULT_TYPEDEF_(0x80110823L) |
| 3165 | 3165 | #define COMADMIN_E_PARTITIONS_DISABLED _HRESULT_TYPEDEF_(0x80110824L) |
| 3166 | −#endif // _WINERROR_ | |
| 3166 | +#endif /* _WINERROR_ */ | |