Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:04:10+00:00 2026-05-27T16:04:10+00:00

I am working with a library that defines a constant like this: #define SOME_BIG_CONSTANT

  • 0

I am working with a library that defines a constant like this:

#define SOME_BIG_CONSTANT 0x0000000100000000

This literal is too large to be represented as long, so any program that uses this macro fails to compile (using gcc 4.1.2 for VxWorks). The (non-standard, but supported by this compiler) solution that works is to add the suffix ull to the literal:

#define SOME_BIG_CONSTANT 0x0000000100000000ull

However, that would require me to modify the library-header, which I’d rather not do. I suck at macros, so my question is, how can I define a macro that would add that suffix, which I could call like this:

ULL_(SOME_BIG_CONSTANT)

Which would expand to:

0x0000000100000000ull
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:04:11+00:00Added an answer on May 27, 2026 at 4:04 pm

    ull is a standard suffix on C++11.

    On the other hand, you may define the following macros:

    #define APPEND(x, y) x ## y
    #define ULL(x) APPEND(x, ull)
    

    Now, you can use:

    int main()
    { 
      unsigned long long a = ULL(SOME_BIG_CONSTANT);
    
      return 0;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Python library that interfaces with a web service API. Like
I am working on a very large scale computing library that is using STL
i used to have a function defined like this (that is working fine under
This may be a long shot question.. I am working on an application that
I'm working with an open-source library and they define a class like so: class
I'm working on an application that lists a stored library using a ListActivity. My
I am working in a project that has two main parts: a class library
I am working on a client-server application that uses boost::serialization library for it's serialization
I'm working on a source-code visualization project that uses the Processing core library. The
I'm working on a Java library and would like to remove some functions from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.