Skip to content

Commit

Permalink
api: use std::uinptr_t for jule::Uinptr and code generation will gene…
Browse files Browse the repository at this point in the history
…rate jule::Uintptr instead of platform bitsize-unsigned integer type
  • Loading branch information
mertcandav committed Apr 8, 2024
1 parent 3b233b9 commit 1187d37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions api/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ namespace jule
using U16 = std::uint16_t;
using U32 = std::uint32_t;
using U64 = std::uint64_t;
using Uintptr = std::uintptr_t;
typedef float F32;
typedef double F64;
typedef bool Bool;

#ifdef ARCH_X32
using Uint = std::uint32_t;
using Int = std::int32_t;
using Uintptr = std::uint32_t;
#else
using Uint = std::uint64_t;
using Int = std::int64_t;
using Uintptr = std::uint64_t;
#endif

constexpr decltype(nullptr) nil = nullptr;
Expand Down
4 changes: 3 additions & 1 deletion src/julec/obj/cxx/type.jule
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ impl TypeCoder {

// Returns given identifier as Jule type identifier.
static fn to_type(mut id: str): str {
id = types::real_kind_of(id)
if id != types::TypeKind.Uintptr {
id = types::real_kind_of(id)
}
if 97 <= id[0] && id[0] <= 122 {
id[0] -= 32 // To upper first byte.
}
Expand Down

0 comments on commit 1187d37

Please sign in to comment.