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 9245667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:18:58+00:00 2026-06-18T09:18:58+00:00

I am now read some c code. And is not very clear about the

  • 0

I am now read some c code. And is not very clear about the “#define someting” expression.

For example, I saw this code:

typedef enum cairo_path_op {
    CAIRO_PATH_OP_MOVE_TO = 0,
    CAIRO_PATH_OP_LINE_TO = 1,
    CAIRO_PATH_OP_CURVE_TO = 2,
    CAIRO_PATH_OP_CLOSE_PATH = 3
} __attribute__ ((packed)) cairo_path_op_t; /* Don't want 32 bits if we can avoid it. */


#ifndef __GNUC__
#define __attribute__(x)
#endif

I take attention to the “__attribute__(x)”. since in other header file , the “__attribute__(x)” is defined with no value, but how it take effect in the enum “cairo_path_op” define?

  • 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-06-18T09:18:59+00:00Added an answer on June 18, 2026 at 9:18 am

    This is for portability reasons.

    __attribute__() is a GCC extension for modifying various properties and behavior of functions, variables, types, etc.

    If a non-GCC-compatible compiler tries to compile code that uses this extension, it won’t able to do so and will throw a syntax error.

    In order to avoid this, the author of the code makes the preprocessor replace this keyword with nothing if __GNUC__ is not defined (i. e. if the compiler is not a GCC-compatible one), so that the code builds on a bigger variety of platforms.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i saw MEF become very popular now but i have no concept about MEF
I've read some problems with Access Violation on the net but this is very
I've worked myself through the rapidXML sources and managed to read some values. Now
I'm implementing right now some syscalls from unistd.h and fcntl.h (open, read, close, e.t.c)
I've been using NSViewAnimation for some time now and I've read somewhere that Core
EDIT: I've altered the code to now read: View code: <h3>Your Orders:</h3> <table class=order-items>
I've read several sources now but did not find a solution: I'm using Facebook
Thank you very much in advance for helping! I have this code in bash:
I recently refactored some code and now have a static utility class with a
first(as always) I want to apologize about my english, it may not be clear

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.