Skip to content

Instantly share code, notes, and snippets.

View jerstlouis's full-sized avatar

Jerome St-Louis jerstlouis

View GitHub Profile
// Compile with GCC 12.2.0 with -O2:
// warning: ‘strcpy’ offset 0 is out of the bounds [0, 0] [-Warray-bounds]
// no warning without -O2
extern char * strcpy(char * , const char * );
struct Inst { int bla; };
struct Class { int offset; };
static struct Class * classFoo; // No problem without static here
/* Code generated from eC source file: GuiApplication.ec */
#if defined(_WIN32)
#define __runtimePlatform 1
#elif defined(__APPLE__)
#define __runtimePlatform 3
#else
#define __runtimePlatform 2
#endif
#if defined(__GNUC__) || defined(__clang__)
#if defined(__clang__) && defined(__WIN32__)
public import "ecere"
public class CubeTris : Object
{
public:
bool Create(const DisplaySystem displaySystem)
{
bool result = false;
if(this)
{
import "ecere"
class MyCube : Cube
{
int extraStuff;
}
Map<String, Array<MyCube>> cubesMap { };
class CubesMapTestForm : Window
diff --git a/default.cf b/default.cf
index fc8cba400..62ac27520 100644
--- a/default.cf
+++ b/default.cf
@@ -80,13 +80,13 @@ export DYLD_LIBRARY_PATH = $(_CF_DIR)obj/$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEB
endif
# HARD CODED PLATFORM-SPECIFIC OPTIONS
-LDFLAGS +=$(if $(LINUX_TARGET), -Wl$(comma)--no-undefined,)
-LDFLAGS +=$(if $(OSX_TARGET), -framework cocoa -framework OpenGL -L/usr/local/opt/openssl/lib,)
#define MODULE_NAME "HelloCube"
#include "ecere.hpp"
class HelloCube : public Window
{
public:
Cube cube;
Light light;
Camera camera;
21c21
< return __x<<8 | __x>>8;
---
> return (__x<<8) | (__x>>8);
26c26
< return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
---
> return (__x>>24) | ((__x>>8)&0xff00) | ((__x<<8)&0xff0000) | (__x<<24);
31c31
< return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32);
template<typename TPT> inline CPPClass & ensureTemplatized(CPPClass & _class, const char * name)
{
if(!_class.impl || !_class.impl->templateClass)
{
char type[1024];
strcpy(type, "CPP");
strcat(type, name);
strcat(type, "<");
{
const char * t1 = TypeName<TPT>::get();
import "ecere"
class Form1 : Window
{
caption = $"Form1";
background = formColor;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;
import "ecere"
class Form1 : Window
{
caption = $"Form1";
background = formColor;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;