Skip to content

Add support for __int128_t and __uint128_t #1815

@CharlesJu1

Description

@CharlesJu1

I am using VS Code wiht C++ extension on Ubuntu 16.04 to navigate code. IN the following code, I got a red wiggle under print saying

identifier "print" is not defined

print is defined in eosiolib/print.hpp which is in /usr/local/include which is in the includePath and browse path in c_cpp_properties.json. When I do "go to definition on "print" , it takes me to a definition of print in boost library which does not match the signature.

In eosiolib/print.hpp, there is a line

static_assert( sizeof(long) == sizeof(int), "unexpected size difference" );

I copy that line over and added to the following code. There is a red wiggle under static_assert saying

static assertion failed with "unexpected size difference"

Is this possible the reason why the definition of print in eosiolib/print.hpp not seen by VS code? how to make VS code to ignore such assert to bring in the definition of print?

#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;

class hello : public eosio::contract {
  public:
      using contract::contract;

      static_assert( sizeof(long) == sizeof(int), "unexpected size difference" );
  
      /// @abi action
      void hi( account_name user ) {
    	 require_auth( user );
         print( "Hello, ", name{user} );
      }

      void hhi( account_name user, uint64_t num) {
    	 require_auth( user );
         print( "Hello hhi, ", name{user}, "num is ", num );
      }
};

EOSIO_ABI( hello, (hi)(hhi) ) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions