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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:13:59+00:00 2026-06-11T09:13:59+00:00

I am porting a win32 app to linux and instead of having bunch of

  • 0

I am porting a win32 app to linux and instead of having bunch of #ifdefs around every _snprintf_s, I was wondering if there is a way to #define it to snprintf somehow.

So something like –

#define _snprintf_s(1,2,3,4,5) snprintf(1,2,4,5)

The third parameter, Maximum number of characters to store, or _TRUNCATE is not present for snprintf.

Is this approach right? Can I do such a #define?
If so, can someone maybe point out how I should go about it?

I went through this question to know I have to be careful about such #defines.

Thanks!

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

    #define _snprintf_s(a,b,c,...) snprintf(a,b,__VA_ARGS__)

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

Sidebar

Related Questions

I am porting linux app under win32 (msvc 9.0) and after finally finishing it,
I am currently porting a program developed on Linux to Win32. Amongst other problems,
I'm porting an app from iOS to Android. In the iOS app, there is
I've got a C++ app that I'm porting from Win32 to OSX. I'd like
I am doing some cross-platform work, porting code from Linux to Win32, but when
In porting a big app from a Windows to Linux, I need to be
Porting a Qt 4.6.3 application from Windows to Linux. The standard way to port
I'm porting a multi-thread application from Win32 to Linux. In Win32 we use SetThreadIdealProcessor
We're porting a legacy Java app to JRuby and would like to reuse some
I'm porting an existing app to rails that makes extensive use of stylized anchors

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.