view release on metacpan or search on metacpan
inc/My/Build.pm view on Meta::CPAN
########################################################################
package My::Build;
########################################################################
use strict;
use warnings;
use parent 'Module::Build';
sub ACTION_build {
my $self = shift;
mkdir 'share';
$self->SUPER::ACTION_build;
}
use File::Path;
inc/My/Build/BSD.pm view on Meta::CPAN
########################################################################
package My::Build::BSD;
########################################################################
use strict;
use warnings;
use parent 'My::Build::Linux';
sub make_command { 'gmake' }
### MidnightBSD detection patch ###
my $is_midnight_handled = 0;
# Apply patch for MidnightBSD, and using cc instead of gcc
My::Build::apply_patches('src/configure' =>
# Note if we have already taken care of midnight bsd or not
inc/My/Build/Cygwin.pm view on Meta::CPAN
########################################################################
package My::Build::Cygwin;
########################################################################
use strict;
use warnings;
use parent 'My::Build::Linux';
sub extra_config_args { '--enable-cygwin' }
1;
inc/My/Build/Linux.pm view on Meta::CPAN
########################################################################
package My::Build::Linux;
########################################################################
use strict;
use warnings;
use parent 'My::Build';
use File::ShareDir;
# We don't need any extra args for pure Linux builds, but this may be
# overridden by derived classes
sub extra_config_args { '' }
sub make_command { 'make' }
sub install_to_prefix {
my ($self, $prefix) = @_;
inc/My/Build/MacOSX.pm view on Meta::CPAN
########################################################################
package My::Build::MacOSX;
########################################################################
use strict;
use warnings;
use parent 'My::Build::Linux';
# Figure out if gcc thinks the 64-bit flags are set, and use that to set
# the cpu type for the config args.
my $extra_config_args = '--cpu=x86';
open my $out_fh, '>', '_test.h';
print $out_fh "\n";
close $out_fh;
$extra_config_args .= '_64' if `gcc -E -dM _test.h` =~ /__x86_64__/;
unlink '_test.h';
sub extra_config_args { $extra_config_args }
inc/My/Build/Solaris.pm view on Meta::CPAN
########################################################################
package My::Build::Solaris;
########################################################################
use strict;
use warnings;
use parent 'My::Build::Linux';
# use gmake on Solaris, otherwise everything goes through (for now)
sub make_command { 'gmake' }
1;
inc/My/Build/Windows.pm view on Meta::CPAN
########################################################################
package My::Build::Windows;
########################################################################
use strict;
use warnings;
use parent 'My::Build';
sub ACTION_code {
my $self = shift;
require File::Copy::Recursive;
if (not $self->notes('build_state')) {
# move into the source directory and invoke the custom Windows build
chdir 'src\\win32';
system('build-tcc.bat');
src/Changelog view on Meta::CPAN
(next_nomacro1 now advances the read-pointer with TOK_LINEFEED)
Global cast (int g_i = 1LL;) no longer crashes tcc.
(nocode_wanted is initially 1, and only 0 for gen_function)
On win32 now tcc.exe finds 'include' & 'lib' even if itself is in 'bin'.
(new function w32_tcc_lib_path removes 'bin' if detected)
Added quick build batch file for mingw (win32/build-tcc.bat)
Last added case label optimization (455) produced wrong code. Reverted.
- Import more changesets from Rob Landley's fork (part 2):
487: Handle long long constants in gen_opic() (Rob Landley)
484: Handle parentheses within __attribute__((...)) (Rob Landley)
480: Remove a goto in decl_initializer_alloc (Rob Landley)
475: Fix dereferences in inline assembly output (Joshua Phillips)
474: Cast ptrs to ints of different sizes correctly (Joshua Phillips)
473: Fix size of structs with empty array member (Joshua Phillips)
470: No warning for && and || with mixed pointers/integers (Rob Landley)
469: Fix symbol visibility problems in the linker (Vincent Pit)
468: Allow && and || involving pointer arguments (Rob Landley)
455: Optimize case labels with no code in between (Zdenek Pavlas)
450: Implement alloca for x86 (grischka)
415: Parse unicode escape sequences (Axel Liljencrantz)
- fix macro substitution with nested definitions (ShangHongzhang)
- FPU st(0) is left unclean (kwisatz haderach). Incompatible with
optimized gcc/msc code
- constructors
- cast bug (Peter Wang)
- define incomplete type if defined several times (Peter Wang).
- test binutils/gcc compile
- tci patch + argument.
- see -lxxx bug (Michael Charity).
- see transparent union pb in /urs/include/sys/socket.h
- precise behaviour of typeof with arrays ? (__put_user macro)
but should suffice for most cases)
- handle '? x, y : z' in unsized variable initialization (',' is
considered incorrectly as separator in preparser)
- transform functions to function pointers in function parameters
(net/ipv4/ip_output.c)
- fix function pointer type display
- check lcc test suite -> fix bitfield binary operations
- check section alignment in C
- fix invalid cast in comparison 'if (v == (int8_t)v)'
} Elf32_Syminfo;
typedef struct
{
Elf64_Half si_boundto; /* Direct bindings, symbol bound to */
Elf64_Half si_flags; /* Per symbol flags */
} Elf64_Syminfo;
/* Possible values for si_boundto. */
#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */
#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */
#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */
/* Possible bitmasks for si_flags. */
#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy
loaded */
/* Syminfo version values. */
#define SYMINFO_NONE 0
src/tccgen.c view on Meta::CPAN
ad->a.func_export = 1;
break;
case TOK_DLLIMPORT:
ad->a.func_import = 1;
break;
default:
if (tcc_state->warn_unsupported)
tcc_warning("'%s' attribute ignored", get_tok_str(t, NULL));
/* skip parameters */
if (tok == '(') {
int parenthesis = 0;
do {
if (tok == '(')
parenthesis++;
else if (tok == ')')
parenthesis--;
next();
} while (parenthesis && tok != -1);
}
break;
}
if (tok != ',')
break;
next();
}
skip(')');
skip(')');
}
src/tccgen.c view on Meta::CPAN
"__builtin_frame_address");
}
level = (uint32_t)tokc.i;
next();
skip(')');
type.t = VT_VOID;
mk_pointer(&type);
vset(&type, VT_LOCAL, 0); /* local frame */
while (level--) {
mk_pointer(&vtop->type);
indir(); /* -> parent frame */
}
if (tok1 == TOK_builtin_return_address) {
// assume return address is just above frame pointer on stack
vpushi(PTR_SIZE);
gen_op('+');
mk_pointer(&vtop->type);
indir();
}
}
break;
src/tests/tcctest.c view on Meta::CPAN
/
/* this is a valid *\/ comment */
/* this is a valid comment *\*/
// this is a valid\
comment
/* test function macro substitution when the function name is
substituted */
TEST2();
/* And again when the name and parenthes are separated by a
comment. */
TEST2 /* the comment */ ();
}
static void print_num(char *fn, int line, int num) {
printf("fn %s, line %d, num %d\n", fn, line, num);
}
void recursive_macro_test(void)
src/win32/examples/hello_win.c view on Meta::CPAN
return msg.wParam;
}
//+---------------------------------------------------------------------------
//+---------------------------------------------------------------------------
void CenterWindow(HWND hwnd_self)
{
HWND hwnd_parent;
RECT rw_self, rc_parent, rw_parent;
int xpos, ypos;
hwnd_parent = GetParent(hwnd_self);
if (NULL == hwnd_parent)
hwnd_parent = GetDesktopWindow();
GetWindowRect(hwnd_parent, &rw_parent);
GetClientRect(hwnd_parent, &rc_parent);
GetWindowRect(hwnd_self, &rw_self);
xpos = rw_parent.left + (rc_parent.right + rw_self.left - rw_self.right) / 2;
ypos = rw_parent.top + (rc_parent.bottom + rw_self.top - rw_self.bottom) / 2;
SetWindowPos(
hwnd_self, NULL,
xpos, ypos, 0, 0,
SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE
);
}
//+---------------------------------------------------------------------------
src/win32/include/limits.h view on Meta::CPAN
#include <_mingw.h>
#ifndef _INC_LIMITS
#define _INC_LIMITS
/*
* File system limits
*
* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
* same as FILENAME_MAX and FOPEN_MAX from stdio.h?
* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
* required for the NUL. TODO: Test?
*/
#define PATH_MAX (259)
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 0xff
#define CHAR_MIN SCHAR_MIN
src/win32/include/winapi/wingdi.h view on Meta::CPAN
BYTE BlendOp;
BYTE BlendFlags;
BYTE SourceConstantAlpha;
BYTE AlphaFormat;
} BLENDFUNCTION,*PBLENDFUNCTION;
#define AC_SRC_OVER 0x00
#define AC_SRC_ALPHA 0x01
WINGDIAPI WINBOOL WINAPI AlphaBlend(HDC hdcDest,int xoriginDest,int yoriginDest,int wDest,int hDest,HDC hdcSrc,int xoriginSrc,int yoriginSrc,int wSrc,int hSrc,BLENDFUNCTION ftn);
WINGDIAPI WINBOOL WINAPI TransparentBlt(HDC hdcDest,int xoriginDest,int yoriginDest,int wDest,int hDest,HDC hdcSrc,int xoriginSrc,int yoriginSrc,int wSrc,int hSrc,UINT crTransparent);
#define GRADIENT_FILL_RECT_H 0x00000000
#define GRADIENT_FILL_RECT_V 0x00000001
#define GRADIENT_FILL_TRIANGLE 0x00000002
#define GRADIENT_FILL_OP_FLAG 0x000000ff
WINGDIAPI WINBOOL WINAPI GradientFill(HDC hdc,PTRIVERTEX pVertex,ULONG nVertex,PVOID pMesh,ULONG nMesh,ULONG ulMode);
#ifndef NOMETAFILE
src/win32/include/winapi/wingdi.h view on Meta::CPAN
BYTE cAccumBits;
BYTE cAccumRedBits;
BYTE cAccumGreenBits;
BYTE cAccumBlueBits;
BYTE cAccumAlphaBits;
BYTE cDepthBits;
BYTE cStencilBits;
BYTE cAuxBuffers;
BYTE iLayerPlane;
BYTE bReserved;
COLORREF crTransparent;
} LAYERPLANEDESCRIPTOR,*PLAYERPLANEDESCRIPTOR,*LPLAYERPLANEDESCRIPTOR;
#define LPD_DOUBLEBUFFER 0x00000001
#define LPD_STEREO 0x00000002
#define LPD_SUPPORT_GDI 0x00000010
#define LPD_SUPPORT_OPENGL 0x00000020
#define LPD_SHARE_DEPTH 0x00000040
#define LPD_SHARE_STENCIL 0x00000080
#define LPD_SHARE_ACCUM 0x00000100
#define LPD_SWAP_EXCHANGE 0x00000200