You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/07/22 22:13:30 UTC
[lucy-commits] [1/6] git commit: refs/heads/charmonizer-decoupling - Revert "Remove
Charmony macros from XSBind.h"
Updated Branches:
refs/heads/charmonizer-decoupling c2ff0a878 -> 7406b6c2d
Revert "Remove Charmony macros from XSBind.h"
This reverts commit c2ff0a87846f54d32c5928a4775470a167b74bf5.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/b039a399
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/b039a399
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/b039a399
Branch: refs/heads/charmonizer-decoupling
Commit: b039a39969f9e031a6a35cf8f35fed104a96a824
Parents: c2ff0a8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 22 21:30:39 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 22 21:30:39 2013 +0200
----------------------------------------------------------------------
clownfish/compiler/src/CFCPerlSub.c | 27 +++--------------
clownfish/runtime/perl/xs/XSBind.c | 1 -
clownfish/runtime/perl/xs/XSBind.h | 51 ++++++++++++++++++++++++++++++++
perl/xs/Lucy/Document/Doc.c | 1 -
4 files changed, 55 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/b039a399/clownfish/compiler/src/CFCPerlSub.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlSub.c b/clownfish/compiler/src/CFCPerlSub.c
index 1f6a7c1..2b35ac5 100644
--- a/clownfish/compiler/src/CFCPerlSub.c
+++ b/clownfish/compiler/src/CFCPerlSub.c
@@ -14,11 +14,8 @@
* limitations under the License.
*/
-#include "charmony.h"
-
#include <string.h>
#include <stdio.h>
-
#define CFC_NEED_BASE_STRUCT_DEF
#define CFC_NEED_PERLSUB_STRUCT_DEF
#include "CFCPerlSub.h"
@@ -121,26 +118,10 @@ struct allot_macro_map {
struct allot_macro_map prim_type_to_allot_macro[] = {
{ "double", "ALLOT_F64" },
{ "float", "ALLOT_F32" },
-#if (CHY_SIZEOF_INT == 4)
- { "int", "ALLOT_I32" },
-#else // sizeof(int) == 8
- { "int", "ALLOT_I64" },
-#endif
-#if (CHY_SIZEOF_SHORT == 2)
- { "short", "ALLOT_I16" },
-#else
- #error "Can't build unless sizeof(short) == 2"
-#endif
-#if (CHY_SIZEOF_LONG == 4)
- { "long", "ALLOT_I32" },
-#else // sizeof(long) == 8
- { "long", "ALLOT_I64" },
-#endif
-#if (CHY_SIZEOF_SIZE_T == 4)
- { "size_t", "ALLOT_U32" },
-#else // sizeof(size_t) == 8
- { "size_t", "ALLOT_U64" },
-#endif
+ { "int", "ALLOT_INT" },
+ { "short", "ALLOT_SHORT" },
+ { "long", "ALLOT_LONG" },
+ { "size_t", "ALLOT_SIZE_T" },
{ "uint64_t", "ALLOT_U64" },
{ "uint32_t", "ALLOT_U32" },
{ "uint16_t", "ALLOT_U16" },
http://git-wip-us.apache.org/repos/asf/lucy/blob/b039a399/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
index ac75d6b..092b5e9 100644
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ b/clownfish/runtime/perl/xs/XSBind.c
@@ -18,7 +18,6 @@
#define C_CFISH_VTABLE
#define C_CFISH_LOCKFREEREGISTRY
#define NEED_newRV_noinc
-#include "charmony.h"
#include "XSBind.h"
#include "Clownfish/LockFreeRegistry.h"
#include "Clownfish/Util/StringHelper.h"
http://git-wip-us.apache.org/repos/asf/lucy/blob/b039a399/clownfish/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.h b/clownfish/runtime/perl/xs/XSBind.h
index b8568af..c5a5453 100644
--- a/clownfish/runtime/perl/xs/XSBind.h
+++ b/clownfish/runtime/perl/xs/XSBind.h
@@ -20,6 +20,7 @@
#ifndef H_CFISH_XSBIND
#define H_CFISH_XSBIND 1
+#include "charmony.h"
#include "Clownfish/Obj.h"
#include "Clownfish/ByteBuf.h"
#include "Clownfish/CharBuf.h"
@@ -165,6 +166,11 @@ cfish_XSBind_enable_overload(void *pobj);
* ALLOT_U32(ptr, key, keylen, required)
* ALLOT_U64(ptr, key, keylen, required)
* ALLOT_BOOL(ptr, key, keylen, required)
+ * ALLOT_CHAR(ptr, key, keylen, required)
+ * ALLOT_SHORT(ptr, key, keylen, required)
+ * ALLOT_INT(ptr, key, keylen, required)
+ * ALLOT_LONG(ptr, key, keylen, required)
+ * ALLOT_SIZE_T(ptr, key, keylen, required)
* ALLOT_F32(ptr, key, keylen, required)
* ALLOT_F64(ptr, key, keylen, required)
*
@@ -220,6 +226,36 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
#define XSBIND_WANT_OBJ 0xC
#define XSBIND_WANT_SV 0xD
+#if (CHY_SIZEOF_CHAR == 1)
+ #define XSBIND_WANT_CHAR XSBIND_WANT_I8
+#else
+ #error "Can't build unless sizeof(char) == 1"
+#endif
+
+#if (CHY_SIZEOF_SHORT == 2)
+ #define XSBIND_WANT_SHORT XSBIND_WANT_I16
+#else
+ #error "Can't build unless sizeof(short) == 2"
+#endif
+
+#if (CHY_SIZEOF_INT == 4)
+ #define XSBIND_WANT_INT XSBIND_WANT_I32
+#else // sizeof(int) == 8
+ #define XSBIND_WANT_INT XSBIND_WANT_I64
+#endif
+
+#if (CHY_SIZEOF_LONG == 4)
+ #define XSBIND_WANT_LONG XSBIND_WANT_I32
+#else // sizeof(long) == 8
+ #define XSBIND_WANT_LONG XSBIND_WANT_I64
+#endif
+
+#if (CHY_SIZEOF_SIZE_T == 4)
+ #define XSBIND_WANT_SIZE_T XSBIND_WANT_U32
+#else // sizeof(long) == 8
+ #define XSBIND_WANT_SIZE_T XSBIND_WANT_U64
+#endif
+
#define XSBIND_ALLOT_I8(ptr, key, keylen, required) \
ptr, key, keylen, required, XSBIND_WANT_I8, NULL, NULL
#define XSBIND_ALLOT_I16(ptr, key, keylen, required) \
@@ -238,6 +274,16 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
ptr, key, keylen, required, XSBIND_WANT_U64, NULL, NULL
#define XSBIND_ALLOT_BOOL(ptr, key, keylen, required) \
ptr, key, keylen, required, XSBIND_WANT_BOOL, NULL, NULL
+#define XSBIND_ALLOT_CHAR(ptr, key, keylen, required) \
+ ptr, key, keylen, required, XSBIND_WANT_CHAR, NULL, NULL
+#define XSBIND_ALLOT_SHORT(ptr, key, keylen, required) \
+ ptr, key, keylen, required, XSBIND_WANT_SHORT, NULL, NULL
+#define XSBIND_ALLOT_INT(ptr, key, keylen, required) \
+ ptr, key, keylen, required, XSBIND_WANT_INT, NULL, NULL
+#define XSBIND_ALLOT_LONG(ptr, key, keylen, required) \
+ ptr, key, keylen, required, XSBIND_WANT_LONG, NULL, NULL
+#define XSBIND_ALLOT_SIZE_T(ptr, key, keylen, required) \
+ ptr, key, keylen, required, XSBIND_WANT_SIZE_T, NULL, NULL
#define XSBIND_ALLOT_F32(ptr, key, keylen, required) \
ptr, key, keylen, required, XSBIND_WANT_F32, NULL, NULL
#define XSBIND_ALLOT_F64(ptr, key, keylen, required) \
@@ -275,6 +321,11 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
#define ALLOT_U32 XSBIND_ALLOT_U32
#define ALLOT_U64 XSBIND_ALLOT_U64
#define ALLOT_BOOL XSBIND_ALLOT_BOOL
+#define ALLOT_CHAR XSBIND_ALLOT_CHAR
+#define ALLOT_SHORT XSBIND_ALLOT_SHORT
+#define ALLOT_INT XSBIND_ALLOT_INT
+#define ALLOT_LONG XSBIND_ALLOT_LONG
+#define ALLOT_SIZE_T XSBIND_ALLOT_SIZE_T
#define ALLOT_F32 XSBIND_ALLOT_F32
#define ALLOT_F64 XSBIND_ALLOT_F64
#define ALLOT_OBJ XSBIND_ALLOT_OBJ
http://git-wip-us.apache.org/repos/asf/lucy/blob/b039a399/perl/xs/Lucy/Document/Doc.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Document/Doc.c b/perl/xs/Lucy/Document/Doc.c
index 6dd58b4..220a7bf 100644
--- a/perl/xs/Lucy/Document/Doc.c
+++ b/perl/xs/Lucy/Document/Doc.c
@@ -15,7 +15,6 @@
*/
#define C_LUCY_DOC
-#include "charmony.h"
#include "XSBind.h"
#include "Lucy/Document/Doc.h"
#include "Lucy/Store/InStream.h"
[lucy-commits] [6/6] git commit: refs/heads/charmonizer-decoupling - Write
platform-specific definitions to cfish_platform.h
Posted by nw...@apache.org.
Write platform-specific definitions to cfish_platform.h
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7406b6c2
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7406b6c2
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7406b6c2
Branch: refs/heads/charmonizer-decoupling
Commit: 7406b6c2d11c0b859b239293e5d84b20101f4ccb
Parents: e513f8f
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 22 22:09:12 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 22 22:09:12 2013 +0200
----------------------------------------------------------------------
clownfish/compiler/src/CFCBindCore.c | 71 ++++++++++++++++++++++---------
1 file changed, 51 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/7406b6c2/clownfish/compiler/src/CFCBindCore.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindCore.c b/clownfish/compiler/src/CFCBindCore.c
index 9d7eda4..b2f8435 100644
--- a/clownfish/compiler/src/CFCBindCore.c
+++ b/clownfish/compiler/src/CFCBindCore.c
@@ -51,8 +51,11 @@ S_write_parcel_h(CFCBindCore *self, CFCParcel *parcel);
static void
S_write_parcel_c(CFCBindCore *self, CFCParcel *parcel);
-static char*
-S_charmony_defines();
+/* Write the "cfish_platform.h" header file, which contains platform-specific
+ * definitions.
+ */
+static void
+S_write_platform_h(CFCBindCore *self);
static char*
S_charmony_feature_defines();
@@ -124,6 +127,8 @@ CFCBindCore_write_all_modified(CFCBindCore *self, int modified) {
// If any class definition has changed, rewrite the parcel.h and parcel.c
// files.
if (modified) {
+ S_write_platform_h(self);
+
CFCParcel **parcels = CFCParcel_all_parcels();
for (size_t i = 0; parcels[i]; ++i) {
CFCParcel *parcel = parcels[i];
@@ -166,19 +171,18 @@ S_write_parcel_h(CFCBindCore *self, CFCParcel *parcel) {
FREEMEM(ordered);
// Special includes and macros for Clownfish parcel.
- const char *cfish_includes_pattern =
+ const char *cfish_includes =
"#include <stdarg.h>\n"
"#include <stddef.h>\n"
"\n"
- "%s"
- "\n"
- "#define CFISH_UNUSED_VAR(var) ((void)var)\n"
- "#define CFISH_UNREACHABLE_RETURN(type) return (type)0\n"
- "\n"
+ "#include \"cfish_platform.h\"\n"
"#include \"cfish_hostdefs.h\"\n";
// Special definitions for Clownfish parcel.
const char *cfish_defs =
+ "#define CFISH_UNUSED_VAR(var) ((void)var)\n"
+ "#define CFISH_UNREACHABLE_RETURN(type) return (type)0\n"
+ "\n"
"/* Generic method pointer.\n"
" */\n"
"typedef void\n"
@@ -280,10 +284,7 @@ S_write_parcel_h(CFCBindCore *self, CFCParcel *parcel) {
char *extra_includes;
if (strcmp(prefix, "cfish_") == 0) {
extra_defs = cfish_defs;
- char *charmony_defines = S_charmony_defines();
- extra_includes = CFCUtil_sprintf(cfish_includes_pattern,
- charmony_defines);
- FREEMEM(charmony_defines);
+ extra_includes = CFCUtil_strdup(cfish_includes);
}
else {
extra_defs = "";
@@ -561,32 +562,62 @@ CFCBindCore_write_callbacks_h(CFCBindCore *self) {
FREEMEM(file_content);
}
-static char*
-S_charmony_defines() {
+/* Write the "cfish_platform.h" header file, which contains platform-specific
+ * definitions.
+ */
+static void
+S_write_platform_h(CFCBindCore *self) {
char *feature_defs = S_charmony_feature_defines();
char *string_defs = S_charmony_string_defines();
char *stdbool_defs = S_charmony_stdbool_defines();
char *stdint_defs = S_charmony_stdint_defines();
char *alloca_defs = S_charmony_alloca_defines();
- const char *pattern =
+ const char pattern[] =
+ "%s"
+ "\n"
+ "#ifndef CFISH_PLATFORM_H\n"
+ "#define CFISH_PLATFORM_H 1\n"
+ "\n"
+ "#ifdef __cplusplus\n"
+ "extern \"C\" {\n"
+ "#endif\n"
+ "\n"
"%s"
"%s"
"\n"
"%s"
"%s"
"\n"
- "%s";
- char *defines
- = CFCUtil_sprintf(pattern, feature_defs, string_defs, stdbool_defs,
- stdint_defs, alloca_defs);
+ "%s"
+ "\n"
+ "#ifdef __cplusplus\n"
+ "}\n"
+ "#endif\n"
+ "\n"
+ "#endif /* CFISH_PLATFORM_H */\n"
+ "\n"
+ "%s"
+ "\n";
+ char *file_content
+ = CFCUtil_sprintf(pattern, self->header, feature_defs, string_defs,
+ stdbool_defs, stdint_defs, alloca_defs,
+ self->footer);
+
+ // Unlink then write file.
+ const char *inc_dest = CFCHierarchy_get_include_dest(self->hierarchy);
+ char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "cfish_platform.h",
+ inc_dest);
+ remove(filepath);
+ CFCUtil_write_file(filepath, file_content, strlen(file_content));
+ FREEMEM(filepath);
FREEMEM(feature_defs);
FREEMEM(string_defs);
FREEMEM(stdbool_defs);
FREEMEM(stdint_defs);
FREEMEM(alloca_defs);
- return defines;
+ FREEMEM(file_content);
}
static char*
[lucy-commits] [5/6] git commit: refs/heads/charmonizer-decoupling - Switch to
CFISH_SIZEOF macros in XSBind.h
Posted by nw...@apache.org.
Switch to CFISH_SIZEOF macros in XSBind.h
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/e513f8f9
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/e513f8f9
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/e513f8f9
Branch: refs/heads/charmonizer-decoupling
Commit: e513f8f96fb66540216edcff55d70d66b1668542
Parents: 23ebeaa
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 22 21:45:11 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 22 22:08:29 2013 +0200
----------------------------------------------------------------------
clownfish/runtime/perl/xs/XSBind.c | 1 +
clownfish/runtime/perl/xs/XSBind.h | 23 ++++++++++++++---------
perl/xs/Lucy/Document/Doc.c | 1 +
3 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/e513f8f9/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
index 092b5e9..ac75d6b 100644
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ b/clownfish/runtime/perl/xs/XSBind.c
@@ -18,6 +18,7 @@
#define C_CFISH_VTABLE
#define C_CFISH_LOCKFREEREGISTRY
#define NEED_newRV_noinc
+#include "charmony.h"
#include "XSBind.h"
#include "Clownfish/LockFreeRegistry.h"
#include "Clownfish/Util/StringHelper.h"
http://git-wip-us.apache.org/repos/asf/lucy/blob/e513f8f9/clownfish/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.h b/clownfish/runtime/perl/xs/XSBind.h
index c5a5453..2b207cd 100644
--- a/clownfish/runtime/perl/xs/XSBind.h
+++ b/clownfish/runtime/perl/xs/XSBind.h
@@ -20,7 +20,6 @@
#ifndef H_CFISH_XSBIND
#define H_CFISH_XSBIND 1
-#include "charmony.h"
#include "Clownfish/Obj.h"
#include "Clownfish/ByteBuf.h"
#include "Clownfish/CharBuf.h"
@@ -226,34 +225,40 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
#define XSBIND_WANT_OBJ 0xC
#define XSBIND_WANT_SV 0xD
-#if (CHY_SIZEOF_CHAR == 1)
+#if (CFISH_SIZEOF_CHAR == 1)
#define XSBIND_WANT_CHAR XSBIND_WANT_I8
#else
#error "Can't build unless sizeof(char) == 1"
#endif
-#if (CHY_SIZEOF_SHORT == 2)
+#if (CFISH_SIZEOF_SHORT == 2)
#define XSBIND_WANT_SHORT XSBIND_WANT_I16
#else
#error "Can't build unless sizeof(short) == 2"
#endif
-#if (CHY_SIZEOF_INT == 4)
+#if (CFISH_SIZEOF_INT == 4)
#define XSBIND_WANT_INT XSBIND_WANT_I32
-#else // sizeof(int) == 8
+#elif (CFISH_SIZEOF_INT == 8)
#define XSBIND_WANT_INT XSBIND_WANT_I64
+#else
+ #error "Can't build unless sizeof(int) == 4 or sizeof(int) == 8"
#endif
-#if (CHY_SIZEOF_LONG == 4)
+#if (CFISH_SIZEOF_LONG == 4)
#define XSBIND_WANT_LONG XSBIND_WANT_I32
-#else // sizeof(long) == 8
+#elif (CFISH_SIZEOF_LONG == 8)
#define XSBIND_WANT_LONG XSBIND_WANT_I64
+#else
+ #error "Can't build unless sizeof(long) == 4 or sizeof(long) == 8"
#endif
-#if (CHY_SIZEOF_SIZE_T == 4)
+#if (CFISH_SIZEOF_SIZE_T == 4)
#define XSBIND_WANT_SIZE_T XSBIND_WANT_U32
-#else // sizeof(long) == 8
+#elif (CFISH_SIZEOF_SIZE_T == 8)
#define XSBIND_WANT_SIZE_T XSBIND_WANT_U64
+#else
+ #error "Can't build unless sizeof(size_t) == 4 or sizeof(size_t) == 8"
#endif
#define XSBIND_ALLOT_I8(ptr, key, keylen, required) \
http://git-wip-us.apache.org/repos/asf/lucy/blob/e513f8f9/perl/xs/Lucy/Document/Doc.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Document/Doc.c b/perl/xs/Lucy/Document/Doc.c
index 220a7bf..6dd58b4 100644
--- a/perl/xs/Lucy/Document/Doc.c
+++ b/perl/xs/Lucy/Document/Doc.c
@@ -15,6 +15,7 @@
*/
#define C_LUCY_DOC
+#include "charmony.h"
#include "XSBind.h"
#include "Lucy/Document/Doc.h"
#include "Lucy/Store/InStream.h"
[lucy-commits] [2/6] git commit: refs/heads/charmonizer-decoupling - Add probe for
CHY_SIZEOF_SIZE_T
Posted by nw...@apache.org.
Add probe for CHY_SIZEOF_SIZE_T
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/fdb420a9
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/fdb420a9
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/fdb420a9
Branch: refs/heads/charmonizer-decoupling
Commit: fdb420a953f827df15e1c97bb14bd88403c1162d
Parents: b039a39
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 22 21:41:27 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 22 21:41:27 2013 +0200
----------------------------------------------------------------------
charmonizer/src/Charmonizer/Probe/Integers.c | 24 ++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/fdb420a9/charmonizer/src/Charmonizer/Probe/Integers.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Integers.c b/charmonizer/src/Charmonizer/Probe/Integers.c
index 3f44097..aec09b5 100644
--- a/charmonizer/src/Charmonizer/Probe/Integers.c
+++ b/charmonizer/src/Charmonizer/Probe/Integers.c
@@ -36,6 +36,7 @@ static const char chaz_Integers_sizes_code[] =
CHAZ_QUOTE( printf("%d ", (int)sizeof(int)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(long)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(void*)); )
+ CHAZ_QUOTE( printf("%d ", (int)sizeof(size_t)); )
CHAZ_QUOTE( return 0; )
CHAZ_QUOTE( } );
@@ -79,6 +80,7 @@ chaz_Integers_run(void) {
int sizeof_long = -1;
int sizeof_long_long = -1;
int sizeof___int64 = -1;
+ int sizeof_size_t = -1;
int has_8 = false;
int has_16 = false;
int has_32 = false;
@@ -113,15 +115,17 @@ chaz_Integers_run(void) {
char *ptr = output;
char *end_ptr = output;
- sizeof_char = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_short = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_int = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_long = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ sizeof_char = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_short = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_int = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_long = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_size_t = strtol(ptr, &end_ptr, 10);
free(output);
}
@@ -243,6 +247,8 @@ chaz_Integers_run(void) {
chaz_ConfWriter_add_def("SIZEOF_LONG", scratch);
sprintf(scratch, "%d", sizeof_ptr);
chaz_ConfWriter_add_def("SIZEOF_PTR", scratch);
+ sprintf(scratch, "%d", sizeof_size_t);
+ chaz_ConfWriter_add_def("SIZEOF_SIZE_T", scratch);
if (has_long_long) {
sprintf(scratch, "%d", sizeof_long_long);
chaz_ConfWriter_add_def("SIZEOF_LONG_LONG", scratch);
[lucy-commits] [3/6] git commit: refs/heads/charmonizer-decoupling - Regenerate
charmonizer.c
Posted by nw...@apache.org.
Regenerate charmonizer.c
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/04d8a90f
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/04d8a90f
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/04d8a90f
Branch: refs/heads/charmonizer-decoupling
Commit: 04d8a90f2332cd80c203bf4b2f3c08d8a48fbbdf
Parents: fdb420a
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 22 21:42:53 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 22 21:42:53 2013 +0200
----------------------------------------------------------------------
clownfish/compiler/common/charmonizer.c | 24 +++++++++++++++---------
clownfish/runtime/common/charmonizer.c | 24 +++++++++++++++---------
common/charmonizer.c | 24 +++++++++++++++---------
3 files changed, 45 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/04d8a90f/clownfish/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.c b/clownfish/compiler/common/charmonizer.c
index f404587..a1c2a19 100644
--- a/clownfish/compiler/common/charmonizer.c
+++ b/clownfish/compiler/common/charmonizer.c
@@ -5583,6 +5583,7 @@ static const char chaz_Integers_sizes_code[] =
CHAZ_QUOTE( printf("%d ", (int)sizeof(int)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(long)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(void*)); )
+ CHAZ_QUOTE( printf("%d ", (int)sizeof(size_t)); )
CHAZ_QUOTE( return 0; )
CHAZ_QUOTE( } );
@@ -5626,6 +5627,7 @@ chaz_Integers_run(void) {
int sizeof_long = -1;
int sizeof_long_long = -1;
int sizeof___int64 = -1;
+ int sizeof_size_t = -1;
int has_8 = false;
int has_16 = false;
int has_32 = false;
@@ -5660,15 +5662,17 @@ chaz_Integers_run(void) {
char *ptr = output;
char *end_ptr = output;
- sizeof_char = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_short = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_int = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_long = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ sizeof_char = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_short = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_int = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_long = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_size_t = strtol(ptr, &end_ptr, 10);
free(output);
}
@@ -5790,6 +5794,8 @@ chaz_Integers_run(void) {
chaz_ConfWriter_add_def("SIZEOF_LONG", scratch);
sprintf(scratch, "%d", sizeof_ptr);
chaz_ConfWriter_add_def("SIZEOF_PTR", scratch);
+ sprintf(scratch, "%d", sizeof_size_t);
+ chaz_ConfWriter_add_def("SIZEOF_SIZE_T", scratch);
if (has_long_long) {
sprintf(scratch, "%d", sizeof_long_long);
chaz_ConfWriter_add_def("SIZEOF_LONG_LONG", scratch);
http://git-wip-us.apache.org/repos/asf/lucy/blob/04d8a90f/clownfish/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.c b/clownfish/runtime/common/charmonizer.c
index 370f3b1..3ab6f63 100644
--- a/clownfish/runtime/common/charmonizer.c
+++ b/clownfish/runtime/common/charmonizer.c
@@ -5583,6 +5583,7 @@ static const char chaz_Integers_sizes_code[] =
CHAZ_QUOTE( printf("%d ", (int)sizeof(int)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(long)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(void*)); )
+ CHAZ_QUOTE( printf("%d ", (int)sizeof(size_t)); )
CHAZ_QUOTE( return 0; )
CHAZ_QUOTE( } );
@@ -5626,6 +5627,7 @@ chaz_Integers_run(void) {
int sizeof_long = -1;
int sizeof_long_long = -1;
int sizeof___int64 = -1;
+ int sizeof_size_t = -1;
int has_8 = false;
int has_16 = false;
int has_32 = false;
@@ -5660,15 +5662,17 @@ chaz_Integers_run(void) {
char *ptr = output;
char *end_ptr = output;
- sizeof_char = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_short = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_int = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_long = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ sizeof_char = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_short = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_int = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_long = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_size_t = strtol(ptr, &end_ptr, 10);
free(output);
}
@@ -5790,6 +5794,8 @@ chaz_Integers_run(void) {
chaz_ConfWriter_add_def("SIZEOF_LONG", scratch);
sprintf(scratch, "%d", sizeof_ptr);
chaz_ConfWriter_add_def("SIZEOF_PTR", scratch);
+ sprintf(scratch, "%d", sizeof_size_t);
+ chaz_ConfWriter_add_def("SIZEOF_SIZE_T", scratch);
if (has_long_long) {
sprintf(scratch, "%d", sizeof_long_long);
chaz_ConfWriter_add_def("SIZEOF_LONG_LONG", scratch);
http://git-wip-us.apache.org/repos/asf/lucy/blob/04d8a90f/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 01eee8b..0fc1466 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -5583,6 +5583,7 @@ static const char chaz_Integers_sizes_code[] =
CHAZ_QUOTE( printf("%d ", (int)sizeof(int)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(long)); )
CHAZ_QUOTE( printf("%d ", (int)sizeof(void*)); )
+ CHAZ_QUOTE( printf("%d ", (int)sizeof(size_t)); )
CHAZ_QUOTE( return 0; )
CHAZ_QUOTE( } );
@@ -5626,6 +5627,7 @@ chaz_Integers_run(void) {
int sizeof_long = -1;
int sizeof_long_long = -1;
int sizeof___int64 = -1;
+ int sizeof_size_t = -1;
int has_8 = false;
int has_16 = false;
int has_32 = false;
@@ -5660,15 +5662,17 @@ chaz_Integers_run(void) {
char *ptr = output;
char *end_ptr = output;
- sizeof_char = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_short = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_int = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_long = strtol(ptr, &end_ptr, 10);
- ptr = end_ptr;
- sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ sizeof_char = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_short = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_int = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_long = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_ptr = strtol(ptr, &end_ptr, 10);
+ ptr = end_ptr;
+ sizeof_size_t = strtol(ptr, &end_ptr, 10);
free(output);
}
@@ -5790,6 +5794,8 @@ chaz_Integers_run(void) {
chaz_ConfWriter_add_def("SIZEOF_LONG", scratch);
sprintf(scratch, "%d", sizeof_ptr);
chaz_ConfWriter_add_def("SIZEOF_PTR", scratch);
+ sprintf(scratch, "%d", sizeof_size_t);
+ chaz_ConfWriter_add_def("SIZEOF_SIZE_T", scratch);
if (has_long_long) {
sprintf(scratch, "%d", sizeof_long_long);
chaz_ConfWriter_add_def("SIZEOF_LONG_LONG", scratch);
[lucy-commits] [4/6] git commit: refs/heads/charmonizer-decoupling - Add
CFISH_SIZEOF macros
Posted by nw...@apache.org.
Add CFISH_SIZEOF macros
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/23ebeaa4
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/23ebeaa4
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/23ebeaa4
Branch: refs/heads/charmonizer-decoupling
Commit: 23ebeaa4efe79bcc779536ff72abcf077c86dbdb
Parents: 04d8a90
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 22 21:43:10 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 22 21:43:10 2013 +0200
----------------------------------------------------------------------
clownfish/compiler/src/CFCBindCore.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/23ebeaa4/clownfish/compiler/src/CFCBindCore.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindCore.c b/clownfish/compiler/src/CFCBindCore.c
index eeb435d..9d7eda4 100644
--- a/clownfish/compiler/src/CFCBindCore.c
+++ b/clownfish/compiler/src/CFCBindCore.c
@@ -637,11 +637,24 @@ S_charmony_string_defines() {
"#define CFISH_INLINE %s\n"
"#define CFISH_EXPORT %s\n"
"#define CFISH_IMPORT %s\n"
+ "#define CFISH_SIZEOF_CHAR %s\n"
+ "#define CFISH_SIZEOF_SHORT %s\n"
+ "#define CFISH_SIZEOF_INT %s\n"
+ "#define CFISH_SIZEOF_LONG %s\n"
+ "#define CFISH_SIZEOF_SIZE_T %s\n"
"#define CFISH_FUNC_MACRO %s\n"
"#define CFISH_U64_TO_DOUBLE(x) %s\n";
char *defines
- = CFCUtil_sprintf(pattern, XSTRING(CHY_INLINE), XSTRING(CHY_EXPORT),
- XSTRING(CHY_IMPORT), XSTRING(CHY_FUNC_MACRO),
+ = CFCUtil_sprintf(pattern,
+ XSTRING(CHY_INLINE),
+ XSTRING(CHY_EXPORT),
+ XSTRING(CHY_IMPORT),
+ XSTRING(CHY_SIZEOF_CHAR),
+ XSTRING(CHY_SIZEOF_SHORT),
+ XSTRING(CHY_SIZEOF_INT),
+ XSTRING(CHY_SIZEOF_LONG),
+ XSTRING(CHY_SIZEOF_SIZE_T),
+ XSTRING(CHY_FUNC_MACRO),
XSTRING(CHY_U64_TO_DOUBLE(x)));
return defines;